From 27e4b807f1b80eca8e0231c0af977dd08eda642e Mon Sep 17 00:00:00 2001 From: Chelsea Date: Mon, 27 Nov 2023 09:25:30 -0800 Subject: [PATCH] [CCFPCM-721] error running seeder on local (#297) --- Makefile | 3 +++ apps/backend/src/lambdas/batch-reconcile.ts | 14 ++++++++------ apps/backend/src/s3-manager/s3-manager.service.ts | 13 +++++-------- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index bceaeef4..ac0443dc 100644 --- a/Makefile +++ b/Makefile @@ -411,6 +411,9 @@ migration-run: @docker exec -it $(PROJECT)-backend ./node_modules/.bin/ts-node -e 'require("./apps/backend/src/database/migrate.ts").handler()' @docker exec -it $(PROJECT)-backend ./node_modules/.bin/ts-node -e 'require("./apps/backend/src/database/seeder.ts").handler()' +migration-seed: + @docker exec -it $(PROJECT)-backend ./node_modules/.bin/ts-node -e 'require("./apps/backend/src/database/seeder.ts").handler()' + migration-run-ci: @docker-compose exec -T backend yarn workspace @payment/backend typeorm:run-migrations diff --git a/apps/backend/src/lambdas/batch-reconcile.ts b/apps/backend/src/lambdas/batch-reconcile.ts index c3052712..70f1b532 100644 --- a/apps/backend/src/lambdas/batch-reconcile.ts +++ b/apps/backend/src/lambdas/batch-reconcile.ts @@ -33,12 +33,14 @@ export const handler = async (event: BatchHandlerEvent, _context?: Context) => { end: event.period.to ? new Date(event.period.to) : new Date(), }); - const messages: ReconciliationEventMessage[] = listOfDays.map((date) => ({ - reconciliationMaxDate: format(date, 'yyyy-MM-dd'), - program: event.program, - reportEnabled: event.reportEnabled, - byPassFileValidity: event.byPassFileValidity, - })); + const messages: ReconciliationEventMessage[] = listOfDays.map( + (date: Date) => ({ + reconciliationMaxDate: format(date, 'yyyy-MM-dd'), + program: event.program, + reportEnabled: event.reportEnabled, + byPassFileValidity: event.byPassFileValidity, + }) + ); for (const message of messages) { if (!isLocal) { diff --git a/apps/backend/src/s3-manager/s3-manager.service.ts b/apps/backend/src/s3-manager/s3-manager.service.ts index d3ac59a4..e1544c68 100644 --- a/apps/backend/src/s3-manager/s3-manager.service.ts +++ b/apps/backend/src/s3-manager/s3-manager.service.ts @@ -22,14 +22,11 @@ import { Injectable } from '@nestjs/common'; export class S3ManagerService { public s3: S3Client; constructor() { - const config: S3ClientConfig = - process.env.NODE_ENV === 'production' - ? { - endpoint: process.env.AWS_ENDPOINT, - region: 'ca-central-1', - forcePathStyle: true, - } - : {}; + const config: S3ClientConfig = { + endpoint: process.env.AWS_ENDPOINT, + region: 'ca-central-1', + forcePathStyle: true, + }; this.s3 = new S3Client(config); }