ffc-pay-schemes 1.0.15 → 1.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +47 -1
- package/app/constants/file-masks.js +2 -1
- package/app/constants/manual-sources.js +4 -2
- package/app/constants/pillars.js +2 -1
- package/app/constants/scheme-batch-properties.js +6 -0
- package/app/constants/scheme-ids.js +2 -1
- package/app/constants/scheme-names.js +16 -15
- package/app/constants/schemes.js +8 -0
- package/app/constants/sequence-positions.js +2 -1
- package/app/constants/siti-agri-schemes.js +2 -2
- package/app/constants/source-systems.js +2 -1
- package/app/create-invoice-number/index.js +2 -2
- package/app/get-account-code-map/index.js +4 -2
- package/app/helpers/get-siti-agri-scheme-ids.js +9 -0
- package/index.js +2 -0
- package/jest.config.js +2 -1
- package/package.json +3 -2
- package/sonar-project.properties +2 -2
- package/test/unit/helpers/get-batch-sequence-from-file-name.test.js +1 -5
- package/test/unit/helpers/get-siti-agri-scheme-ids.test.js +8 -0
- package/test-output/cobertura-coverage.xml +84 -104
- package/test-output/junit.xml +375 -353
- package/test-output/lcov-report/constants/account-codes/ap.js.html +229 -0
- package/test-output/lcov-report/constants/account-codes/ar-admin.js.html +229 -0
- package/test-output/lcov-report/constants/account-codes/ar-irregular.js.html +226 -0
- package/test-output/lcov-report/constants/account-codes/index.html +146 -0
- package/test-output/lcov-report/constants/delivery-bodies.js.html +103 -0
- package/test-output/lcov-report/constants/description-codes.js.html +187 -0
- package/test-output/lcov-report/constants/file-masks.js.html +130 -0
- package/test-output/lcov-report/constants/frps-schemes.js.html +94 -0
- package/test-output/lcov-report/constants/fund-codes.js.html +109 -0
- package/test-output/lcov-report/constants/index.html +356 -0
- package/test-output/lcov-report/constants/manual-sources.js.html +328 -0
- package/test-output/lcov-report/constants/pillars.js.html +208 -0
- package/test-output/lcov-report/constants/scheme-batch-properties.js.html +421 -0
- package/test-output/lcov-report/constants/scheme-ids.js.html +145 -0
- package/test-output/lcov-report/constants/scheme-names.js.html +145 -0
- package/test-output/lcov-report/constants/schemes-not-requiring-ppas.js.html +94 -0
- package/test-output/lcov-report/constants/schemes-providing-account-values.js.html +94 -0
- package/test-output/lcov-report/constants/schemes.js.html +529 -0
- package/test-output/lcov-report/constants/sequence-positions.js.html +127 -0
- package/test-output/lcov-report/constants/siti-agri-schemes.js.html +94 -0
- package/test-output/lcov-report/constants/source-systems.js.html +145 -0
- package/test-output/lcov-report/constants/unknown.js.html +94 -0
- package/test-output/lcov-report/create-invoice-number/create-default-invoice-number.js.html +118 -0
- package/test-output/lcov-report/create-invoice-number/create-es-invoice-number.js.html +106 -0
- package/test-output/lcov-report/create-invoice-number/create-imps-invoice-number.js.html +127 -0
- package/test-output/lcov-report/create-invoice-number/create-siti-agri-invoice-number.js.html +121 -0
- package/test-output/lcov-report/create-invoice-number/create-standard-scheme-invoice-number.js.html +121 -0
- package/test-output/lcov-report/create-invoice-number/index.html +206 -0
- package/test-output/lcov-report/create-invoice-number/index.js.html +199 -0
- package/test-output/lcov-report/create-invoice-number/use-invoice-number-as-is.js.html +106 -0
- package/test-output/lcov-report/create-split-invoice-number/create-default-invoice-number.js.html +121 -0
- package/test-output/lcov-report/create-split-invoice-number/create-siti-agri-invoice-number.js.html +121 -0
- package/test-output/lcov-report/create-split-invoice-number/index.html +146 -0
- package/test-output/lcov-report/create-split-invoice-number/index.js.html +130 -0
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ap.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-admin.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-irregular.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/delivery-bodies.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/description-codes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/file-masks.js.html +6 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/frps-schemes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/fund-codes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/manual-sources.js.html +10 -4
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/pillars.js.html +6 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-batch-properties.js.html +20 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-ids.js.html +6 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-names.js.html +20 -17
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-not-requiring-ppas.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-providing-account-values.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes.js.html +26 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/sequence-positions.js.html +6 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/siti-agri-schemes.js.html +5 -5
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/source-systems.js.html +6 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/unknown.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-default-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-es-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-imps-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-standard-scheme-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.js.html +3 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/use-invoice-number-as-is.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-default-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/bps-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cohtc-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cs-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/default-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/delinked-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.js.html +10 -4
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/lump-sums-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/sfi-frps-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/vet-visits-map.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/get-batch-sequence-from-file-name.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/get-journal-source-from-pillar.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/get-reporting-data-filter.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/{scheme-properties/scheme-does-not-require-ppas.js.html → helpers/get-siti-agri-scheme-ids.js.html} +8 -8
- package/test-output/lcov-report/ffc-pay-schemes/app/{scheme-id/is-valid-scheme-id.js.html → helpers/getSitiAgriSchemeIds.js.html} +19 -22
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/index.html +19 -4
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/is-frps.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/is-siti-agri.js.html +2 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/is-valid-scheme-id.js.html +3 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/scheme-does-not-require-ppas.js.html +2 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/helpers/scheme-provides-accounting-values.js.html +2 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/pillar/get-pillar-from-scheme-id.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/pillar/get-pillars.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/pillar/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/get-scheme-id-from-pillar.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/get-scheme-id-from-source-system.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/get-scheme-ids.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-name/get-scheme-name-from-scheme-id.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-name/get-scheme-names.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-name/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-scheme-batch-properties.js.html +2 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-scheme-from-batch-file-name.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-scheme-properties.js.html +8 -8
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-schemes.js.html +2 -2
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/source-system/get-source-system-from-scheme-id.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/source-system/get-source-systems.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/source-system/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/index.html +5 -5
- package/test-output/lcov-report/ffc-pay-schemes/index.js.html +10 -4
- package/test-output/lcov-report/get-account-code-map/bps-map.js.html +508 -0
- package/test-output/lcov-report/get-account-code-map/cohtc-map.js.html +148 -0
- package/test-output/lcov-report/get-account-code-map/cs-map.js.html +607 -0
- package/test-output/lcov-report/get-account-code-map/default-map.js.html +223 -0
- package/test-output/lcov-report/get-account-code-map/delinked-map.js.html +178 -0
- package/test-output/lcov-report/get-account-code-map/index.html +236 -0
- package/test-output/lcov-report/get-account-code-map/index.js.html +262 -0
- package/test-output/lcov-report/get-account-code-map/lump-sums-map.js.html +118 -0
- package/test-output/lcov-report/get-account-code-map/sfi-frps-map.js.html +130 -0
- package/test-output/lcov-report/get-account-code-map/vet-visits-map.js.html +118 -0
- package/test-output/lcov-report/helpers/get-batch-sequence-from-file-name.js.html +187 -0
- package/test-output/lcov-report/helpers/get-journal-source-from-pillar.js.html +130 -0
- package/test-output/lcov-report/helpers/get-reporting-data-filter.js.html +154 -0
- package/test-output/lcov-report/helpers/get-siti-agri-scheme-ids.js.html +112 -0
- package/test-output/lcov-report/helpers/index.html +236 -0
- package/test-output/lcov-report/helpers/is-frps.js.html +112 -0
- package/test-output/lcov-report/helpers/is-siti-agri.js.html +112 -0
- package/test-output/lcov-report/{ffc-pay-schemes/app → helpers}/is-valid-scheme-id.js.html +13 -13
- package/test-output/lcov-report/{ffc-pay-schemes/app → helpers}/scheme-does-not-require-ppas.js.html +12 -12
- package/test-output/lcov-report/{ffc-pay-schemes/app/scheme-properties → helpers}/scheme-provides-accounting-values.js.html +11 -11
- package/test-output/lcov-report/index.html +24 -39
- package/test-output/lcov-report/{ffc-pay-schemes/app/get-source-system.js.html → pillar/get-pillar-from-scheme-id.js.html} +21 -18
- package/test-output/lcov-report/pillar/get-pillars.js.html +112 -0
- package/test-output/lcov-report/pillar/index.html +131 -0
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-id}/get-scheme-id-from-pillar.js.html +11 -11
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-id}/get-scheme-id-from-source-system.js.html +11 -11
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-id}/get-scheme-ids.js.html +11 -11
- package/test-output/lcov-report/scheme-id/index.html +146 -0
- package/test-output/lcov-report/{ffc-pay-schemes/app/get-scheme-name.js.html → scheme-name/get-scheme-name-from-scheme-id.js.html} +21 -18
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-name}/get-scheme-names.js.html +11 -11
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-name}/index.html +30 -30
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-properties}/get-scheme-batch-properties.js.html +12 -12
- package/test-output/lcov-report/scheme-properties/get-scheme-from-batch-file-name.js.html +118 -0
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-properties}/get-scheme-properties.js.html +19 -19
- package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-properties}/get-schemes.js.html +15 -15
- package/test-output/lcov-report/scheme-properties/index.html +161 -0
- package/test-output/lcov-report/{ffc-pay-schemes/app → source-system}/get-source-system-from-scheme-id.js.html +12 -12
- package/test-output/lcov-report/{ffc-pay-schemes/app → source-system}/get-source-systems.js.html +11 -11
- package/test-output/lcov-report/source-system/index.html +131 -0
- package/test-output/lcov.info +68 -87
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-name-from-scheme-id.js.html +0 -118
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-provides-accounting-values.js.html +0 -112
package/README.md
CHANGED
|
@@ -62,6 +62,7 @@ const {
|
|
|
62
62
|
- `getSourceSystems()` returns all supported source systems.
|
|
63
63
|
- `isFRPS(schemeId)` returns `true` if the scheme ID comes from FRPS, or `false` if not.
|
|
64
64
|
- `isSitiAgri(schemeId)` returns `true` if the scheme ID comes from Siti Agri, or `false` if not.
|
|
65
|
+
- `getSitiAgriSchemeIds()` returns all Siti Agri scheme IDs.
|
|
65
66
|
- `isValidSchemeId(schemeId)` returns `true` if the scheme ID is recognised, or `false` if not, including converting the scheme ID to a numeric value first if required.
|
|
66
67
|
- `schemeDoesNotRequirePPAs(schemeId)` returns `true` if Payment Hub does not support Post Payment Adjustments (PPAs) for a given `schemeId`; otherwise, it returns `false`.
|
|
67
68
|
- `schemeProvidesAccountingValues(schemeId)` returns `true` if a given `schemeId` provides accounting values within its payment requests; otherwise, it returns `false`.
|
|
@@ -99,12 +100,57 @@ The following services are intended to be used with the ffc-pay-schemes package:
|
|
|
99
100
|
- ffc-pay-injection
|
|
100
101
|
- ffc-pay-processing
|
|
101
102
|
- ffc-pay-request-editor
|
|
103
|
+
- ffc-pay-responses
|
|
102
104
|
- ffc-pay-submission
|
|
103
105
|
- ffc-pay-tracking
|
|
104
106
|
- ffc-pay-web
|
|
105
107
|
|
|
106
108
|
In the event a new payment scheme is added to the package, all of the above services must be bumped to the latest package version to ensure that Payment Hub can process associated payments.
|
|
107
109
|
|
|
110
|
+
## Scheme onboarding process
|
|
111
|
+
|
|
112
|
+
See the linked PR for an example of how to onboard a payment scheme with batch files to the ffc-pay-schemes package:
|
|
113
|
+
|
|
114
|
+
<https://github.com/DEFRA/ffc-pay-schemes/pull/16>
|
|
115
|
+
|
|
116
|
+
The below breakdown details all steps required for a general scheme onboarding:
|
|
117
|
+
|
|
118
|
+
- Add the scheme's pillar name to `app/constants/pillars.js` - this allows the pillar to be recognised for manual payments in `ffc-pay-injection`
|
|
119
|
+
- Add the manual source name for the scheme to `app/constants/manual-sources.js` - this defines the `source` name to use in D365 journals for manual payments for the scheme, created by `ffc-pay-submission`
|
|
120
|
+
- Add the scheme batch properties to `app/constants/scheme-batch-properties.js` - this defines the naming convention for D365 journals for the scheme, created by `ffc-pay-submission`
|
|
121
|
+
- Add the new scheme ID to `app/constants/scheme-ids.js` - this is the glue that holds payment processing together
|
|
122
|
+
- Add the scheme name to `app/constants/scheme-names.js` - this is how the scheme will be referred to in all frontend services, and in system logs
|
|
123
|
+
- Add the default scheme properties to `app/constants/schemes.js` - this is the primary driver for scheme defaults as read by `ffc-pay-enrichment`
|
|
124
|
+
- Add the source system to `app/constants/source-systems.js` - this is how the scheme will be recognised by `ffc-pay-enrichment`, and allow the scheme ID to be determined
|
|
125
|
+
- Add the scheme ID to the correct function in `app/create-invoice-number/index.js` - this is how the D365 formatted invoice number will be calculated in `ffc-pay-enrichment`
|
|
126
|
+
- Add the scheme ID to the mapping in `app/get-account-code-map/index.js` - this is how account codes will be assigned to invoice lines with different description codes in `ffc-pay-processing` - this is only usually called for PPAs, but for good practice it should be determined for all schemes
|
|
127
|
+
|
|
128
|
+
For all schemes supporting batch file ingestion:
|
|
129
|
+
|
|
130
|
+
- Add details of the file mask to `app/constants/file-masks.js` - this should be the file mask as read by `ffc-pay-batch-processor`, and allows the service to recognise the file to be processed.
|
|
131
|
+
- Add the file mask to the default scheme properties in `app/constants/schemes.js` - this is referenced by `ffc-pay-batch-processor`
|
|
132
|
+
- Add the position of the sequence number within the payment file to `app/constants/sequence-positions.js` - as used by `ffc-pay-batch-processor` to determine the correct sequence number of the file for processing
|
|
133
|
+
|
|
134
|
+
> Remember that ffc-pay-gateway must still be updated with the inbound file path, server name, and other configuration. See <https://github.com/DEFRA/ffc-pay-gateway/pull/78> for an example.
|
|
135
|
+
|
|
136
|
+
For all schemes delivered via FRPS:
|
|
137
|
+
|
|
138
|
+
- Add the scheme ID to `app/constants/frps-schemes.js` - this allows services to understand if it has been delivered by FRPS, helping with numerous helpers for FRPS specific behaviours
|
|
139
|
+
|
|
140
|
+
For all schemes delivered via Siti Agri:
|
|
141
|
+
|
|
142
|
+
- Add the scheme ID to `app/constants/siti-agri-schemes.js` - this allows services to understand if it has been delivered by Siti Agri, helping with numerous helpers for Siti Agri specific behaviours
|
|
143
|
+
|
|
144
|
+
For all schemes which do not support PPAs:
|
|
145
|
+
|
|
146
|
+
- Add the scheme ID to `app/constants/schemes-not-requiring-ppas.js` - this tells `ffc-pay-processing` not to calculate PPAs
|
|
147
|
+
|
|
148
|
+
For all schemes which provide accounting values:
|
|
149
|
+
|
|
150
|
+
- Add the scheme ID to `app/constants/schemes-providing-account-values.js` - this tells `ffc-pay-enrichment` to mark the payment request as providing accounting values, and enables correct value reporting in Payment Hub reports
|
|
151
|
+
|
|
152
|
+
Completing all of these steps as required should allow Payment Hub to support payments for a new payment scheme, assuming there are no specific behaviours that differ from a general payment scheme.
|
|
153
|
+
|
|
108
154
|
## Licence
|
|
109
155
|
|
|
110
156
|
THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT
|
|
@@ -126,4 +172,4 @@ public sector to license the use and re-use of their information under a common
|
|
|
126
172
|
open licence.
|
|
127
173
|
|
|
128
174
|
It is designed to encourage use and re-use of information freely and flexibly,
|
|
129
|
-
with only a few conditions.
|
|
175
|
+
with only a few conditions.
|
|
@@ -10,5 +10,6 @@ module.exports = {
|
|
|
10
10
|
SFI23: /^SITISFIA\d{4}_AP_\d*.dat$/,
|
|
11
11
|
DELINKED: /^SITIDP\d{4}_AP_\d*.dat$/,
|
|
12
12
|
SFI_EXPANDED: /^ESFIO\d{4}_AP_\d*.dat$/,
|
|
13
|
-
COHT_CAPITAL: /^SITICOHTC\d{4}_AP_\d*.dat
|
|
13
|
+
COHT_CAPITAL: /^SITICOHTC\d{4}_AP_\d*.dat$/,
|
|
14
|
+
SFI26: /^SITISFI26\d{4}_AP_\d*.dat$/
|
|
14
15
|
}
|
|
@@ -35,7 +35,8 @@ const {
|
|
|
35
35
|
COHT_CAPITAL,
|
|
36
36
|
COHT_REVENUE,
|
|
37
37
|
FPTT,
|
|
38
|
-
WMP
|
|
38
|
+
WMP,
|
|
39
|
+
SFI26
|
|
39
40
|
} = require('./pillars')
|
|
40
41
|
|
|
41
42
|
module.exports = {
|
|
@@ -75,5 +76,6 @@ module.exports = {
|
|
|
75
76
|
[COHT_CAPITAL]: 'PMAN_COHTC',
|
|
76
77
|
[COHT_REVENUE]: 'PMAN_COHTR',
|
|
77
78
|
[FPTT]: 'PMAN_FPTT',
|
|
78
|
-
[WMP]: 'PMAN_WMP'
|
|
79
|
+
[WMP]: 'PMAN_WMP',
|
|
80
|
+
[SFI26]: 'PMAN_SFI26'
|
|
79
81
|
}
|
package/app/constants/pillars.js
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
module.exports = {
|
|
2
|
-
SFI: '
|
|
3
|
-
SFI_PILOT: '
|
|
2
|
+
SFI: 'SFI-22',
|
|
3
|
+
SFI_PILOT: 'SFI-P',
|
|
4
4
|
LUMP_SUMS: 'Lump Sums',
|
|
5
|
-
VET_VISITS: '
|
|
6
|
-
CS: '
|
|
7
|
-
BPS: '
|
|
8
|
-
MANUAL: 'Manual Injection',
|
|
9
|
-
ES: '
|
|
10
|
-
FC: '
|
|
11
|
-
IMPS: '
|
|
12
|
-
SFI23: '
|
|
5
|
+
VET_VISITS: 'Vet Visits (AHWR)',
|
|
6
|
+
CS: 'CS',
|
|
7
|
+
BPS: 'BPS',
|
|
8
|
+
MANUAL: 'Manual Payments (Injection)',
|
|
9
|
+
ES: 'Genesis (ES)',
|
|
10
|
+
FC: 'GLOS (FC)',
|
|
11
|
+
IMPS: 'IMPS',
|
|
12
|
+
SFI23: 'SFI-23',
|
|
13
13
|
DELINKED: 'Delinked Payments',
|
|
14
|
-
SFI_EXPANDED: '
|
|
15
|
-
COHT_REVENUE: '
|
|
16
|
-
COHT_CAPITAL: '
|
|
17
|
-
FPTT: '
|
|
18
|
-
WMP: '
|
|
14
|
+
SFI_EXPANDED: 'SFI-EO',
|
|
15
|
+
COHT_REVENUE: 'CS-HT (Revenue)',
|
|
16
|
+
COHT_CAPITAL: 'CS-HT (Capital)',
|
|
17
|
+
FPTT: 'FPTT',
|
|
18
|
+
WMP: 'WMP',
|
|
19
|
+
SFI26: 'SFI-26'
|
|
19
20
|
}
|
package/app/constants/schemes.js
CHANGED
|
@@ -136,5 +136,13 @@ module.exports = Object.freeze([
|
|
|
136
136
|
pillar: pillars.WMP,
|
|
137
137
|
deliveryBody: RP10,
|
|
138
138
|
fundCode: DRD10
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
schemeId: schemeIds.SFI26,
|
|
142
|
+
sourceSystem: sourceSystems.SFI26,
|
|
143
|
+
pillar: pillars.SFI26,
|
|
144
|
+
deliveryBody: RP00,
|
|
145
|
+
fundCode: DRD10,
|
|
146
|
+
fileMask: fileMasks.SFI26
|
|
139
147
|
}
|
|
140
148
|
])
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const { SFI, SFI_PILOT, LUMP_SUMS, CS, BPS, SFI23, DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL } = require('../constants/scheme-ids')
|
|
1
|
+
const { SFI, SFI_PILOT, LUMP_SUMS, CS, BPS, SFI23, DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL, SFI26 } = require('../constants/scheme-ids')
|
|
2
2
|
|
|
3
|
-
module.exports = [SFI, SFI_PILOT, LUMP_SUMS, CS, BPS, SFI23, DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL]
|
|
3
|
+
module.exports = [SFI, SFI_PILOT, LUMP_SUMS, CS, BPS, SFI23, DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL, SFI26]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const { MANUAL: MANUAL_SOURCE } = require('../constants/source-systems')
|
|
2
|
-
const { MANUAL, FC, FPTT, WMP, DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL, SFI, SFI_PILOT, LUMP_SUMS, CS, BPS, SFI23, ES, IMPS } = require('../constants/scheme-ids')
|
|
2
|
+
const { MANUAL, FC, FPTT, WMP, DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL, SFI, SFI_PILOT, LUMP_SUMS, CS, BPS, SFI23, ES, IMPS, SFI26 } = require('../constants/scheme-ids')
|
|
3
3
|
const { createStandardSchemeInvoiceNumber } = require('./create-standard-scheme-invoice-number')
|
|
4
4
|
const { createSitiAgriInvoiceNumber } = require('./create-siti-agri-invoice-number')
|
|
5
5
|
const { createESInvoiceNumber } = require('./create-es-invoice-number')
|
|
@@ -12,7 +12,7 @@ const createInvoiceNumber = (paymentRequest) => {
|
|
|
12
12
|
if (schemesWithAcceptedInvoiceNumbers.has(paymentRequest.schemeId) || paymentRequest?.sourceSystem === MANUAL_SOURCE) {
|
|
13
13
|
return paymentRequest.invoiceNumber
|
|
14
14
|
}
|
|
15
|
-
const standardSchemeInvoices = new Set([DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL])
|
|
15
|
+
const standardSchemeInvoices = new Set([DELINKED, SFI_EXPANDED, COHT_REVENUE, COHT_CAPITAL, SFI26])
|
|
16
16
|
if (standardSchemeInvoices.has(paymentRequest.schemeId)) {
|
|
17
17
|
return createStandardSchemeInvoiceNumber(paymentRequest)
|
|
18
18
|
}
|
|
@@ -11,7 +11,8 @@ const {
|
|
|
11
11
|
COHT_REVENUE,
|
|
12
12
|
COHT_CAPITAL,
|
|
13
13
|
FPTT,
|
|
14
|
-
WMP
|
|
14
|
+
WMP,
|
|
15
|
+
SFI26
|
|
15
16
|
} = require('../constants/scheme-ids')
|
|
16
17
|
|
|
17
18
|
const defaultMap = require('./default-map')
|
|
@@ -36,7 +37,8 @@ const schemeMap = new Map([
|
|
|
36
37
|
[COHT_REVENUE, defaultMap],
|
|
37
38
|
[COHT_CAPITAL, cohtcMap],
|
|
38
39
|
[FPTT, sfiFrpsMap],
|
|
39
|
-
[WMP, sfiFrpsMap]
|
|
40
|
+
[WMP, sfiFrpsMap],
|
|
41
|
+
[SFI26, sfiFrpsMap]
|
|
40
42
|
])
|
|
41
43
|
|
|
42
44
|
const getAccountCodeMap = (schemeId) => {
|
package/index.js
CHANGED
|
@@ -15,6 +15,7 @@ const { getSchemeNameFromSchemeId } = require('./app/scheme-name/get-scheme-name
|
|
|
15
15
|
const { getSchemeNames } = require('./app/scheme-name/get-scheme-names')
|
|
16
16
|
const { getSchemeProperties } = require('./app/scheme-properties/get-scheme-properties')
|
|
17
17
|
const { getSchemes } = require('./app/scheme-properties/get-schemes')
|
|
18
|
+
const { getSitiAgriSchemeIds } = require('./app/helpers/get-siti-agri-scheme-ids')
|
|
18
19
|
const { getSourceSystemFromSchemeId } = require('./app/source-system/get-source-system-from-scheme-id')
|
|
19
20
|
const { getSourceSystems } = require('./app/source-system/get-source-systems')
|
|
20
21
|
const { isFRPS } = require('./app/helpers/is-frps')
|
|
@@ -41,6 +42,7 @@ module.exports = {
|
|
|
41
42
|
getSchemeNames,
|
|
42
43
|
getSchemeProperties,
|
|
43
44
|
getSchemes,
|
|
45
|
+
getSitiAgriSchemeIds,
|
|
44
46
|
getSourceSystemFromSchemeId,
|
|
45
47
|
getSourceSystems,
|
|
46
48
|
isFRPS,
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ffc-pay-schemes",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "Module for defining and providing details for the payment schemes supported by the Payment Hub.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"author": "Defra DDTS",
|
|
19
19
|
"contributors": [
|
|
20
|
-
"Sam Plackett samuel.plackett@atos.ai"
|
|
20
|
+
"Sam Plackett samuel.plackett@atos.ai",
|
|
21
|
+
"Leigh Godson leigh.godson@atos.ai"
|
|
21
22
|
],
|
|
22
23
|
"license": "OGL-UK-3.0",
|
|
23
24
|
"bugs": {
|
package/sonar-project.properties
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
sonar.
|
|
1
|
+
sonar.exclusions=**/test/**,**/test-output/**,**/*.test.js,*snyk_report.html,*snyk_report.css,README.md,**/jest.config.js,**/jest.setup.js,**/eslint.config.js
|
|
2
|
+
sonar.coverage.exclusions=index.js
|
|
2
3
|
sonar.javascript.lcov.reportPaths=test-output/lcov.info
|
|
3
|
-
sonar.exclusions=/test/**,**/*.test.js,*snyk_report.html,*snyk_report.css,README.md
|
|
@@ -4,10 +4,6 @@ jest.mock('../../../app/constants/scheme-ids', () => ({
|
|
|
4
4
|
FPTT: 18
|
|
5
5
|
}))
|
|
6
6
|
|
|
7
|
-
jest.mock('../../../app/constants/sequence-positions', () => ({
|
|
8
|
-
SFI: 6
|
|
9
|
-
}))
|
|
10
|
-
|
|
11
7
|
const {
|
|
12
8
|
getBatchSequenceFromFileName
|
|
13
9
|
} = require('../../../app/helpers/get-batch-sequence-from-file-name')
|
|
@@ -16,7 +12,7 @@ const schemeIds = require('../../../app/constants/scheme-ids')
|
|
|
16
12
|
|
|
17
13
|
describe('getBatchSequenceFromFileName', () => {
|
|
18
14
|
test('returns the sequence using the scheme sequence position', () => {
|
|
19
|
-
const fileName = '
|
|
15
|
+
const fileName = 'prefix012345678.csv'
|
|
20
16
|
|
|
21
17
|
expect(
|
|
22
18
|
getBatchSequenceFromFileName(schemeIds.SFI, fileName)
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const sitiAgriSchemes = require('../../../app/constants/siti-agri-schemes')
|
|
2
|
+
const { getSitiAgriSchemeIds } = require('../../../app/helpers/get-siti-agri-scheme-ids')
|
|
3
|
+
|
|
4
|
+
describe('getSitiAgriSchemeIds', () => {
|
|
5
|
+
test('returns the Siti Agri scheme IDs', () => {
|
|
6
|
+
expect(getSitiAgriSchemeIds()).toEqual(sitiAgriSchemes)
|
|
7
|
+
})
|
|
8
|
+
})
|