module provinces

This commit is contained in:
2026-07-07 19:44:31 +03:30
parent e2d9b5ef99
commit 45ab6a8dda
27 changed files with 3848 additions and 6 deletions
+16
View File
@@ -7,6 +7,8 @@ import {
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { City } from '../../provinces/entities/city.entity';
import { Province } from '../../provinces/entities/province.entity';
import { User } from '../../users/entities/user.entity';
@Entity('salons')
@@ -33,6 +35,20 @@ export class Salon {
@JoinColumn({ name: 'ownerId' })
owner: User;
@Column({ nullable: true })
provinceId: string | null;
@ManyToOne(() => Province, { onDelete: 'SET NULL', nullable: true })
@JoinColumn({ name: 'provinceId' })
province: Province | null;
@Column({ nullable: true })
cityId: string | null;
@ManyToOne(() => City, { onDelete: 'SET NULL', nullable: true })
@JoinColumn({ name: 'cityId' })
city: City | null;
@CreateDateColumn()
createdAt: Date;