@labdigital/commercetools-mock 2.22.0 → 2.23.0
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/dist/index.cjs +10 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +10 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/src/lib/predicateParser.test.ts +40 -0
- package/src/lib/predicateParser.ts +4 -0
- package/src/repositories/cart/actions.ts +9 -0
- package/src/repositories/customer/index.ts +5 -2
- package/src/services/cart.test.ts +20 -0
package/dist/index.js
CHANGED
|
@@ -1202,6 +1202,9 @@ var generateMatchFunc = (predicate) => {
|
|
|
1202
1202
|
} else {
|
|
1203
1203
|
const value = resolveValue(obj, left);
|
|
1204
1204
|
if (value) {
|
|
1205
|
+
if (Array.isArray(value)) {
|
|
1206
|
+
return value.some((item) => expr(item, vars));
|
|
1207
|
+
}
|
|
1205
1208
|
return expr(value, vars);
|
|
1206
1209
|
}
|
|
1207
1210
|
return false;
|
|
@@ -2478,6 +2481,9 @@ var CartUpdateHandler = class extends AbstractUpdateHandler {
|
|
|
2478
2481
|
}
|
|
2479
2482
|
resource.totalPrice.centAmount = calculateCartTotalPrice(resource);
|
|
2480
2483
|
}
|
|
2484
|
+
changeTaxRoundingMode(_context, resource, { taxRoundingMode }) {
|
|
2485
|
+
resource.taxRoundingMode = taxRoundingMode;
|
|
2486
|
+
}
|
|
2481
2487
|
recalculate() {
|
|
2482
2488
|
}
|
|
2483
2489
|
removeDiscountCode(context, resource, { discountCode }) {
|
|
@@ -3391,10 +3397,12 @@ var CustomerRepository = class extends AbstractResourceRepository {
|
|
|
3391
3397
|
}
|
|
3392
3398
|
const expiresAt = new Date(Date.now() + 30 * 60);
|
|
3393
3399
|
const customer = results.results[0];
|
|
3394
|
-
const
|
|
3400
|
+
const rest = getBaseResourceProperties();
|
|
3395
3401
|
const token = createPasswordResetToken(customer);
|
|
3396
3402
|
return {
|
|
3397
|
-
|
|
3403
|
+
id: rest.id,
|
|
3404
|
+
createdAt: rest.createdAt,
|
|
3405
|
+
lastModifiedAt: rest.lastModifiedAt,
|
|
3398
3406
|
customerId: customer.id,
|
|
3399
3407
|
expiresAt: expiresAt.toISOString(),
|
|
3400
3408
|
value: token
|