@defra-fish/dynamics-lib 1.58.0-rc.1 → 1.58.0-rc.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@defra-fish/dynamics-lib",
3
- "version": "1.58.0-rc.1",
3
+ "version": "1.58.0-rc.3",
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": "e00aea1ef5780d2c91cc88c39483fd73bfdbc1fb"
46
+ "gitHead": "c212ed313ee072f1cef1fc75bff40526a94ee7c6"
47
47
  }
@@ -18,6 +18,7 @@ describe('permission entity', () => {
18
18
  defra_stagingid: '71ad9a25-2a03-406b-a0e3-f4ff37799374',
19
19
  defra_datasource: 910400003,
20
20
  defra_renewal: true,
21
+ defra_rcpagreement: false,
21
22
  defra_licenceforyou: 1
22
23
  },
23
24
  optionSetData
@@ -32,6 +33,7 @@ describe('permission entity', () => {
32
33
  stagingId: '71ad9a25-2a03-406b-a0e3-f4ff37799374',
33
34
  dataSource: expect.objectContaining({ id: 910400003, label: 'Web Sales', description: 'Web Sales' }),
34
35
  isRenewal: true,
36
+ isRecurringPayment: false,
35
37
  isLicenceForYou: expect.objectContaining({ id: 1, label: 'Yes', description: 'Yes' })
36
38
  }
37
39
 
@@ -76,6 +78,7 @@ describe('permission entity', () => {
76
78
  permission.stagingId = '71ad9a25-2a03-406b-a0e3-f4ff37799374'
77
79
  permission.dataSource = optionSetData.defra_datasource.options['910400003']
78
80
  permission.isRenewal = true
81
+ permission.isRecurringPayment = false
79
82
  permission.isLicenceForYou = optionSetData.defra_islicenceforyou.options['1']
80
83
 
81
84
  permission.bindToEntity(Permission.definition.relationships.licensee, contact)
@@ -97,7 +100,8 @@ describe('permission entity', () => {
97
100
  'defra_ContactId@odata.bind': `$${contact.uniqueContentId}`,
98
101
  'defra_Transaction@odata.bind': `$${transaction.uniqueContentId}`,
99
102
  'defra_POCLFileId@odata.bind': `$${poclFile.uniqueContentId}`,
100
- defra_renewal: true
103
+ defra_renewal: true,
104
+ defra_rcpagreement: false
101
105
  })
102
106
  )
103
107
  })
@@ -24,6 +24,7 @@ export class Permission extends BaseEntity {
24
24
  stagingId: { field: 'defra_stagingid', type: 'string' },
25
25
  dataSource: { field: 'defra_datasource', type: 'optionset', ref: 'defra_datasource' },
26
26
  isRenewal: { field: 'defra_renewal', type: 'boolean' },
27
+ isRecurringPayment: { field: 'defra_rcpagreement', type: 'boolean' },
27
28
  isLicenceForYou: { field: 'defra_licenceforyou', type: 'optionset', ref: 'defra_islicenceforyou' }
28
29
  },
29
30
  relationships: {
@@ -127,6 +128,18 @@ export class Permission extends BaseEntity {
127
128
  super._setState('isRenewal', isRenewal)
128
129
  }
129
130
 
131
+ /**
132
+ * Whether the permission has a recurring payment agreement
133
+ * @type {boolean}
134
+ */
135
+ get isRecurringPayment () {
136
+ return super._getState('isRecurringPayment')
137
+ }
138
+
139
+ set isRecurringPayment (isRecurringPayment) {
140
+ super._setState('isRecurringPayment', isRecurringPayment)
141
+ }
142
+
130
143
  /*
131
144
  * Whether the permission is for the user purchasing the licence or someone else
132
145
  * @type {boolean}