phone
This commit is contained in:
@@ -2,9 +2,7 @@ import { Entity, Index, Property, OneToMany, Collection, PrimaryKey, OptionalPro
|
||||
import { BaseEntity } from '../../../common/entities/base.entity';
|
||||
import { LearningProgress } from '../../learnings/entities/learning-progress.entity';
|
||||
import { Criticism } from '../../criticisms/entities/criticism.entity';
|
||||
// import { Order } from 'src/modules/order/entities/order.entity';
|
||||
import { normalizePhone } from '../../util/phone.util';
|
||||
import { ulid } from 'ulid';
|
||||
|
||||
|
||||
@Entity({ tableName: 'users' })
|
||||
export class User extends BaseEntity {
|
||||
@@ -26,16 +24,9 @@ export class User extends BaseEntity {
|
||||
@Property({ nullable: true })
|
||||
lastName?: string;
|
||||
|
||||
private _phone!: string;
|
||||
|
||||
@Property({ unique: true })
|
||||
get phone(): string {
|
||||
return this._phone;
|
||||
}
|
||||
|
||||
set phone(value: string) {
|
||||
this._phone = normalizePhone(value);
|
||||
}
|
||||
phone: string
|
||||
|
||||
|
||||
@Property({ default: true })
|
||||
|
||||
Reference in New Issue
Block a user