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.
Files changed (173) hide show
  1. package/README.md +47 -1
  2. package/app/constants/file-masks.js +2 -1
  3. package/app/constants/manual-sources.js +4 -2
  4. package/app/constants/pillars.js +2 -1
  5. package/app/constants/scheme-batch-properties.js +6 -0
  6. package/app/constants/scheme-ids.js +2 -1
  7. package/app/constants/scheme-names.js +16 -15
  8. package/app/constants/schemes.js +8 -0
  9. package/app/constants/sequence-positions.js +2 -1
  10. package/app/constants/siti-agri-schemes.js +2 -2
  11. package/app/constants/source-systems.js +2 -1
  12. package/app/create-invoice-number/index.js +2 -2
  13. package/app/get-account-code-map/index.js +4 -2
  14. package/app/helpers/get-siti-agri-scheme-ids.js +9 -0
  15. package/index.js +2 -0
  16. package/jest.config.js +2 -1
  17. package/package.json +3 -2
  18. package/sonar-project.properties +2 -2
  19. package/test/unit/helpers/get-batch-sequence-from-file-name.test.js +1 -5
  20. package/test/unit/helpers/get-siti-agri-scheme-ids.test.js +8 -0
  21. package/test-output/cobertura-coverage.xml +84 -104
  22. package/test-output/junit.xml +375 -353
  23. package/test-output/lcov-report/constants/account-codes/ap.js.html +229 -0
  24. package/test-output/lcov-report/constants/account-codes/ar-admin.js.html +229 -0
  25. package/test-output/lcov-report/constants/account-codes/ar-irregular.js.html +226 -0
  26. package/test-output/lcov-report/constants/account-codes/index.html +146 -0
  27. package/test-output/lcov-report/constants/delivery-bodies.js.html +103 -0
  28. package/test-output/lcov-report/constants/description-codes.js.html +187 -0
  29. package/test-output/lcov-report/constants/file-masks.js.html +130 -0
  30. package/test-output/lcov-report/constants/frps-schemes.js.html +94 -0
  31. package/test-output/lcov-report/constants/fund-codes.js.html +109 -0
  32. package/test-output/lcov-report/constants/index.html +356 -0
  33. package/test-output/lcov-report/constants/manual-sources.js.html +328 -0
  34. package/test-output/lcov-report/constants/pillars.js.html +208 -0
  35. package/test-output/lcov-report/constants/scheme-batch-properties.js.html +421 -0
  36. package/test-output/lcov-report/constants/scheme-ids.js.html +145 -0
  37. package/test-output/lcov-report/constants/scheme-names.js.html +145 -0
  38. package/test-output/lcov-report/constants/schemes-not-requiring-ppas.js.html +94 -0
  39. package/test-output/lcov-report/constants/schemes-providing-account-values.js.html +94 -0
  40. package/test-output/lcov-report/constants/schemes.js.html +529 -0
  41. package/test-output/lcov-report/constants/sequence-positions.js.html +127 -0
  42. package/test-output/lcov-report/constants/siti-agri-schemes.js.html +94 -0
  43. package/test-output/lcov-report/constants/source-systems.js.html +145 -0
  44. package/test-output/lcov-report/constants/unknown.js.html +94 -0
  45. package/test-output/lcov-report/create-invoice-number/create-default-invoice-number.js.html +118 -0
  46. package/test-output/lcov-report/create-invoice-number/create-es-invoice-number.js.html +106 -0
  47. package/test-output/lcov-report/create-invoice-number/create-imps-invoice-number.js.html +127 -0
  48. package/test-output/lcov-report/create-invoice-number/create-siti-agri-invoice-number.js.html +121 -0
  49. package/test-output/lcov-report/create-invoice-number/create-standard-scheme-invoice-number.js.html +121 -0
  50. package/test-output/lcov-report/create-invoice-number/index.html +206 -0
  51. package/test-output/lcov-report/create-invoice-number/index.js.html +199 -0
  52. package/test-output/lcov-report/create-invoice-number/use-invoice-number-as-is.js.html +106 -0
  53. package/test-output/lcov-report/create-split-invoice-number/create-default-invoice-number.js.html +121 -0
  54. package/test-output/lcov-report/create-split-invoice-number/create-siti-agri-invoice-number.js.html +121 -0
  55. package/test-output/lcov-report/create-split-invoice-number/index.html +146 -0
  56. package/test-output/lcov-report/create-split-invoice-number/index.js.html +130 -0
  57. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ap.js.html +1 -1
  58. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-admin.js.html +1 -1
  59. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-irregular.js.html +1 -1
  60. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/index.html +1 -1
  61. package/test-output/lcov-report/ffc-pay-schemes/app/constants/delivery-bodies.js.html +1 -1
  62. package/test-output/lcov-report/ffc-pay-schemes/app/constants/description-codes.js.html +1 -1
  63. package/test-output/lcov-report/ffc-pay-schemes/app/constants/file-masks.js.html +6 -3
  64. package/test-output/lcov-report/ffc-pay-schemes/app/constants/frps-schemes.js.html +1 -1
  65. package/test-output/lcov-report/ffc-pay-schemes/app/constants/fund-codes.js.html +1 -1
  66. package/test-output/lcov-report/ffc-pay-schemes/app/constants/index.html +1 -1
  67. package/test-output/lcov-report/ffc-pay-schemes/app/constants/manual-sources.js.html +10 -4
  68. package/test-output/lcov-report/ffc-pay-schemes/app/constants/pillars.js.html +6 -3
  69. package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-batch-properties.js.html +20 -2
  70. package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-ids.js.html +6 -3
  71. package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-names.js.html +20 -17
  72. package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-not-requiring-ppas.js.html +1 -1
  73. package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-providing-account-values.js.html +1 -1
  74. package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes.js.html +26 -2
  75. package/test-output/lcov-report/ffc-pay-schemes/app/constants/sequence-positions.js.html +6 -3
  76. package/test-output/lcov-report/ffc-pay-schemes/app/constants/siti-agri-schemes.js.html +5 -5
  77. package/test-output/lcov-report/ffc-pay-schemes/app/constants/source-systems.js.html +6 -3
  78. package/test-output/lcov-report/ffc-pay-schemes/app/constants/unknown.js.html +1 -1
  79. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-default-invoice-number.js.html +1 -1
  80. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-es-invoice-number.js.html +1 -1
  81. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-imps-invoice-number.js.html +1 -1
  82. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
  83. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-standard-scheme-invoice-number.js.html +1 -1
  84. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.html +1 -1
  85. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.js.html +3 -3
  86. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/use-invoice-number-as-is.js.html +1 -1
  87. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-default-invoice-number.js.html +1 -1
  88. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
  89. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.html +1 -1
  90. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.js.html +1 -1
  91. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/bps-map.js.html +1 -1
  92. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cohtc-map.js.html +1 -1
  93. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cs-map.js.html +1 -1
  94. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/default-map.js.html +1 -1
  95. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/delinked-map.js.html +1 -1
  96. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.html +1 -1
  97. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.js.html +10 -4
  98. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/lump-sums-map.js.html +1 -1
  99. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/sfi-frps-map.js.html +1 -1
  100. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/vet-visits-map.js.html +1 -1
  101. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/get-batch-sequence-from-file-name.js.html +1 -1
  102. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/get-journal-source-from-pillar.js.html +1 -1
  103. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/get-reporting-data-filter.js.html +1 -1
  104. 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
  105. package/test-output/lcov-report/ffc-pay-schemes/app/{scheme-id/is-valid-scheme-id.js.html → helpers/getSitiAgriSchemeIds.js.html} +19 -22
  106. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/index.html +19 -4
  107. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/is-frps.js.html +1 -1
  108. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/is-siti-agri.js.html +2 -2
  109. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/is-valid-scheme-id.js.html +3 -3
  110. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/scheme-does-not-require-ppas.js.html +2 -2
  111. package/test-output/lcov-report/ffc-pay-schemes/app/helpers/scheme-provides-accounting-values.js.html +2 -2
  112. package/test-output/lcov-report/ffc-pay-schemes/app/pillar/get-pillar-from-scheme-id.js.html +1 -1
  113. package/test-output/lcov-report/ffc-pay-schemes/app/pillar/get-pillars.js.html +1 -1
  114. package/test-output/lcov-report/ffc-pay-schemes/app/pillar/index.html +1 -1
  115. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/get-scheme-id-from-pillar.js.html +1 -1
  116. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/get-scheme-id-from-source-system.js.html +1 -1
  117. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/get-scheme-ids.js.html +1 -1
  118. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-id/index.html +1 -1
  119. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-name/get-scheme-name-from-scheme-id.js.html +1 -1
  120. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-name/get-scheme-names.js.html +1 -1
  121. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-name/index.html +1 -1
  122. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-scheme-batch-properties.js.html +2 -2
  123. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-scheme-from-batch-file-name.js.html +1 -1
  124. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-scheme-properties.js.html +8 -8
  125. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/get-schemes.js.html +2 -2
  126. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-properties/index.html +1 -1
  127. package/test-output/lcov-report/ffc-pay-schemes/app/source-system/get-source-system-from-scheme-id.js.html +1 -1
  128. package/test-output/lcov-report/ffc-pay-schemes/app/source-system/get-source-systems.js.html +1 -1
  129. package/test-output/lcov-report/ffc-pay-schemes/app/source-system/index.html +1 -1
  130. package/test-output/lcov-report/ffc-pay-schemes/index.html +5 -5
  131. package/test-output/lcov-report/ffc-pay-schemes/index.js.html +10 -4
  132. package/test-output/lcov-report/get-account-code-map/bps-map.js.html +508 -0
  133. package/test-output/lcov-report/get-account-code-map/cohtc-map.js.html +148 -0
  134. package/test-output/lcov-report/get-account-code-map/cs-map.js.html +607 -0
  135. package/test-output/lcov-report/get-account-code-map/default-map.js.html +223 -0
  136. package/test-output/lcov-report/get-account-code-map/delinked-map.js.html +178 -0
  137. package/test-output/lcov-report/get-account-code-map/index.html +236 -0
  138. package/test-output/lcov-report/get-account-code-map/index.js.html +262 -0
  139. package/test-output/lcov-report/get-account-code-map/lump-sums-map.js.html +118 -0
  140. package/test-output/lcov-report/get-account-code-map/sfi-frps-map.js.html +130 -0
  141. package/test-output/lcov-report/get-account-code-map/vet-visits-map.js.html +118 -0
  142. package/test-output/lcov-report/helpers/get-batch-sequence-from-file-name.js.html +187 -0
  143. package/test-output/lcov-report/helpers/get-journal-source-from-pillar.js.html +130 -0
  144. package/test-output/lcov-report/helpers/get-reporting-data-filter.js.html +154 -0
  145. package/test-output/lcov-report/helpers/get-siti-agri-scheme-ids.js.html +112 -0
  146. package/test-output/lcov-report/helpers/index.html +236 -0
  147. package/test-output/lcov-report/helpers/is-frps.js.html +112 -0
  148. package/test-output/lcov-report/helpers/is-siti-agri.js.html +112 -0
  149. package/test-output/lcov-report/{ffc-pay-schemes/app → helpers}/is-valid-scheme-id.js.html +13 -13
  150. package/test-output/lcov-report/{ffc-pay-schemes/app → helpers}/scheme-does-not-require-ppas.js.html +12 -12
  151. package/test-output/lcov-report/{ffc-pay-schemes/app/scheme-properties → helpers}/scheme-provides-accounting-values.js.html +11 -11
  152. package/test-output/lcov-report/index.html +24 -39
  153. package/test-output/lcov-report/{ffc-pay-schemes/app/get-source-system.js.html → pillar/get-pillar-from-scheme-id.js.html} +21 -18
  154. package/test-output/lcov-report/pillar/get-pillars.js.html +112 -0
  155. package/test-output/lcov-report/pillar/index.html +131 -0
  156. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-id}/get-scheme-id-from-pillar.js.html +11 -11
  157. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-id}/get-scheme-id-from-source-system.js.html +11 -11
  158. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-id}/get-scheme-ids.js.html +11 -11
  159. package/test-output/lcov-report/scheme-id/index.html +146 -0
  160. 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
  161. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-name}/get-scheme-names.js.html +11 -11
  162. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-name}/index.html +30 -30
  163. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-properties}/get-scheme-batch-properties.js.html +12 -12
  164. package/test-output/lcov-report/scheme-properties/get-scheme-from-batch-file-name.js.html +118 -0
  165. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-properties}/get-scheme-properties.js.html +19 -19
  166. package/test-output/lcov-report/{ffc-pay-schemes/app → scheme-properties}/get-schemes.js.html +15 -15
  167. package/test-output/lcov-report/scheme-properties/index.html +161 -0
  168. package/test-output/lcov-report/{ffc-pay-schemes/app → source-system}/get-source-system-from-scheme-id.js.html +12 -12
  169. package/test-output/lcov-report/{ffc-pay-schemes/app → source-system}/get-source-systems.js.html +11 -11
  170. package/test-output/lcov-report/source-system/index.html +131 -0
  171. package/test-output/lcov.info +68 -87
  172. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-name-from-scheme-id.js.html +0 -118
  173. 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
  }
