add business category

This commit is contained in:
2026-05-25 21:37:01 +03:30
parent c502fd86d7
commit f213ad2453
10 changed files with 494 additions and 0 deletions
@@ -0,0 +1,91 @@
import {
Column,
CreateDateColumn,
Entity,
JoinColumn,
ManyToOne,
PrimaryGeneratedColumn,
UpdateDateColumn,
} from 'typeorm';
import { BusinessEntity } from './business.entity';
import { BusinessServiceEntity } from './business-service.entity';
import { ServiceTemplateEntity } from './service-template.entity';
import { UserEntity } from './user.entity';
export enum BusinessServiceRequestStatus {
PENDING = 'pending',
APPROVED = 'approved',
REJECTED = 'rejected',
}
@Entity('business_service_requests')
export class BusinessServiceRequestEntity {
@PrimaryGeneratedColumn('uuid')
id!: string;
@ManyToOne(() => BusinessEntity, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'businessId' })
business!: BusinessEntity;
@Column('uuid')
businessId!: string;
@ManyToOne(() => UserEntity, { onDelete: 'CASCADE' })
@JoinColumn({ name: 'requestedById' })
requestedBy!: UserEntity;
@Column('uuid')
requestedById!: string;
@Column({
type: 'varchar',
length: 20,
default: BusinessServiceRequestStatus.PENDING,
})
status!: BusinessServiceRequestStatus;
@Column({ length: 150 })
title!: string;
@Column({ type: 'varchar', nullable: true, length: 500 })
description!: string | null;
@Column({ type: 'numeric', precision: 12, scale: 2 })
price!: string;
@Column({ type: 'int', nullable: true })
durationMinutes!: number | null;
@Column({ type: 'varchar', nullable: true, length: 500 })
adminNote!: string | null;
@ManyToOne(() => UserEntity, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'reviewedById' })
reviewedBy!: UserEntity | null;
@Column({ type: 'uuid', nullable: true })
reviewedById!: string | null;
@Column({ type: 'timestamptz', nullable: true })
reviewedAt!: Date | null;
@ManyToOne(() => ServiceTemplateEntity, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'serviceTemplateId' })
serviceTemplate!: ServiceTemplateEntity | null;
@Column({ type: 'uuid', nullable: true })
serviceTemplateId!: string | null;
@ManyToOne(() => BusinessServiceEntity, { nullable: true, onDelete: 'SET NULL' })
@JoinColumn({ name: 'businessServiceId' })
businessService!: BusinessServiceEntity | null;
@Column({ type: 'uuid', nullable: true })
businessServiceId!: string | null;
@CreateDateColumn()
createdAt!: Date;
@UpdateDateColumn()
updatedAt!: Date;
}