|
| 1 | +/** |
| 2 | + * @typedef {import('typeorm').MigrationInterface} MigrationInterface |
| 3 | + * @typedef {import('typeorm').QueryRunner} QueryRunner |
| 4 | + */ |
| 5 | + |
| 6 | +/** |
| 7 | + * Reset EUR fiat_output transactions that were processed before EUR blocking was enabled. |
| 8 | + * |
| 9 | + * These 8 transactions were transmitted via Yapeal and need to be reset |
| 10 | + * so they can be reprocessed when EUR payouts are re-enabled. |
| 11 | + * |
| 12 | + * Affected transactions: |
| 13 | + * - ID 79157: BuyFiat, 392.39 EUR |
| 14 | + * - ID 79158: BuyFiat, 205.03 EUR |
| 15 | + * - ID 79161: BuyFiat, 99.46 EUR |
| 16 | + * - ID 79162: BuyCryptoFail, 2994.61 EUR |
| 17 | + * - ID 79163: BuyCryptoFail, 47.79 EUR |
| 18 | + * - ID 79164: BuyCryptoFail, 115.71 EUR |
| 19 | + * - ID 79165: BuyFiat, 16.17 EUR |
| 20 | + * - ID 79166: BuyFiat, 364.72 EUR |
| 21 | + * |
| 22 | + * @class |
| 23 | + * @implements {MigrationInterface} |
| 24 | + */ |
| 25 | +module.exports = class ResetEurFiatOutputTransactions1737392400000 { |
| 26 | + name = 'ResetEurFiatOutputTransactions1737392400000'; |
| 27 | + |
| 28 | + /** |
| 29 | + * @param {QueryRunner} queryRunner |
| 30 | + */ |
| 31 | + async up(queryRunner) { |
| 32 | + const result = await queryRunner.query(` |
| 33 | + UPDATE "dbo"."fiat_output" |
| 34 | + SET "isReadyDate" = NULL, |
| 35 | + "isTransmittedDate" = NULL, |
| 36 | + "isApprovedDate" = NULL, |
| 37 | + "yapealMsgId" = NULL, |
| 38 | + "endToEndId" = NULL |
| 39 | + WHERE "id" IN (79157, 79158, 79161, 79162, 79163, 79164, 79165, 79166) |
| 40 | + AND "currency" = 'EUR' |
| 41 | + AND "isComplete" = 0 |
| 42 | + `); |
| 43 | + |
| 44 | + console.log('Reset EUR fiat_output transactions:', result); |
| 45 | + } |
| 46 | + |
| 47 | + /** |
| 48 | + * @param {QueryRunner} queryRunner |
| 49 | + */ |
| 50 | + async down(queryRunner) { |
| 51 | + // Cannot restore original timestamps - manual intervention required |
| 52 | + console.log('Down migration not supported - original timestamps cannot be restored'); |
| 53 | + } |
| 54 | +}; |
0 commit comments