Add business images upload and cascade delete improvements.

This commit is contained in:
2026-05-21 17:57:27 +03:30
parent 2d6bae2ba1
commit 715ca585a8
13 changed files with 303 additions and 14 deletions
+6
View File
@@ -11,6 +11,7 @@ import {
import { BookingEntity } from './booking.entity';
import { BusinessAttributeValueEntity } from './business-attribute-value.entity';
import { BusinessCategoryEntity } from './business-category.entity';
import { BusinessImageEntity } from './business-image.entity';
import { BusinessServiceEntity } from './business-service.entity';
import { UserEntity } from './user.entity';
@@ -62,6 +63,11 @@ export class BusinessEntity {
@Column({ type: 'uuid', nullable: true })
ownerId!: string | null;
@OneToMany(() => BusinessImageEntity, (image) => image.business, {
cascade: true,
})
images!: BusinessImageEntity[];
@OneToMany(() => BusinessServiceEntity, (service) => service.business)
services!: BusinessServiceEntity[];