Spaces:
Sleeping
Sleeping
import { | |
Entity, | |
Column, | |
BaseEntity, | |
PrimaryGeneratedColumn, | |
OneToMany, | |
ManyToOne, | |
Relation, | |
JoinColumn, | |
} from 'typeorm'; | |
import { BranchEntity } from './branch.entity.js'; | |
import { RoleEntity } from './role.entity.js'; | |
'users') | (|
export class UserEntity extends BaseEntity { | |
'uuid') | (|
id: string; | |
nullable: true }) | ({|
avatar: string; | |
nullable: true }) | ({|
full_name: string; | |
nullable: true }) | ({|
phone_number: string; | |
nullable: true }) | ({|
address: string; | |
nullable: true }) | ({|
email: string; | |
nullable: true }) | ({|
role_id: number; | |
nullable: true }) | ({|
hash_password: string; | |
default: true }) | ({|
is_valid: boolean; | |
type: 'timestamp', default: () => 'CURRENT_TIMESTAMP' }) | ({|
create_at: Date; | |
() => BranchEntity, (branch) => branch.owner) | (|
branches: Relation<BranchEntity>[]; | |
() => RoleEntity) | (|
name: 'role_id'}) | ({|
role: RoleEntity; | |
} | |