update: add target service to the announement get by id for admin

This commit is contained in:
mahyargdz
2025-04-17 10:49:57 +03:30
parent f9cb3cf653
commit cd77db93d0
17 changed files with 123 additions and 506 deletions
@@ -1,6 +1,5 @@
import { Column, Entity, OneToMany } from "typeorm";
import { Column, DeleteDateColumn, Entity, OneToMany } from "typeorm";
import { DiscountService } from "./discount-product.entity";
import { UsageDiscount } from "./usage-discount.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { DecimalTransformer } from "../../../common/transformers/decimal.transformer";
@@ -32,18 +31,9 @@ export class Discount extends BaseEntity {
@Column({ type: "boolean", default: true })
isActive: boolean;
@Column({ type: "boolean", default: false })
direct: boolean;
@Column({ type: "int", nullable: true })
maxUsage: number;
@Column({ type: "int", nullable: true })
maxUsagePerUser: number;
@OneToMany(() => DiscountService, (discountService) => discountService.discount, { cascade: true })
discountServices: DiscountService[];
@OneToMany(() => UsageDiscount, (usageDiscount) => usageDiscount.discount)
usages: UsageDiscount[];
@DeleteDateColumn({ nullable: true })
deletedAt?: Date;
}