module salon

This commit is contained in:
2026-06-28 19:57:51 +03:30
parent 4fbb86663a
commit 043e80a139
7 changed files with 214 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { User } from '../../users/entities/user.entity';
@Entity('salons')
export class Salon {
@PrimaryGeneratedColumn('uuid')
id: string;
@Column({ length: 200 })
name: string;
@Column({ type: 'text', nullable: true })
description: string | null;
@Column({ length: 500 })
address: string;
@Column({ length: 11 })
phone: string;
@Column()
ownerId: string;
@ManyToOne(() => User, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'ownerId' })
owner: User;
@CreateDateColumn()
createdAt: Date;
@UpdateDateColumn()
updatedAt: Date;
}