biz9-logic 4.9.16 → 4.9.18
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/biz9_config +1 -1
- package/index.js +1 -6
- package/package.json +2 -3
- package/test.js +10 -31
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -95,27 +95,22 @@ class Title {
|
|
|
95
95
|
static ORDER_PAYMENT_METHOD_CASH="Cash";
|
|
96
96
|
static ORDER_PAYMENT_METHOD_OTHER="Other";
|
|
97
97
|
static ORDER_PAYMENT_METHOD_TEST="Test";
|
|
98
|
-
|
|
99
98
|
//cart
|
|
100
99
|
static CART_NUMBER="CA-";
|
|
101
|
-
|
|
102
100
|
//data_type
|
|
103
101
|
static DATA_TYPE_BLOG_POST="Blog Post";
|
|
104
102
|
static DATA_TYPE_CATEGORY="Category";
|
|
105
103
|
static DATA_TYPE_CONTENT="Content";
|
|
106
|
-
|
|
107
104
|
//role
|
|
108
105
|
static USER_ROLE_SUPER_ADMIN='Super Admin';
|
|
109
106
|
static USER_ROLE_ADMIN='Admin';
|
|
110
107
|
static USER_ROLE_MANAGER='Manager';
|
|
111
108
|
static USER_ROLE_USER='User';
|
|
112
109
|
static USER_ROLE_GUEST='Guest';
|
|
113
|
-
|
|
114
110
|
//app
|
|
115
111
|
static APP_MOBILE="Mobile";
|
|
116
112
|
static APP_WEBSITE="Website";
|
|
117
113
|
static APP_LANDING="Landing";
|
|
118
|
-
|
|
119
114
|
//social
|
|
120
115
|
static SOCIAL_URL_FACEBOOK="https://facebook.com/";
|
|
121
116
|
static SOCIAL_URL_TWITTER="https://twitter.com/";
|
|
@@ -496,7 +491,7 @@ class Order_Logic {
|
|
|
496
491
|
order_number:order_number,
|
|
497
492
|
payment_method_type:payment_method_type,
|
|
498
493
|
payment_amount:payment_amount,
|
|
499
|
-
transaction_id:
|
|
494
|
+
transaction_id:Title.ORDER_TRANSACTION_ID + Num.get_id(99999)
|
|
500
495
|
});
|
|
501
496
|
};
|
|
502
497
|
static get_total = (order) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biz9-logic",
|
|
3
|
-
"version": "4.9.
|
|
3
|
+
"version": "4.9.18",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -30,6 +30,5 @@
|
|
|
30
30
|
"axios",
|
|
31
31
|
"fetch",
|
|
32
32
|
"random"
|
|
33
|
-
]
|
|
34
|
-
"devDependencies": {}
|
|
33
|
+
]
|
|
35
34
|
}
|
package/test.js
CHANGED
|
@@ -31,40 +31,19 @@ describe("connect", () => {
|
|
|
31
31
|
series([
|
|
32
32
|
function(call) {
|
|
33
33
|
console.log('CONNECT-START');
|
|
34
|
-
//console.log(Cart_Logic.get_new(DataType.PRODUCT,123));
|
|
35
|
-
//console.log(Type.get_title(Str.get_title(DataType.BLOG_POST)));
|
|
36
|
-
console.log(Type.get_title(DataType.BLOG_POST));
|
|
37
|
-
/*
|
|
38
34
|
|
|
39
|
-
let
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
35
|
+
let post_cart = Cart_Logic.get_new(DataType.PRODUCT,0);
|
|
36
|
+
let post_cart_list = [];
|
|
37
|
+
let post_cart_item = Cart_Logic.get_new_cart_item(DataType.PRODUCT,123,post_cart.cart_number,1,30);
|
|
38
|
+
let post_cart_sub_item = Cart_Logic.get_new_cart_sub_item(DataType.PRODUCT,1234,post_cart.cart_number,1,10);
|
|
39
|
+
let post_cart_sub_item_2 = Cart_Logic.get_new_cart_sub_item(DataType.PRODUCT,1234,post_cart.cart_number,1,30);
|
|
40
|
+
post_cart_item.cart_sub_item_list.push(post_cart_sub_item);
|
|
41
|
+
post_cart_item.cart_sub_item_list.push(post_cart_sub_item_2);
|
|
42
|
+
post_cart.cart_item_list.push(post_cart_item);
|
|
47
43
|
|
|
48
|
-
Log.w('
|
|
44
|
+
Log.w('post_cart',post_cart);
|
|
45
|
+
Log.w('post_cart_2',Cart_Logic.get_total(post_cart));
|
|
49
46
|
|
|
50
|
-
let post_item_count = 0;
|
|
51
|
-
let post_category_count = 0;
|
|
52
|
-
for(const item_type of post_type_list){
|
|
53
|
-
for(const item_cat of item_type.categorys){
|
|
54
|
-
post_category_count = post_category_count+1;
|
|
55
|
-
if(!item_cat.items){
|
|
56
|
-
item_cat.items = []
|
|
57
|
-
}
|
|
58
|
-
for(const item_item of item_cat.items){
|
|
59
|
-
post_item_count = post_item_count+1;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
Log.w('post_type_list',post_type_list);
|
|
65
|
-
Log.w('post_type_list',post_type_list[0].categorys);
|
|
66
|
-
*/
|
|
67
|
-
//Log.w('post_item_count',post_item_count);
|
|
68
47
|
|
|
69
48
|
console.log('CONNECT-END');
|
|
70
49
|
//call();
|