ffc-pay-schemes 1.0.4 → 1.0.5

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 (65) hide show
  1. package/README.md +8 -3
  2. package/app/get-scheme-ids.js +9 -0
  3. package/app/get-scheme-names.js +9 -0
  4. package/app/get-source-systems.js +9 -0
  5. package/index.js +7 -3
  6. package/package.json +1 -1
  7. package/test/unit/get-scheme-ids.test.js +8 -0
  8. package/test/unit/get-scheme-names.test.js +8 -0
  9. package/test/unit/get-source-systems.test.js +8 -0
  10. package/test-output/cobertura-coverage.xml +51 -4
  11. package/test-output/junit.xml +284 -272
  12. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ap.js.html +1 -1
  13. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-admin.js.html +1 -1
  14. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/ar-irregular.js.html +1 -1
  15. package/test-output/lcov-report/ffc-pay-schemes/app/constants/account-codes/index.html +1 -1
  16. package/test-output/lcov-report/ffc-pay-schemes/app/constants/delivery-bodies.js.html +1 -1
  17. package/test-output/lcov-report/ffc-pay-schemes/app/constants/description-codes.js.html +1 -1
  18. package/test-output/lcov-report/ffc-pay-schemes/app/constants/fund-codes.js.html +1 -1
  19. package/test-output/lcov-report/ffc-pay-schemes/app/constants/index.html +1 -1
  20. package/test-output/lcov-report/ffc-pay-schemes/app/constants/pillars.js.html +1 -1
  21. package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-batch-properties.js.html +1 -1
  22. package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-ids.js.html +2 -2
  23. package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-names.js.html +2 -2
  24. package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-not-requiring-ppas.js.html +1 -1
  25. package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes-providing-account-values.js.html +1 -1
  26. package/test-output/lcov-report/ffc-pay-schemes/app/constants/schemes.js.html +1 -1
  27. package/test-output/lcov-report/ffc-pay-schemes/app/constants/source-systems.js.html +2 -2
  28. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-default-invoice-number.js.html +1 -1
  29. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-es-invoice-number.js.html +1 -1
  30. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-imps-invoice-number.js.html +1 -1
  31. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
  32. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/create-standard-scheme-invoice-number.js.html +1 -1
  33. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.html +1 -1
  34. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/index.js.html +1 -1
  35. package/test-output/lcov-report/ffc-pay-schemes/app/create-invoice-number/use-invoice-number-as-is.js.html +1 -1
  36. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-default-invoice-number.js.html +1 -1
  37. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
  38. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.html +1 -1
  39. package/test-output/lcov-report/ffc-pay-schemes/app/create-split-invoice-number/index.js.html +1 -1
  40. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/bps-map.js.html +1 -1
  41. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cohtc-map.js.html +1 -1
  42. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/cs-map.js.html +1 -1
  43. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/default-map.js.html +1 -1
  44. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/delinked-map.js.html +1 -1
  45. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.html +1 -1
  46. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/index.js.html +1 -1
  47. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/lump-sums-map.js.html +1 -1
  48. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/sfi-frps-map.js.html +1 -1
  49. package/test-output/lcov-report/ffc-pay-schemes/app/get-account-code-map/vet-visits-map.js.html +1 -1
  50. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-batch-properties.js.html +1 -1
  51. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-id-from-source-system.js.html +1 -1
  52. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-ids.js.html +112 -0
  53. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-name-from-scheme-id.js.html +1 -1
  54. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-names.js.html +112 -0
  55. package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-properties.js.html +1 -1
  56. package/test-output/lcov-report/ffc-pay-schemes/app/get-schemes.js.html +1 -1
  57. package/test-output/lcov-report/ffc-pay-schemes/app/get-source-system-from-scheme-id.js.html +1 -1
  58. package/test-output/lcov-report/ffc-pay-schemes/app/get-source-systems.js.html +112 -0
  59. package/test-output/lcov-report/ffc-pay-schemes/app/index.html +49 -4
  60. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-does-not-require-ppas.js.html +1 -1
  61. package/test-output/lcov-report/ffc-pay-schemes/app/scheme-provides-accounting-values.js.html +1 -1
  62. package/test-output/lcov-report/ffc-pay-schemes/index.html +5 -5
  63. package/test-output/lcov-report/ffc-pay-schemes/index.js.html +19 -7
  64. package/test-output/lcov-report/index.html +11 -11
  65. package/test-output/lcov.info +51 -4
