diff --git a/__tests__/pages/api/field-reqs.test.ts b/__tests__/pages/api/field-reqs.test.ts index 98908298e..3040d5109 100644 --- a/__tests__/pages/api/field-reqs.test.ts +++ b/__tests__/pages/api/field-reqs.test.ts @@ -83,7 +83,7 @@ describe('field requirement analysis', () => { partnerYearsInCanadaSince18: 5, }) // expect(res.body.summary.state).toEqual(SummaryState.AVAILABLE_ELIGIBLE) - expect(res.body.missingFields).toEqual([]) + expect(res.body.missingFields).toEqual(['partnerYearsInCanadaSinceOAS']) expect(res.body.visibleFields).toEqual([ FieldKey.MARITAL_STATUS, FieldKey.INV_SEPARATED, @@ -105,7 +105,7 @@ describe('field requirement analysis', () => { // FieldKey.PARTNER_LEGAL_STATUS, FieldKey.PARTNER_LIVING_COUNTRY, FieldKey.PARTNER_LIVED_ONLY_IN_CANADA, - FieldKey.PARTNER_YEARS_IN_CANADA_SINCE_18, + FieldKey.PARTNER_YEARS_IN_CANADA_SINCE_OAS, FieldKey.OAS_AGE, ]) }) diff --git a/__tests__/utils/excelReaderUtil.ts b/__tests__/utils/excelReaderUtil.ts index 22747def5..94ab7188f 100644 --- a/__tests__/utils/excelReaderUtil.ts +++ b/__tests__/utils/excelReaderUtil.ts @@ -150,6 +150,24 @@ function createTransformedPayload(rowToTransform: string): Record { ], rowToTransform['Partner Birth Year and Month'] ), + partnerYearsInCanadaSinceOAS: + transformLiveOnlyCanadaValue( + rowToTransform[ + 'Partner: # of years resided in Canada after age 18 (Full, 40, 10, etc.)' + ] + ) !== 'true' + ? transformValue( + rowToTransform["Partner Rec'ing OAS (Yes / No / IDK)"] + ) === 'true' + ? transformYearsInCanadaSinceOAS18Value( + rowToTransform['Partner Age'], + rowToTransform[ + 'Partner: # of years resided in Canada after age 18 (Full, 40, 10, etc.)' + ], + rowToTransform['Partner Birth Year and Month'] + ) + : undefined + : undefined, } payload = Object.fromEntries( Object.entries(payload).filter( diff --git a/utils/api/fieldsHandler.ts b/utils/api/fieldsHandler.ts index dc09d7ced..2a04081c8 100644 --- a/utils/api/fieldsHandler.ts +++ b/utils/api/fieldsHandler.ts @@ -252,10 +252,8 @@ export class FieldsHandler { this.input.client.partnerBenefitStatus.value === PartnerBenefitStatus.OAS_GIS ) { - console.log('INSIDEs') requiredFields.push(FieldKey.PARTNER_YEARS_IN_CANADA_SINCE_OAS) } else { - console.log('INSIDESEEEEEE') requiredFields.push(FieldKey.PARTNER_YEARS_IN_CANADA_SINCE_18) } }