mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Supplementary payments issue resolution
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import { MigrationInterface, QueryRunner } from "typeorm";
|
||||
|
||||
/**
|
||||
* `reference_type` was varchar(16) but `SUPPLEMENTARY_CHARGE` is 20 characters, causing
|
||||
* a value-too-long error whenever the passenger API initiates a supplementary-charge payment.
|
||||
* Widen to varchar(32) to accommodate all current and near-future PaymentReferenceType values.
|
||||
* Same fix applied to notification_outbox.reference_type for consistency.
|
||||
*/
|
||||
export class WideReferenceType1782100000000 implements MigrationInterface {
|
||||
name = "WideReferenceType1782100000000";
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "edr_payment"."payment_intent" ALTER COLUMN "reference_type" TYPE varchar(32)`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "edr_payment"."notification_outbox" ALTER COLUMN "reference_type" TYPE varchar(32)`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "edr_payment"."notification_outbox" ALTER COLUMN "reference_type" TYPE varchar(16)`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "edr_payment"."payment_intent" ALTER COLUMN "reference_type" TYPE varchar(16)`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@ export class PaymentIntent extends BaseEntity {
|
||||
@Column({ name: "service", type: "varchar", length: 16 })
|
||||
service!: PaymentService;
|
||||
|
||||
@Column({ name: "reference_type", type: "varchar", length: 16 })
|
||||
@Column({ name: "reference_type", type: "varchar", length: 32 })
|
||||
referenceType!: PaymentReferenceType;
|
||||
|
||||
/** Domain order id (booking/shipment). Soft reference — no cross-schema FK. */
|
||||
|
||||
@@ -28,7 +28,7 @@ export class NotificationOutbox extends BaseEntity {
|
||||
@Column({ name: "intent_id", type: "uuid" })
|
||||
intentId!: string;
|
||||
|
||||
@Column({ name: "reference_type", type: "varchar", length: 16 })
|
||||
@Column({ name: "reference_type", type: "varchar", length: 32 })
|
||||
referenceType!: PaymentReferenceType;
|
||||
|
||||
@Column({ name: "reference_id", type: "varchar", length: 64 })
|
||||
|
||||
Reference in New Issue
Block a user