Skip to content

Commit

Permalink
#3623 - SFAS-SIMS Bridge File - Update layout and Insert PT MSFAA info (
Browse files Browse the repository at this point in the history
#3775)

- Created the new MSFAA columns.
- Used the same DB type already in place for the existing full-time
MSFAA.
  - Updated the entity model to reflect the DB type.
- Adjusted an E2E file to one individual with part-time data.

### Rollback

![image](https://github.com/user-attachments/assets/5ff95ca2-cfd2-4ed5-b51c-7240c577a78f)
  • Loading branch information
andrewsignori-aot authored Oct 8, 2024
1 parent 411d242 commit 5f8e6d6
Show file tree
Hide file tree
Showing 8 changed files with 82 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { MigrationInterface, QueryRunner } from "typeorm";
import { getSQLFileData } from "../utilities/sqlLoader";

export class SFAStoSIMSBridgePartTimeMSFAAColumns1728416893266
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData("Add-part-time-msfaa-columns.sql", "SFASIndividuals"),
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
getSQLFileData(
"Rollback-add-part-time-msfaa-columns.sql",
"SFASIndividuals",
),
);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
ALTER TABLE
sims.sfas_individuals
ADD
COLUMN part_time_msfaa_number CHAR(10),
ADD
COLUMN part_time_msfaa_effective_date DATE;

COMMENT ON COLUMN sims.sfas_individuals.part_time_msfaa_number IS 'The most recent Part-time Master Student Loan Agreement Number (agreement_num.sail_msfaa_numbers).';

COMMENT ON COLUMN sims.sfas_individuals.part_time_msfaa_effective_date IS 'The most recent Part-time Master Student Loan Agreement effective date (effective_date.sail_msfaa_numbers).';
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ALTER TABLE
sims.sfas_individuals DROP COLUMN part_time_msfaa_number,
DROP COLUMN part_time_msfaa_effective_date;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
100AESTSFAS TO SIMS BRIDGE 20240709110630
2000000083540000000000083540GIORGIO GIOVANNI 19660721121380174Y19660721Y1967072298765432102024071276543210010000005000000000500000007560500000756050000007413000000741300000074130000007413000000000020000000017
2000000083541000000000083541GIORGIO GIOVANNI 19491116108796293N N 98765432112024071376543220020000005000000000500000011040000001104000000110400000011040000001104000000110400000000000020000000002
2000000083542000000000083542GIORGIO GIOVANNI 19700702122886591 00000000000000000000000000000000000000000000000000000000000000000000000000000000011039000000000000000000000000000000000000000000
2000000083541000000000083541GIORGIO GIOVANNI 19491116108796293N N 98765432112024071376543220020000005000000000500000011040000001104000000110400000011040000001104000000110400000000000020000000002123456789020241231
2000000083542000000000083542GIORGIO GIOVANNI 19700702122886591 00000000000000000000000000000000000000000000000000000000000000000000000000000000011039000000000000000000000000000000000000000000
999000048090000009580094900
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
grantOveraward: true,
withdrawals: true,
unsuccessfulCompletion: true,
partTimeMSFAANumber: true,
partTimeMSFAAEffectiveDate: true,
},
where: {
id: In([83540, 83541, 83542]),
Expand All @@ -348,7 +350,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
pdStatus: true,
ppdStatus: true,
ppdStatusDate: "1967-07-22",
msfaaNumber: 9876543210,
msfaaNumber: "9876543210",
msfaaSignedDate: "2024-07-12",
neb: 5000,
bcgg: 5000,
Expand All @@ -360,6 +362,8 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
grantOveraward: 741.3,
withdrawals: 2,
unsuccessfulCompletion: 17,
partTimeMSFAANumber: null,
partTimeMSFAAEffectiveDate: null,
});
expect(secondSFASIndividual).toEqual({
id: 83541,
Expand All @@ -370,7 +374,7 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
pdStatus: false,
ppdStatus: false,
ppdStatusDate: null,
msfaaNumber: 9876543211,
msfaaNumber: "9876543211",
msfaaSignedDate: "2024-07-13",
neb: 5000,
bcgg: 5000,
Expand All @@ -382,6 +386,8 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
grantOveraward: 11040,
withdrawals: 2,
unsuccessfulCompletion: 2,
partTimeMSFAANumber: "1234567890",
partTimeMSFAAEffectiveDate: "2024-12-31",
});
expect(thirdSFASIndividual).toEqual({
id: 83542,
Expand All @@ -404,6 +410,8 @@ describe(describeProcessorRootTest(QueueNames.SFASIntegration), () => {
grantOveraward: 0,
withdrawals: null,
unsuccessfulCompletion: 0,
partTimeMSFAANumber: null,
partTimeMSFAAEffectiveDate: null,
});
},
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export class SFASIndividualService
individual.ppdStatusDate = getISODateOnlyString(
sfasIndividual.ppdStatusDate,
);
individual.msfaaNumber = sfasIndividual.msfaaNumber;
individual.msfaaNumber = sfasIndividual.msfaaNumber?.toString();
individual.msfaaSignedDate = getISODateOnlyString(
sfasIndividual.msfaaSignedDate,
);
Expand All @@ -87,6 +87,11 @@ export class SFASIndividualService
individual.withdrawals = sfasIndividual.withdrawals;
individual.unsuccessfulCompletion = sfasIndividual.unsuccessfulCompletion;
individual.extractedAt = getUTC(extractedDate);
individual.partTimeMSFAANumber =
sfasIndividual.partTimeMSFAANumber?.toString();
individual.partTimeMSFAAEffectiveDate = getISODateOnlyString(
sfasIndividual.partTimeMSFAAEffectiveDate,
);
await this.repo.save(individual, { reload: false, transaction: false });
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,4 +169,16 @@ export class SFASIndividualRecord extends SFASRecordIdentification {
get unsuccessfulCompletion(): number {
return +this.line.substring(221, 231);
}
/**
* The most recent Part-time Master Student Loan Agreement Number (agreement_num.sail_msfaa_numbers).
*/
get partTimeMSFAANumber(): number | null {
return +this.line.substring(231, 241) || null;
}
/**
* The most recent Part-time Master Student Loan Agreement effective date (effective_date.sail_msfaa_numbers).
*/
get partTimeMSFAAEffectiveDate(): Date | null {
return parseDate(this.line.substring(241, 249));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export class SFASIndividual extends BaseModel {
name: "msfaa_number",
nullable: true,
})
msfaaNumber?: number;
msfaaNumber?: string;
/**
* The most recent, active Master Student Loan Agreement signed date (loan_agreement_request.loan_agreement_signed_dte).
*/
Expand Down Expand Up @@ -194,4 +194,21 @@ export class SFASIndividual extends BaseModel {
nullable: false,
})
extractedAt: Date;
/**
* The most recent Part-time Master Student Loan Agreement Number (agreement_num.sail_msfaa_numbers).
*/
@Column({
name: "part_time_msfaa_number",
nullable: true,
})
partTimeMSFAANumber?: string;
/**
* The most recent Part-time Master Student Loan Agreement effective date (effective_date.sail_msfaa_numbers).
*/
@Column({
name: "part_time_msfaa_effective_date",
type: "date",
nullable: true,
})
partTimeMSFAAEffectiveDate?: string;
}

0 comments on commit 5f8e6d6

Please sign in to comment.