@defra-fish/dynamics-lib 1.30.0-rc.6 → 1.30.0-rc.7

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.30.0-rc.6",
3
+ "version": "1.30.0-rc.7",
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": "6d5c66a8fe7d90774e98cee8f07063447e2cbf9f"
46
+ "gitHead": "b79e1ff213a9862e8b53c4c997344b3dcfb99637"
47
47
  }
@@ -22,6 +22,8 @@ describe('permit entity', () => {
22
22
  defra_iscountersales: true,
23
23
  defra_recurringsupported: false,
24
24
  defra_advertisedprice: 6.0,
25
+ defra_newadvertisedprice: 7.2,
26
+ defra_dateofpricechange: '2023-04-01T00:00:00Z',
25
27
  defra_itemid: '42289'
26
28
  },
27
29
  optionSetData
@@ -41,6 +43,8 @@ describe('permit entity', () => {
41
43
  isCounterSales: true,
42
44
  isRecurringPaymentSupported: false,
43
45
  cost: 6,
46
+ newCost: 7.2,
47
+ newCostStartDate: '2023-04-01T00:00:00Z',
44
48
  itemId: '42289'
45
49
  }
46
50
 
@@ -24,6 +24,8 @@ export class Permit extends BaseEntity {
24
24
  isCounterSales: { field: 'defra_iscountersales', type: 'boolean' },
25
25
  isRecurringPaymentSupported: { field: 'defra_recurringsupported', type: 'boolean' },
26
26
  cost: { field: 'defra_advertisedprice', type: 'decimal' },
27
+ newCost: { field: 'defra_newadvertisedprice', type: 'decimal' },
28
+ newCostStartDate: { field: 'defra_dateofpricechange', type: 'datetime' },
27
29
  itemId: { field: 'defra_itemid', type: 'string' }
28
30
  }
29
31
  }))
@@ -144,6 +146,24 @@ export class Permit extends BaseEntity {
144
146
  return super._getState('cost')
145
147
  }
146
148
 
149
+ /**
150
+ * The new cost of permissions associated with this permit
151
+ * @type {number}
152
+ * @readonly
153
+ */
154
+ get newCost () {
155
+ return super._getState('newCost')
156
+ }
157
+
158
+ /**
159
+ * The date when the cost of permissions changes from cost to newCost
160
+ * @type {date}
161
+ * @readonly
162
+ */
163
+ get newCostStartDate () {
164
+ return super._getState('newCostStartDate')
165
+ }
166
+
147
167
  /**
148
168
  * The POCL itemId associated with this permit
149
169
  * @type {number}