Skip to content

Commit

Permalink
#3878 - Update PTMSFAA File Name (#3880)
Browse files Browse the repository at this point in the history
Added a gap to skip some sequence numbers while generating the MSFAA
sequence to avoid conflicts with legacy MSFAA.
  • Loading branch information
andrewsignori-aot authored Nov 1, 2024
1 parent 20389ad commit db39bab
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ describe(
getProcessDateFromMSFAARequestContent(createMSFAARequestContentMock);
const uploadedFile = getUploadedFile(sftpClientMock);
expect(uploadedFile.remoteFilePath).toBe(
`MSFT-Request\\DPBC.EDU.MSFA.SENT.PT.${processDateFormatted}.001`,
`MSFT-Request\\DPBC.EDU.MSFA.SENT.PT.${processDateFormatted}.010`,
);
// Assert process result.
expect(msfaaRequestResults).toStrictEqual([
Expand All @@ -106,7 +106,7 @@ describe(
] = uploadedFile.fileLines;
// Validate header.
expect(header).toBe(
`100BC MSFAA SENT ${processDateFormatted}${processTimeFormatted}000001 `,
`100BC MSFAA SENT ${processDateFormatted}${processTimeFormatted}000010 `,
);
// Validate records.
expect(msfaaPartTimeMarried).toBe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import { MSFAAIntegrationService } from "./msfaa.integration.service";
import { ESDCFileHandler } from "../esdc-file-handler";
import { ConfigService } from "@sims/utilities/config";
import { MSFAANumberService } from "@sims/integrations/services";
import { MSFAA_SEQUENCE_GAP } from "@sims/services/constants";

@Injectable()
export class MSFAARequestProcessingService extends ESDCFileHandler {
Expand Down Expand Up @@ -76,6 +77,10 @@ export class MSFAARequestProcessingService extends ESDCFileHandler {
)}`,
async (nextSequenceNumber: number, entityManager: EntityManager) => {
try {
this.logger.log(
`Applying MSFAA sequence gap to the sequence number. Current sequence gap ${MSFAA_SEQUENCE_GAP}.`,
);
nextSequenceNumber += MSFAA_SEQUENCE_GAP;
this.logger.log("Creating MSFAA request content...");
// Create the Request content for the MSFAA file by populating the
// header, footer and trailer content.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ export const ESDC_SIN_VALIDATION_SEQUENCE_GROUP_NAME = "ESDC_SIN_VALIDATION";
*/
export const MSFAA_FULL_TIME_FILE_CODE = "PBC.EDU.MSFA.SENT.";
export const MSFAA_PART_TIME_FILE_CODE = "PBC.EDU.MSFA.SENT.PT.";
/**
* Sequence gap to be added to MSFAA sequence numbers to avoid conflicts
* with the MSFAA sequence numbers generated by the legacy system.
*/
export const MSFAA_SEQUENCE_GAP = 9;

/**
* Report the SFAS import progress every time that certain
Expand Down

0 comments on commit db39bab

Please sign in to comment.