biz9-logic 10.0.60 → 10.0.76

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.
Files changed (4) hide show
  1. package/biz9_config +1 -1
  2. package/index.js +1197 -97
  3. package/package.json +1 -1
  4. package/test.js +38 -58
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "10.0.60",
3
+ "version": "10.0.76",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -1,5 +1,5 @@
1
1
  const series = require('async-series');
2
- const {Type,App_Logic,Data_Logic,User_Logic} = require('./index');
2
+ const {Type,App_Logic,Data_Logic,User_Logic,Cart_Logic,Order_Logic} = require('./index');
3
3
  const {Log,Num,Str,Obj} = require('biz9-utility');
4
4
  const {Scriptz}= require('biz9-scriptz');
5
5
 
@@ -31,8 +31,41 @@ describe("connect", () => {
31
31
  series([
32
32
  function(call) {
33
33
  console.log('CONNECT-BASE-START');
34
+ // -->
35
+ // -- CART START -- //
36
+ let user = Data_Logic.get(Type.USER,Num.get_id(),{test:true});
37
+ let cart_product_1 = Data_Logic.get(Type.DATA_PRODUCT,Num.get_id(),{test:true});
38
+ let cart_sub_item_product_1 = Data_Logic.get(Type.DATA_PRODUCT,Num.get_id(),{test:true});
39
+ //let cart_sub_item_product_2 = Data_Logic.get(Type.DATA_PRODUCT,Num.get_id(),{test:true});
40
+ // -- cart start //
41
+ let cart = Cart_Logic.get(user.id,{cart_code:'CA'});
42
+ // -- cart end //
43
+ // -- cart item start //
44
+ let cart_item_1 = Cart_Logic.get_cart_item(cart_product_1.data_type,cart_product_1.id,1,cart_product_1.cost,{cart_code:'CA'});
45
+ cart_item_1.id = Num.get_id();
46
+ // -- cart item sub item start //
47
+ let cart_sub_item_1 = Cart_Logic.get_cart_sub_item(cart_item_1.id,Type.CART_SUB_TYPE_STANDARD,1,cart_sub_item_product_1.cost);
48
+ // -- cart item sub item end //
49
+ // -- bind start //
50
+ cart_item_1.cart_sub_items.push(cart_sub_item_1);
51
+ cart.cart_items.push(cart_item_1);
52
+ cart = Cart_Logic.get_total(cart);
53
+ // -- bind end //
54
+ // -- CART END -- //
55
+ // -- ORDER START -- //
56
+ // -- order start //
57
+ let order = Order_Logic.get(cart,{order_code:'OR'});
58
+ Log.w('order',order);
59
+ Log.w('order_items',order.order_items[0]);
60
+ // -- order end //
61
+ // -- order item start //
62
+ // -- order item end //
63
+
64
+ // -- ORDER END -- //
65
+
34
66
  // -->
35
67
  //let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0);
68
+ //let parent = Data_Logic.get_new(Type.DATA_PRODUCT,0,{test:true,count:3,blank:false,data:{field_1:'apple'}});
36
69
  // -->
37
70
  //let join = App_Logic.get_join({},'','',{});
38
71
  // -->
@@ -49,8 +82,8 @@ describe("connect", () => {
49
82
  // -->
50
83
  //let data_items = Type.get_app_links();
51
84
  // -->
52
- let data = User_Logic.get_user_role_by_type(Type.USER_ROLE_USER);
53
- Log.w('99_result_data',data.label);
85
+ //let data = User_Logic.get_user_role_by_type(Type.USER_ROLE_USER);
86
+ //Log.w('99_result_data',data.label);
54
87
  //Log.w('99_result_parent',parent);
55
88
  //Log.w('99_result_data_items',data_items);
56
89
 
@@ -59,69 +92,16 @@ describe("connect", () => {
59
92
  //Log.w('Title 2',Field_Logic.get_field_value_title(Type.FIELD_VALUE_LIST,3,4,'cool'));
60
93
  //Log.w('item_list',item_list);
61
94
  //Log.w('bind_obj_list',App_Logic.bind_item_parent_user_list(item_list));
95
+ //Log.w('countries',User_Logic.get_countries());
62
96
 
63
97
  //item.id = 333;
64
98
  //item.items = ['a','b'];
65
99
  //Log.w('bind_obj',App_Logic.bind_item_parent_user_obj(item,parent_item,user));
66
100
  //let stat = Stat_Logic.get_new(parent_data_type,parent_id,Type.STAT_VIEW,user_id,item);
67
101
  //Log.w('stat',stat);
102
+ //Log.w('blog_post',Data_Logic.get(Type.DATA_BLOG_POST,0,{test:true,count:9}));
68
103
  console.log('CONNECT-BASE-END');
69
104
  }
70
- /*
71
- function(call) {
72
- console.log('CONNECT-CMS-DEMO-START');
73
- let category_type = Type.DATA_PRODUCT;
74
- let category_count = 12;
75
- let item_count = 500;
76
-
77
- //let category_type_title_list = ['Add On','Admin Panel','Hosting','Landing Page','Mobile','Website'];
78
- //let category_title_list = ['Beauty','Church','Fashion','Food Trucks','Health Care','Music','Pets','Services','Service Repair','Sports','Trucking'];
79
-
80
- let category_type_title_list = '';
81
- let category_title_list = '';
82
-
83
- let item_title_list = [];
84
- let post_type_list = [];
85
- let val_category_title = '';
86
- let cat_max = 0;
87
- let option = {get_category:true,category_count:category_count,category_data_type:category_type,categorys:val_category_title?val_category_title:null,
88
- get_item:true,item_count:item_count,item_data_type:category_type,items:null}
89
-
90
- console.log(Demo_Logic.get_new_type('',option));
91
- for(const item of category_type_title_list){
92
- post_type_list.push(
93
- Demo_Logic.get_new_type(item,option));
94
- }
95
- console.log('CONNECT-CMS-DEMO-SUCCESS');
96
- },
97
- */
98
- /*
99
- function(call) {
100
- //console.log('CONNECT-START');
101
- //let post_cart = Cart_Logic.get_new(Type.DATA_PRODUCT,0,);
102
- //let post_cart_list = [];
103
- //let post_cart_item = Cart_Logic.get_new_cart_item(Type.DATA_PRODUCT,123,post_cart.cart_number,1,30);
104
- //let post_cart_sub_item = Cart_Logic.get_new_cart_sub_item(Type.DATA_PRODUCT,1234,post_cart.cart_number,1,10);
105
- //let post_cart_sub_item_2 = Cart_Logic.get_new_cart_sub_item(Type.DATA_PRODUCT,1234,post_cart.cart_number,1,30);
106
- //post_cart_item.cart_sub_item_list.push(post_cart_sub_item);
107
- //post_cart_item.cart_sub_item_list.push(post_cart_sub_item_2);
108
- //post_cart.cart_item_list.push(post_cart_item);
109
-
110
- //Log.w('post_cart',post_cart);
111
- //Log.w('post_order',Order_Logic.get_new(post_cart,{get_payment_plan:true,payment_plan:Title.ORDER_PAYMENT_PLAN_1,payment_plan_status:Title.ORDER_PAYMENT_STATUS_OPEN}));
112
- //Log.w('post_cart_2',Cart_Logic.get_total(post_cart));
113
-
114
- //console.log('CONNECT-END');
115
- //call();
116
- },
117
- /* --- TEST LOGIC - CONNECT - END --- */
118
-
119
- /*
120
- function(call) {
121
- console.log('BLANK-START');
122
- console.log('BLANK-END');
123
- },
124
- */
125
105
  ], function(err) {
126
106
  console.log(err.message) // "another thing"
127
107
  })