Skip to content

Commit

Permalink
#3841 - Hotfix: Name change for CRA Response file (#3865)
Browse files Browse the repository at this point in the history
Acceptance Criteria
- [x] Update CRA Response Integration job to search for new file name 
    - [x] [CRA Environment Code]BCSA#####.TXT
- [x] No change on request - confirmed with IMB CRA income verification
request file name can remain the same.

**Context:** 
DEV: ABCSA#####.TXT
TEST: ABCSA#####.TXT
PROD: PBCSA#####.TXT

**Current File Names for CRA Income:** 
- CCRA_REQUEST_${this.craConfig.environmentCode}${sequenceFile}.DAT
- /CCRA_RESPONSE_[\w]*\.txt/i

*note
Regex test

```
const environmentCode = 'A';
const regex = new RegExp(`[${environmentCode}]BCSA\\d{5}\\.TXT`, 'i');
const testString = 'ABCSA00001.TXT';

console.log(regex.test(testString)); // true
```
  • Loading branch information
bidyashish authored Oct 31, 2024
2 parents d5e0fa3 + d6a3013 commit 47cc7d9
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import * as path from "path";
import { SshService } from "@sims/integrations/services";
import { FILE_DEFAULT_ENCODING } from "@sims/services/constants";

const MOCKED_RESPONSE_FILES = [
"CCRA_RESPONSE_ABCSL00001.TXT",
"CCRA_RESPONSE_ABCSL00002.TXT",
];
const MOCKED_RESPONSE_FILES = ["ABCSA00001.TXT", "PBCSA00002.TXT"];

const SshServiceMock = new SshService();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,10 @@ export class CRAIncomeVerificationProcessingService {
async processResponses(): Promise<ProcessSftpResponseResult[]> {
const remoteFilePaths = await this.craService.getResponseFilesFullPath(
this.ftpResponseFolder,
/CCRA_RESPONSE_[\w]*\.txt/i,
new RegExp(
`${this.configService.craIntegration.environmentCode}BCSA\\d{5}\\.TXT`,
"i",
),
);
const processFiles: ProcessSftpResponseResult[] = [];
for (const remoteFilePath of remoteFilePaths) {
Expand Down

0 comments on commit 47cc7d9

Please sign in to comment.