import { Table, Column, Model, DataType, HasMany, HasOne, } from 'sequelize-typescript'; import { Order } from '../../orders/entities/order.entity'; import { Wallet } from 'src/modules/wallets/entities/wallet.entity'; @Table({ tableName: 'users' }) export class User extends Model { @Column({ type: DataType.UUID, allowNull: false, defaultValue: DataType.UUIDV4, }) uuid: string; @Column({ type: DataType.STRING, allowNull: false, }) firstName: string; @Column({ type: DataType.STRING, allowNull: false, }) lastName: string; @Column({ type: DataType.STRING, unique: true, allowNull: false, }) email: string; @Column({ type: DataType.STRING, allowNull: false, }) password: string; @Column({ type: DataType.STRING, allowNull: true, }) phoneNumber: string; @Column({ type: DataType.STRING, allowNull: true, }) city: string; @Column({ type: DataType.ENUM, values: ['male', 'female'], allowNull: true, }) gender: string; @HasMany(() => Order) orders: Order[]; @HasOne(() => Wallet) wallet: Wallet; }