Skip to content

Commit

Permalink
Merge branch 'main' into chore/EMS-3660-form
Browse files Browse the repository at this point in the history
  • Loading branch information
ttbarnes committed Jul 31, 2024
2 parents 159d737 + 1d78d31 commit e88557b
Show file tree
Hide file tree
Showing 21 changed files with 57 additions and 16 deletions.
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "2.25.0"
".": "2.27.0"
}
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## [2.27.0](https://github.com/UK-Export-Finance/exip/compare/v2.26.0...v2.27.0) (2024-07-31)

### Features

- **EMS-3680-3682:** eligibility - Data saving ([#2853](https://github.com/UK-Export-Finance/exip/issues/2853)) ([8464b3f](https://github.com/UK-Export-Finance/exip/commit/8464b3fba3657788b3292d95d9bbd79ef452f2e9))

## [2.26.0](https://github.com/UK-Export-Finance/exip/compare/v2.25.0...v2.26.0) (2024-07-31)

### Features

- **EMS-3665:** export contract - how was contract awarded - data model ([#2856](https://github.com/UK-Export-Finance/exip/issues/2856)) ([8295356](https://github.com/UK-Export-Finance/exip/commit/82953569ccb86c167805ec5adf45fb3fea214136))

## [2.25.0](https://github.com/UK-Export-Finance/exip/compare/v2.24.0...v2.25.0) (2024-07-31)

### Features
Expand Down
2 changes: 2 additions & 0 deletions database/exip.sql
Original file line number Diff line number Diff line change
Expand Up @@ -666,6 +666,8 @@ CREATE TABLE IF NOT EXISTS `Eligibility` (
`paidByLetterOfCredit` tinyint(1) NOT NULL DEFAULT '0',
`totalContractValue` varchar(191) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`validExporterLocation` tinyint(1) NOT NULL DEFAULT '0',
`isPartyToConsortium` tinyint(1) NOT NULL DEFAULT '0',
`isMemberOfAGroup` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`),
KEY `Eligibility_application_idx` (`application`),
KEY `Eligibility_buyerCountry_idx` (`buyerCountry`),
Expand Down
4 changes: 4 additions & 0 deletions e2e-tests/fixtures/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ const {
TOTAL_CONTRACT_VALUE_ID,
VALID_EXPORTER_LOCATION,
BUYER_COUNTRY,
IS_MEMBER_OF_A_GROUP,
IS_PARTY_TO_CONSORTIUM,
},
POLICY: {
CONTRACT_POLICY: {
Expand Down Expand Up @@ -104,6 +106,8 @@ const application = {
[HAS_MINIMUM_UK_GOODS_OR_SERVICES]: true,
[TOTAL_CONTRACT_VALUE_ID]: TOTAL_CONTRACT_VALUE_CONSTANTS.LESS_THAN_250K.DB_ID,
[VALID_EXPORTER_LOCATION]: true,
[IS_PARTY_TO_CONSORTIUM]: false,
[IS_MEMBER_OF_A_GROUP]: false,
},
[BUYER_COUNTRY]: COUNTRY_APPLICATION_SUPPORT.ONLINE.NAME,
COMPANY: mockCompanies[COMPANIES_HOUSE_NUMBER],
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@uk-export-finance/exip",
"version": "2.25.0",
"version": "2.27.0",
"description": "Export Insurance Policies",
"homepage": "https://github.com/UK-Export-Finance/exip#readme",
"bugs": {
Expand Down
6 changes: 5 additions & 1 deletion 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/custom-schema/type-defs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ const typeDefs = `
hasMinimumUkGoodsOrServices: Boolean!
totalContractValueId: Int!
validExporterLocation: Boolean!
isPartyToConsortium: Boolean!
isMemberOfAGroup: Boolean!
}
type CreateAnApplicationResponse {
Expand Down
2 changes: 2 additions & 0 deletions src/api/helpers/create-an-eligibility/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ describe('helpers/create-an-eligibility', () => {
expect(result.hasCompaniesHouseNumber).toEqual(false);
expect(result.otherPartiesInvolved).toEqual(false);
expect(result.paidByLetterOfCredit).toEqual(false);
expect(result.isPartyToConsortium).toEqual(false);
expect(result.isMemberOfAGroup).toEqual(false);
});

describe('when an invalid country ID is passed', () => {
Expand Down
12 changes: 12 additions & 0 deletions src/api/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -2509,6 +2509,8 @@ type Eligibility {
paidByLetterOfCredit: Boolean
totalContractValue: TotalContractValue
validExporterLocation: Boolean
isPartyToConsortium: Boolean
isMemberOfAGroup: Boolean
}

input EligibilityWhereUniqueInput {
Expand All @@ -2530,6 +2532,8 @@ input EligibilityWhereInput {
paidByLetterOfCredit: BooleanFilter
totalContractValue: TotalContractValueWhereInput
validExporterLocation: BooleanFilter
isPartyToConsortium: BooleanFilter
isMemberOfAGroup: BooleanFilter
}

input EligibilityOrderByInput {
Expand All @@ -2540,6 +2544,8 @@ input EligibilityOrderByInput {
otherPartiesInvolved: OrderDirection
paidByLetterOfCredit: OrderDirection
validExporterLocation: OrderDirection
isPartyToConsortium: OrderDirection
isMemberOfAGroup: OrderDirection
}

input EligibilityUpdateInput {
Expand All @@ -2553,6 +2559,8 @@ input EligibilityUpdateInput {
paidByLetterOfCredit: Boolean
totalContractValue: TotalContractValueRelateToOneForUpdateInput
validExporterLocation: Boolean
isPartyToConsortium: Boolean
isMemberOfAGroup: Boolean
}

input CoverPeriodRelateToOneForUpdateInput {
Expand Down Expand Up @@ -2583,6 +2591,8 @@ input EligibilityCreateInput {
paidByLetterOfCredit: Boolean
totalContractValue: TotalContractValueRelateToOneForCreateInput
validExporterLocation: Boolean
isPartyToConsortium: Boolean
isMemberOfAGroup: Boolean
}

input CoverPeriodRelateToOneForCreateInput {
Expand Down Expand Up @@ -3697,6 +3707,8 @@ input ApplicationEligibility {
hasMinimumUkGoodsOrServices: Boolean!
totalContractValueId: Int!
validExporterLocation: Boolean!
isPartyToConsortium: Boolean!
isMemberOfAGroup: Boolean!
}

type CreateAnApplicationResponse {
Expand Down
2 changes: 2 additions & 0 deletions src/api/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,8 @@ model Eligibility {
totalContractValue TotalContractValue? @relation("Eligibility_totalContractValue", fields: [totalContractValueId], references: [id])
totalContractValueId String? @map("totalContractValue")
validExporterLocation Boolean @default(false)
isPartyToConsortium Boolean @default(false)
isMemberOfAGroup Boolean @default(false)
from_Application_eligibility Application[] @relation("Application_eligibility")
@@index([applicationId])
Expand Down
2 changes: 2 additions & 0 deletions src/api/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -785,6 +785,8 @@ export const lists = {
paidByLetterOfCredit: checkbox(),
totalContractValue: relationship({ ref: 'TotalContractValue' }),
validExporterLocation: checkbox(),
isPartyToConsortium: checkbox(),
isMemberOfAGroup: checkbox(),
},
access: allowAll,
}),
Expand Down
2 changes: 2 additions & 0 deletions src/api/test-mocks/mock-application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export const mockApplicationEligibility = {
},
totalContractValueId: TOTAL_CONTRACT_VALUE.LESS_THAN_500K.DB_ID,
validExporterLocation: true,
isPartyToConsortium: false,
isMemberOfAGroup: false,
};

const mockGenericPolicy = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ const applicationByReferenceNumberQuery = gql`
valueId
}
validExporterLocation
isPartyToConsortium
isMemberOfAGroup
}
nominatedLossPayee {
id
Expand Down
2 changes: 2 additions & 0 deletions src/ui/server/graphql/queries/application.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ const applicationQuery = gql`
valueId
}
validExporterLocation
isPartyToConsortium
isMemberOfAGroup
}
nominatedLossPayee {
id
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { mockApplication } from '../../test-mocks';
describe('server/helpers/application-is-complete', () => {
it('should return true', () => {
const flatApplicationData = flattenApplicationData(mockApplication);

const result = applicationIsComplete(flatApplicationData);

expect(result).toEqual(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ describe('server/helpers/map-eligibility-answers', () => {

const result = mapEligibilityAnswers(mockAnswers);

const { buyerCountry, totalContractValue, coverPeriod, hasReviewedEligibility, isPartyToConsortium, isMemberOfAGroup, ...otherAnswers } = mockAnswers;
const { buyerCountry, totalContractValue, coverPeriod, hasReviewedEligibility, ...otherAnswers } = mockAnswers;

const expected = {
...otherAnswers,
Expand Down
3 changes: 1 addition & 2 deletions src/ui/server/helpers/map-eligibility-answers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const {
*/
const mapEligibilityAnswers = (answers: SubmittedDataInsuranceEligibility) => {
if (answers.buyerCountry) {
// TODO: EMS-3680 3682 remove partyToConsortium, memberOfAGroup
const { buyerCountry, totalContractValue, coverPeriod, hasReviewedEligibility, isPartyToConsortium, isMemberOfAGroup, ...otherAnswers } = answers;
const { buyerCountry, totalContractValue, coverPeriod, hasReviewedEligibility, ...otherAnswers } = answers;

const mapped = {
...otherAnswers,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ const {
TOTAL_CONTRACT_VALUE_ID,
TOTAL_CONTRACT_VALUE,
HAS_REVIEWED_ELIGIBILITY,
IS_MEMBER_OF_A_GROUP,
IS_PARTY_TO_CONSORTIUM,
...FIELD_IDS
},
} = INSURANCE_FIELD_IDS;
Expand Down
3 changes: 0 additions & 3 deletions src/ui/server/helpers/required-fields/eligibility/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ const {
TOTAL_CONTRACT_VALUE,
TOTAL_CONTRACT_VALUE_ID,
HAS_REVIEWED_ELIGIBILITY,
// TODO: EMS-3680 3682 remove partyToConsortium, memberOfAGroup
IS_MEMBER_OF_A_GROUP,
IS_PARTY_TO_CONSORTIUM,
...FIELD_IDS
},
} = INSURANCE_FIELD_IDS;
Expand Down
4 changes: 2 additions & 2 deletions src/ui/server/test-mocks/mock-eligibility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const mockEligibility = {
totalContractValue: TOTAL_CONTRACT_VALUE.LESS_THAN_500K.DB_ID,
company,
hasReviewedEligibility: true,
partyToConsortium: false,
memberOfAGroup: false,
isPartyToConsortium: false,
isMemberOfAGroup: false,
} as InsuranceEligibility;

export default mockEligibility;

0 comments on commit e88557b

Please sign in to comment.