feat: implement support plan upgrade functionality with invoice creation
This commit is contained in:
@@ -383,9 +383,16 @@ export class InvoicesService {
|
||||
return invoice;
|
||||
}
|
||||
//********************************** */
|
||||
async createInvoiceForSupportPlan(user: User, supPlan: SupportPlan, userSupPlan: UserSupportPlan, dueDate: Date, qryRnr: QueryRunner) {
|
||||
async createInvoiceForSupportPlan(
|
||||
user: User,
|
||||
supPlan: SupportPlan,
|
||||
userSupPlan: UserSupportPlan,
|
||||
dueDate: Date,
|
||||
qryRnr: QueryRunner,
|
||||
price?: number,
|
||||
) {
|
||||
const originalPrice = supPlan.price;
|
||||
const finalPrice = supPlan.price;
|
||||
const finalPrice = price || supPlan.price;
|
||||
|
||||
const invoiceItem = {
|
||||
name: supPlan.name,
|
||||
@@ -593,6 +600,9 @@ export class InvoicesService {
|
||||
subscriptionPlan: {
|
||||
plan: true,
|
||||
},
|
||||
supportPlan: {
|
||||
supportPlan: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user