package/README.md CHANGED
@@ -18,13 +18,16 @@ const {
18
18
  createSplitInvoiceNumber,
19
19
  getAccountCodeMap,
20
20
  getSchemeBatchProperties,
21
+ getSchemeIdFromSourceSystem,
22
+ getSchemeIds,
21
23
  getSchemeNameFromSchemeId,
24
+ getSchemeNames,
22
25
  getSchemeProperties,
23
26
  getSchemes,
24
27
  getSourceSystemFromSchemeId,
28
+ getSourceSystems,
25
29
  schemeDoesNotRequirePPAs,
26
- schemeProvidesAccountingValues,
27
- schemeIds
30
+ schemeProvidesAccountingValues
28
31
  } = require('ffc-pay-schemes')
29
32
  ```
30
33
 
@@ -33,13 +36,15 @@ const {
33
36
  - `getAccountCodeMap(schemeId)` returns the account code mapping used for a given `schemeId`.
34
37
  - `getSchemeBatchProperties(schemeId)` returns the batch processing properties for a given `schemeId`.
35
38
  - `getSchemeIdFromSourceSystem(sourceSystem)` returns the scheme ID for a given `sourceSystem`.
39
+ - `getSchemeIds()` returns all supported scheme IDs.
36
40
  - `getSchemeNameFromSchemeId(schemeId)` returns the scheme name for a given `schemeId`.
41
+ - `getSchemeNames()` returns all supported scheme names.
37
42
  - `getSchemeProperties(schemeId, sourceSystem, pillar)` returns the default payment properties for a scheme. A scheme can be identified by its ID or source system. The optional `pillar` can be used for manual payments.
38
43
  - `getSchemes()` returns all supported schemes as an array of objects containing `schemeId`, `schemeName` and `sourceSystem`.
39
44
  - `getSourceSystemFromSchemeId(schemeId)` returns the source system name for a given `schemeId`.
45
+ - `getSourceSystems()` returns all supported source systems.
40
46
  - `schemeDoesNotRequirePPAs(schemeId)` returns `true` if Payment Hub does not support Post Payment Adjustments (PPAs) for a given `schemeId`; otherwise, it returns `false`.
41
47
  - `schemeProvidesAccountingValues(schemeId)` returns `true` if a given `schemeId` provides accounting values within its payment requests; otherwise, it returns `false`.
42
- - `schemeIds` provides the constants for all supported scheme IDs.
43
48
 
44
49
  ### Examples
45
50
 
@@ -0,0 +1,9 @@
1
+ const schemeIds = require('./constants/scheme-ids')
2
+
3
+ const getSchemeIds = () => {
4
+ return schemeIds
5
+ }
6
+
7
+ module.exports = {
8
+ getSchemeIds
9
+ }
@@ -0,0 +1,9 @@
1
+ const schemeNames = require('./constants/scheme-names')
2
+
3
+ const getSchemeNames = () => {
4
+ return schemeNames
5
+ }
6
+
7
+ module.exports = {
8
+ getSchemeNames
9
+ }
@@ -0,0 +1,9 @@
1
+ const sourceSystems = require('./constants/source-systems')
2
+
3
+ const getSourceSystems = () => {
4
+ return sourceSystems
5
+ }
6
+
7
+ module.exports = {
8
+ getSourceSystems
9
+ }
package/index.js CHANGED
@@ -3,13 +3,15 @@ const { createSplitInvoiceNumber } = require('./app/create-split-invoice-number'
3
3
  const { getAccountCodeMap } = require('./app/get-account-code-map')
4
4
  const { getSchemeBatchProperties } = require('./app/get-scheme-batch-properties')
5
5
  const { getSchemeIdFromSourceSystem } = require('./app/get-scheme-id-from-source-system')
6
+ const { getSchemeIds } = require('./app/get-scheme-ids')
6
7
  const { getSchemeNameFromSchemeId } = require('./app/get-scheme-name-from-scheme-id')
8
+ const { getSchemeNames } = require('./app/get-scheme-names')
7
9
  const { getSchemeProperties } = require('./app/get-scheme-properties')
8
10
  const { getSchemes } = require('./app/get-schemes')
9
11
  const { getSourceSystemFromSchemeId } = require('./app/get-source-system-from-scheme-id')
12
+ const { getSourceSystems } = require('./app/get-source-systems')
10
13
  const { schemeDoesNotRequirePPAs } = require('./app/scheme-does-not-require-ppas')
11
14
  const { schemeProvidesAccountingValues } = require('./app/scheme-provides-accounting-values')
12
- const schemeIds = require('./app/constants/scheme-ids')
13
15
 
14
16
  module.exports = {
15
17
  createInvoiceNumber,
@@ -17,11 +19,13 @@ module.exports = {
17
19
  getAccountCodeMap,
18
20
  getSchemeBatchProperties,
19
21
  getSchemeIdFromSourceSystem,
22
+ getSchemeIds,
20
23
  getSchemeNameFromSchemeId,
24
+ getSchemeNames,
21
25
  getSchemeProperties,
22
26
  getSchemes,
23
27
  getSourceSystemFromSchemeId,
28
+ getSourceSystems,
24
29
  schemeDoesNotRequirePPAs,
25
- schemeProvidesAccountingValues,
26
- schemeIds
30
+ schemeProvidesAccountingValues
27
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffc-pay-schemes",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
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": {
@@ -0,0 +1,8 @@
1
+ const { getSchemeIds } = require('../../app/get-scheme-ids')
2
+ const schemeIds = require('../../app/constants/scheme-ids')
3
+
4
+ describe('getSchemeIds', () => {
5
+ test('returns all scheme IDs', () => {
6
+ expect(getSchemeIds()).toEqual(schemeIds)
7
+ })
8
+ })
@@ -0,0 +1,8 @@
1
+ const { getSchemeNames } = require('../../app/get-scheme-names')
2
+ const schemeNames = require('../../app/constants/scheme-names')
3
+
4
+ describe('getSchemeNames', () => {
5
+ test('returns all scheme names', () => {
6
+ expect(getSchemeNames()).toEqual(schemeNames)
7
+ })
8
+ })
@@ -0,0 +1,8 @@
1
+ const { getSourceSystems } = require('../../app/get-source-systems')
2
+ const sourceSystems = require('../../app/constants/source-systems')
3
+
4
+ describe('getSourceSystems', () => {
5
+ test('returns all source systems', () => {
6
+ expect(getSourceSystems()).toEqual(sourceSystems)
7
+ })
8
+ })
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" ?>
2
2
  <!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
3
- <coverage lines-valid="220" lines-covered="207" line-rate="0.9409000000000001" branches-valid="50" branches-covered="50" branch-rate="1" timestamp="1787762739854" complexity="0" version="0.1">
3
+ <coverage lines-valid="234" lines-covered="219" line-rate="0.9358" branches-valid="50" branches-covered="50" branch-rate="1" timestamp="1787827130090" complexity="0" version="0.1">
4
4
  <sources>
5
5
  <source>/home/samplackett/ffc-pay-schemes</source>
6
6
  </sources>
@@ -23,7 +23,9 @@
23
23
  <line number="10" hits="0" branch="false"/>
24
24
  <line number="11" hits="0" branch="false"/>
25
25
  <line number="12" hits="0" branch="false"/>
26
+ <line number="13" hits="0" branch="false"/>
26
27
  <line number="14" hits="0" branch="false"/>
28
+ <line number="16" hits="0" branch="false"/>
27
29
  </lines>
28
30
  </class>
29
31
  </classes>
@@ -71,6 +73,21 @@
71
73
  <line number="8" hits="1" branch="false"/>
72
74
  </lines>
73
75
  </class>
76
+ <class name="get-scheme-ids.js" filename="app/get-scheme-ids.js" line-rate="1" branch-rate="1">
77
+ <methods>
78
+ <method name="(anonymous_0)" hits="1" signature="()V">
79
+ <lines>
80
+ <line number="3" hits="1"/>
81
+ </lines>
82
+ </method>
83
+ </methods>
84
+ <lines>
85
+ <line number="1" hits="1" branch="false"/>
86
+ <line number="3" hits="1" branch="false"/>
87
+ <line number="4" hits="1" branch="false"/>
88
+ <line number="7" hits="1" branch="false"/>
89
+ </lines>
90
+ </class>
74
91
  <class name="get-scheme-name-from-scheme-id.js" filename="app/get-scheme-name-from-scheme-id.js" line-rate="1" branch-rate="1">
75
92
  <methods>
76
93
  <method name="(anonymous_0)" hits="4" signature="()V">
@@ -92,6 +109,21 @@
92
109
  <line number="8" hits="1" branch="false"/>
93
110
  </lines>
94
111
  </class>
112
+ <class name="get-scheme-names.js" filename="app/get-scheme-names.js" line-rate="1" branch-rate="1">
113
+ <methods>
114
+ <method name="(anonymous_0)" hits="1" signature="()V">
115
+ <lines>
116
+ <line number="3" hits="1"/>
117
+ </lines>
118
+ </method>
119
+ </methods>
120
+ <lines>
121
+ <line number="1" hits="1" branch="false"/>
122
+ <line number="3" hits="1" branch="false"/>
123
+ <line number="4" hits="1" branch="false"/>
124
+ <line number="7" hits="1" branch="false"/>
125
+ </lines>
126
+ </class>
95
127
  <class name="get-scheme-properties.js" filename="app/get-scheme-properties.js" line-rate="1" branch-rate="1">
96
128
  <methods>
97
129
  <method name="(anonymous_0)" hits="54" signature="()V">
@@ -175,6 +207,21 @@
175
207
  <line number="8" hits="1" branch="false"/>
176
208
  </lines>
177
209
  </class>
210
+ <class name="get-source-systems.js" filename="app/get-source-systems.js" line-rate="1" branch-rate="1">
211
+ <methods>
212
+ <method name="(anonymous_0)" hits="1" signature="()V">
213
+ <lines>
214
+ <line number="3" hits="1"/>
215
+ </lines>
216
+ </method>
217
+ </methods>
218
+ <lines>
219
+ <line number="1" hits="1" branch="false"/>
220
+ <line number="3" hits="1" branch="false"/>
221
+ <line number="4" hits="1" branch="false"/>
222
+ <line number="7" hits="1" branch="false"/>
223
+ </lines>
224
+ </class>
178
225
  <class name="scheme-does-not-require-ppas.js" filename="app/scheme-does-not-require-ppas.js" line-rate="1" branch-rate="1">
179
226
  <methods>
180
227
  <method name="(anonymous_0)" hits="18" signature="()V">
@@ -249,14 +296,14 @@
249
296
  <methods>
250
297
  </methods>
251
298
  <lines>
252
- <line number="1" hits="8" branch="false"/>
299
+ <line number="1" hits="9" branch="false"/>
253
300
  </lines>
254
301
  </class>
255
302
  <class name="scheme-names.js" filename="app/constants/scheme-names.js" line-rate="1" branch-rate="1">
256
303
  <methods>
257
304
  </methods>
258
305
  <lines>
259
- <line number="1" hits="1" branch="false"/>
306
+ <line number="1" hits="2" branch="false"/>
260
307
  </lines>
261
308
  </class>
262
309
  <class name="schemes-not-requiring-ppas.js" filename="app/constants/schemes-not-requiring-ppas.js" line-rate="1" branch-rate="1">
@@ -291,7 +338,7 @@
291
338
  <methods>
292
339
  </methods>
293
340
  <lines>
294
- <line number="1" hits="3" branch="false"/>
341
+ <line number="1" hits="4" branch="false"/>
295
342
  </lines>
296
343
  </class>
297
344
  </classes>