@defra-fish/dynamics-lib 1.34.0 → 1.35.0-rc.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/package.json +2 -2
- package/src/__mocks__/option-set-data.json +39 -78
- package/src/entities/__tests__/__snapshots__/pocl-validation-error.entity.spec.js.snap +8 -0
- package/src/entities/__tests__/pocl-validation-error.entity.spec.js +10 -0
- package/src/entities/pocl-validation-error.entity.js +26 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defra-fish/dynamics-lib",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.35.0-rc.1",
|
|
4
4
|
"description": "Framework to support integration with dynamics",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -43,5 +43,5 @@
|
|
|
43
43
|
"simple-oauth2": "^4.3.0",
|
|
44
44
|
"uuid": "^8.3.2"
|
|
45
45
|
},
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "ee71d7b48f62a786778bd80a5a836f9379a551cd"
|
|
47
47
|
}
|
|
@@ -4664,28 +4664,29 @@
|
|
|
4664
4664
|
"MetadataId": "4797ec42-f6df-4ea9-892b-892e403a362d",
|
|
4665
4665
|
"Options": [
|
|
4666
4666
|
{
|
|
4667
|
-
"Value":
|
|
4667
|
+
"Value": 910400002,
|
|
4668
4668
|
"Color": "#0000ff",
|
|
4669
4669
|
"IsManaged": false,
|
|
4670
|
-
"ExternalValue":
|
|
4670
|
+
"ExternalValue": "",
|
|
4671
4671
|
"ParentValues": [],
|
|
4672
|
+
"Tag": null,
|
|
4672
4673
|
"MetadataId": null,
|
|
4673
4674
|
"HasChanged": null,
|
|
4674
4675
|
"Label": {
|
|
4675
4676
|
"LocalizedLabels": [
|
|
4676
4677
|
{
|
|
4677
|
-
"Label": "
|
|
4678
|
+
"Label": "Direct Debit",
|
|
4678
4679
|
"LanguageCode": 1033,
|
|
4679
4680
|
"IsManaged": false,
|
|
4680
|
-
"MetadataId": "
|
|
4681
|
+
"MetadataId": "c32cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4681
4682
|
"HasChanged": null
|
|
4682
4683
|
}
|
|
4683
4684
|
],
|
|
4684
4685
|
"UserLocalizedLabel": {
|
|
4685
|
-
"Label": "
|
|
4686
|
+
"Label": "Direct Debit",
|
|
4686
4687
|
"LanguageCode": 1033,
|
|
4687
4688
|
"IsManaged": false,
|
|
4688
|
-
"MetadataId": "
|
|
4689
|
+
"MetadataId": "c32cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4689
4690
|
"HasChanged": null
|
|
4690
4691
|
}
|
|
4691
4692
|
},
|
|
@@ -4695,7 +4696,7 @@
|
|
|
4695
4696
|
"Label": "",
|
|
4696
4697
|
"LanguageCode": 1033,
|
|
4697
4698
|
"IsManaged": false,
|
|
4698
|
-
"MetadataId": "
|
|
4699
|
+
"MetadataId": "c42cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4699
4700
|
"HasChanged": null
|
|
4700
4701
|
}
|
|
4701
4702
|
],
|
|
@@ -4703,7 +4704,7 @@
|
|
|
4703
4704
|
"Label": "",
|
|
4704
4705
|
"LanguageCode": 1033,
|
|
4705
4706
|
"IsManaged": false,
|
|
4706
|
-
"MetadataId": "
|
|
4707
|
+
"MetadataId": "c42cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4707
4708
|
"HasChanged": null
|
|
4708
4709
|
}
|
|
4709
4710
|
}
|
|
@@ -4712,8 +4713,9 @@
|
|
|
4712
4713
|
"Value": 910400000,
|
|
4713
4714
|
"Color": "#0000ff",
|
|
4714
4715
|
"IsManaged": false,
|
|
4715
|
-
"ExternalValue":
|
|
4716
|
+
"ExternalValue": "",
|
|
4716
4717
|
"ParentValues": [],
|
|
4718
|
+
"Tag": null,
|
|
4717
4719
|
"MetadataId": null,
|
|
4718
4720
|
"HasChanged": null,
|
|
4719
4721
|
"Label": {
|
|
@@ -4757,8 +4759,9 @@
|
|
|
4757
4759
|
"Value": 910400001,
|
|
4758
4760
|
"Color": "#0000ff",
|
|
4759
4761
|
"IsManaged": false,
|
|
4760
|
-
"ExternalValue":
|
|
4762
|
+
"ExternalValue": "",
|
|
4761
4763
|
"ParentValues": [],
|
|
4764
|
+
"Tag": null,
|
|
4762
4765
|
"MetadataId": null,
|
|
4763
4766
|
"HasChanged": null,
|
|
4764
4767
|
"Label": {
|
|
@@ -4798,74 +4801,30 @@
|
|
|
4798
4801
|
}
|
|
4799
4802
|
}
|
|
4800
4803
|
},
|
|
4801
|
-
{
|
|
4802
|
-
"Value": 910400002,
|
|
4803
|
-
"Color": "#0000ff",
|
|
4804
|
-
"IsManaged": false,
|
|
4805
|
-
"ExternalValue": null,
|
|
4806
|
-
"ParentValues": [],
|
|
4807
|
-
"MetadataId": null,
|
|
4808
|
-
"HasChanged": null,
|
|
4809
|
-
"Label": {
|
|
4810
|
-
"LocalizedLabels": [
|
|
4811
|
-
{
|
|
4812
|
-
"Label": "Direct Debit",
|
|
4813
|
-
"LanguageCode": 1033,
|
|
4814
|
-
"IsManaged": false,
|
|
4815
|
-
"MetadataId": "c32cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4816
|
-
"HasChanged": null
|
|
4817
|
-
}
|
|
4818
|
-
],
|
|
4819
|
-
"UserLocalizedLabel": {
|
|
4820
|
-
"Label": "Direct Debit",
|
|
4821
|
-
"LanguageCode": 1033,
|
|
4822
|
-
"IsManaged": false,
|
|
4823
|
-
"MetadataId": "c32cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4824
|
-
"HasChanged": null
|
|
4825
|
-
}
|
|
4826
|
-
},
|
|
4827
|
-
"Description": {
|
|
4828
|
-
"LocalizedLabels": [
|
|
4829
|
-
{
|
|
4830
|
-
"Label": "",
|
|
4831
|
-
"LanguageCode": 1033,
|
|
4832
|
-
"IsManaged": false,
|
|
4833
|
-
"MetadataId": "c42cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4834
|
-
"HasChanged": null
|
|
4835
|
-
}
|
|
4836
|
-
],
|
|
4837
|
-
"UserLocalizedLabel": {
|
|
4838
|
-
"Label": "",
|
|
4839
|
-
"LanguageCode": 1033,
|
|
4840
|
-
"IsManaged": false,
|
|
4841
|
-
"MetadataId": "c42cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4842
|
-
"HasChanged": null
|
|
4843
|
-
}
|
|
4844
|
-
}
|
|
4845
|
-
},
|
|
4846
4804
|
{
|
|
4847
4805
|
"Value": 910400004,
|
|
4848
4806
|
"Color": "#0000ff",
|
|
4849
4807
|
"IsManaged": false,
|
|
4850
|
-
"ExternalValue":
|
|
4808
|
+
"ExternalValue": "",
|
|
4851
4809
|
"ParentValues": [],
|
|
4810
|
+
"Tag": null,
|
|
4852
4811
|
"MetadataId": null,
|
|
4853
4812
|
"HasChanged": null,
|
|
4854
4813
|
"Label": {
|
|
4855
4814
|
"LocalizedLabels": [
|
|
4856
4815
|
{
|
|
4857
|
-
"Label": "
|
|
4816
|
+
"Label": "Postal Order",
|
|
4858
4817
|
"LanguageCode": 1033,
|
|
4859
4818
|
"IsManaged": false,
|
|
4860
|
-
"MetadataId": "
|
|
4819
|
+
"MetadataId": "c26b31e1-43b8-ed11-83ff-000d3a655712",
|
|
4861
4820
|
"HasChanged": null
|
|
4862
4821
|
}
|
|
4863
4822
|
],
|
|
4864
4823
|
"UserLocalizedLabel": {
|
|
4865
|
-
"Label": "
|
|
4824
|
+
"Label": "Postal Order",
|
|
4866
4825
|
"LanguageCode": 1033,
|
|
4867
4826
|
"IsManaged": false,
|
|
4868
|
-
"MetadataId": "
|
|
4827
|
+
"MetadataId": "c26b31e1-43b8-ed11-83ff-000d3a655712",
|
|
4869
4828
|
"HasChanged": null
|
|
4870
4829
|
}
|
|
4871
4830
|
},
|
|
@@ -4875,7 +4834,7 @@
|
|
|
4875
4834
|
"Label": "",
|
|
4876
4835
|
"LanguageCode": 1033,
|
|
4877
4836
|
"IsManaged": false,
|
|
4878
|
-
"MetadataId": "
|
|
4837
|
+
"MetadataId": "c46b31e1-43b8-ed11-83ff-000d3a655712",
|
|
4879
4838
|
"HasChanged": null
|
|
4880
4839
|
}
|
|
4881
4840
|
],
|
|
@@ -4883,34 +4842,35 @@
|
|
|
4883
4842
|
"Label": "",
|
|
4884
4843
|
"LanguageCode": 1033,
|
|
4885
4844
|
"IsManaged": false,
|
|
4886
|
-
"MetadataId": "
|
|
4845
|
+
"MetadataId": "c46b31e1-43b8-ed11-83ff-000d3a655712",
|
|
4887
4846
|
"HasChanged": null
|
|
4888
4847
|
}
|
|
4889
4848
|
}
|
|
4890
4849
|
},
|
|
4891
4850
|
{
|
|
4892
|
-
"Value":
|
|
4851
|
+
"Value": 910400006,
|
|
4893
4852
|
"Color": "#0000ff",
|
|
4894
4853
|
"IsManaged": false,
|
|
4895
|
-
"ExternalValue":
|
|
4854
|
+
"ExternalValue": "",
|
|
4896
4855
|
"ParentValues": [],
|
|
4856
|
+
"Tag": null,
|
|
4897
4857
|
"MetadataId": null,
|
|
4898
4858
|
"HasChanged": null,
|
|
4899
4859
|
"Label": {
|
|
4900
4860
|
"LocalizedLabels": [
|
|
4901
4861
|
{
|
|
4902
|
-
"Label": "
|
|
4862
|
+
"Label": "Telesales",
|
|
4903
4863
|
"LanguageCode": 1033,
|
|
4904
4864
|
"IsManaged": false,
|
|
4905
|
-
"MetadataId": "
|
|
4865
|
+
"MetadataId": "c92cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4906
4866
|
"HasChanged": null
|
|
4907
4867
|
}
|
|
4908
4868
|
],
|
|
4909
4869
|
"UserLocalizedLabel": {
|
|
4910
|
-
"Label": "
|
|
4870
|
+
"Label": "Telesales",
|
|
4911
4871
|
"LanguageCode": 1033,
|
|
4912
4872
|
"IsManaged": false,
|
|
4913
|
-
"MetadataId": "
|
|
4873
|
+
"MetadataId": "c92cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4914
4874
|
"HasChanged": null
|
|
4915
4875
|
}
|
|
4916
4876
|
},
|
|
@@ -4920,7 +4880,7 @@
|
|
|
4920
4880
|
"Label": "",
|
|
4921
4881
|
"LanguageCode": 1033,
|
|
4922
4882
|
"IsManaged": false,
|
|
4923
|
-
"MetadataId": "
|
|
4883
|
+
"MetadataId": "ca2cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4924
4884
|
"HasChanged": null
|
|
4925
4885
|
}
|
|
4926
4886
|
],
|
|
@@ -4928,34 +4888,35 @@
|
|
|
4928
4888
|
"Label": "",
|
|
4929
4889
|
"LanguageCode": 1033,
|
|
4930
4890
|
"IsManaged": false,
|
|
4931
|
-
"MetadataId": "
|
|
4891
|
+
"MetadataId": "ca2cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4932
4892
|
"HasChanged": null
|
|
4933
4893
|
}
|
|
4934
4894
|
}
|
|
4935
4895
|
},
|
|
4936
4896
|
{
|
|
4937
|
-
"Value":
|
|
4897
|
+
"Value": 910400003,
|
|
4938
4898
|
"Color": "#0000ff",
|
|
4939
4899
|
"IsManaged": false,
|
|
4940
|
-
"ExternalValue":
|
|
4900
|
+
"ExternalValue": "",
|
|
4941
4901
|
"ParentValues": [],
|
|
4902
|
+
"Tag": null,
|
|
4942
4903
|
"MetadataId": null,
|
|
4943
4904
|
"HasChanged": null,
|
|
4944
4905
|
"Label": {
|
|
4945
4906
|
"LocalizedLabels": [
|
|
4946
4907
|
{
|
|
4947
|
-
"Label": "
|
|
4908
|
+
"Label": "Worldpay",
|
|
4948
4909
|
"LanguageCode": 1033,
|
|
4949
4910
|
"IsManaged": false,
|
|
4950
|
-
"MetadataId": "
|
|
4911
|
+
"MetadataId": "bd2cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4951
4912
|
"HasChanged": null
|
|
4952
4913
|
}
|
|
4953
4914
|
],
|
|
4954
4915
|
"UserLocalizedLabel": {
|
|
4955
|
-
"Label": "
|
|
4916
|
+
"Label": "Worldpay",
|
|
4956
4917
|
"LanguageCode": 1033,
|
|
4957
4918
|
"IsManaged": false,
|
|
4958
|
-
"MetadataId": "
|
|
4919
|
+
"MetadataId": "bd2cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4959
4920
|
"HasChanged": null
|
|
4960
4921
|
}
|
|
4961
4922
|
},
|
|
@@ -4965,7 +4926,7 @@
|
|
|
4965
4926
|
"Label": "",
|
|
4966
4927
|
"LanguageCode": 1033,
|
|
4967
4928
|
"IsManaged": false,
|
|
4968
|
-
"MetadataId": "
|
|
4929
|
+
"MetadataId": "be2cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4969
4930
|
"HasChanged": null
|
|
4970
4931
|
}
|
|
4971
4932
|
],
|
|
@@ -4973,7 +4934,7 @@
|
|
|
4973
4934
|
"Label": "",
|
|
4974
4935
|
"LanguageCode": 1033,
|
|
4975
4936
|
"IsManaged": false,
|
|
4976
|
-
"MetadataId": "
|
|
4937
|
+
"MetadataId": "be2cfff1-d4e1-e711-810c-5065f38ada61",
|
|
4977
4938
|
"HasChanged": null
|
|
4978
4939
|
}
|
|
4979
4940
|
}
|
|
@@ -24,6 +24,12 @@ Object {
|
|
|
24
24
|
"label": "Cash",
|
|
25
25
|
},
|
|
26
26
|
"mobilePhone": "07722 123456",
|
|
27
|
+
"newPaymentSource": Object {
|
|
28
|
+
"description": "Worldpay",
|
|
29
|
+
"id": 910400003,
|
|
30
|
+
"label": "Worldpay",
|
|
31
|
+
},
|
|
32
|
+
"newStartDate": "2021-06-15",
|
|
27
33
|
"organisation": "Fishy Endeavours",
|
|
28
34
|
"paymentSource": "Post Office Sales",
|
|
29
35
|
"permitId": "test-permit-id",
|
|
@@ -75,6 +81,8 @@ Object {
|
|
|
75
81
|
"defra_methodofpayment": 910400001,
|
|
76
82
|
"defra_mobilenumber": "07722 123456",
|
|
77
83
|
"defra_name": "Ricciardo",
|
|
84
|
+
"defra_newpaymentsource": 910400003,
|
|
85
|
+
"defra_newstartdate": "2021-06-15",
|
|
78
86
|
"defra_organisation": "Fishy Endeavours",
|
|
79
87
|
"defra_paymentsource": "Post Office Sales",
|
|
80
88
|
"defra_permitid": "test-permit-id",
|
|
@@ -31,11 +31,13 @@ describe('pocl staging exception entity', () => {
|
|
|
31
31
|
defra_postalfulfilment: true,
|
|
32
32
|
defra_concessions: '[{"type":"Blue Badge","referenceNumber":123456789}]',
|
|
33
33
|
defra_startdate: '2021-06-15',
|
|
34
|
+
defra_newstartdate: '2021-06-15',
|
|
34
35
|
defra_serialnumber: '14345-48457J',
|
|
35
36
|
defra_permitid: 'test-permit-id',
|
|
36
37
|
defra_transactiondate: '2020-01-01T14:00:00Z',
|
|
37
38
|
defra_amount: 30,
|
|
38
39
|
defra_paymentsource: 'Post Office Sales',
|
|
40
|
+
defra_newpaymentsource: 910400003,
|
|
39
41
|
defra_channelid: '948594',
|
|
40
42
|
defra_methodofpayment: 910400001,
|
|
41
43
|
defra_status: 910400000,
|
|
@@ -80,11 +82,17 @@ describe('pocl staging exception entity', () => {
|
|
|
80
82
|
postalFulfilment: true,
|
|
81
83
|
concessions: '[{"type":"Blue Badge","referenceNumber":123456789}]',
|
|
82
84
|
startDate: '2021-06-15',
|
|
85
|
+
newStartDate: '2021-06-15',
|
|
83
86
|
serialNumber: '14345-48457J',
|
|
84
87
|
permitId: 'test-permit-id',
|
|
85
88
|
transactionDate: '2020-01-01T14:00:00Z',
|
|
86
89
|
amount: 30,
|
|
87
90
|
paymentSource: 'Post Office Sales',
|
|
91
|
+
newPaymentSource: {
|
|
92
|
+
description: 'Worldpay',
|
|
93
|
+
id: 910400003,
|
|
94
|
+
label: 'Worldpay'
|
|
95
|
+
},
|
|
88
96
|
channelId: '948594',
|
|
89
97
|
methodOfPayment: expect.objectContaining({ id: 910400001, label: 'Cash', description: 'Cash' }),
|
|
90
98
|
status: expect.objectContaining({ id: 910400000, label: 'Needs Review', description: 'Needs Review' }),
|
|
@@ -118,11 +126,13 @@ describe('pocl staging exception entity', () => {
|
|
|
118
126
|
validationError.postalFulfilment = true
|
|
119
127
|
validationError.concessions = '[{"type":"Blue Badge","referenceNumber":123456789}]'
|
|
120
128
|
validationError.startDate = '2021-06-15'
|
|
129
|
+
validationError.newStartDate = '2021-06-15'
|
|
121
130
|
validationError.serialNumber = '14345-48457J'
|
|
122
131
|
validationError.permitId = 'test-permit-id'
|
|
123
132
|
validationError.transactionDate = '2020-01-01T14:00:00Z'
|
|
124
133
|
validationError.amount = 30
|
|
125
134
|
validationError.paymentSource = 'Post Office Sales'
|
|
135
|
+
validationError.newPaymentSource = optionSetData.defra_financialtransactionsource.options['910400003']
|
|
126
136
|
validationError.channelId = '948594'
|
|
127
137
|
validationError.methodOfPayment = optionSetData.defra_paymenttype.options['910400001']
|
|
128
138
|
validationError.status = optionSetData.defra_poclvalidationerrorstatus.options['910400000']
|
|
@@ -34,11 +34,13 @@ export class PoclValidationError extends BaseEntity {
|
|
|
34
34
|
postalFulfilment: { field: 'defra_postalfulfilment', type: 'boolean' },
|
|
35
35
|
concessions: { field: 'defra_concessions', type: 'string' },
|
|
36
36
|
startDate: { field: 'defra_startdate', type: 'string' },
|
|
37
|
+
newStartDate: { field: 'defra_newstartdate', type: 'string' },
|
|
37
38
|
serialNumber: { field: 'defra_serialnumber', type: 'string' },
|
|
38
39
|
permitId: { field: 'defra_permitid', type: 'string' },
|
|
39
40
|
transactionDate: { field: 'defra_transactiondate', type: 'string' },
|
|
40
41
|
amount: { field: 'defra_amount', type: 'decimal' },
|
|
41
42
|
paymentSource: { field: 'defra_paymentsource', type: 'string' },
|
|
43
|
+
newPaymentSource: { field: 'defra_newpaymentsource', type: 'optionset', ref: 'defra_financialtransactionsource' },
|
|
42
44
|
channelId: { field: 'defra_channelid', type: 'string' },
|
|
43
45
|
methodOfPayment: { field: 'defra_methodofpayment', type: 'optionset', ref: 'defra_paymenttype' },
|
|
44
46
|
status: { field: 'defra_status', type: 'optionset', ref: 'defra_poclvalidationerrorstatus' },
|
|
@@ -273,6 +275,18 @@ export class PoclValidationError extends BaseEntity {
|
|
|
273
275
|
super._setState('startDate', startDate)
|
|
274
276
|
}
|
|
275
277
|
|
|
278
|
+
/**
|
|
279
|
+
* The licence new start date associated with this pocl record
|
|
280
|
+
* @type {string}
|
|
281
|
+
*/
|
|
282
|
+
get newStartDate () {
|
|
283
|
+
return super._getState('newStartDate')
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
set newStartDate (newStartDate) {
|
|
287
|
+
super._setState('newStartDate', newStartDate)
|
|
288
|
+
}
|
|
289
|
+
|
|
276
290
|
/**
|
|
277
291
|
* The serial number associated with this pocl record
|
|
278
292
|
* @type {string}
|
|
@@ -323,6 +337,18 @@ export class PoclValidationError extends BaseEntity {
|
|
|
323
337
|
|
|
324
338
|
/**
|
|
325
339
|
* The payment source associated with this pocl record
|
|
340
|
+
* @type {GlobalOptionSetDefinition}
|
|
341
|
+
*/
|
|
342
|
+
get newPaymentSource () {
|
|
343
|
+
return super._getState('newPaymentSource')
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
set newPaymentSource (newPaymentSource) {
|
|
347
|
+
super._setState('newPaymentSource', newPaymentSource)
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* The new payment source associated with this pocl record
|
|
326
352
|
* @type {string}
|
|
327
353
|
*/
|
|
328
354
|
get paymentSource () {
|