Skip to content

Commit a785e35

Browse files
committed
Merge branch 'main' into feat/FN-3675/fix-facility-id-correction
2 parents aed1cf4 + ec624be commit a785e35

File tree

37 files changed

+1036
-174
lines changed

37 files changed

+1036
-174
lines changed

dtfs-central-api/src/v1/swagger-definitions/portal/portal-amendments.js

Lines changed: 67 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,44 @@
3232
* - IN_PROGRESS
3333
* - COMPLETED
3434
* description: The current status of the amendment.
35+
* createdBy:
36+
* type: object
37+
* properties:
38+
* username:
39+
* type: string
40+
* description: The username of the creator.
41+
* name:
42+
* type: string
43+
* description: The name of the creator.
44+
* email:
45+
* type: string
46+
* description: The email of the creator.
47+
* eligibilityCriteria:
48+
* type: object
49+
* properties:
50+
* version:
51+
* type: integer
52+
* description: The version number of the eligibility criteria.
53+
* criteria:
54+
* type: array
55+
* items:
56+
* type: object
57+
* properties:
58+
* id:
59+
* type: integer
60+
* description: The ID of the criteria.
61+
* text:
62+
* type: string
63+
* description: The text of the criteria.
64+
* textList:
65+
* type: array
66+
* items:
67+
* type: string
68+
* description: The list of text items for the criteria.
69+
* answer:
70+
* type: boolean
71+
* nullable: true
72+
* description: The answer to the criteria.
3573
* version:
3674
* type: integer
3775
* description: The version number of the amendment.
@@ -106,6 +144,10 @@
106144
* effectiveDate:
107145
* type: integer
108146
* description: The effective date of the amendment in seconds.
147+
* effectiveFrom:
148+
* type: integer
149+
* format: int64
150+
* description: The effective from date of the amendment in seconds.
109151
* createdBy:
110152
* type: object
111153
* properties:
@@ -129,11 +171,6 @@
129171
* format: int64
130172
* nullable: true
131173
* description: The new cover end date in seconds.
132-
* currentCoverEndDate:
133-
* type: integer
134-
* format: int64
135-
* nullable: true
136-
* description: The current cover end date in seconds.
137174
* isUsingFacilityEndDate:
138175
* type: boolean
139176
* description: Indicates if the facility end date is being used.
@@ -152,10 +189,6 @@
152189
* type: number
153190
* nullable: true
154191
* description: The new value of the facility.
155-
* currentValue:
156-
* type: number
157-
* nullable: true
158-
* description: The current value of the facility.
159192
* currency:
160193
* type: string
161194
* enum:
@@ -165,11 +198,29 @@
165198
* - JPY
166199
* nullable: true
167200
* description: The currency of the facility value.
168-
* ukefExposure:
169-
* type: number
170-
* nullable: true
171-
* description: The UKEF exposure amount.
172-
* coveredPercentage:
173-
* type: number
174-
* description: The percentage of the facility covered.
201+
* eligibilityCriteria:
202+
* type: object
203+
* properties:
204+
* version:
205+
* type: integer
206+
* description: The version number of the eligibility criteria.
207+
* criteria:
208+
* type: array
209+
* items:
210+
* type: object
211+
* properties:
212+
* id:
213+
* type: integer
214+
* description: The ID of the criteria.
215+
* text:
216+
* type: string
217+
* description: The text of the criteria.
218+
* textList:
219+
* type: array
220+
* items:
221+
* type: string
222+
* description: The list of text items for the criteria.
223+
* answer:
224+
* type: boolean
225+
* description: The answer to the criteria.
175226
*/

e2e-tests/tfm/cypress/e2e/journeys/case-amendments/add-bank-decision/add-bank-decision-proceed.spec.js

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,21 +5,37 @@ import facilityPage from '../../../pages/facilityPage';
55
import amendmentsPage from '../../../pages/amendments/amendmentsPage';
66
import caseDealPage from '../../../pages/caseDealPage';
77
import MOCK_DEAL_AIN from '../../../../fixtures/deal-AIN';
8-
import { oneMonth, tomorrow, yearWithZeroLetter } from '../../../../../../e2e-fixtures/dateConstants';
8+
import { oneMonth, tomorrow, twoYearsAgo, yearWithZeroLetter } from '../../../../../../e2e-fixtures/dateConstants';
99
import { ADMIN, BANK1_MAKER1, PIM_USER_1, UNDERWRITER_MANAGER_1, UNDERWRITER_MANAGER_DECISIONS } from '../../../../../../e2e-fixtures';
1010
import pages from '../../../pages';
1111
import { CURRENCY } from '../../../../../../e2e-fixtures/constants.fixture';
1212

