diff --git a/dtfs-central-api/src/v1/controllers/utilisation-report-service/fee-record-correction/post-fee-record-correction.controller/helpers.ts b/dtfs-central-api/src/v1/controllers/utilisation-report-service/fee-record-correction/post-fee-record-correction.controller/helpers.ts index fed09093a8..adefc9abe3 100644 --- a/dtfs-central-api/src/v1/controllers/utilisation-report-service/fee-record-correction/post-fee-record-correction.controller/helpers.ts +++ b/dtfs-central-api/src/v1/controllers/utilisation-report-service/fee-record-correction/post-fee-record-correction.controller/helpers.ts @@ -30,7 +30,7 @@ export const generateFeeRecordCorrectionRequestEmailParameters = ( reportPeriod: ReportPeriod, exporter: string, requestedByUserEmail: string, - recipient: string, + paymentOfficerTeamName: string, paymentOfficerTeamEmails: string[], ): FeeRecordCorrectionRequestEmails => { const reportPeriodString = getFormattedReportPeriodWithLongMonth(reportPeriod); @@ -38,7 +38,7 @@ export const generateFeeRecordCorrectionRequestEmailParameters = ( return { emails: [...paymentOfficerTeamEmails, requestedByUserEmail], variables: { - recipient, + recipient: paymentOfficerTeamName, reportPeriod: reportPeriodString, exporterName: exporter, reasonsList: formatReasonsAsBulletedListForEmail(reasons), @@ -53,9 +53,9 @@ export const generateFeeRecordCorrectionRequestEmailParameters = ( * @param reasons - The reasons for the record correction request * @param reportPeriod - The report period of the fee's report * @param exporter - The exporter of the fee record - * @param bankId - The id of the bank - * @param requestedByUserEmail - The email of the TFM user who is - * requesting the correction + * @param requestedByUserEmail - The email of the TFM user who is requesting the correction + * @param paymentOfficerTeamName - The name of the bank payment officer team + * @param paymentOfficerTeamEmails - The email addresses of the bank payment officer team * @returns A promise that resolves to an object containing the email addresses * that were notified. */ @@ -64,7 +64,7 @@ export const sendFeeRecordCorrectionRequestEmails = async ( reportPeriod: ReportPeriod, exporter: string, requestedByUserEmail: string, - recipient: string, + paymentOfficerTeamName: string, paymentOfficerTeamEmails: string[], ): Promise => { const { emails, variables } = generateFeeRecordCorrectionRequestEmailParameters( @@ -72,7 +72,7 @@ export const sendFeeRecordCorrectionRequestEmails = async ( reportPeriod, exporter, requestedByUserEmail, - recipient, + paymentOfficerTeamName, paymentOfficerTeamEmails, ); diff --git a/libs/common/src/sql-db-connection/migrations/1732803141766-AddFeeRecordCorrectionTable.ts b/libs/common/src/sql-db-connection/migrations/1732803141766-AddFeeRecordCorrectionTable.ts index f3f58a11c9..411199dfb5 100644 --- a/libs/common/src/sql-db-connection/migrations/1732803141766-AddFeeRecordCorrectionTable.ts +++ b/libs/common/src/sql-db-connection/migrations/1732803141766-AddFeeRecordCorrectionTable.ts @@ -12,8 +12,6 @@ export class AddFeeRecordCorrectionTable1732803141766 implements MigrationInterf "dateRequested" datetime2 NOT NULL CONSTRAINT "DF_489233b45b51a528c7c12d9e999" DEFAULT getdate(), "isCompleted" bit NOT NULL, "feeRecordId" int NOT NULL, - "bankTeamName" nvarchar(500), - "bankTeamEmails" nvarchar(1000), "requestedByUserId" nvarchar(255) NOT NULL, "requestedByUserFirstname" nvarchar(255) NOT NULL, "requestedByUserLastname" nvarchar(255) NOT NULL, diff --git a/libs/common/src/sql-db-connection/migrations/1738320805938-addFeeRecordCorrectionBankTeamNameAndEmailsColumns.ts b/libs/common/src/sql-db-connection/migrations/1738320805938-addFeeRecordCorrectionBankTeamNameAndEmailsColumns.ts new file mode 100644 index 0000000000..1ffdfdd348 --- /dev/null +++ b/libs/common/src/sql-db-connection/migrations/1738320805938-addFeeRecordCorrectionBankTeamNameAndEmailsColumns.ts @@ -0,0 +1,25 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class AddFeeRecordCorrectionBankTeamNameAndEmailsColumns1738320805938 implements MigrationInterface { + name = 'AddFeeRecordCorrectionBankTeamNameAndEmailsColumns1738320805938'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE "FeeRecordCorrection" + ADD "bankTeamName" nvarchar(500) NOT NULL + `); + await queryRunner.query(` + ALTER TABLE "FeeRecordCorrection" + ADD "bankTeamEmails" nvarchar(1000) NOT NULL + `); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query(` + ALTER TABLE "FeeRecordCorrection" DROP COLUMN "bankTeamEmails" + `); + await queryRunner.query(` + ALTER TABLE "FeeRecordCorrection" DROP COLUMN "bankTeamName" + `); + } +}