chore: complete ads service
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user