biz9-logic 4.8.122 → 4.8.125
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 +132 -81
- package/package.json +1 -1
- package/test.js +18 -14
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -199,38 +199,35 @@ class Page_Logic {
|
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
201
|
class Order_Logic {
|
|
202
|
-
static get_cart_id = () => {
|
|
203
|
-
return FieldType.CART_ID + Number.get_id();
|
|
204
|
-
}
|
|
205
202
|
static get_order_id = () => {
|
|
206
203
|
return FieldType.ORDER_ID + Number.get_id();
|
|
207
204
|
}
|
|
208
|
-
static
|
|
209
|
-
option = Field_Logic.get_option(DataType.
|
|
210
|
-
let
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
if(option.
|
|
217
|
-
|
|
218
|
-
for(let a = 0;a<option.
|
|
219
|
-
|
|
205
|
+
static get_test_order_item = (order_item_id,order_id,user_id,parent_data_type,parent_id,option) =>{
|
|
206
|
+
option = Field_Logic.get_option(DataType.ORDER_ITEM,option?option:{generate_id:Str.check_is_null(order_item_id)? true : false });
|
|
207
|
+
let order_item = DataItem.get_new(DataType.ORDER_ITEM,Number.get_guid(),Field_Logic.get_test("Order Item "+Number.get_id(),option));
|
|
208
|
+
order_item.order_id = order_id;
|
|
209
|
+
order_item.user_id = user_id;
|
|
210
|
+
order_item.parent_data_type = parent_data_type;
|
|
211
|
+
order_item.parent_id = parent_id;
|
|
212
|
+
order_item.cost = Field_Logic.get_test_cost();
|
|
213
|
+
if(option.get_order_sub_item){
|
|
214
|
+
order_item.order_sub_item_list = [];
|
|
215
|
+
for(let a = 0;a<option.order_sub_item_count;a++){
|
|
216
|
+
order_item.order_sub_item_list.push(Order_Logic.get_test_order_sub_item(order_id,user_id,order_item.id,parent_data_type,parent_id,{get_value:true,get_order_sub_item:option.get_order_sub_item,order_sub_item_count:option.order_sub_item_count}));
|
|
220
217
|
}
|
|
221
218
|
}
|
|
222
|
-
return
|
|
219
|
+
return order_item;
|
|
223
220
|
};
|
|
224
|
-
static
|
|
225
|
-
option = Field_Logic.get_option(DataType.
|
|
226
|
-
let
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
return
|
|
221
|
+
static get_test_order_sub_item = (order_id,user_id,order_item_id,parent_data_type,parent_id,option) =>{
|
|
222
|
+
option = Field_Logic.get_option(DataType.ORDER_SUB_ITEM,option?option:{});
|
|
223
|
+
let order_sub_item = DataItem.get_new(DataType.ORDER_SUB_ITEM,Number.get_guid(),Field_Logic.get_test("Order Sub Item "+Number.get_id(),option));
|
|
224
|
+
order_sub_item.user_id = user_id;
|
|
225
|
+
order_sub_item.order_id = order_id;
|
|
226
|
+
order_sub_item.order_item_id = order_item_id;
|
|
227
|
+
order_sub_item.parent_data_type = parent_data_type;
|
|
228
|
+
order_sub_item.parent_id = parent_id;
|
|
229
|
+
order_sub_item.cost = Field_Logic.get_test_cost();
|
|
230
|
+
return order_sub_item;
|
|
234
231
|
};
|
|
235
232
|
static get_test_order_item = (order_id,user_id,parent_data_type,parent_id,option) =>{
|
|
236
233
|
option = Field_Logic.get_option(DataType.ORDER_ITEM,option?option:{});
|
|
@@ -259,7 +256,6 @@ class Order_Logic {
|
|
|
259
256
|
order_sub_item.cost = Field_Logic.get_test_cost();
|
|
260
257
|
return order_sub_item;
|
|
261
258
|
};
|
|
262
|
-
|
|
263
259
|
static get_test_list = (option) =>{
|
|
264
260
|
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
265
261
|
let item_list = [];
|
|
@@ -283,16 +279,74 @@ class Order_Logic {
|
|
|
283
279
|
}
|
|
284
280
|
return [category_list,product_list]
|
|
285
281
|
};
|
|
282
|
+
|
|
283
|
+
//static get_product_order = (order,product_list,,parent_data_type,parent_id,option) =>{
|
|
284
|
+
//return order_item;
|
|
285
|
+
//};
|
|
286
|
+
}
|
|
287
|
+
class Cart_Logic {
|
|
288
|
+
static get_cart_number = () => {
|
|
289
|
+
return FieldType.CART_NUMBER + Number.get_id(99999);
|
|
290
|
+
}
|
|
291
|
+
static get_test_cart_item = (cart_item_id,cart_number,user_id,parent_data_type,parent_id,option) =>{
|
|
292
|
+
option = Field_Logic.get_option(DataType.CART_ITEM,option?option:{generate_id:Str.check_is_null(cart_item_id)? true : false });
|
|
293
|
+
let cart_item = DataItem.get_new(DataType.CART_ITEM,Number.get_guid(),Field_Logic.get_test("Cart Item "+Number.get_id(),option));
|
|
294
|
+
cart_item.cart_item_id = cart_item_id;
|
|
295
|
+
cart_item.cart_number = cart_number;
|
|
296
|
+
cart_item.user_id = user_id;
|
|
297
|
+
cart_item.parent_data_type = parent_data_type;
|
|
298
|
+
cart_item.parent_id = parent_id;
|
|
299
|
+
if(option.get_cart_sub_item){
|
|
300
|
+
cart_item.cart_sub_item_list = [];
|
|
301
|
+
for(let a = 0;a<option.cart_sub_item_count;a++){
|
|
302
|
+
let cart_sub_item = Cart_Logic.get_test_cart_sub_item(cart_number,user_id,cart_item.id,parent_data_type,parent_id,{get_value:true,get_cart_sub_item:option.get_cart_sub_item,cart_sub_item_count:option.cart_sub_item_count});
|
|
303
|
+
cart_item.cart_sub_item_list.push(cart_sub_item);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
return cart_item;
|
|
307
|
+
};
|
|
308
|
+
static get_test_cart_sub_item = (cart_number,user_id,cart_item_id,parent_data_type,parent_id,option) =>{
|
|
309
|
+
option = Field_Logic.get_option(DataType.CART_SUB_ITEM,option?option:{});
|
|
310
|
+
let item_blank = Item_Logic.get_test('Sub Item '+Number.get_id(),DataType.ITEM,0,{generate_id:true});
|
|
311
|
+
let cart_sub_item = DataItem.get_new(DataType.CART_SUB_ITEM,Number.get_guid(),Field_Logic.get_test("Cart Sub Item "+Number.get_id(),option));
|
|
312
|
+
cart_sub_item.cart_number = cart_number;
|
|
313
|
+
cart_sub_item.user_id = user_id;
|
|
314
|
+
cart_sub_item.cart_item_id = cart_item_id;
|
|
315
|
+
cart_sub_item.parent_data_type = item_blank.data_type;
|
|
316
|
+
cart_sub_item.parent_id = item_blank.id;
|
|
317
|
+
cart_sub_item.cost = Field_Logic.get_test_cost();
|
|
318
|
+
cart_sub_item.parent_item = item_blank;
|
|
319
|
+
return cart_sub_item;
|
|
320
|
+
};
|
|
321
|
+
static get_test_list = (option) =>{
|
|
322
|
+
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
323
|
+
let item_list = [];
|
|
324
|
+
for(let a=0;a<option.product_count+1;a++){
|
|
325
|
+
item_list.push(Product_Logic.get_test("Product "+String(parseInt(a+1)),option));
|
|
326
|
+
}
|
|
327
|
+
return item_list;
|
|
328
|
+
}
|
|
329
|
+
static get_test_list_by_category = (option) =>{
|
|
330
|
+
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
331
|
+
let product_list = [];
|
|
332
|
+
let category_list = Category_Logic.get_type_category_list(DataType.PRODUCT,option.category_count);
|
|
333
|
+
let item_count = 0;
|
|
334
|
+
for(let a=0;a<category_list.length;a++){
|
|
335
|
+
for(let b=0;b<option.product_count;b++){
|
|
336
|
+
item_count++;
|
|
337
|
+
let product = Product_Logic.get_test("Product "+String(parseInt(b+1)),option);
|
|
338
|
+
product.category = category_list[Number.get_id(category_list.length+1)].title;
|
|
339
|
+
product_list.push(product);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
return [category_list,product_list]
|
|
343
|
+
};
|
|
286
344
|
}
|
|
287
345
|
class Product_Logic {
|
|
288
346
|
static get_test = (title,option) =>{
|
|
289
347
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
290
348
|
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
291
|
-
let product = DataItem.
|
|
292
|
-
DataItem.get_new(DataType.PRODUCT,0),
|
|
293
|
-
DataItem.get_new(DataType.PRODUCT,0),
|
|
294
|
-
DataItem.get_new(DataType.PRODUCT,0),
|
|
295
|
-
Field_Logic.get_test(title,option));
|
|
349
|
+
let product = DataItem.get_new(DataType.PRODUCT,0,Field_Logic.get_test(title,option));
|
|
296
350
|
if(option.get_blank ==false){
|
|
297
351
|
product.cost = Field_Logic.get_test_cost();
|
|
298
352
|
product.old_cost = Field_Logic.get_test_cost();
|
|
@@ -315,37 +369,25 @@ class Product_Logic {
|
|
|
315
369
|
}
|
|
316
370
|
return product;
|
|
317
371
|
};
|
|
318
|
-
static get_test_cart = (
|
|
319
|
-
[
|
|
372
|
+
static get_test_cart = (cart_number,user_id,option) =>{
|
|
373
|
+
[cart_number,option] = Field_Logic.get_option_title(cart_number,option);
|
|
320
374
|
option = Field_Logic.get_option(DataType.CART,option?option:{});
|
|
321
|
-
let cart = DataItem.get_new(DataType.CART,Number.get_guid(),Field_Logic.get_test(
|
|
375
|
+
let cart = DataItem.get_new(DataType.CART,Number.get_guid(),Field_Logic.get_test(cart_number,option));
|
|
322
376
|
cart.user_id = user_id;
|
|
323
|
-
|
|
377
|
+
cart.cart_number = cart_number;
|
|
378
|
+
if(option.get_cart_item){
|
|
379
|
+
let product_option = {product_count:option.cart_item_count,generate_id:true};
|
|
324
380
|
let product_list = Product_Logic.get_test_list(product_option);
|
|
325
|
-
if(option.get_cart_item){
|
|
326
381
|
cart.cart_item_list = [];
|
|
327
|
-
for(let a = 0;a<
|
|
328
|
-
|
|
382
|
+
for(let a = 0;a<product_list.length;a++){
|
|
383
|
+
let product_cart_item =Cart_Logic.get_test_cart_item(cart_number,cart.id,user_id,product_list[a].data_type,product_list[a].id,{get_value:false,get_cart_sub_item:option.get_cart_sub_item,cart_sub_item_count:option.cart_sub_item_count,generate_id:true});
|
|
384
|
+
product_cart_item.parent_item = product_list[a];
|
|
385
|
+
cart.cart_item_list.push(product_cart_item);
|
|
329
386
|
}
|
|
330
387
|
}
|
|
331
388
|
return cart;
|
|
332
389
|
};
|
|
333
|
-
|
|
334
|
-
[order_id,option] = Field_Logic.get_option_title(order_id,option);
|
|
335
|
-
option = Field_Logic.get_option(DataType.ORDER,option?option:{});
|
|
336
|
-
let order = DataItem.get_new(DataType.ORDER,Number.get_guid(),Field_Logic.get_test(order_id,option));
|
|
337
|
-
order.user_id = user_id;
|
|
338
|
-
let product_option = {generate_id:true,product_count:option.order_item_count};
|
|
339
|
-
let product_list = Product_Logic.get_test_list(product_option);
|
|
340
|
-
order.order_item_list = [];
|
|
341
|
-
if(option.get_order_item){
|
|
342
|
-
for(let a = 0;a<option.order_item_count;a++){
|
|
343
|
-
order.order_item_list.push(Order_Logic.get_test_order_item(order_id,user_id,product_list[a].data_type,product_list[a].id,{get_value:true,get_order_sub_item:option.get_order_sub_item,order_sub_item_count:option.order_sub_item_count}));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
return order;
|
|
347
|
-
};
|
|
348
|
-
static get_test_list = (option) =>{
|
|
390
|
+
static get_test_list = (option) =>{
|
|
349
391
|
option = Field_Logic.get_option(DataType.PRODUCT,option?option:{});
|
|
350
392
|
let item_list = [];
|
|
351
393
|
for(let a=0;a<option.product_count+1;a++){
|
|
@@ -373,11 +415,7 @@ class Service_Logic {
|
|
|
373
415
|
static get_test = (title,option) =>{
|
|
374
416
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
375
417
|
option = Field_Logic.get_option(DataType.SERVICE,option?option:{});
|
|
376
|
-
let service = DataItem.
|
|
377
|
-
DataItem.get_new(DataType.SERVICE,0),
|
|
378
|
-
DataItem.get_new(DataType.SERVICE,0),
|
|
379
|
-
DataItem.get_new(DataType.SERVICE,0),
|
|
380
|
-
Field_Logic.get_test(title,option));
|
|
418
|
+
let service = DataItem.get_new(DataType.SERVICE,0,Field_Logic.get_test(title,option));
|
|
381
419
|
service.cost = Field_Logic.get_test_cost();
|
|
382
420
|
service.old_cost = Field_Logic.get_test_cost();
|
|
383
421
|
service.type = "Type "+String(Number.get_id());
|
|
@@ -458,11 +496,7 @@ class Blog_Post_Logic {
|
|
|
458
496
|
static get_test = (title,option) =>{
|
|
459
497
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
460
498
|
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
461
|
-
let blog_post = DataItem.
|
|
462
|
-
DataItem.get_new(DataType.BLOG_POST,0),
|
|
463
|
-
DataItem.get_new(DataType.BLOG_POST,0),
|
|
464
|
-
DataItem.get_new(DataType.BLOG_POST,0),
|
|
465
|
-
Field_Logic.get_test(title,option));
|
|
499
|
+
let blog_post = DataItem.get_new(DataType.BLOG_POST,0,Field_Logic.get_test(title,option));
|
|
466
500
|
blog_post.author="First Name "+ Number.get_id();
|
|
467
501
|
blog_post.tag = "Tag "+ Number.get_id() + ", Tag "+Number.get_id() + ", Tag "+ Number.get_id();
|
|
468
502
|
if(option.get_item){
|
|
@@ -547,7 +581,6 @@ class Field_Logic {
|
|
|
547
581
|
option = !Obj.check_is_empty(option) ? option : {};
|
|
548
582
|
let sub_note = "Sub Note "+String(Number.get_id());
|
|
549
583
|
let note = "Note "+String(Number.get_id()) + " Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.";
|
|
550
|
-
option.category_title = !Str.check_is_null(option.category_title) ? option.category_title : 'Category '+String(Number.get_id());
|
|
551
584
|
if(option.get_blank == true){
|
|
552
585
|
date_create:"";
|
|
553
586
|
date_save:"";
|
|
@@ -560,7 +593,6 @@ class Field_Logic {
|
|
|
560
593
|
title:title,
|
|
561
594
|
setting_visible:"1",
|
|
562
595
|
title_url:Str.get_title_url(title),
|
|
563
|
-
category:option.category_title,
|
|
564
596
|
sub_note:sub_note,
|
|
565
597
|
note:note,
|
|
566
598
|
view_count:0,
|
|
@@ -568,6 +600,9 @@ class Field_Logic {
|
|
|
568
600
|
date_create:new moment().toISOString(),
|
|
569
601
|
date_save:new moment().toISOString()
|
|
570
602
|
}
|
|
603
|
+
if(!Str.check_is_null(option.category_title)){
|
|
604
|
+
item.category = 'Category ' + Number.get_id();
|
|
605
|
+
}
|
|
571
606
|
if(option.generate_id){
|
|
572
607
|
item.id=Number.get_guid();
|
|
573
608
|
}
|
|
@@ -605,7 +640,7 @@ class Field_Logic {
|
|
|
605
640
|
static get_option(data_type,option){
|
|
606
641
|
data_type = data_type ? data_type : DataType.BLANK;
|
|
607
642
|
option = !Obj.check_is_empty(option) ? option : {get_value:false,get_item:false,get_photo:false,item_count:9,value_count:9};
|
|
608
|
-
option.generate_id =
|
|
643
|
+
option.generate_id = option.generate_id ? option.generate_id : false;
|
|
609
644
|
option.get_photo = option.get_photo ? true : false;
|
|
610
645
|
option.get_value = option.get_value ? true : false;
|
|
611
646
|
option.get_item = option.get_item ? true : false;
|
|
@@ -654,10 +689,11 @@ class Field_Logic {
|
|
|
654
689
|
if(data_type==DataType.CART){
|
|
655
690
|
option.category_title = option.category_title ? option.category_title : "";
|
|
656
691
|
option.value_count = option.value_count ? option.value_count : 9;
|
|
692
|
+
option.generate_id = option.generate_id ? option.generate_id : true;
|
|
657
693
|
option.get_cart_item = option.get_cart_item ? option.get_cart_item : false;
|
|
658
|
-
option.cart_item_count = option.cart_item_count ? option.cart_item_count :
|
|
694
|
+
option.cart_item_count = option.cart_item_count ? option.cart_item_count : 5;
|
|
659
695
|
option.get_cart_sub_item = option.get_cart_sub_item ? option.get_cart_sub_item : false;
|
|
660
|
-
option.cart_sub_item_count = option.cart_sub_item_count ? option.cart_sub_item_count :
|
|
696
|
+
option.cart_sub_item_count = option.cart_sub_item_count ? option.cart_sub_item_count : 3;
|
|
661
697
|
}
|
|
662
698
|
if(data_type==DataType.CART_ITEM){
|
|
663
699
|
option.category_title = option.category_title ? option.category_title : "";
|
|
@@ -669,9 +705,9 @@ class Field_Logic {
|
|
|
669
705
|
option.category_title = option.category_title ? option.category_title : "";
|
|
670
706
|
option.value_count = option.value_count ? option.value_count : 9;
|
|
671
707
|
option.get_order_item = option.get_order_item ? option.get_order_item : false;
|
|
672
|
-
option.order_item_count = option.order_item_count ? option.order_item_count :
|
|
708
|
+
option.order_item_count = option.order_item_count ? option.order_item_count : 5;
|
|
673
709
|
option.get_order_sub_item = option.get_order_sub_item ? option.get_order_sub_item : false;
|
|
674
|
-
option.order_sub_item_count = option.order_sub_item_count ? option.order_sub_item_count :
|
|
710
|
+
option.order_sub_item_count = option.order_sub_item_count ? option.order_sub_item_count : 3;
|
|
675
711
|
}
|
|
676
712
|
if(data_type==DataType.ORDER_ITEM){
|
|
677
713
|
option.category_title = option.category_title ? option.category_title : "";
|
|
@@ -772,7 +808,7 @@ class FieldType {
|
|
|
772
808
|
static SOURCE_TOP_DATA_TYPE='source_top_data_type';
|
|
773
809
|
static DATE_CREATE='date_create';
|
|
774
810
|
static DATE_SAVE='date_save';
|
|
775
|
-
static
|
|
811
|
+
static STAT_VIEW_ADD_ID='1';
|
|
776
812
|
static STAT_LIKE_ADD_ID='2';
|
|
777
813
|
static STAT_FAVORITE_ADD_ID='3';
|
|
778
814
|
static STAT_CART_ADD_ID='4';
|
|
@@ -787,8 +823,8 @@ class FieldType {
|
|
|
787
823
|
static KEY_ORDER="key_order";
|
|
788
824
|
static KEY_USER="key_user";
|
|
789
825
|
|
|
790
|
-
static
|
|
791
|
-
static
|
|
826
|
+
static ORDER_NUMBER="OR-";
|
|
827
|
+
static CART_NUMBER="CA-";
|
|
792
828
|
}
|
|
793
829
|
class Social {
|
|
794
830
|
static FACEBOOK_URL="https://facebook.com/";
|
|
@@ -1208,20 +1244,20 @@ class FAQ_Url {
|
|
|
1208
1244
|
};
|
|
1209
1245
|
}
|
|
1210
1246
|
class Order_Url {
|
|
1211
|
-
static stripe_checkout = (biz9_config,
|
|
1212
|
-
let action_url="order/stripe-checkout/"+
|
|
1247
|
+
static stripe_checkout = (biz9_config,cart_number,params) => {
|
|
1248
|
+
let action_url="order/stripe-checkout/"+cart_number;
|
|
1213
1249
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1214
1250
|
};
|
|
1215
|
-
static checkout_success = (biz9_config,
|
|
1216
|
-
let action_url="order/checkout-success/"+
|
|
1251
|
+
static checkout_success = (biz9_config,cart_number,params) => {
|
|
1252
|
+
let action_url="order/checkout-success/"+cart_number;
|
|
1217
1253
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1218
1254
|
};
|
|
1219
1255
|
static cart_update = (biz9_config,params) => {
|
|
1220
1256
|
let action_url="order/cart-update/";
|
|
1221
1257
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1222
1258
|
};
|
|
1223
|
-
static cart_get = (biz9_config,
|
|
1224
|
-
let action_url="order/cart-get/"+
|
|
1259
|
+
static cart_get = (biz9_config,cart_number,params) => {
|
|
1260
|
+
let action_url="order/cart-get/"+cart_number;
|
|
1225
1261
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1226
1262
|
};
|
|
1227
1263
|
static cart_delete = (biz9_config,id,params) => {
|
|
@@ -1349,6 +1385,20 @@ class Gallery_Url {
|
|
|
1349
1385
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1350
1386
|
};
|
|
1351
1387
|
}
|
|
1388
|
+
class User_Url {
|
|
1389
|
+
static favorite = (biz9_config,user_id,params) => {
|
|
1390
|
+
let action_url="user/favorite/"+user_id;
|
|
1391
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1392
|
+
};
|
|
1393
|
+
static favorite_update = (biz9_config,parent_data_type,parent_id,user_id,params) => {
|
|
1394
|
+
let action_url="user/favorite/"+parent_data_type+"/"+parent_id +"/"user_id;
|
|
1395
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1396
|
+
};
|
|
1397
|
+
static search = (biz9_config,params) => {
|
|
1398
|
+
let action_url="user/search";
|
|
1399
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1352
1402
|
class Category_Url {
|
|
1353
1403
|
static get = (biz9_config,key,params) => {
|
|
1354
1404
|
let action_url="category/get/"+key;
|
|
@@ -1898,6 +1948,7 @@ module.exports = {
|
|
|
1898
1948
|
Blank_Url,
|
|
1899
1949
|
Blog_Post_Logic,
|
|
1900
1950
|
Blog_Post_Url,
|
|
1951
|
+
Cart_Logic,
|
|
1901
1952
|
Category_Logic,
|
|
1902
1953
|
Category_Url,
|
|
1903
1954
|
Content_Url,
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const series = require('async-series');
|
|
3
|
-
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic,Order_Logic} = require('./index');
|
|
3
|
+
const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business,Product,Service,Event,Template,Page,Category,Review,Blog_Post,Faq_Logic,Category_Url,Blank_Url,Blank_Logic,Item_Logic,Service_Logic,Template_Logic,Page_Logic,Product_Logic,Event_Logic,Blog_Post_Logic,Content_Logic,Category_Logic,Team_Logic,Business_Logic,PageType,Sub_Item_Logic,Page_Url,Review_Logic,User_Logic,Field_Logic,Order_Logic,Cart_Logic} = require('./index');
|
|
4
4
|
const {Log,Number} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -208,15 +208,24 @@ describe("connect", () => {
|
|
|
208
208
|
console.log('PRODUCT-START');
|
|
209
209
|
|
|
210
210
|
console.log('PRODUCT-CART-START');
|
|
211
|
+
let data_type = DataType.PRODUCT;
|
|
211
212
|
let user = User_Logic.get_test({generate_id:true});
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
let
|
|
215
|
-
Log.w('
|
|
216
|
-
Log.w('
|
|
217
|
-
Log.w('
|
|
218
|
-
//
|
|
219
|
-
|
|
213
|
+
//Log.w('user',user);
|
|
214
|
+
let cart_number = Cart_Logic.get_cart_number();
|
|
215
|
+
let product_cart = Product_Logic.get_test_cart(cart_number,user.id,{get_cart_item:true,cart_item_count:1,get_cart_sub_item:true,cart_sub_item_count:1,category_title:null});
|
|
216
|
+
Log.w('product_cart',product_cart);
|
|
217
|
+
Log.w('product_cart_parent',product_cart.cart_item_list[0]);
|
|
218
|
+
Log.w('product_cart_sub_item_list',product_cart.cart_item_list[0].cart_sub_item_list);
|
|
219
|
+
//cart.cart_number = cart_number;
|
|
220
|
+
//Log.w('cart',cart);
|
|
221
|
+
//let product = Product_Logic.get_test("Product "+Number.get_id(),{get_value:false,get_item:false})
|
|
222
|
+
//cart_item_id,cart_number,user_id,parent_data_type,parent_id
|
|
223
|
+
//let cart_item = Cart_Logic.get_test_cart_item(0,Order_Logic.get_cart_number(),user.id,product.data_type,product.id);
|
|
224
|
+
//Log.w('user',user);
|
|
225
|
+
//Log.w('product',product);
|
|
226
|
+
//Log.w('cart_item',cart_item);
|
|
227
|
+
//let cart_number = Order_Logic.get_order_id();
|
|
228
|
+
//let product_cart = Product_Logic.get_test_cart(cart_number,user.id,{get_cart_item:true,cart_item_count:1, get_cart_sub_item:true,cart_sub_item_count:1 });
|
|
220
229
|
//let product_cart = Product_Logic.get_test_cart(user.id,{get_cart_item:true,order_item_count:1,get_order_sub_item:true,order_sub_item_count:2 });
|
|
221
230
|
//Log.w('product_cart',product_cart);
|
|
222
231
|
//Log.w('product_cart_item_list',product_order.order_item_list.length);
|
|
@@ -358,16 +367,11 @@ describe("connect", () => {
|
|
|
358
367
|
/* --REVIEW--END */
|
|
359
368
|
|
|
360
369
|
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
370
|
/* --BUSINESS--START */
|
|
365
371
|
//Log.w("Business",Business_Logic.get_test("Business " + Number.get_id()));
|
|
366
372
|
//Log.w("Business",Business_Logic.get_test());
|
|
367
373
|
/* --BUSINESS--END */
|
|
368
374
|
|
|
369
|
-
|
|
370
|
-
|
|
371
375
|
console.log('CONNECT-SUCCESS');
|
|
372
376
|
//call()
|
|
373
377
|
},
|