refactor: the invoice and subscription flow of user

This commit is contained in:
mahyargdz
2025-03-01 17:08:02 +03:30
parent ada9c153e6
commit 7c1d444c21
9 changed files with 87 additions and 86 deletions
@@ -5,7 +5,7 @@ import { Column, Entity, ManyToOne } from "typeorm";
import { Invoice } from "./invoice.entity";
import { BaseEntity } from "../../../common/entities/base.entity";
import { DecimalTransformer } from "../../../common/transformers/decimal.transformer";
import { SubscriptionPlan } from "../../subscriptions/entities/subscription.entity";
import { UserSubscription } from "../../subscriptions/entities/user-subscription.entity";
@Entity()
export class InvoiceItem extends BaseEntity {
@@ -27,6 +27,6 @@ export class InvoiceItem extends BaseEntity {
@Column({ type: "decimal", precision: 16, scale: 2, nullable: false, transformer: new DecimalTransformer() })
totalPrice: Decimal;
@ManyToOne(() => SubscriptionPlan, { nullable: true, onDelete: "RESTRICT" })
subscriptionPlan: SubscriptionPlan | null;
@ManyToOne(() => UserSubscription, { nullable: true, onDelete: "RESTRICT" })
subscriptionPlan: UserSubscription | null;
}