merchi_sdk_js 0.0.15 → 0.0.17
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/cart.js +2 -0
- package/src/item.js +9 -0
- package/src/job.js +2 -0
- package/src/model.js +3 -0
package/package.json
CHANGED
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/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);
|
package/src/model.js
CHANGED
@@ -415,6 +415,9 @@ export function getList(resource, success, error, parameters, withUpdates) {
|
|
415
415
|
if (notEmpty(parameters.relatedJob)) {
|
416
416
|
request.query().add('related_job', parameters.relatedJob);
|
417
417
|
}
|
418
|
+
if (notEmpty(parameters.relatedJobs)) {
|
419
|
+
request.query().add('related_jobs', parameters.relatedJobs);
|
420
|
+
}
|
418
421
|
if (notEmpty(parameters.relatedProduct)) {
|
419
422
|
request.query().add('related_product', parameters.relatedProduct);
|
420
423
|
}
|