-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'refs/heads/main' into feat/DTFS2-7498/fetch-eligibility…
…-critieria-to-display # Conflicts: # dtfs-central-api/src/services/portal/facility-amendment.upsertPortalFacilityAmendmentDraft.service.test.ts # gef-ui/test-helpers/mock-amendment.ts # libs/common/src/test-helpers/mock-data-backend/portal-facility-amendment.ts # libs/common/src/types/mongo-db-models/tfm-facilities.ts
- Loading branch information
Showing
101 changed files
with
685 additions
and
323 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
.../repositories/tfm-facilities-repo/aggregate-pipelines/amendments-by-deal-id-and-status.ts
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
...ositories/tfm-facilities-repo/aggregate-pipelines/amendments-by-facility-id-and-status.ts
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
...tral-api/src/repositories/tfm-facilities-repo/aggregate-pipelines/amendments-by-status.ts
This file was deleted.
Oops, something went wrong.
12 changes: 6 additions & 6 deletions
12
dtfs-central-api/src/repositories/tfm-facilities-repo/aggregate-pipelines/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...itories/tfm-facilities-repo/aggregate-pipelines/lastest-completed-amendment-by-deal-id.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ries/tfm-facilities-repo/aggregate-pipelines/latest-completed-amendment-by-facility-id.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
...ositories/tfm-facilities-repo/aggregate-pipelines/tfm-amendments-by-deal-id-and-status.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { ObjectId, Document } from 'mongodb'; | ||
import { AMENDMENT_TYPES, TfmAmendmentStatus } from '@ukef/dtfs2-common'; | ||
|
||
/** | ||
* Generate aggregate pipeline to get tfm amendments by deal id and status | ||
* @param dealId - the deal id | ||
* @param status - the tfm amendment status | ||
* @returns aggregate pipeline to get tfm amendments by deal id and status | ||
*/ | ||
export const tfmAmendmentsByDealIdAndStatus = (dealId: string | ObjectId, status: TfmAmendmentStatus): Document[] => [ | ||
{ $match: { 'facilitySnapshot.dealId': { $eq: new ObjectId(dealId) } } }, | ||
{ | ||
$addFields: { | ||
'amendments.ukefFacilityId': '$facilitySnapshot.ukefFacilityId', | ||
}, | ||
}, | ||
{ $unwind: '$amendments' }, | ||
{ $match: { 'amendments.status': { $eq: status }, 'amendments.type': { $ne: AMENDMENT_TYPES.PORTAL } } }, | ||
{ $project: { _id: false, amendments: true } }, | ||
]; |
15 changes: 15 additions & 0 deletions
15
...ories/tfm-facilities-repo/aggregate-pipelines/tfm-amendments-by-facility-id-and-status.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { ObjectId, Document } from 'mongodb'; | ||
import { AMENDMENT_TYPES, TfmAmendmentStatus } from '@ukef/dtfs2-common'; | ||
|
||
/** | ||
* Generate aggregate pipeline to get tfm amendments by facility id and status | ||
* @param facilityId - the facility id | ||
* @param status - the tfm amendment status | ||
* @returns aggregate pipeline to get tfm amendments by facility id and status | ||
*/ | ||
export const tfmAmendmentsByFacilityIdAndStatus = (facilityId: string | ObjectId, status: TfmAmendmentStatus): Document[] => [ | ||
{ $match: { _id: { $eq: new ObjectId(facilityId) } } }, | ||
{ $unwind: '$amendments' }, | ||
{ $match: { 'amendments.status': { $eq: status }, 'amendments.type': { $ne: AMENDMENT_TYPES.PORTAL } } }, | ||
{ $project: { _id: false, amendments: true } }, | ||
]; |
13 changes: 13 additions & 0 deletions
13
...-api/src/repositories/tfm-facilities-repo/aggregate-pipelines/tfm-amendments-by-status.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Document } from 'mongodb'; | ||
import { AMENDMENT_TYPES, TfmAmendmentStatus } from '@ukef/dtfs2-common'; | ||
|
||
/** | ||
* Generate aggregate pipeline to get tfm amendments by status | ||
* @param status - the tfm amendment status | ||
* @returns aggregate pipeline to get tfm amendments by status | ||
*/ | ||
export const tfmAmendmentsByStatus = (status: TfmAmendmentStatus): Document[] => [ | ||
{ $unwind: '$amendments' }, | ||
{ $match: { 'amendments.status': { $eq: status }, 'amendments.type': { $ne: AMENDMENT_TYPES.PORTAL } } }, | ||
{ $project: { _id: false, amendments: true } }, | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.