@molopos/shared 2.0.76 → 2.0.78
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/enum/index.d.ts +16 -6
- package/enum/index.js +14 -4
- package/package.json +1 -1
- package/validator/index.d.ts +11 -0
- package/validator/index.js +14 -0
package/enum/index.d.ts
CHANGED
|
@@ -16,14 +16,16 @@ export declare enum DiscountTypeEnum {
|
|
|
16
16
|
* Payment method enum
|
|
17
17
|
*/
|
|
18
18
|
export declare enum PaymentMethodEnum {
|
|
19
|
-
Paypal = "PAYPAL",
|
|
20
|
-
Stripe = "STRIPE",
|
|
21
19
|
Free = "FREE",
|
|
22
20
|
Card = "CARD",
|
|
23
|
-
Office = "OFFICE",
|
|
24
|
-
Phone = "PHONE",
|
|
25
21
|
Cash = "CASH",
|
|
26
|
-
Iban = "IBAN"
|
|
22
|
+
Iban = "IBAN",
|
|
23
|
+
Phone = "PHONE",
|
|
24
|
+
Office = "OFFICE",
|
|
25
|
+
Paypal = "PAYPAL",
|
|
26
|
+
Stripe = "STRIPE",
|
|
27
|
+
PayLater = "PAYLATER",
|
|
28
|
+
Customise = "CUSTOMISE"
|
|
27
29
|
}
|
|
28
30
|
/**
|
|
29
31
|
* Product type enum
|
|
@@ -43,6 +45,7 @@ export declare enum QueryTypeEnum {
|
|
|
43
45
|
Brand = "BRAND",
|
|
44
46
|
Order = "ORDER",
|
|
45
47
|
Quote = "QUOTE",
|
|
48
|
+
Wallet = "WALLET",
|
|
46
49
|
Section = "SECTION",
|
|
47
50
|
Message = "MESSAGE",
|
|
48
51
|
Catalog = "CATALOG",
|
|
@@ -63,6 +66,7 @@ export declare enum QueryTypeEnum {
|
|
|
63
66
|
Warehouse = "WAREHOUSE",
|
|
64
67
|
OrderItem = "ORDERITEM",
|
|
65
68
|
QuoteItem = "QUOTEITEM",
|
|
69
|
+
Transaction = "TRANSACTION",
|
|
66
70
|
QuoteOption = "QUOTEOPTION",
|
|
67
71
|
UserAddress = "USERADDRESS",
|
|
68
72
|
Subcategory = "SUBCATEGORY",
|
|
@@ -160,7 +164,13 @@ export declare enum ActivityModelEnum {
|
|
|
160
164
|
PaymentTypeDelete = "PAYMENT_TYPE_DELETE",
|
|
161
165
|
InventoryAdjustmentCreate = "INVENTORY_ADJUSTMENT_CREATE",
|
|
162
166
|
InventoryAdjustmentUpdate = "INVENTORY_ADJUSTMENT_UPDATE",
|
|
163
|
-
InventoryAdjustmentDelete = "INVENTORY_ADJUSTMENT_DELETE"
|
|
167
|
+
InventoryAdjustmentDelete = "INVENTORY_ADJUSTMENT_DELETE",
|
|
168
|
+
WalletCreate = "WALLET_CREATE",
|
|
169
|
+
WalletUpdate = "WALLET_UPDATE",
|
|
170
|
+
WalletDelete = "WALLET_DELETE",
|
|
171
|
+
TransactionCreate = "TRANSACTION_CREATE",
|
|
172
|
+
TransactionUpdate = "TRANSACTION_UPDATE",
|
|
173
|
+
TransactionDelete = "TRANSACTION_DELETE"
|
|
164
174
|
}
|
|
165
175
|
/**
|
|
166
176
|
* Transaction direction enum
|
package/enum/index.js
CHANGED
|
@@ -22,14 +22,16 @@ var DiscountTypeEnum;
|
|
|
22
22
|
*/
|
|
23
23
|
var PaymentMethodEnum;
|
|
24
24
|
(function (PaymentMethodEnum) {
|
|
25
|
-
PaymentMethodEnum["Paypal"] = "PAYPAL";
|
|
26
|
-
PaymentMethodEnum["Stripe"] = "STRIPE";
|
|
27
25
|
PaymentMethodEnum["Free"] = "FREE";
|
|
28
26
|
PaymentMethodEnum["Card"] = "CARD";
|
|
29
|
-
PaymentMethodEnum["Office"] = "OFFICE";
|
|
30
|
-
PaymentMethodEnum["Phone"] = "PHONE";
|
|
31
27
|
PaymentMethodEnum["Cash"] = "CASH";
|
|
32
28
|
PaymentMethodEnum["Iban"] = "IBAN";
|
|
29
|
+
PaymentMethodEnum["Phone"] = "PHONE";
|
|
30
|
+
PaymentMethodEnum["Office"] = "OFFICE";
|
|
31
|
+
PaymentMethodEnum["Paypal"] = "PAYPAL";
|
|
32
|
+
PaymentMethodEnum["Stripe"] = "STRIPE";
|
|
33
|
+
PaymentMethodEnum["PayLater"] = "PAYLATER";
|
|
34
|
+
PaymentMethodEnum["Customise"] = "CUSTOMISE";
|
|
33
35
|
})(PaymentMethodEnum || (exports.PaymentMethodEnum = PaymentMethodEnum = {}));
|
|
34
36
|
/**
|
|
35
37
|
* Product type enum
|
|
@@ -51,6 +53,7 @@ var QueryTypeEnum;
|
|
|
51
53
|
QueryTypeEnum["Brand"] = "BRAND";
|
|
52
54
|
QueryTypeEnum["Order"] = "ORDER";
|
|
53
55
|
QueryTypeEnum["Quote"] = "QUOTE";
|
|
56
|
+
QueryTypeEnum["Wallet"] = "WALLET";
|
|
54
57
|
QueryTypeEnum["Section"] = "SECTION";
|
|
55
58
|
QueryTypeEnum["Message"] = "MESSAGE";
|
|
56
59
|
QueryTypeEnum["Catalog"] = "CATALOG";
|
|
@@ -71,6 +74,7 @@ var QueryTypeEnum;
|
|
|
71
74
|
QueryTypeEnum["Warehouse"] = "WAREHOUSE";
|
|
72
75
|
QueryTypeEnum["OrderItem"] = "ORDERITEM";
|
|
73
76
|
QueryTypeEnum["QuoteItem"] = "QUOTEITEM";
|
|
77
|
+
QueryTypeEnum["Transaction"] = "TRANSACTION";
|
|
74
78
|
QueryTypeEnum["QuoteOption"] = "QUOTEOPTION";
|
|
75
79
|
QueryTypeEnum["UserAddress"] = "USERADDRESS";
|
|
76
80
|
QueryTypeEnum["Subcategory"] = "SUBCATEGORY";
|
|
@@ -170,6 +174,12 @@ var ActivityModelEnum;
|
|
|
170
174
|
ActivityModelEnum["InventoryAdjustmentCreate"] = "INVENTORY_ADJUSTMENT_CREATE";
|
|
171
175
|
ActivityModelEnum["InventoryAdjustmentUpdate"] = "INVENTORY_ADJUSTMENT_UPDATE";
|
|
172
176
|
ActivityModelEnum["InventoryAdjustmentDelete"] = "INVENTORY_ADJUSTMENT_DELETE";
|
|
177
|
+
ActivityModelEnum["WalletCreate"] = "WALLET_CREATE";
|
|
178
|
+
ActivityModelEnum["WalletUpdate"] = "WALLET_UPDATE";
|
|
179
|
+
ActivityModelEnum["WalletDelete"] = "WALLET_DELETE";
|
|
180
|
+
ActivityModelEnum["TransactionCreate"] = "TRANSACTION_CREATE";
|
|
181
|
+
ActivityModelEnum["TransactionUpdate"] = "TRANSACTION_UPDATE";
|
|
182
|
+
ActivityModelEnum["TransactionDelete"] = "TRANSACTION_DELETE";
|
|
173
183
|
})(ActivityModelEnum || (exports.ActivityModelEnum = ActivityModelEnum = {}));
|
|
174
184
|
/**
|
|
175
185
|
* Transaction direction enum
|
package/package.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"@molopos/shared","publishConfig":{"access":"public"},"version":"2.0.
|
|
1
|
+
{"name":"@molopos/shared","publishConfig":{"access":"public"},"version":"2.0.78","description":"Shared between backend and frontend repos","license":"ISC","repository":{"type":"git","url":"https://github.com/unicubate/molopos-shared.git"},"dependencies":{"class-transformer":"^0.5.1","date-fns":"^4.4.0","luxon":"^3.7.2"}}
|
package/validator/index.d.ts
CHANGED
|
@@ -24,3 +24,14 @@ export declare function TransformBooleanString(): PropertyDecorator;
|
|
|
24
24
|
* }
|
|
25
25
|
*/
|
|
26
26
|
export declare function TransformToNullIfFalsy(): PropertyDecorator;
|
|
27
|
+
/**
|
|
28
|
+
* Transforme les chaînes séparées par des virgules en un tableau de chaînes.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* class MyDto {
|
|
32
|
+
* @IsArray()
|
|
33
|
+
* @TransformArrayString()
|
|
34
|
+
* tags?: string[];
|
|
35
|
+
* }
|
|
36
|
+
*/
|
|
37
|
+
export declare function TransformArrayString(): PropertyDecorator;
|
package/validator/index.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TransformBooleanString = TransformBooleanString;
|
|
4
4
|
exports.TransformToNullIfFalsy = TransformToNullIfFalsy;
|
|
5
|
+
exports.TransformArrayString = TransformArrayString;
|
|
5
6
|
const class_transformer_1 = require("class-transformer");
|
|
6
7
|
/**
|
|
7
8
|
* Transforme les chaînes 'true'/'false' en booléens, tout en conservant
|
|
@@ -39,3 +40,16 @@ function TransformBooleanString() {
|
|
|
39
40
|
function TransformToNullIfFalsy() {
|
|
40
41
|
return (0, class_transformer_1.Transform)(({ value }) => (value ? value : null));
|
|
41
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Transforme les chaînes séparées par des virgules en un tableau de chaînes.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* class MyDto {
|
|
48
|
+
* @IsArray()
|
|
49
|
+
* @TransformArrayString()
|
|
50
|
+
* tags?: string[];
|
|
51
|
+
* }
|
|
52
|
+
*/
|
|
53
|
+
function TransformArrayString() {
|
|
54
|
+
return (0, class_transformer_1.Transform)(({ value }) => value ? value === null || value === void 0 ? void 0 : value.split(",").map((item) => item.trim()) : null);
|
|
55
|
+
}
|