ffc-pay-schemes 1.0.5 → 1.0.6
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/constants/unknown.js +3 -0
- package/app/get-scheme-name-from-scheme-id.js +2 -1
- package/app/get-source-system-from-scheme-id.js +2 -1
- package/package.json +1 -1
- package/test/unit/get-scheme-name-from-scheme-id.test.js +5 -4
- package/test/unit/get-source-system-from-scheme-id.test.js +5 -4
- package/test-output/cobertura-coverage.xml +14 -6
- package/test-output/junit.xml +312 -312
- 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/fund-codes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/index.html +18 -3
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/pillars.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-batch-properties.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-ids.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/scheme-names.js.html +1 -1
- 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 +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/source-systems.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/constants/unknown.js.html +94 -0
- 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 +1 -1
- 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 +1 -1
- 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/get-scheme-batch-properties.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-id-from-source-system.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-ids.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-name-from-scheme-id.js.html +10 -7
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-names.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-scheme-properties.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-schemes.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/get-source-system-from-scheme-id.js.html +7 -4
- package/test-output/lcov-report/ffc-pay-schemes/app/get-source-systems.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/index.html +7 -7
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-does-not-require-ppas.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/app/scheme-provides-accounting-values.js.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/index.html +1 -1
- package/test-output/lcov-report/ffc-pay-schemes/index.js.html +1 -1
- package/test-output/lcov-report/index.html +11 -11
- package/test-output/lcov.info +22 -9
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
const { UNKNOWN } = require('./constants/unknown')
|
|
1
2
|
const { getSchemes } = require('./get-schemes')
|
|
2
3
|
|
|
3
4
|
const getSchemeNameFromSchemeId = (schemeId) => {
|
|
4
5
|
const matchingScheme = getSchemes().find((scheme) => scheme.schemeId === schemeId)
|
|
5
|
-
return matchingScheme?.schemeName
|
|
6
|
+
return matchingScheme?.schemeName ?? UNKNOWN
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
module.exports = {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
const { UNKNOWN } = require('./constants/unknown')
|
|
1
2
|
const { getSchemes } = require('./get-schemes')
|
|
2
3
|
|
|
3
4
|
const getSourceSystemFromSchemeId = (schemeId) => {
|
|
4
5
|
const matchingScheme = getSchemes().find((scheme) => scheme.schemeId === schemeId)
|
|
5
|
-
return matchingScheme?.sourceSystem
|
|
6
|
+
return matchingScheme?.sourceSystem ?? UNKNOWN
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
module.exports = {
|
package/package.json
CHANGED
|
@@ -4,6 +4,7 @@ jest.mock('../../app/get-schemes', () => ({
|
|
|
4
4
|
|
|
5
5
|
const { getSchemes } = require('../../app/get-schemes')
|
|
6
6
|
const { getSchemeNameFromSchemeId } = require('../../app/get-scheme-name-from-scheme-id')
|
|
7
|
+
const { UNKNOWN } = require('../../app/constants/unknown')
|
|
7
8
|
|
|
8
9
|
describe('getSchemeNameFromSchemeId', () => {
|
|
9
10
|
beforeEach(() => {
|
|
@@ -22,7 +23,7 @@ describe('getSchemeNameFromSchemeId', () => {
|
|
|
22
23
|
expect(getSchemeNameFromSchemeId(1)).toBe('Example Scheme')
|
|
23
24
|
})
|
|
24
25
|
|
|
25
|
-
test('returns
|
|
26
|
+
test('returns unknown when the scheme ID is not found', () => {
|
|
26
27
|
getSchemes.mockReturnValue([
|
|
27
28
|
{
|
|
28
29
|
schemeId: 1,
|
|
@@ -31,13 +32,13 @@ describe('getSchemeNameFromSchemeId', () => {
|
|
|
31
32
|
}
|
|
32
33
|
])
|
|
33
34
|
|
|
34
|
-
expect(getSchemeNameFromSchemeId(2)).
|
|
35
|
+
expect(getSchemeNameFromSchemeId(2)).toBe(UNKNOWN)
|
|
35
36
|
})
|
|
36
37
|
|
|
37
|
-
test('returns
|
|
38
|
+
test('returns unknown when no schemes are available', () => {
|
|
38
39
|
getSchemes.mockReturnValue([])
|
|
39
40
|
|
|
40
|
-
expect(getSchemeNameFromSchemeId(2)).
|
|
41
|
+
expect(getSchemeNameFromSchemeId(2)).toBe(UNKNOWN)
|
|
41
42
|
})
|
|
42
43
|
|
|
43
44
|
test('gets schemes before searching for the source system', () => {
|
|
@@ -2,6 +2,7 @@ jest.mock('../../app/get-schemes', () => ({
|
|
|
2
2
|
getSchemes: jest.fn()
|
|
3
3
|
}))
|
|
4
4
|
|
|
5
|
+
const { UNKNOWN } = require('../../app/constants/unknown')
|
|
5
6
|
const { getSchemes } = require('../../app/get-schemes')
|
|
6
7
|
const { getSourceSystemFromSchemeId } = require('../../app/get-source-system-from-scheme-id')
|
|
7
8
|
|
|
@@ -22,7 +23,7 @@ describe('getSourceSystemFromSchemeId', () => {
|
|
|
22
23
|
expect(getSourceSystemFromSchemeId(1)).toBe('Example Source')
|
|
23
24
|
})
|
|
24
25
|
|
|
25
|
-
test('returns
|
|
26
|
+
test('returns unknown when the scheme ID is not found', () => {
|
|
26
27
|
getSchemes.mockReturnValue([
|
|
27
28
|
{
|
|
28
29
|
schemeId: 1,
|
|
@@ -31,13 +32,13 @@ describe('getSourceSystemFromSchemeId', () => {
|
|
|
31
32
|
}
|
|
32
33
|
])
|
|
33
34
|
|
|
34
|
-
expect(getSourceSystemFromSchemeId(2)).
|
|
35
|
+
expect(getSourceSystemFromSchemeId(2)).toBe(UNKNOWN)
|
|
35
36
|
})
|
|
36
37
|
|
|
37
|
-
test('returns
|
|
38
|
+
test('returns unknown when no schemes are available', () => {
|
|
38
39
|
getSchemes.mockReturnValue([])
|
|
39
40
|
|
|
40
|
-
expect(getSourceSystemFromSchemeId(2)).
|
|
41
|
+
expect(getSourceSystemFromSchemeId(2)).toBe(UNKNOWN)
|
|
41
42
|
})
|
|
42
43
|
|
|
43
44
|
test('gets schemes before searching for the source system', () => {
|
|
@@ -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="
|
|
3
|
+
<coverage lines-valid="236" lines-covered="221" line-rate="0.9364" branches-valid="52" branches-covered="52" branch-rate="1" timestamp="1787846748080" complexity="0" version="0.1">
|
|
4
4
|
<sources>
|
|
5
5
|
<source>/home/samplackett/ffc-pay-schemes</source>
|
|
6
6
|
</sources>
|
|
@@ -92,21 +92,22 @@
|
|
|
92
92
|
<methods>
|
|
93
93
|
<method name="(anonymous_0)" hits="4" signature="()V">
|
|
94
94
|
<lines>
|
|
95
|
-
<line number="
|
|
95
|
+
<line number="4" hits="4"/>
|
|
96
96
|
</lines>
|
|
97
97
|
</method>
|
|
98
98
|
<method name="(anonymous_1)" hits="2" signature="()V">
|
|
99
99
|
<lines>
|
|
100
|
-
<line number="
|
|
100
|
+
<line number="5" hits="2"/>
|
|
101
101
|
</lines>
|
|
102
102
|
</method>
|
|
103
103
|
</methods>
|
|
104
104
|
<lines>
|
|
105
105
|
<line number="1" hits="1" branch="false"/>
|
|
106
|
-
<line number="
|
|
107
|
-
<line number="4" hits="
|
|
106
|
+
<line number="2" hits="1" branch="false"/>
|
|
107
|
+
<line number="4" hits="1" branch="false"/>
|
|
108
108
|
<line number="5" hits="4" branch="false"/>
|
|
109
|
-
<line number="
|
|
109
|
+
<line number="6" hits="4" branch="true" condition-coverage="100% (2/2)"/>
|
|
110
|
+
<line number="9" hits="1" branch="false"/>
|
|
110
111
|
</lines>
|
|
111
112
|
</class>
|
|
112
113
|
<class name="get-scheme-names.js" filename="app/get-scheme-names.js" line-rate="1" branch-rate="1">
|
|
@@ -341,6 +342,13 @@
|
|
|
341
342
|
<line number="1" hits="4" branch="false"/>
|
|
342
343
|
</lines>
|
|
343
344
|
</class>
|
|
345
|
+
<class name="unknown.js" filename="app/constants/unknown.js" line-rate="1" branch-rate="1">
|
|
346
|
+
<methods>
|
|
347
|
+
</methods>
|
|
348
|
+
<lines>
|
|
349
|
+
<line number="1" hits="1" branch="false"/>
|
|
350
|
+
</lines>
|
|
351
|
+
</class>
|
|
344
352
|
</classes>
|
|
345
353
|
</package>
|
|
346
354
|
<package name="ffc-pay-schemes.app.constants.account-codes" line-rate="1" branch-rate="1">
|