feat(billing): add PAYMENT_PROCESSING invoice status on payment success redirect (all except CBE bill)

This commit is contained in:
Marshal
2026-08-05 12:59:37 +00:00
parent 26837d5a7d
commit b7dcc1bf0a
20 changed files with 160 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
import { MigrationInterface, QueryRunner } from "typeorm";
/**
* Adds PAYMENT_PROCESSING to the invoice status enum: the customer completed
* provider checkout (success redirect) and settlement is awaiting the
* provider webhook.
*/
export class InvoicePaymentProcessingStatus3260000000000
implements MigrationInterface
{
name = "InvoicePaymentProcessingStatus3260000000000";
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TYPE freight.invoices_status_enum ADD VALUE IF NOT EXISTS 'PAYMENT_PROCESSING' AFTER 'PENDING'`,
);
}
public async down(): Promise<void> {
// Postgres cannot drop an enum value; PAYMENT_PROCESSING stays. Harmless.
}
}