@@ -36,5 +36,6 @@ module.exports = {
36
36
  COHT_REVENUE: 'COHTR',
37
37
  COHT_CAPITAL: 'COHTC',
38
38
  FPTT: 'FPTT',
39
- WMP: 'WMP'
39
+ WMP: 'WMP',
40
+ SFI26: 'SFI26'
40
41
  }
@@ -102,5 +102,11 @@ module.exports = Object.freeze([
102
102
  prefix: 'FFCFALS_WMP',
103
103
  suffix: ' (FALS_WMP)',
104
104
  source: 'FALS_WMP'
105
+ },
106
+ {
107
+ schemeId: schemeIds.SFI26,
108
+ prefix: 'FFCSITISFI26',
109
+ suffix: ' (SITISFI26)',
110
+ source: 'SITISFI26'
105
111
  }
106
112
  ])
@@ -15,5 +15,6 @@ module.exports = {
15
15
  COHT_REVENUE: 15,
16
16
  COHT_CAPITAL: 16,
17
17
  FPTT: 17,
18
- WMP: 18
18
+ WMP: 18,
19
+ SFI26: 19
19
20
  }
@@ -1,19 +1,20 @@
1
1
  module.exports = {
2
- SFI: 'Sustainable Farming Incentive 22',
3
- SFI_PILOT: 'Sustainable Farming Incentive Pilot',
2
+ SFI: 'SFI-22',
3
+ SFI_PILOT: 'SFI-P',
4
4
  LUMP_SUMS: 'Lump Sums',
5
- VET_VISITS: 'Annual Health and Welfare Review',
6
- CS: 'Countryside Stewardship',
7
- BPS: 'Basic Payment Scheme',
8
- MANUAL: 'Manual Injection',
9
- ES: 'Environmental Stewardship',
10
- FC: 'Forestry Commission',
11
- IMPS: 'Internal Market Payment Scheme',
12
- SFI23: 'Sustainable Farming Incentive 23',
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: 'Sustainable Farming Incentive Expanded Offer',
15
- COHT_REVENUE: 'Combined Offer Higher Tier (Revenue)',
16
- COHT_CAPITAL: 'Combined Offer Higher Tier (Capital)',
17
- FPTT: 'Farm Payments Technical Test',
18
- WMP: 'Woodland Management Plan'
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
  }
