Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(EMS-3685): xlsx - Member of a group and party to consortium #2884

Merged
merged 1 commit into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 21 additions & 5 deletions src/api/.keystone/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/api/constants/field-ids/insurance/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const INSURANCE_FIELD_IDS = {
HAS_END_BUYER: 'hasEndBuyer',
HAVE_AN_ACCOUNT: 'haveAnAccount',
HAS_REVIEWED_ELIGIBILITY: 'hasReviewedEligibility',
IS_PARTY_TO_CONSORTIUM: 'isPartyToConsortium',
IS_MEMBER_OF_A_GROUP: 'isMemberOfAGroup',
},
...SHARED_FIELD_IDS,
CURRENCY: {
Expand Down
12 changes: 11 additions & 1 deletion src/api/content-strings/XLSX.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,15 @@ const { AMOUNT_250K, MORE_THAN_250K } = TOTAL_CONTRACT_VALUE;
const {
ACCOUNT: { FIRST_NAME, LAST_NAME },
DECLARATIONS: { HAS_ANTI_BRIBERY_CODE_OF_CONDUCT, WILL_EXPORT_WITH_CODE_OF_CONDUCT },
ELIGIBILITY: { BUYER_COUNTRY, COMPANIES_HOUSE_NUMBER, COVER_PERIOD, HAS_END_BUYER, HAS_MINIMUM_UK_GOODS_OR_SERVICES },
ELIGIBILITY: {
BUYER_COUNTRY,
COMPANIES_HOUSE_NUMBER,
COVER_PERIOD,
HAS_END_BUYER,
HAS_MINIMUM_UK_GOODS_OR_SERVICES,
IS_MEMBER_OF_A_GROUP,
IS_PARTY_TO_CONSORTIUM,
},
EXPORT_CONTRACT: {
ABOUT_GOODS_OR_SERVICES: { DESCRIPTION, FINAL_DESTINATION_KNOWN },
AGENT_CHARGES: { PAYABLE_COUNTRY_CODE, FIXED_SUM_AMOUNT, PERCENTAGE_CHARGE },
Expand Down Expand Up @@ -170,6 +178,8 @@ export const XLSX = {
[WEBSITE]: 'Exporter Company website (optional)',
[WILL_EXPORT_WITH_CODE_OF_CONDUCT]: 'Will the exporter export using their code of conduct?',
[YEARS_EXPORTING]: 'How long the business has been exporting for',
[IS_PARTY_TO_CONSORTIUM]: 'Party to any consortium in connection with the export contract(s)?',
[IS_MEMBER_OF_A_GROUP]: 'Member of a group which may have a part in negotiating the contract(s)?',
ttbarnes marked this conversation as resolved.
Show resolved Hide resolved
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const {
HAS_COMPANIES_HOUSE_NUMBER,
COMPANIES_HOUSE_NUMBER,
HAS_END_BUYER,
IS_PARTY_TO_CONSORTIUM,
IS_MEMBER_OF_A_GROUP,
},
} = INSURANCE_FIELD_IDS;

Expand All @@ -45,6 +47,9 @@ describe('api/generate-xlsx/map-application-to-xlsx/map-eligibility', () => {

xlsxRow(String(FIELDS[HAS_MINIMUM_UK_GOODS_OR_SERVICES]), mapYesNoField({ answer: eligibility[HAS_MINIMUM_UK_GOODS_OR_SERVICES] })),
xlsxRow(String(FIELDS[HAS_END_BUYER]), mapYesNoField({ answer: eligibility[HAS_END_BUYER] })),

xlsxRow(String(FIELDS[IS_PARTY_TO_CONSORTIUM]), mapYesNoField({ answer: eligibility[IS_PARTY_TO_CONSORTIUM] })),
xlsxRow(String(FIELDS[IS_MEMBER_OF_A_GROUP]), mapYesNoField({ answer: eligibility[IS_MEMBER_OF_A_GROUP] })),
];

expect(result).toEqual(expected);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ const {
HAS_COMPANIES_HOUSE_NUMBER,
COMPANIES_HOUSE_NUMBER,
HAS_END_BUYER,
IS_PARTY_TO_CONSORTIUM,
IS_MEMBER_OF_A_GROUP,
},
} = INSURANCE_FIELD_IDS;

Expand All @@ -47,6 +49,9 @@ const mapEligibility = (application: Application) => {

xlsxRow(String(FIELDS[HAS_MINIMUM_UK_GOODS_OR_SERVICES]), mapYesNoField({ answer: eligibility[HAS_MINIMUM_UK_GOODS_OR_SERVICES] })),
xlsxRow(String(FIELDS[HAS_END_BUYER]), mapYesNoField({ answer: eligibility[HAS_END_BUYER] })),

xlsxRow(String(FIELDS[IS_PARTY_TO_CONSORTIUM]), mapYesNoField({ answer: eligibility[IS_PARTY_TO_CONSORTIUM] })),
xlsxRow(String(FIELDS[IS_MEMBER_OF_A_GROUP]), mapYesNoField({ answer: eligibility[IS_MEMBER_OF_A_GROUP] })),
];

return mapped;
Expand Down
Loading