feat: implement support plan subscription functionality

This commit is contained in:
mahyargdz
2025-05-05 17:01:13 +03:30
parent 47c9cd47e6
commit 1ea3195f4f
9 changed files with 177 additions and 5 deletions
@@ -5,7 +5,7 @@ import { Invoice } from "./invoice.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { DecimalTransformer } from "../../../common/transformers/decimal.transformer";
import { UserSubscription } from "../../subscriptions/entities/user-subscription.entity";
import { UserSupportPlan } from "../../support-plans/entities/user-support-plan.entity";
@Entity()
export class InvoiceItem extends BaseEntity {
@ManyToOne(() => Invoice, (invoice) => invoice.items, { onDelete: "CASCADE" })
@@ -28,4 +28,7 @@ export class InvoiceItem extends BaseEntity {
@ManyToOne(() => UserSubscription, { nullable: true, onDelete: "RESTRICT" })
subscriptionPlan: UserSubscription | null;
@ManyToOne(() => UserSupportPlan, { nullable: true, onDelete: "RESTRICT" })
supportPlan: UserSupportPlan | null;
}