merchi_sdk_js 0.0.14 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "merchi_sdk_js",
3
- "version": "0.0.14",
3
+ "version": "0.0.16",
4
4
  "type": "module",
5
5
  "main": "src/merchi.js",
6
6
  "module": "src/merchi.js",
package/src/cart.js CHANGED
@@ -7,6 +7,7 @@ import { CartShipmentGroup } from './cart_shipment_group.js';
7
7
  import { Company } from './company.js';
8
8
  import { Domain } from './domain.js';
9
9
  import { Invoice } from './invoice.js';
10
+ import { Item } from './item.js';
10
11
  import { Shipment } from './shipment.js';
11
12
  import { User } from './user.js';
12
13
 
@@ -30,6 +31,7 @@ export function Cart() {
30
31
  addPropertyTo(this, 'cartItemsSubtotalCost');
31
32
  addPropertyTo(this, 'cartItemsTaxAmount');
32
33
  addPropertyTo(this, 'cartItemsTotalCost');
34
+ addPropertyTo(this, 'discountItems', Item);
33
35
  addPropertyTo(this, 'shipmentSubtotalCost');
34
36
  addPropertyTo(this, 'shipmentTaxAmount');
35
37
  addPropertyTo(this, 'shipmentTotalCost');
package/src/discount.js CHANGED
@@ -9,6 +9,9 @@ export function Discount() {
9
9
  addPropertyTo(this, 'id');
10
10
  addPropertyTo(this, 'lowerLimit');
11
11
  addPropertyTo(this, 'amount');
12
+ addPropertyTo(this, 'code');
13
+ addPropertyTo(this, 'usageLimit');
14
+ addPropertyTo(this, 'isPercentage');
12
15
 
13
16
  this.discountedUnitCost = function (unitPrice) {
14
17
  var unitCost = unitPrice ? unitPrice : 0,
@@ -17,7 +17,6 @@ export function DiscountGroup() {
17
17
  addPropertyTo(this, 'discountType');
18
18
  addPropertyTo(this, 'discounts');
19
19
  addPropertyTo(this, 'name');
20
- addPropertyTo(this, 'code');
21
20
  addPropertyTo(this, 'domain', Domain);
22
21
  addPropertyTo(this, 'product', Product);
23
22
  }
package/src/item.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import { generateUUID } from './uuid.js';
2
2
  import { addPropertyTo } from './model.js';
3
+ import { Cart } from './cart.js';
3
4
  import { CountryTax } from './country_tax.js';
5
+ import { Discount } from './discount.js';
6
+ import { Invoice } from './invoice.js';
7
+ import { Job } from './job.js';
4
8
 
5
9
  export function Item() {
6
10
  this.resource = '/items';
@@ -8,8 +12,13 @@ export function Item() {
8
12
  this.temporaryId = generateUUID();
9
13
 
10
14
  addPropertyTo(this, 'id');
15
+ addPropertyTo(this, 'code');
11
16
  addPropertyTo(this, 'quantity');
17
+ addPropertyTo(this, 'cart', Cart);
12
18
  addPropertyTo(this, 'taxType', CountryTax);
19
+ addPropertyTo(this, 'discount', Discount);
20
+ addPropertyTo(this, 'invoice', Invoice);
21
+ addPropertyTo(this, 'job', Job);
13
22
  addPropertyTo(this, 'taxAmount');
14
23
  addPropertyTo(this, 'cost');
15
24
  addPropertyTo(this, 'description');
package/src/job.js CHANGED
@@ -27,6 +27,7 @@ import { MatchingInventory } from './matching_inventory.js';
27
27
  import { User } from './user.js';
28
28
  import { Variation } from './variation.js';
29
29
  import { VariationsGroup } from './variations_group.js';
30
+ import { Item } from './item.js';
30
31
  import { JobComment } from './job_comment.js';
31
32
  import { InternalTag } from './internal_tag.js';
32
33
 
@@ -58,6 +59,7 @@ export function Job() {
58
59
  addPropertyTo(this, 'draftComments', DraftComment);
59
60
  addPropertyTo(this, 'comments', JobComment);
60
61
  addPropertyTo(this, 'invoice', Invoice);
62
+ addPropertyTo(this, 'items', Item);
61
63
  addPropertyTo(this, 'shipment', Shipment);
62
64
  addPropertyTo(this, 'client', User);
63
65
  addPropertyTo(this, 'clientEmail', EmailAddress);