1313
context('Amendments underwriting - add banks decision - proceed', () => {
14-
// If the expiry & commencement date are the same day of the month then we add one to the month
15-
// difference for BS (but not for EWCS)
16-
// BUT... If the commencement date is end of month and the expiry date isn't then we don't add one
17-
//
18-
// In these tests, the mock start date is two years ago today & the mock end date is a month today.
19-
// Therefore if today is EOM and a month from now is not EOM we need to NOT add one to the tenor
20-
const todayIsEndOfMonth = add(new Date(), { days: 1 }).getDate() === 1;
21-
const aMonthFromNowIsEndOfMonth = add(new Date(), { months: 1, days: 1 }).getDate() === 1;
22-
const facilityTenor = todayIsEndOfMonth && !aMonthFromNowIsEndOfMonth ? '25 months' : '26 months';
14+
/**
15+
* The deal in the test is a BSS deal.
16+
*
17+
* The tenor is calculated using a SQL function used by MDM.
18+
*
19+
* In these tests, the mock start date is two years ago from today
20+
* & the mock end date is a month from today.
21+
*
22+
* So in this case it boils down to the tenor being 25 months except for:
23+
* - if expiry and commencement dates are the same date of month then you add one
24+
* - if commencement is end of month and expiry is also end of month you add one
25+
*/
26+
let facilityTenor = '25 months';
27+
28+
if (twoYearsAgo.date.getDate() === oneMonth.date.getDate()) {
29+
facilityTenor = '26 months';
30+
}
31+
32+
const isCommencementDateEndOfMonth = add(twoYearsAgo.date, { days: 1 }).getDate() === 1;
33+
const isExpiryDateEndOFMonth = add(oneMonth.date, { days: 1 }).getDate() === 1;
34+
35+
if (isCommencementDateEndOfMonth && isExpiryDateEndOFMonth) {
36+
facilityTenor = '26 months';
37+
}
38+
2339
const updatedFacilityTenor = '25 months';
2440

2541
let dealId;

e2e-tests/tfm/cypress/e2e/journeys/case-amendments/user-flow/7. amendment-details-automatic-approval.spec.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,34 @@ import facilityPage from '../../../pages/facilityPage';
55
import amendmentsPage from '../../../pages/amendments/amendmentsPage';
66
import caseDealPage from '../../../pages/caseDealPage';
77
import MOCK_DEAL_AIN from '../../../../fixtures/deal-AIN';
8-
import { fourDaysAgo, oneMonth, today, twoMonths, yearWithZeroLetter } from '../../../../../../e2e-fixtures/dateConstants';
8+
import { fourDaysAgo, oneMonth, today, twoMonths, yearWithZeroLetter, twoYearsAgo } from '../../../../../../e2e-fixtures/dateConstants';
99
import { PIM_USER_1, UNDERWRITER_MANAGER_DECISIONS, BANK1_MAKER1, ADMIN, CURRENCY } from '../../../../../../e2e-fixtures';
1010

1111
context('Amendments - automatic approval journey', () => {
12-
// If the expiry & commencement date are the same day of the month then we add one to the month
13-
// difference for BS (but not for EWCS)
14-
// BUT... If the commencement date is end of month and the expiry date isn't then we don't add one
15-
//
16-
// In these tests, the mock start date is two years ago today & the mock end date is a month today.
17-
// Therefore if today is EOM and a month from now is not EOM we need to NOT add one to the tenor
18-
const todayIsEndOfMonth = add(new Date(), { days: 1 }).getDate() === 1;
19-
const aMonthFromNowIsEndOfMonth = add(new Date(), { months: 1, days: 1 }).getDate() === 1;
20-
const facilityTenor = todayIsEndOfMonth && !aMonthFromNowIsEndOfMonth ? '25 months' : '26 months';
12+
/**
13+
* The deal in the test is a BSS deal.
14+
*
15+
* The tenor is calculated using a SQL function used by MDM.
16+
*
17+
* In these tests, the mock start date is two years ago from today
18+
* & the mock end date is a month from today.
19+
*
20+
* So in this case it boils down to the tenor being 25 months except for:
21+
* - if expiry and commencement dates are the same date of month then you add one
22+
* - if commencement is end of month and expiry is also end of month you add one
23+
*/
24+
let facilityTenor = '25 months';
25+
26+
if (twoYearsAgo.date.getDate() === oneMonth.date.getDate()) {
27+
facilityTenor = '26 months';
28+
}
29+
30+
const isCommencementDateEndOfMonth = add(twoYearsAgo.date, { days: 1 }).getDate() === 1;
31+
const isExpiryDateEndOFMonth = add(oneMonth.date, { days: 1 }).getDate() === 1;
32+
33+
if (isCommencementDateEndOfMonth && isExpiryDateEndOFMonth) {
34+
facilityTenor = '26 months';
35+
}
2136

2237
describe('Amendment details - Change the Cover end date AND Facility value', () => {
2338
let dealId;

e2e-tests/tfm/cypress/e2e/journeys/case-amendments/user-flow/8. amendment-details-manual-approval.spec.js

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,36 @@ import relative from '../../../relativeURL';
33
import facilityPage from '../../../pages/facilityPage';
44
import amendmentsPage from '../../../pages/amendments/amendmentsPage';
55
import MOCK_DEAL_AIN from '../../../../fixtures/deal-AIN';
6-
import { oneMonth, today, tomorrow } from '../../../../../../e2e-fixtures/dateConstants';
6+
import { oneMonth, today, twoYearsAgo, tomorrow } from '../../../../../../e2e-fixtures/dateConstants';
77
import { NOT_ADDED } from '../../../../fixtures/constants';
88
import { PIM_USER_1, UNDERWRITER_MANAGER_DECISIONS, BANK1_MAKER1, ADMIN, CURRENCY } from '../../../../../../e2e-fixtures';
99
import caseDealPage from '../../../pages/caseDealPage';
1010

1111
context('Amendments - Manual approval journey', () => {
12-
// If the expiry & commencement date are the same day of the month then we add one to the month
13-
// difference for BS (but not for EWCS)
14-
// BUT... If the commencement date is end of month and the expiry date isn't then we don't add one
15-
//
16-
// In these tests, the mock start date is two years ago today & the mock end date is a month today.
17-
// Therefore if today is EOM and a month from now is not EOM we need to NOT add one to the tenor
18-
const todayIsEndOfMonth = add(new Date(), { days: 1 }).getDate() === 1;
19-
const aMonthFromNowIsEndOfMonth = add(new Date(), { months: 1, days: 1 }).getDate() === 1;
20-
const facilityTenor = todayIsEndOfMonth && !aMonthFromNowIsEndOfMonth ? '25 months' : '26 months';
12+
/**
13+
* The deal in the test is a BSS deal.
14+
*
15+
* The tenor is calculated using a SQL function used by MDM.
16+
*
17+
* In these tests, the mock start date is two years ago from today
18+
* & the mock end date is a month from today.
19+
*
20+
* So in this case it boils down to the tenor being 25 months except for:
21+
* - if expiry and commencement dates are the same date of month then you add one
22+
* - if commencement is end of month and expiry is also end of month you add one
23+
*/
24+
let facilityTenor = '25 months';
25+
26+
if (twoYearsAgo.date.getDate() === oneMonth.date.getDate()) {
27+
facilityTenor = '26 months';
28+
}
29+
30+
const isCommencementDateEndOfMonth = add(twoYearsAgo.date, { days: 1 }).getDate() === 1;
31+
const isExpiryDateEndOFMonth = add(oneMonth.date, { days: 1 }).getDate() === 1;
32+
33+
if (isCommencementDateEndOfMonth && isExpiryDateEndOFMonth) {
34+
facilityTenor = '26 months';
35+
}
2136

2237
describe('Amendment details - Change the Cover end date AND Facility value', () => {
2338
let dealId;

0 commit comments

Comments
 (0)