@@ -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
  ])
@@ -9,5 +9,6 @@ module.exports = {
9
9
  SFI23: 8,
10
10
  DELINKED: 6,
11
11
  SFI_EXPANDED: 5,
12
- COHT_CAPITAL: 9
12
+ COHT_CAPITAL: 9,
13
+ SFI26: 9
13
14
  }
@@ -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]
@@ -15,5 +15,6 @@ module.exports = {
15
15
  COHT_REVENUE: 'COHTR',
16
16
  COHT_CAPITAL: 'COHTC',
17
17
  FPTT: 'FPTT',
18
- WMP: 'WMP'
18
+ WMP: 'WMP',
19
+ SFI26: 'SFI26'
19
20
  }
@@ -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) => {
@@ -0,0 +1,9 @@
1
+ const sitiAgriSchemes = require('../constants/siti-agri-schemes')
2
+
3
+ const getSitiAgriSchemeIds = () => {
4
+ return sitiAgriSchemes
5
+ }
6
+
7
+ module.exports = {
8
+ getSitiAgriSchemeIds
9
+ }
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
@@ -2,7 +2,8 @@ module.exports = {
2
2
  collectCoverage: true,
3
3
  collectCoverageFrom: [
4
4
  '**/*.js',
5
- '!**/*.test.js'
5
+ '!**/*.test.js',
6
+ '!index.js'
6
7
  ],
7
8
  coverageDirectory: 'test-output',
8
9
  coverageReporters: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-schemes",
3
- "version": "1.0.15",
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": {
@@ -1,3 +1,3 @@
1
- sonar.javascript.exclusions=**/jest.config.js,**/jest.setup.js,**/__mocks__/**,**/node_modules/**,**/test/**,**/test-output/**,**/eslint.config.js,index.js
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 = 'prefix12345678.csv'
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
+ })