add subscription upgrade plan
Build & Push / Pipeline Tests (push) Failing after 2m0s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Successful in 53s
Test / API Unit Tests (push) Successful in 1m8s
Test / Homepage Unit Tests (push) Successful in 48s
Test / Carplace Unit Tests (push) Successful in 42s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 43s
Test / API Integration Tests (push) Failing after 1m7s
Build & Push / Pipeline Tests (push) Failing after 2m0s
Build & Push / Build & Push Docker Image (push) Has been skipped
Test / Type Check (all packages) (push) Successful in 53s
Test / API Unit Tests (push) Successful in 1m8s
Test / Homepage Unit Tests (push) Successful in 48s
Test / Carplace Unit Tests (push) Successful in 42s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 43s
Test / API Integration Tests (push) Failing after 1m7s
This commit is contained in:
@@ -1368,6 +1368,22 @@ export async function submitManualPaymentSubmission(companyId: string, submissio
|
||||
source: 'customer',
|
||||
payload: { submissionId: submission.id, documentCount: submission.documents.length },
|
||||
})
|
||||
const upgradeRequestId = (submission.invoice.metadata as any)?.subscriptionUpgradeRequestId
|
||||
if (upgradeRequestId) {
|
||||
await tx.subscriptionUpgradeRequest.updateMany({
|
||||
where: { id: upgradeRequestId, companyId, status: { in: ['PAYMENT_PENDING', 'CORRECTION_REQUIRED'] } },
|
||||
data: { status: 'PAYMENT_REVIEW', version: { increment: 1 } },
|
||||
})
|
||||
await createBillingEvent(tx, {
|
||||
billingAccountId: submission.billingAccountId,
|
||||
invoiceId: submission.invoiceId,
|
||||
subscriptionId: submission.invoice.subscriptionId,
|
||||
companyId,
|
||||
eventType: 'subscription_upgrade.evidence_submitted',
|
||||
source: 'customer',
|
||||
payload: { requestId: upgradeRequestId, submissionId: submission.id, documentCount: submission.documents.length },
|
||||
})
|
||||
}
|
||||
return {
|
||||
response: safeSubmission(updated),
|
||||
notification: {
|
||||
|
||||
Reference in New Issue
Block a user