@questwork/q-store-model 0.1.41 → 0.1.42

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.
@@ -84,6 +84,7 @@ __webpack_require__.d(__webpack_exports__, {
84
84
  Status: () => (/* reexport */ Status),
85
85
  StatusQStore: () => (/* reexport */ StatusQStore),
86
86
  StatusQStoreInvoice: () => (/* reexport */ StatusQStoreInvoice),
87
+ StatusQStoreOrder: () => (/* reexport */ StatusQStoreOrder),
87
88
  StatusQStoreOrderLine: () => (/* reexport */ StatusQStoreOrderLine),
88
89
  StoreItem: () => (/* reexport */ StoreItem),
89
90
  Transaction: () => (/* reexport */ Transaction),
@@ -145,6 +146,7 @@ __webpack_require__.d(models_namespaceObject, {
145
146
  Status: () => (Status),
146
147
  StatusQStore: () => (StatusQStore),
147
148
  StatusQStoreInvoice: () => (StatusQStoreInvoice),
149
+ StatusQStoreOrder: () => (StatusQStoreOrder),
148
150
  StatusQStoreOrderLine: () => (StatusQStoreOrderLine),
149
151
  StoreItem: () => (StoreItem),
150
152
  Transaction: () => (Transaction),
@@ -1949,7 +1951,7 @@ class Merchandise extends q_utilities_namespaceObject.TenantAwareEntity {
1949
1951
  super(options)
1950
1952
 
1951
1953
  const { _ItemOption, _ItemOptionFillIn, _MerchandiseOption, _Price, _Product } = options._constructor || {}
1952
- this._ItemOption = _ItemOption && (_ItemOption._superclass === ItemOption._superclass) ? _I_ItemOptiontemOptionFillIn : ItemOption
1954
+ this._ItemOption = _ItemOption && (_ItemOption._superclass === ItemOption._superclass) ? _ItemOption : ItemOption
1953
1955
  this._ItemOptionFillIn = _ItemOptionFillIn && (_ItemOptionFillIn._superclass === ItemOptionFillIn._superclass) ? _ItemOptionFillIn : ItemOptionFillIn
1954
1956
  this._MerchandiseOption = _MerchandiseOption && (_MerchandiseOption._superclass === MerchandiseOption._superclass) ? _MerchandiseOption : MerchandiseOption
1955
1957
  this._Price = _Price && (_Price._superclass === Price._superclass) ? _Price : Price
@@ -2286,11 +2288,20 @@ class Merchandise extends q_utilities_namespaceObject.TenantAwareEntity {
2286
2288
  }
2287
2289
  getPreservedData() {
2288
2290
  return {
2291
+ allowEditQty: this.allowEditQty,
2292
+ allowEditUnitPrice: this.allowEditUnitPrice,
2293
+ defaultCurrency: this.defaultCurrency,
2294
+ description: this.description,
2295
+ merchandiseCategoryCodes: this.merchandiseCategoryCodes,
2289
2296
  merchandiseCode: this.merchandiseCode,
2297
+ merchandiseOptions: this.merchandiseOptions,
2290
2298
  merchandiseType: this.merchandiseType,
2291
2299
  metadata: this.metadata,
2292
2300
  name: this.name,
2301
+ priority: this.priority,
2293
2302
  productCodes: this.productCodes,
2303
+ sku: this.sku,
2304
+ stock: this.stock,
2294
2305
  tenantCode: this.tenantCode,
2295
2306
  }
2296
2307
  }
@@ -3917,10 +3928,10 @@ class StatusQStoreInvoice extends StatusQStore {
3917
3928
  return 'StatusQStoreInvoice'
3918
3929
  }
3919
3930
  get isClosed() {
3920
- return this.closed?.timestamp > Date.now()
3931
+ return this.closed?.timestamp > 0
3921
3932
  }
3922
3933
  get isOpen() {
3923
- return this.open?.timestamp > Date.now()
3934
+ return this.open?.timestamp > 0
3924
3935
  }
3925
3936
  get isValid() {
3926
3937
  return super.isValid
@@ -3933,6 +3944,64 @@ class StatusQStoreInvoice extends StatusQStore {
3933
3944
  }
3934
3945
  }
3935
3946
 
3947
+ ;// ./lib/models/statusQStore/statusQStoreOrder.js
3948
+
3949
+
3950
+ const statusQStoreOrder_notUpdateAllowedProps = (/* unused pure expression or super */ null && ([
3951
+ ]))
3952
+
3953
+ class StatusQStoreOrder extends StatusQStore {
3954
+ constructor(options) {
3955
+ options = options || {}
3956
+ super(options)
3957
+ this.closed = this._ActionRecord.init(options.closed)
3958
+ // this.expired = this._ActionRecord.init(options.expired)
3959
+ // this.fulfilled = this._ActionRecord.init(options.fulfilled)
3960
+ // this.invalid = this._ActionRecord.init(options.invalid)
3961
+ // this.posted = this._ActionRecord.init(options.posted)
3962
+ }
3963
+
3964
+ static get _classname() {
3965
+ return 'StatusQStoreOrder'
3966
+ }
3967
+ get _classname() {
3968
+ return 'StatusQStoreOrder'
3969
+ }
3970
+ get isClosed() {
3971
+ return this.closed?.timestamp > 0
3972
+ }
3973
+ // get isExpired() {
3974
+ // return this.expired?.timestamp < Date.now()
3975
+ // }
3976
+ // get isFulfilled() {
3977
+ // return this.fulfilled?.timestamp > 0
3978
+ // }
3979
+ // get isInvalid() {
3980
+ // return this.invalid?.timestamp < Date.now()
3981
+ // }
3982
+ // get isPosted() {
3983
+ // return this.posted?.timestamp > 0
3984
+ // }
3985
+ // get isValid() {
3986
+ // return super.isValid
3987
+ // }
3988
+ setClosed(value, actorCode) {
3989
+ return this.setValue(value, actorCode, 'closed')
3990
+ }
3991
+ // setExpired(value, actorCode) {
3992
+ // return this.setValue(value, actorCode, 'expired')
3993
+ // }
3994
+ // setFulfilled(value, actorCode) {
3995
+ // return this.setValue(value, actorCode, 'fulfilled')
3996
+ // }
3997
+ // setInvalid(value, actorCode) {
3998
+ // return this.setValue(value, actorCode, 'invalid')
3999
+ // }
4000
+ // setPosted(value, actorCode) {
4001
+ // return this.setValue(value, actorCode, 'posted')
4002
+ // }
4003
+ }
4004
+
3936
4005
  ;// ./lib/models/statusQStore/statusQStoreOrderLine.js
3937
4006
 
3938
4007
 
@@ -3945,7 +4014,9 @@ class StatusQStoreOrderLine extends StatusQStore {
3945
4014
  super(options)
3946
4015
 
3947
4016
  this.expired = this._ActionRecord.init(options.expired)
4017
+ this.fulfilled = this._ActionRecord.init(options.fulfilled)
3948
4018
  this.invalid = this._ActionRecord.init(options.invalid)
4019
+ this.posted = this._ActionRecord.init(options.posted)
3949
4020
  }
3950
4021
 
3951
4022
  static get _classname() {
@@ -3955,20 +4026,32 @@ class StatusQStoreOrderLine extends StatusQStore {
3955
4026
  return 'StatusQStoreOrderLine'
3956
4027
  }
3957
4028
  get isExpired() {
3958
- return this.expired?.timestamp > Date.now()
4029
+ return this.expired?.timestamp < Date.now()
4030
+ }
4031
+ get isFulfilled() {
4032
+ return this.fulfilled?.timestamp > 0
3959
4033
  }
3960
4034
  get isInvalid() {
3961
- return this.invalid?.timestamp > Date.now()
4035
+ return this.invalid?.timestamp < Date.now()
3962
4036
  }
3963
- get isValid() {
3964
- return super.isValid
4037
+ get isPosted() {
4038
+ return this.posted?.timestamp > 0
3965
4039
  }
4040
+ // get isValid() {
4041
+ // return super.isValid
4042
+ // }
3966
4043
  setExpired(value, actorCode) {
3967
4044
  return this.setValue(value, actorCode, 'expired')
3968
4045
  }
4046
+ setFulfilled(value, actorCode) {
4047
+ return this.setValue(value, actorCode, 'fulfilled')
4048
+ }
3969
4049
  setInvalid(value, actorCode) {
3970
4050
  return this.setValue(value, actorCode, 'invalid')
3971
4051
  }
4052
+ setPosted(value, actorCode) {
4053
+ return this.setValue(value, actorCode, 'posted')
4054
+ }
3972
4055
  // update(update) {
3973
4056
  // Object.keys(update).forEach((key) => {
3974
4057
  // if (!notUpdateAllowedProps.includes(key)) {
@@ -3986,6 +4069,7 @@ class StatusQStoreOrderLine extends StatusQStore {
3986
4069
 
3987
4070
 
3988
4071
 
4072
+
3989
4073
  ;// ./lib/models/paymentCharge/paymentCharge.js
3990
4074
 
3991
4075
 
@@ -5789,17 +5873,53 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5789
5873
  return 'OrderLine'
5790
5874
  }
5791
5875
 
5876
+ get currentStatus() {
5877
+ if (this.isPosted) {
5878
+ return 'posted'
5879
+ } else if (this.isBillable) {
5880
+ return 'billable'
5881
+ } else if (this.isCancelled) {
5882
+ return 'cancelled'
5883
+ } else if (this.isInvalid) {
5884
+ return 'invalid'
5885
+ } else if (this.isExpired) {
5886
+ return 'expired'
5887
+ } else {
5888
+ return 'open'
5889
+ }
5890
+ }
5891
+ get isActive() {
5892
+ return !this.isPosted && !this.isCancelled && !this.isExpired && !this.isInvalid
5893
+ }
5894
+ get isBillable() {
5895
+ return this.isFulfilled && !this.isPosted && !this.isCancelled
5896
+ }
5897
+ get isOpen() {
5898
+ return !this.isPosted && !this.isCancelled && !this.isExpired && !this.isInvalid && !this.isFulfilled
5899
+ }
5900
+
5792
5901
  get isCompleted() {
5793
5902
  return this.status.isCompleted
5794
5903
  }
5795
-
5796
- get isProcessing() {
5797
- return this.status.isProcessing
5904
+ get isCancelled() {
5905
+ return this.status.isCancelled
5798
5906
  }
5799
-
5800
- get isTerminated() {
5801
- return this.status.isTerminated
5907
+ get isExpired() {
5908
+ return !this.isPosted && !this.isCancelled && this.status.isExpired
5802
5909
  }
5910
+ get isFulfilled() {
5911
+ return this.status.isFulfilled
5912
+ }
5913
+ get isInvalid() {
5914
+ return !this.isPosted && !this.isCancelled && this.status.isInvalid
5915
+ }
5916
+ get isPosted() {
5917
+ return this.status.isPosted
5918
+ }
5919
+
5920
+ // get isTerminated() {
5921
+ // return this.status.isTerminated
5922
+ // }
5803
5923
 
5804
5924
  get isValid() {
5805
5925
  return super.isValid && !!this.merchandiseCode
@@ -5843,6 +5963,7 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5843
5963
 
5844
5964
  getPreservedData() {
5845
5965
  return {
5966
+ created: this.created,
5846
5967
  orderCode: this.orderCode,
5847
5968
  orderLineCode: this.orderLineCode,
5848
5969
  orderLineType: this.orderLineType,
@@ -5867,11 +5988,31 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5867
5988
  return this.amount ? this.amount.getCurrencyCode() : null
5868
5989
  }
5869
5990
 
5991
+ setCancelled(value, actorCode) {
5992
+ this.status.setCancelled(value, actorCode)
5993
+ return this.setModified()
5994
+ }
5995
+
5870
5996
  setCompleted(value, actorCode) {
5871
5997
  this.status.setCompleted(value, actorCode)
5872
5998
  return this.setModified()
5873
5999
  }
5874
6000
 
6001
+ setFulfilled(value, actorCode) {
6002
+ this.status.setFulfilled(value, actorCode)
6003
+ return this.setModified()
6004
+ }
6005
+
6006
+ setInvalid(value, actorCode) {
6007
+ this.status.setInvalid(value, actorCode)
6008
+ return this.setModified()
6009
+ }
6010
+
6011
+ setPosted(value, actorCode) {
6012
+ this.status.setPosted(value, actorCode)
6013
+ return this.setModified()
6014
+ }
6015
+
5875
6016
  setQty(qty) {
5876
6017
  if (typeof qty === 'number' && qty > 0) {
5877
6018
  this.qty = qty
@@ -5880,42 +6021,20 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5880
6021
  return this.qty
5881
6022
  }
5882
6023
 
5883
- settle(service) {
5884
- if (!service) {
5885
- return this
5886
- }
5887
-
5888
- if (service.end) {
5889
- this.setCompleted()
5890
- }
5891
-
5892
- return this
5893
- }
5894
-
5895
- // setCompleted() {
5896
- // this.status.setCompleted()
6024
+ // setProcessing() {
6025
+ // this.status.setProcessing()
5897
6026
  // return this.setModified()
5898
6027
  // }
5899
6028
 
5900
- setCancelled() {
5901
- this.status.setCancelled()
5902
- return this.setModified()
5903
- }
5904
-
5905
- setProcessing() {
5906
- this.status.setProcessing()
5907
- return this.setModified()
5908
- }
5909
-
5910
- setTerminated() {
5911
- this.status.setTerminated()
6029
+ setTerminated(value, actorCode) {
6030
+ this.status.setTerminated(value, actorCode)
5912
6031
  return this.setModified()
5913
6032
  }
5914
6033
 
5915
- setWaived() {
5916
- this.status.setWaived()
5917
- return this.setModified()
5918
- }
6034
+ // setWaived() {
6035
+ // this.status.setWaived()
6036
+ // return this.setModified()
6037
+ // }
5919
6038
 
5920
6039
  update(obj) {
5921
6040
  Object.keys(obj).forEach((key) => {
@@ -5982,7 +6101,7 @@ class Order extends q_utilities_namespaceObject.TenantAwareEntity {
5982
6101
  const { _Amount, _OrderLine, _Status } = options._constructor || {}
5983
6102
  this._Amount = _Amount && (_Amount._superclass === Amount._superclass) ? _Amount : Amount
5984
6103
  this._OrderLine = _OrderLine && (_OrderLine._superclass === OrderLine._superclass) ? _OrderLine : OrderLine
5985
- this._Status = _Status && (_Status._superclass === StatusQStore._superclass) ? _Status : StatusQStore
6104
+ this._Status = _Status && (_Status._superclass === StatusQStoreOrder._superclass) ? _Status : StatusQStoreOrder
5986
6105
 
5987
6106
  this._orderLines = options._orderLines
5988
6107
 
@@ -6049,6 +6168,11 @@ class Order extends q_utilities_namespaceObject.TenantAwareEntity {
6049
6168
  return this
6050
6169
  }
6051
6170
 
6171
+ setClosed(value, actorCode) {
6172
+ this.status.setClosed(value, actorCode)
6173
+ return this.setModified()
6174
+ }
6175
+
6052
6176
  setCompleted() {
6053
6177
  this.status.setCompleted()
6054
6178
  return this.setModified()
package/dist/index.min.js CHANGED
@@ -72,6 +72,7 @@ __webpack_require__.d(__webpack_exports__, {
72
72
  nW: () => (/* reexport */ Status),
73
73
  TM: () => (/* reexport */ StatusQStore),
74
74
  M: () => (/* reexport */ StatusQStoreInvoice),
75
+ z9: () => (/* reexport */ StatusQStoreOrder),
75
76
  Dy: () => (/* reexport */ StatusQStoreOrderLine),
76
77
  vB: () => (/* reexport */ StoreItem),
77
78
  ZX: () => (/* reexport */ Transaction),
@@ -133,6 +134,7 @@ __webpack_require__.d(models_namespaceObject, {
133
134
  Status: () => (Status),
134
135
  StatusQStore: () => (StatusQStore),
135
136
  StatusQStoreInvoice: () => (StatusQStoreInvoice),
137
+ StatusQStoreOrder: () => (StatusQStoreOrder),
136
138
  StatusQStoreOrderLine: () => (StatusQStoreOrderLine),
137
139
  StoreItem: () => (StoreItem),
138
140
  Transaction: () => (Transaction),
@@ -1945,7 +1947,7 @@ class Merchandise extends q_utilities_namespaceObject.TenantAwareEntity {
1945
1947
  super(options)
1946
1948
 
1947
1949
  const { _ItemOption, _ItemOptionFillIn, _MerchandiseOption, _Price, _Product } = options._constructor || {}
1948
- this._ItemOption = _ItemOption && (_ItemOption._superclass === ItemOption._superclass) ? _I_ItemOptiontemOptionFillIn : ItemOption
1950
+ this._ItemOption = _ItemOption && (_ItemOption._superclass === ItemOption._superclass) ? _ItemOption : ItemOption
1949
1951
  this._ItemOptionFillIn = _ItemOptionFillIn && (_ItemOptionFillIn._superclass === ItemOptionFillIn._superclass) ? _ItemOptionFillIn : ItemOptionFillIn
1950
1952
  this._MerchandiseOption = _MerchandiseOption && (_MerchandiseOption._superclass === MerchandiseOption._superclass) ? _MerchandiseOption : MerchandiseOption
1951
1953
  this._Price = _Price && (_Price._superclass === Price._superclass) ? _Price : Price
@@ -2282,11 +2284,20 @@ class Merchandise extends q_utilities_namespaceObject.TenantAwareEntity {
2282
2284
  }
2283
2285
  getPreservedData() {
2284
2286
  return {
2287
+ allowEditQty: this.allowEditQty,
2288
+ allowEditUnitPrice: this.allowEditUnitPrice,
2289
+ defaultCurrency: this.defaultCurrency,
2290
+ description: this.description,
2291
+ merchandiseCategoryCodes: this.merchandiseCategoryCodes,
2285
2292
  merchandiseCode: this.merchandiseCode,
2293
+ merchandiseOptions: this.merchandiseOptions,
2286
2294
  merchandiseType: this.merchandiseType,
2287
2295
  metadata: this.metadata,
2288
2296
  name: this.name,
2297
+ priority: this.priority,
2289
2298
  productCodes: this.productCodes,
2299
+ sku: this.sku,
2300
+ stock: this.stock,
2290
2301
  tenantCode: this.tenantCode,
2291
2302
  }
2292
2303
  }
@@ -3913,10 +3924,10 @@ class StatusQStoreInvoice extends StatusQStore {
3913
3924
  return 'StatusQStoreInvoice'
3914
3925
  }
3915
3926
  get isClosed() {
3916
- return this.closed?.timestamp > Date.now()
3927
+ return this.closed?.timestamp > 0
3917
3928
  }
3918
3929
  get isOpen() {
3919
- return this.open?.timestamp > Date.now()
3930
+ return this.open?.timestamp > 0
3920
3931
  }
3921
3932
  get isValid() {
3922
3933
  return super.isValid
@@ -3929,6 +3940,64 @@ class StatusQStoreInvoice extends StatusQStore {
3929
3940
  }
3930
3941
  }
3931
3942
 
3943
+ ;// ./lib/models/statusQStore/statusQStoreOrder.js
3944
+
3945
+
3946
+ const statusQStoreOrder_notUpdateAllowedProps = (/* unused pure expression or super */ null && ([
3947
+ ]))
3948
+
3949
+ class StatusQStoreOrder extends StatusQStore {
3950
+ constructor(options) {
3951
+ options = options || {}
3952
+ super(options)
3953
+ this.closed = this._ActionRecord.init(options.closed)
3954
+ // this.expired = this._ActionRecord.init(options.expired)
3955
+ // this.fulfilled = this._ActionRecord.init(options.fulfilled)
3956
+ // this.invalid = this._ActionRecord.init(options.invalid)
3957
+ // this.posted = this._ActionRecord.init(options.posted)
3958
+ }
3959
+
3960
+ static get _classname() {
3961
+ return 'StatusQStoreOrder'
3962
+ }
3963
+ get _classname() {
3964
+ return 'StatusQStoreOrder'
3965
+ }
3966
+ get isClosed() {
3967
+ return this.closed?.timestamp > 0
3968
+ }
3969
+ // get isExpired() {
3970
+ // return this.expired?.timestamp < Date.now()
3971
+ // }
3972
+ // get isFulfilled() {
3973
+ // return this.fulfilled?.timestamp > 0
3974
+ // }
3975
+ // get isInvalid() {
3976
+ // return this.invalid?.timestamp < Date.now()
3977
+ // }
3978
+ // get isPosted() {
3979
+ // return this.posted?.timestamp > 0
3980
+ // }
3981
+ // get isValid() {
3982
+ // return super.isValid
3983
+ // }
3984
+ setClosed(value, actorCode) {
3985
+ return this.setValue(value, actorCode, 'closed')
3986
+ }
3987
+ // setExpired(value, actorCode) {
3988
+ // return this.setValue(value, actorCode, 'expired')
3989
+ // }
3990
+ // setFulfilled(value, actorCode) {
3991
+ // return this.setValue(value, actorCode, 'fulfilled')
3992
+ // }
3993
+ // setInvalid(value, actorCode) {
3994
+ // return this.setValue(value, actorCode, 'invalid')
3995
+ // }
3996
+ // setPosted(value, actorCode) {
3997
+ // return this.setValue(value, actorCode, 'posted')
3998
+ // }
3999
+ }
4000
+
3932
4001
  ;// ./lib/models/statusQStore/statusQStoreOrderLine.js
3933
4002
 
3934
4003
 
@@ -3941,7 +4010,9 @@ class StatusQStoreOrderLine extends StatusQStore {
3941
4010
  super(options)
3942
4011
 
3943
4012
  this.expired = this._ActionRecord.init(options.expired)
4013
+ this.fulfilled = this._ActionRecord.init(options.fulfilled)
3944
4014
  this.invalid = this._ActionRecord.init(options.invalid)
4015
+ this.posted = this._ActionRecord.init(options.posted)
3945
4016
  }
3946
4017
 
3947
4018
  static get _classname() {
@@ -3951,20 +4022,32 @@ class StatusQStoreOrderLine extends StatusQStore {
3951
4022
  return 'StatusQStoreOrderLine'
3952
4023
  }
3953
4024
  get isExpired() {
3954
- return this.expired?.timestamp > Date.now()
4025
+ return this.expired?.timestamp < Date.now()
4026
+ }
4027
+ get isFulfilled() {
4028
+ return this.fulfilled?.timestamp > 0
3955
4029
  }
3956
4030
  get isInvalid() {
3957
- return this.invalid?.timestamp > Date.now()
4031
+ return this.invalid?.timestamp < Date.now()
3958
4032
  }
3959
- get isValid() {
3960
- return super.isValid
4033
+ get isPosted() {
4034
+ return this.posted?.timestamp > 0
3961
4035
  }
4036
+ // get isValid() {
4037
+ // return super.isValid
4038
+ // }
3962
4039
  setExpired(value, actorCode) {
3963
4040
  return this.setValue(value, actorCode, 'expired')
3964
4041
  }
4042
+ setFulfilled(value, actorCode) {
4043
+ return this.setValue(value, actorCode, 'fulfilled')
4044
+ }
3965
4045
  setInvalid(value, actorCode) {
3966
4046
  return this.setValue(value, actorCode, 'invalid')
3967
4047
  }
4048
+ setPosted(value, actorCode) {
4049
+ return this.setValue(value, actorCode, 'posted')
4050
+ }
3968
4051
  // update(update) {
3969
4052
  // Object.keys(update).forEach((key) => {
3970
4053
  // if (!notUpdateAllowedProps.includes(key)) {
@@ -3982,6 +4065,7 @@ class StatusQStoreOrderLine extends StatusQStore {
3982
4065
 
3983
4066
 
3984
4067
 
4068
+
3985
4069
  ;// ./lib/models/paymentCharge/paymentCharge.js
3986
4070
 
3987
4071
 
@@ -5785,17 +5869,53 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5785
5869
  return 'OrderLine'
5786
5870
  }
5787
5871
 
5872
+ get currentStatus() {
5873
+ if (this.isPosted) {
5874
+ return 'posted'
5875
+ } else if (this.isBillable) {
5876
+ return 'billable'
5877
+ } else if (this.isCancelled) {
5878
+ return 'cancelled'
5879
+ } else if (this.isInvalid) {
5880
+ return 'invalid'
5881
+ } else if (this.isExpired) {
5882
+ return 'expired'
5883
+ } else {
5884
+ return 'open'
5885
+ }
5886
+ }
5887
+ get isActive() {
5888
+ return !this.isPosted && !this.isCancelled && !this.isExpired && !this.isInvalid
5889
+ }
5890
+ get isBillable() {
5891
+ return this.isFulfilled && !this.isPosted && !this.isCancelled
5892
+ }
5893
+ get isOpen() {
5894
+ return !this.isPosted && !this.isCancelled && !this.isExpired && !this.isInvalid && !this.isFulfilled
5895
+ }
5896
+
5788
5897
  get isCompleted() {
5789
5898
  return this.status.isCompleted
5790
5899
  }
5791
-
5792
- get isProcessing() {
5793
- return this.status.isProcessing
5900
+ get isCancelled() {
5901
+ return this.status.isCancelled
5794
5902
  }
5795
-
5796
- get isTerminated() {
5797
- return this.status.isTerminated
5903
+ get isExpired() {
5904
+ return !this.isPosted && !this.isCancelled && this.status.isExpired
5798
5905
  }
5906
+ get isFulfilled() {
5907
+ return this.status.isFulfilled
5908
+ }
5909
+ get isInvalid() {
5910
+ return !this.isPosted && !this.isCancelled && this.status.isInvalid
5911
+ }
5912
+ get isPosted() {
5913
+ return this.status.isPosted
5914
+ }
5915
+
5916
+ // get isTerminated() {
5917
+ // return this.status.isTerminated
5918
+ // }
5799
5919
 
5800
5920
  get isValid() {
5801
5921
  return super.isValid && !!this.merchandiseCode
@@ -5839,6 +5959,7 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5839
5959
 
5840
5960
  getPreservedData() {
5841
5961
  return {
5962
+ created: this.created,
5842
5963
  orderCode: this.orderCode,
5843
5964
  orderLineCode: this.orderLineCode,
5844
5965
  orderLineType: this.orderLineType,
@@ -5863,11 +5984,31 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5863
5984
  return this.amount ? this.amount.getCurrencyCode() : null
5864
5985
  }
5865
5986
 
5987
+ setCancelled(value, actorCode) {
5988
+ this.status.setCancelled(value, actorCode)
5989
+ return this.setModified()
5990
+ }
5991
+
5866
5992
  setCompleted(value, actorCode) {
5867
5993
  this.status.setCompleted(value, actorCode)
5868
5994
  return this.setModified()
5869
5995
  }
5870
5996
 
5997
+ setFulfilled(value, actorCode) {
5998
+ this.status.setFulfilled(value, actorCode)
5999
+ return this.setModified()
6000
+ }
6001
+
6002
+ setInvalid(value, actorCode) {
6003
+ this.status.setInvalid(value, actorCode)
6004
+ return this.setModified()
6005
+ }
6006
+
6007
+ setPosted(value, actorCode) {
6008
+ this.status.setPosted(value, actorCode)
6009
+ return this.setModified()
6010
+ }
6011
+
5871
6012
  setQty(qty) {
5872
6013
  if (typeof qty === 'number' && qty > 0) {
5873
6014
  this.qty = qty
@@ -5876,42 +6017,20 @@ class OrderLine extends q_utilities_namespaceObject.TenantAwareEntity {
5876
6017
  return this.qty
5877
6018
  }
5878
6019
 
5879
- settle(service) {
5880
- if (!service) {
5881
- return this
5882
- }
5883
-
5884
- if (service.end) {
5885
- this.setCompleted()
5886
- }
5887
-
5888
- return this
5889
- }
5890
-
5891
- // setCompleted() {
5892
- // this.status.setCompleted()
6020
+ // setProcessing() {
6021
+ // this.status.setProcessing()
5893
6022
  // return this.setModified()
5894
6023
  // }
5895
6024
 
5896
- setCancelled() {
5897
- this.status.setCancelled()
5898
- return this.setModified()
5899
- }
5900
-
5901
- setProcessing() {
5902
- this.status.setProcessing()
5903
- return this.setModified()
5904
- }
5905
-
5906
- setTerminated() {
5907
- this.status.setTerminated()
6025
+ setTerminated(value, actorCode) {
6026
+ this.status.setTerminated(value, actorCode)
5908
6027
  return this.setModified()
5909
6028
  }
5910
6029
 
5911
- setWaived() {
5912
- this.status.setWaived()
5913
- return this.setModified()
5914
- }
6030
+ // setWaived() {
6031
+ // this.status.setWaived()
6032
+ // return this.setModified()
6033
+ // }
5915
6034
 
5916
6035
  update(obj) {
5917
6036
  Object.keys(obj).forEach((key) => {
@@ -5978,7 +6097,7 @@ class Order extends q_utilities_namespaceObject.TenantAwareEntity {
5978
6097
  const { _Amount, _OrderLine, _Status } = options._constructor || {}
5979
6098
  this._Amount = _Amount && (_Amount._superclass === Amount._superclass) ? _Amount : Amount
5980
6099
  this._OrderLine = _OrderLine && (_OrderLine._superclass === OrderLine._superclass) ? _OrderLine : OrderLine
5981
- this._Status = _Status && (_Status._superclass === StatusQStore._superclass) ? _Status : StatusQStore
6100
+ this._Status = _Status && (_Status._superclass === StatusQStoreOrder._superclass) ? _Status : StatusQStoreOrder
5982
6101
 
5983
6102
  this._orderLines = options._orderLines
5984
6103
 
@@ -6045,6 +6164,11 @@ class Order extends q_utilities_namespaceObject.TenantAwareEntity {
6045
6164
  return this
6046
6165
  }
6047
6166
 
6167
+ setClosed(value, actorCode) {
6168
+ this.status.setClosed(value, actorCode)
6169
+ return this.setModified()
6170
+ }
6171
+
6048
6172
  setCompleted() {
6049
6173
  this.status.setCompleted()
6050
6174
  return this.setModified()
@@ -8843,6 +8967,7 @@ var __webpack_exports__ReceiptLine = __webpack_exports__.Hx;
8843
8967
  var __webpack_exports__Status = __webpack_exports__.nW;
8844
8968
  var __webpack_exports__StatusQStore = __webpack_exports__.TM;
8845
8969
  var __webpack_exports__StatusQStoreInvoice = __webpack_exports__.M;
8970
+ var __webpack_exports__StatusQStoreOrder = __webpack_exports__.z9;
8846
8971
  var __webpack_exports__StatusQStoreOrderLine = __webpack_exports__.Dy;
8847
8972
  var __webpack_exports__StoreItem = __webpack_exports__.vB;
8848
8973
  var __webpack_exports__Transaction = __webpack_exports__.ZX;
@@ -8868,4 +8993,4 @@ var __webpack_exports__objectComparator = __webpack_exports__.aL;
8868
8993
  var __webpack_exports__objectOrderInArrayComparator = __webpack_exports__.il;
8869
8994
  var __webpack_exports__setQuery = __webpack_exports__.NY;
8870
8995
  var __webpack_exports__stringHelper = __webpack_exports__.yO;
8871
- export { __webpack_exports__Amount as Amount, __webpack_exports__BillingAccount as BillingAccount, __webpack_exports__BillingProject as BillingProject, __webpack_exports__Cart as Cart, __webpack_exports__CartItem as CartItem, __webpack_exports__Category as Category, __webpack_exports__Chain as Chain, __webpack_exports__ChainManager as ChainManager, __webpack_exports__ChainManagerFactory as ChainManagerFactory, __webpack_exports__ChainTarget as ChainTarget, __webpack_exports__CouponManager as CouponManager, __webpack_exports__CreditNote as CreditNote, __webpack_exports__CreditNoteLine as CreditNoteLine, __webpack_exports__CreditNoteRepo as CreditNoteRepo, __webpack_exports__Currency as Currency, __webpack_exports__Invoice as Invoice, __webpack_exports__InvoiceLine as InvoiceLine, __webpack_exports__ItemOption as ItemOption, __webpack_exports__ItemOptionLocale as ItemOptionLocale, __webpack_exports__KeyValueObject as KeyValueObject, __webpack_exports__Merchandise as Merchandise, __webpack_exports__Order as Order, __webpack_exports__OrderLine as OrderLine, __webpack_exports__PaymentCharge as PaymentCharge, __webpack_exports__PaymentGateway as PaymentGateway, __webpack_exports__PaymentItem as PaymentItem, __webpack_exports__PaymentResult as PaymentResult, __webpack_exports__Price as Price, __webpack_exports__PriceStrategy as PriceStrategy, __webpack_exports__Product as Product, __webpack_exports__Receipt as Receipt, __webpack_exports__ReceiptLine as ReceiptLine, __webpack_exports__Status as Status, __webpack_exports__StatusQStore as StatusQStore, __webpack_exports__StatusQStoreInvoice as StatusQStoreInvoice, __webpack_exports__StatusQStoreOrderLine as StatusQStoreOrderLine, __webpack_exports__StoreItem as StoreItem, __webpack_exports__Transaction as Transaction, __webpack_exports__WalletItem as WalletItem, __webpack_exports__adminSettle as adminSettle, __webpack_exports__calculateByCoupon as calculateByCoupon, __webpack_exports__calculator as calculator, __webpack_exports__checkDuplicate as checkDuplicate, __webpack_exports__convertTimestampToString as convertTimestampToString, __webpack_exports__defaultComparator as defaultComparator, __webpack_exports__defaultSort as defaultSort, __webpack_exports__eleInArrayComparator as eleInArrayComparator, __webpack_exports__firstLetterToLower as firstLetterToLower, __webpack_exports__getFakeClass as getFakeClass, __webpack_exports__getSubClass as getSubClass, __webpack_exports__handlerOrderList as handlerOrderList, __webpack_exports__isAllEqual as isAllEqual, __webpack_exports__isDescendingOrder as isDescendingOrder, __webpack_exports__makeResponseHelper as makeResponseHelper, __webpack_exports__models as models, __webpack_exports__objectAllInArrayComparator as objectAllInArrayComparator, __webpack_exports__objectComparator as objectComparator, __webpack_exports__objectOrderInArrayComparator as objectOrderInArrayComparator, __webpack_exports__setQuery as setQuery, __webpack_exports__stringHelper as stringHelper };
8996
+ export { __webpack_exports__Amount as Amount, __webpack_exports__BillingAccount as BillingAccount, __webpack_exports__BillingProject as BillingProject, __webpack_exports__Cart as Cart, __webpack_exports__CartItem as CartItem, __webpack_exports__Category as Category, __webpack_exports__Chain as Chain, __webpack_exports__ChainManager as ChainManager, __webpack_exports__ChainManagerFactory as ChainManagerFactory, __webpack_exports__ChainTarget as ChainTarget, __webpack_exports__CouponManager as CouponManager, __webpack_exports__CreditNote as CreditNote, __webpack_exports__CreditNoteLine as CreditNoteLine, __webpack_exports__CreditNoteRepo as CreditNoteRepo, __webpack_exports__Currency as Currency, __webpack_exports__Invoice as Invoice, __webpack_exports__InvoiceLine as InvoiceLine, __webpack_exports__ItemOption as ItemOption, __webpack_exports__ItemOptionLocale as ItemOptionLocale, __webpack_exports__KeyValueObject as KeyValueObject, __webpack_exports__Merchandise as Merchandise, __webpack_exports__Order as Order, __webpack_exports__OrderLine as OrderLine, __webpack_exports__PaymentCharge as PaymentCharge, __webpack_exports__PaymentGateway as PaymentGateway, __webpack_exports__PaymentItem as PaymentItem, __webpack_exports__PaymentResult as PaymentResult, __webpack_exports__Price as Price, __webpack_exports__PriceStrategy as PriceStrategy, __webpack_exports__Product as Product, __webpack_exports__Receipt as Receipt, __webpack_exports__ReceiptLine as ReceiptLine, __webpack_exports__Status as Status, __webpack_exports__StatusQStore as StatusQStore, __webpack_exports__StatusQStoreInvoice as StatusQStoreInvoice, __webpack_exports__StatusQStoreOrder as StatusQStoreOrder, __webpack_exports__StatusQStoreOrderLine as StatusQStoreOrderLine, __webpack_exports__StoreItem as StoreItem, __webpack_exports__Transaction as Transaction, __webpack_exports__WalletItem as WalletItem, __webpack_exports__adminSettle as adminSettle, __webpack_exports__calculateByCoupon as calculateByCoupon, __webpack_exports__calculator as calculator, __webpack_exports__checkDuplicate as checkDuplicate, __webpack_exports__convertTimestampToString as convertTimestampToString, __webpack_exports__defaultComparator as defaultComparator, __webpack_exports__defaultSort as defaultSort, __webpack_exports__eleInArrayComparator as eleInArrayComparator, __webpack_exports__firstLetterToLower as firstLetterToLower, __webpack_exports__getFakeClass as getFakeClass, __webpack_exports__getSubClass as getSubClass, __webpack_exports__handlerOrderList as handlerOrderList, __webpack_exports__isAllEqual as isAllEqual, __webpack_exports__isDescendingOrder as isDescendingOrder, __webpack_exports__makeResponseHelper as makeResponseHelper, __webpack_exports__models as models, __webpack_exports__objectAllInArrayComparator as objectAllInArrayComparator, __webpack_exports__objectComparator as objectComparator, __webpack_exports__objectOrderInArrayComparator as objectOrderInArrayComparator, __webpack_exports__setQuery as setQuery, __webpack_exports__stringHelper as stringHelper };
@@ -122,6 +122,7 @@ __webpack_require__.d(__webpack_exports__, {
122
122
  Status: () => (/* reexport */ Status),
123
123
  StatusQStore: () => (/* reexport */ StatusQStore),
124
124
  StatusQStoreInvoice: () => (/* reexport */ StatusQStoreInvoice),
125
+ StatusQStoreOrder: () => (/* reexport */ StatusQStoreOrder),
125
126
  StatusQStoreOrderLine: () => (/* reexport */ StatusQStoreOrderLine),
126
127
  StoreItem: () => (/* reexport */ StoreItem),
127
128
  Transaction: () => (/* reexport */ Transaction),
@@ -183,6 +184,7 @@ __webpack_require__.d(models_namespaceObject, {
183
184
  Status: () => (Status),
184
185
  StatusQStore: () => (StatusQStore),
185
186
  StatusQStoreInvoice: () => (StatusQStoreInvoice),
187
+ StatusQStoreOrder: () => (StatusQStoreOrder),
186
188
  StatusQStoreOrderLine: () => (StatusQStoreOrderLine),
187
189
  StoreItem: () => (StoreItem),
188
190
  Transaction: () => (Transaction),
@@ -1987,7 +1989,7 @@ class Merchandise extends q_utilities_.TenantAwareEntity {
1987
1989
  super(options)
1988
1990
 
1989
1991
  const { _ItemOption, _ItemOptionFillIn, _MerchandiseOption, _Price, _Product } = options._constructor || {}
1990
- this._ItemOption = _ItemOption && (_ItemOption._superclass === ItemOption._superclass) ? _I_ItemOptiontemOptionFillIn : ItemOption
1992
+ this._ItemOption = _ItemOption && (_ItemOption._superclass === ItemOption._superclass) ? _ItemOption : ItemOption
1991
1993
  this._ItemOptionFillIn = _ItemOptionFillIn && (_ItemOptionFillIn._superclass === ItemOptionFillIn._superclass) ? _ItemOptionFillIn : ItemOptionFillIn
1992
1994
  this._MerchandiseOption = _MerchandiseOption && (_MerchandiseOption._superclass === MerchandiseOption._superclass) ? _MerchandiseOption : MerchandiseOption
1993
1995
  this._Price = _Price && (_Price._superclass === Price._superclass) ? _Price : Price
@@ -2324,11 +2326,20 @@ class Merchandise extends q_utilities_.TenantAwareEntity {
2324
2326
  }
2325
2327
  getPreservedData() {
2326
2328
  return {
2329
+ allowEditQty: this.allowEditQty,
2330
+ allowEditUnitPrice: this.allowEditUnitPrice,
2331
+ defaultCurrency: this.defaultCurrency,
2332
+ description: this.description,
2333
+ merchandiseCategoryCodes: this.merchandiseCategoryCodes,
2327
2334
  merchandiseCode: this.merchandiseCode,
2335
+ merchandiseOptions: this.merchandiseOptions,
2328
2336
  merchandiseType: this.merchandiseType,
2329
2337
  metadata: this.metadata,
2330
2338
  name: this.name,
2339
+ priority: this.priority,
2331
2340
  productCodes: this.productCodes,
2341
+ sku: this.sku,
2342
+ stock: this.stock,
2332
2343
  tenantCode: this.tenantCode,
2333
2344
  }
2334
2345
  }
@@ -3955,10 +3966,10 @@ class StatusQStoreInvoice extends StatusQStore {
3955
3966
  return 'StatusQStoreInvoice'
3956
3967
  }
3957
3968
  get isClosed() {
3958
- return this.closed?.timestamp > Date.now()
3969
+ return this.closed?.timestamp > 0
3959
3970
  }
3960
3971
  get isOpen() {
3961
- return this.open?.timestamp > Date.now()
3972
+ return this.open?.timestamp > 0
3962
3973
  }
3963
3974
  get isValid() {
3964
3975
  return super.isValid
@@ -3971,6 +3982,64 @@ class StatusQStoreInvoice extends StatusQStore {
3971
3982
  }
3972
3983
  }
3973
3984
 
3985
+ ;// ./lib/models/statusQStore/statusQStoreOrder.js
3986
+
3987
+
3988
+ const statusQStoreOrder_notUpdateAllowedProps = (/* unused pure expression or super */ null && ([
3989
+ ]))
3990
+
3991
+ class StatusQStoreOrder extends StatusQStore {
3992
+ constructor(options) {
3993
+ options = options || {}
3994
+ super(options)
3995
+ this.closed = this._ActionRecord.init(options.closed)
3996
+ // this.expired = this._ActionRecord.init(options.expired)
3997
+ // this.fulfilled = this._ActionRecord.init(options.fulfilled)
3998
+ // this.invalid = this._ActionRecord.init(options.invalid)
3999
+ // this.posted = this._ActionRecord.init(options.posted)
4000
+ }
4001
+
4002
+ static get _classname() {
4003
+ return 'StatusQStoreOrder'
4004
+ }
4005
+ get _classname() {
4006
+ return 'StatusQStoreOrder'
4007
+ }
4008
+ get isClosed() {
4009
+ return this.closed?.timestamp > 0
4010
+ }
4011
+ // get isExpired() {
4012
+ // return this.expired?.timestamp < Date.now()
4013
+ // }
4014
+ // get isFulfilled() {
4015
+ // return this.fulfilled?.timestamp > 0
4016
+ // }
4017
+ // get isInvalid() {
4018
+ // return this.invalid?.timestamp < Date.now()
4019
+ // }
4020
+ // get isPosted() {
4021
+ // return this.posted?.timestamp > 0
4022
+ // }
4023
+ // get isValid() {
4024
+ // return super.isValid
4025
+ // }
4026
+ setClosed(value, actorCode) {
4027
+ return this.setValue(value, actorCode, 'closed')
4028
+ }
4029
+ // setExpired(value, actorCode) {
4030
+ // return this.setValue(value, actorCode, 'expired')
4031
+ // }
4032
+ // setFulfilled(value, actorCode) {
4033
+ // return this.setValue(value, actorCode, 'fulfilled')
4034
+ // }
4035
+ // setInvalid(value, actorCode) {
4036
+ // return this.setValue(value, actorCode, 'invalid')
4037
+ // }
4038
+ // setPosted(value, actorCode) {
4039
+ // return this.setValue(value, actorCode, 'posted')
4040
+ // }
4041
+ }
4042
+
3974
4043
  ;// ./lib/models/statusQStore/statusQStoreOrderLine.js
3975
4044
 
3976
4045
 
@@ -3983,7 +4052,9 @@ class StatusQStoreOrderLine extends StatusQStore {
3983
4052
  super(options)
3984
4053
 
3985
4054
  this.expired = this._ActionRecord.init(options.expired)
4055
+ this.fulfilled = this._ActionRecord.init(options.fulfilled)
3986
4056
  this.invalid = this._ActionRecord.init(options.invalid)
4057
+ this.posted = this._ActionRecord.init(options.posted)
3987
4058
  }
3988
4059
 
3989
4060
  static get _classname() {
@@ -3993,20 +4064,32 @@ class StatusQStoreOrderLine extends StatusQStore {
3993
4064
  return 'StatusQStoreOrderLine'
3994
4065
  }
3995
4066
  get isExpired() {
3996
- return this.expired?.timestamp > Date.now()
4067
+ return this.expired?.timestamp < Date.now()
4068
+ }
4069
+ get isFulfilled() {
4070
+ return this.fulfilled?.timestamp > 0
3997
4071
  }
3998
4072
  get isInvalid() {
3999
- return this.invalid?.timestamp > Date.now()
4073
+ return this.invalid?.timestamp < Date.now()
4000
4074
  }
4001
- get isValid() {
4002
- return super.isValid
4075
+ get isPosted() {
4076
+ return this.posted?.timestamp > 0
4003
4077
  }
4078
+ // get isValid() {
4079
+ // return super.isValid
4080
+ // }
4004
4081
  setExpired(value, actorCode) {
4005
4082
  return this.setValue(value, actorCode, 'expired')
4006
4083
  }
4084
+ setFulfilled(value, actorCode) {
4085
+ return this.setValue(value, actorCode, 'fulfilled')
4086
+ }
4007
4087
  setInvalid(value, actorCode) {
4008
4088
  return this.setValue(value, actorCode, 'invalid')
4009
4089
  }
4090
+ setPosted(value, actorCode) {
4091
+ return this.setValue(value, actorCode, 'posted')
4092
+ }
4010
4093
  // update(update) {
4011
4094
  // Object.keys(update).forEach((key) => {
4012
4095
  // if (!notUpdateAllowedProps.includes(key)) {
@@ -4024,6 +4107,7 @@ class StatusQStoreOrderLine extends StatusQStore {
4024
4107
 
4025
4108
 
4026
4109
 
4110
+
4027
4111
  ;// ./lib/models/paymentCharge/paymentCharge.js
4028
4112
 
4029
4113
 
@@ -5827,17 +5911,53 @@ class OrderLine extends q_utilities_.TenantAwareEntity {
5827
5911
  return 'OrderLine'
5828
5912
  }
5829
5913
 
5914
+ get currentStatus() {
5915
+ if (this.isPosted) {
5916
+ return 'posted'
5917
+ } else if (this.isBillable) {
5918
+ return 'billable'
5919
+ } else if (this.isCancelled) {
5920
+ return 'cancelled'
5921
+ } else if (this.isInvalid) {
5922
+ return 'invalid'
5923
+ } else if (this.isExpired) {
5924
+ return 'expired'
5925
+ } else {
5926
+ return 'open'
5927
+ }
5928
+ }
5929
+ get isActive() {
5930
+ return !this.isPosted && !this.isCancelled && !this.isExpired && !this.isInvalid
5931
+ }
5932
+ get isBillable() {
5933
+ return this.isFulfilled && !this.isPosted && !this.isCancelled
5934
+ }
5935
+ get isOpen() {
5936
+ return !this.isPosted && !this.isCancelled && !this.isExpired && !this.isInvalid && !this.isFulfilled
5937
+ }
5938
+
5830
5939
  get isCompleted() {
5831
5940
  return this.status.isCompleted
5832
5941
  }
5833
-
5834
- get isProcessing() {
5835
- return this.status.isProcessing
5942
+ get isCancelled() {
5943
+ return this.status.isCancelled
5836
5944
  }
5837
-
5838
- get isTerminated() {
5839
- return this.status.isTerminated
5945
+ get isExpired() {
5946
+ return !this.isPosted && !this.isCancelled && this.status.isExpired
5840
5947
  }
5948
+ get isFulfilled() {
5949
+ return this.status.isFulfilled
5950
+ }
5951
+ get isInvalid() {
5952
+ return !this.isPosted && !this.isCancelled && this.status.isInvalid
5953
+ }
5954
+ get isPosted() {
5955
+ return this.status.isPosted
5956
+ }
5957
+
5958
+ // get isTerminated() {
5959
+ // return this.status.isTerminated
5960
+ // }
5841
5961
 
5842
5962
  get isValid() {
5843
5963
  return super.isValid && !!this.merchandiseCode
@@ -5881,6 +6001,7 @@ class OrderLine extends q_utilities_.TenantAwareEntity {
5881
6001
 
5882
6002
  getPreservedData() {
5883
6003
  return {
6004
+ created: this.created,
5884
6005
  orderCode: this.orderCode,
5885
6006
  orderLineCode: this.orderLineCode,
5886
6007
  orderLineType: this.orderLineType,
@@ -5905,11 +6026,31 @@ class OrderLine extends q_utilities_.TenantAwareEntity {
5905
6026
  return this.amount ? this.amount.getCurrencyCode() : null
5906
6027
  }
5907
6028
 
6029
+ setCancelled(value, actorCode) {
6030
+ this.status.setCancelled(value, actorCode)
6031
+ return this.setModified()
6032
+ }
6033
+
5908
6034
  setCompleted(value, actorCode) {
5909
6035
  this.status.setCompleted(value, actorCode)
5910
6036
  return this.setModified()
5911
6037
  }
5912
6038
 
6039
+ setFulfilled(value, actorCode) {
6040
+ this.status.setFulfilled(value, actorCode)
6041
+ return this.setModified()
6042
+ }
6043
+
6044
+ setInvalid(value, actorCode) {
6045
+ this.status.setInvalid(value, actorCode)
6046
+ return this.setModified()
6047
+ }
6048
+
6049
+ setPosted(value, actorCode) {
6050
+ this.status.setPosted(value, actorCode)
6051
+ return this.setModified()
6052
+ }
6053
+
5913
6054
  setQty(qty) {
5914
6055
  if (typeof qty === 'number' && qty > 0) {
5915
6056
  this.qty = qty
@@ -5918,42 +6059,20 @@ class OrderLine extends q_utilities_.TenantAwareEntity {
5918
6059
  return this.qty
5919
6060
  }
5920
6061
 
5921
- settle(service) {
5922
- if (!service) {
5923
- return this
5924
- }
5925
-
5926
- if (service.end) {
5927
- this.setCompleted()
5928
- }
5929
-
5930
- return this
5931
- }
5932
-
5933
- // setCompleted() {
5934
- // this.status.setCompleted()
6062
+ // setProcessing() {
6063
+ // this.status.setProcessing()
5935
6064
  // return this.setModified()
5936
6065
  // }
5937
6066
 
5938
- setCancelled() {
5939
- this.status.setCancelled()
5940
- return this.setModified()
5941
- }
5942
-
5943
- setProcessing() {
5944
- this.status.setProcessing()
5945
- return this.setModified()
5946
- }
5947
-
5948
- setTerminated() {
5949
- this.status.setTerminated()
6067
+ setTerminated(value, actorCode) {
6068
+ this.status.setTerminated(value, actorCode)
5950
6069
  return this.setModified()
5951
6070
  }
5952
6071
 
5953
- setWaived() {
5954
- this.status.setWaived()
5955
- return this.setModified()
5956
- }
6072
+ // setWaived() {
6073
+ // this.status.setWaived()
6074
+ // return this.setModified()
6075
+ // }
5957
6076
 
5958
6077
  update(obj) {
5959
6078
  Object.keys(obj).forEach((key) => {
@@ -6020,7 +6139,7 @@ class Order extends q_utilities_.TenantAwareEntity {
6020
6139
  const { _Amount, _OrderLine, _Status } = options._constructor || {}
6021
6140
  this._Amount = _Amount && (_Amount._superclass === Amount._superclass) ? _Amount : Amount
6022
6141
  this._OrderLine = _OrderLine && (_OrderLine._superclass === OrderLine._superclass) ? _OrderLine : OrderLine
6023
- this._Status = _Status && (_Status._superclass === StatusQStore._superclass) ? _Status : StatusQStore
6142
+ this._Status = _Status && (_Status._superclass === StatusQStoreOrder._superclass) ? _Status : StatusQStoreOrder
6024
6143
 
6025
6144
  this._orderLines = options._orderLines
6026
6145
 
@@ -6087,6 +6206,11 @@ class Order extends q_utilities_.TenantAwareEntity {
6087
6206
  return this
6088
6207
  }
6089
6208
 
6209
+ setClosed(value, actorCode) {
6210
+ this.status.setClosed(value, actorCode)
6211
+ return this.setModified()
6212
+ }
6213
+
6090
6214
  setCompleted() {
6091
6215
  this.status.setCompleted()
6092
6216
  return this.setModified()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@questwork/q-store-model",
3
- "version": "0.1.41",
3
+ "version": "0.1.42",
4
4
  "description": "Questwork QStore Model",
5
5
  "main": "dist/index.min.js",
6
6
  "type": "module",
@@ -24,7 +24,7 @@
24
24
  },
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
- "@questwork/q-utilities": "^0.1.24",
27
+ "@questwork/q-utilities": "^0.1.30",
28
28
  "lodash": "^4.17.21"
29
29
  },
30
30
  "devDependencies": {