chore: complete ads service

This commit is contained in:
mahyargdz
2025-02-15 12:08:19 +03:30
parent a13f374031
commit 817d638f3e
16 changed files with 475 additions and 5 deletions
@@ -3,6 +3,7 @@ import { Column, Entity, ManyToOne, OneToMany } from "typeorm";
import { DanakServiceCategory } from "./danak-service-category.entity";
import { DanakServiceImage } from "./danak-service-image.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { Ads } from "../../ads/entities/ads.entity";
import { Announcement } from "../../announcements/entities/announcement.entity";
import { SubscriptionPlan } from "../../subscriptions/entities/subscription.entity";
import { Ticket } from "../../tickets/entities/ticket.entity";
@@ -49,6 +50,7 @@ export class DanakService extends BaseEntity {
@Column({ type: "varchar", length: 255, nullable: false })
icon: string;
//-------------------------------------
@ManyToOne(() => DanakServiceCategory, (danakServiceCategory) => danakServiceCategory.danakServices, {
nullable: false,
onDelete: "RESTRICT",
@@ -66,6 +68,12 @@ export class DanakService extends BaseEntity {
@OneToMany(() => SubscriptionPlan, (plan) => plan.service, { cascade: true })
subscriptionPlans: SubscriptionPlan[];
@OneToMany(() => Ads, (ads) => ads.service)
ads: Ads[];
// @ManyToMany(() => Discount, (discount) => discount.services, { nullable: true })
// discounts?: Discount[];
}
// @ManyToMany(() => User, (user) => user.danakServices)