ffc-pay-schemes 1.1.2 → 1.1.3
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/app/scheme-properties/get-siti-agri-schemes.js +20 -6
- package/package.json +1 -1
- package/test/unit/scheme-properties/get-siti-agri-schemes.test.js +30 -6
- package/test-output/cobertura-coverage.xml +2 -10
- package/test-output/junit.xml +355 -355
- package/test-output/lcov-report/constants/account-codes/ap.js.html +1 -1
- package/test-output/lcov-report/constants/account-codes/ar-admin.js.html +1 -1
- package/test-output/lcov-report/constants/account-codes/ar-irregular.js.html +1 -1
- package/test-output/lcov-report/constants/account-codes/index.html +1 -1
- package/test-output/lcov-report/constants/delivery-bodies.js.html +1 -1
- package/test-output/lcov-report/constants/description-codes.js.html +1 -1
- package/test-output/lcov-report/constants/file-masks.js.html +1 -1
- package/test-output/lcov-report/constants/frps-schemes.js.html +1 -1
- package/test-output/lcov-report/constants/fund-codes.js.html +1 -1
- package/test-output/lcov-report/constants/index.html +5 -20
- package/test-output/lcov-report/constants/manual-sources.js.html +1 -1
- package/test-output/lcov-report/constants/pillars.js.html +1 -1
- package/test-output/lcov-report/constants/scheme-batch-properties.js.html +1 -1
- package/test-output/lcov-report/constants/scheme-ids.js.html +1 -1
- package/test-output/lcov-report/constants/scheme-names.js.html +1 -1
- package/test-output/lcov-report/constants/schemes-not-requiring-ppas.js.html +1 -1
- package/test-output/lcov-report/constants/schemes-providing-account-values.js.html +1 -1
- package/test-output/lcov-report/constants/schemes.js.html +1 -1
- package/test-output/lcov-report/constants/sequence-positions.js.html +1 -1
- package/test-output/lcov-report/constants/siti-agri-schemes.js.html +1 -1
- package/test-output/lcov-report/constants/source-systems.js.html +1 -1
- package/test-output/lcov-report/constants/unknown.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/create-default-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/create-es-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/create-imps-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/create-standard-scheme-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/index.html +1 -1
- package/test-output/lcov-report/create-invoice-number/index.js.html +1 -1
- package/test-output/lcov-report/create-invoice-number/use-invoice-number-as-is.js.html +1 -1
- package/test-output/lcov-report/create-split-invoice-number/create-default-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-split-invoice-number/create-siti-agri-invoice-number.js.html +1 -1
- package/test-output/lcov-report/create-split-invoice-number/index.html +1 -1
- package/test-output/lcov-report/create-split-invoice-number/index.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/bps-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/cohtc-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/cs-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/default-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/delinked-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/index.html +1 -1
- package/test-output/lcov-report/get-account-code-map/index.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/lump-sums-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/sfi-frps-map.js.html +1 -1
- package/test-output/lcov-report/get-account-code-map/vet-visits-map.js.html +1 -1
- package/test-output/lcov-report/helpers/get-batch-sequence-from-file-name.js.html +1 -1
- package/test-output/lcov-report/helpers/get-journal-source-from-pillar.js.html +1 -1
- package/test-output/lcov-report/helpers/get-reporting-data-filter.js.html +1 -1
- package/test-output/lcov-report/helpers/index.html +1 -1
- package/test-output/lcov-report/helpers/is-frps.js.html +1 -1
- package/test-output/lcov-report/helpers/is-siti-agri.js.html +1 -1
- package/test-output/lcov-report/helpers/scheme-does-not-require-ppas.js.html +1 -1
- package/test-output/lcov-report/helpers/scheme-provides-accounting-values.js.html +1 -1
- package/test-output/lcov-report/index.html +11 -11
- package/test-output/lcov-report/pillar/get-pillar-from-scheme-id.js.html +1 -1
- package/test-output/lcov-report/pillar/get-pillars.js.html +1 -1
- package/test-output/lcov-report/pillar/index.html +1 -1
- package/test-output/lcov-report/scheme-id/get-scheme-id-from-pillar.js.html +1 -1
- package/test-output/lcov-report/scheme-id/get-scheme-id-from-source-system.js.html +1 -1
- package/test-output/lcov-report/scheme-id/get-scheme-ids.js.html +1 -1
- package/test-output/lcov-report/scheme-id/get-siti-agri-scheme-ids.js.html +1 -1
- package/test-output/lcov-report/scheme-id/index.html +1 -1
- package/test-output/lcov-report/scheme-id/is-valid-scheme-id.js.html +1 -1
- package/test-output/lcov-report/scheme-name/get-scheme-name-from-scheme-id.js.html +1 -1
- package/test-output/lcov-report/scheme-name/get-scheme-names.js.html +1 -1
- package/test-output/lcov-report/scheme-name/index.html +1 -1
- package/test-output/lcov-report/scheme-properties/get-scheme-batch-properties.js.html +1 -1
- package/test-output/lcov-report/scheme-properties/get-scheme-from-batch-file-name.js.html +1 -1
- package/test-output/lcov-report/scheme-properties/get-scheme-properties.js.html +1 -1
- package/test-output/lcov-report/scheme-properties/get-schemes.js.html +1 -1
- package/test-output/lcov-report/scheme-properties/get-siti-agri-schemes.js.html +50 -8
- package/test-output/lcov-report/scheme-properties/index.html +1 -1
- package/test-output/lcov-report/source-system/get-source-system-from-scheme-id.js.html +1 -1
- package/test-output/lcov-report/source-system/get-source-systems.js.html +1 -1
- package/test-output/lcov-report/source-system/index.html +1 -1
- package/test-output/lcov.info +0 -11
|
@@ -2,14 +2,28 @@ const pillars = require('../constants/pillars')
|
|
|
2
2
|
const sitiAgriSchemeIds = require('../constants/siti-agri-schemes')
|
|
3
3
|
const schemeNames = require('../constants/scheme-names')
|
|
4
4
|
const sourceSystems = require('../constants/source-systems')
|
|
5
|
+
const schemeIds = require('../constants/scheme-ids')
|
|
6
|
+
|
|
7
|
+
const schemeKeyById = Object.entries(schemeIds).reduce((acc, [key, value]) => {
|
|
8
|
+
acc[value] = key
|
|
9
|
+
return acc
|
|
10
|
+
}, {})
|
|
5
11
|
|
|
6
12
|
const getSitiAgriSchemes = () =>
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
sitiAgriSchemeIds.map((schemeId) => {
|
|
14
|
+
const schemeKey = schemeKeyById[schemeId]
|
|
15
|
+
|
|
16
|
+
if (!schemeKey) {
|
|
17
|
+
throw new Error(`No scheme metadata found for schemeId: ${schemeId}`)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
schemeId,
|
|
22
|
+
schemeName: schemeNames[schemeKey],
|
|
23
|
+
sourceSystem: sourceSystems[schemeKey],
|
|
24
|
+
pillar: pillars[schemeKey]
|
|
25
|
+
}
|
|
26
|
+
})
|
|
13
27
|
|
|
14
28
|
module.exports = {
|
|
15
29
|
getSitiAgriSchemes
|
package/package.json
CHANGED
|
@@ -1,18 +1,42 @@
|
|
|
1
1
|
const sitiAgriSchemeIds = require('../../../app/constants/siti-agri-schemes')
|
|
2
|
+
const schemeIds = require('../../../app/constants/scheme-ids')
|
|
2
3
|
const schemeNames = require('../../../app/constants/scheme-names')
|
|
3
4
|
const sourceSystems = require('../../../app/constants/source-systems')
|
|
4
5
|
const pillars = require('../../../app/constants/pillars')
|
|
5
6
|
const { getSitiAgriSchemes } = require('../../../app/scheme-properties/get-siti-agri-schemes')
|
|
6
7
|
|
|
8
|
+
const schemeKeyById = Object.entries(schemeIds).reduce((acc, [key, value]) => {
|
|
9
|
+
acc[value] = key
|
|
10
|
+
return acc
|
|
11
|
+
}, {})
|
|
12
|
+
|
|
7
13
|
describe('getSitiAgriSchemes', () => {
|
|
8
14
|
test('returns one scheme object for each SITI Agri scheme id', () => {
|
|
9
|
-
const expected =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
+
const expected = sitiAgriSchemeIds.map((schemeId) => {
|
|
16
|
+
const schemeKey = schemeKeyById[schemeId]
|
|
17
|
+
|
|
18
|
+
expect(schemeKey).toBeDefined()
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
schemeId,
|
|
22
|
+
schemeName: schemeNames[schemeKey],
|
|
23
|
+
sourceSystem: sourceSystems[schemeKey],
|
|
24
|
+
pillar: pillars[schemeKey]
|
|
25
|
+
}
|
|
26
|
+
})
|
|
15
27
|
|
|
16
28
|
expect(getSitiAgriSchemes()).toEqual(expected)
|
|
17
29
|
})
|
|
30
|
+
|
|
31
|
+
test('returns the correct metadata for specific scheme (SFI23)', () => {
|
|
32
|
+
const schemes = getSitiAgriSchemes()
|
|
33
|
+
const sfi23 = schemes.find((scheme) => scheme.schemeId === schemeIds.SFI23)
|
|
34
|
+
|
|
35
|
+
expect(sfi23).toEqual({
|
|
36
|
+
schemeId: schemeIds.SFI23,
|
|
37
|
+
schemeName: schemeNames.SFI23,
|
|
38
|
+
sourceSystem: sourceSystems.SFI23,
|
|
39
|
+
pillar: pillars.SFI23
|
|
40
|
+
})
|
|
41
|
+
})
|
|
18
42
|
})
|
|
@@ -1,20 +1,12 @@
|
|
|
1
1
|
<?xml version="1.0" ?>
|
|
2
2
|
<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">
|
|
3
|
-
<coverage lines-valid="
|
|
3
|
+
<coverage lines-valid="312" lines-covered="312" line-rate="1" branches-valid="67" branches-covered="67" branch-rate="1" timestamp="1791821370454" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/samplackett/ffc-pay-schemes</source>
|
|
6
6
|
</sources>
|
|
7
7
|
<packages>
|
|
8
|
-
<package name="constants" line-rate="
|
|
8
|
+
<package name="constants" line-rate="1" branch-rate="1">
|
|
9
9
|
<classes>
|
|
10
|
-
<class name="batch-schemes.js" filename="app/constants/batch-schemes.js" line-rate="0" branch-rate="1">
|
|
11
|
-
<methods>
|
|
12
|
-
</methods>
|
|
13
|
-
<lines>
|
|
14
|
-
<line number="1" hits="0" branch="false"/>
|
|
15
|
-
<line number="3" hits="0" branch="false"/>
|
|
16
|
-
</lines>
|
|
17
|
-
</class>
|
|
18
10
|
<class name="delivery-bodies.js" filename="app/constants/delivery-bodies.js" line-rate="1" branch-rate="1">
|
|
19
11
|
<methods>
|
|
20
12
|
</methods>
|