biz9-logic 4.8.158 → 4.8.159
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 +73 -74
- package/main.js +1 -1
- package/main_test.js +33 -33
- package/package.json +1 -1
- package/test.js +19 -19
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -5,7 +5,7 @@ License GNU General Public License v3.0
|
|
|
5
5
|
Description: BiZ9 Framework: Logic-JS
|
|
6
6
|
*/
|
|
7
7
|
const moment = require('moment'); const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_main,get_cloud_filter_obj_main,get_new_full_item_main } = require('./main');
|
|
8
|
-
const { Log,Str,DateTime,
|
|
8
|
+
const { Log,Str,DateTime,Num,Obj } = require('/home/think2/www/doqbox/biz9-framework/biz9-utility/code');
|
|
9
9
|
class Message {
|
|
10
10
|
static SUCCESS="Update Success";
|
|
11
11
|
static LOGIN_GOOD="Login Success";
|
|
@@ -130,7 +130,7 @@ class Template_Logic {
|
|
|
130
130
|
static get_test = (title,option) =>{
|
|
131
131
|
if(!Str.check_is_null(title) && Obj.check_is_empty(option)){
|
|
132
132
|
option = title;
|
|
133
|
-
title = "Test " +
|
|
133
|
+
title = "Test " + Num.get_id();
|
|
134
134
|
}
|
|
135
135
|
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
136
136
|
let template = DataItem.get_new_full_item(
|
|
@@ -181,11 +181,11 @@ class Team_Logic {
|
|
|
181
181
|
DataItem.get_new(DataType.TEAM,team.id),
|
|
182
182
|
DataItem.get_new(DataType.TEAM,team.id),
|
|
183
183
|
Field_Logic.get_test(title,option));
|
|
184
|
-
team_member.first_name = "First Name "+
|
|
185
|
-
team_member.last_name = "Last Name "+
|
|
186
|
-
team_member.position = "Position "+
|
|
187
|
-
team_member.city = "City "+
|
|
188
|
-
team_member.state = "State "+
|
|
184
|
+
team_member.first_name = "First Name "+ Num.get_id();
|
|
185
|
+
team_member.last_name = "Last Name "+ Num.get_id();
|
|
186
|
+
team_member.position = "Position "+ Num.get_id();
|
|
187
|
+
team_member.city = "City "+ Num.get_id();
|
|
188
|
+
team_member.state = "State "+ Num.get_id();
|
|
189
189
|
return team_member;
|
|
190
190
|
};
|
|
191
191
|
static get_test_member_list = (team,option) =>{
|
|
@@ -231,15 +231,15 @@ class Page_Logic {
|
|
|
231
231
|
}
|
|
232
232
|
class Order_Logic {
|
|
233
233
|
static get_order_number = () => {
|
|
234
|
-
return FieldType.ORDER_NUMBER +
|
|
234
|
+
return FieldType.ORDER_NUMBER + Num.get_id(99999);
|
|
235
235
|
};
|
|
236
236
|
static get_transaction_id = () => {
|
|
237
|
-
return FieldType.TRANSACTION_ID +
|
|
237
|
+
return FieldType.TRANSACTION_ID + Num.get_id(99999);
|
|
238
238
|
};
|
|
239
239
|
}
|
|
240
240
|
class Cart_Logic {
|
|
241
241
|
static get_cart_number = () => {
|
|
242
|
-
return FieldType.CART_NUMBER +
|
|
242
|
+
return FieldType.CART_NUMBER + Num.get_id(99999);
|
|
243
243
|
};
|
|
244
244
|
static get_cart = (user_id) => {
|
|
245
245
|
return DataItem.get_new(DataType.CART,0,{user_id:user_id,cart_number:Cart_Logic.get_cart_number(),quanity:1,grand_total:0,cart_item_list:[]});
|
|
@@ -249,7 +249,7 @@ class Cart_Logic {
|
|
|
249
249
|
};
|
|
250
250
|
static get_test_item = (cart_item_id,cart_number,user_id,parent_data_type,parent_id,option) =>{
|
|
251
251
|
option = Field_Logic.get_option(DataType.CART_ITEM,option?option:{generate_id:Str.check_is_null(cart_item_id)? true : false });
|
|
252
|
-
let cart_item = DataItem.get_new(DataType.CART_ITEM,
|
|
252
|
+
let cart_item = DataItem.get_new(DataType.CART_ITEM,Num.get_guid(),Field_Logic.get_test("Cart Item "+Num.get_id(),option));
|
|
253
253
|
cart_item.cart_item_id = cart_item_id;
|
|
254
254
|
cart_item.cart_number = cart_number;
|
|
255
255
|
cart_item.user_id = user_id;
|
|
@@ -266,8 +266,8 @@ class Cart_Logic {
|
|
|
266
266
|
};
|
|
267
267
|
static get_test_sub_item = (cart_number,user_id,cart_item_id,parent_data_type,parent_id,option) =>{
|
|
268
268
|
option = Field_Logic.get_option(DataType.CART_SUB_ITEM,option?option:{});
|
|
269
|
-
let item_blank = Item_Logic.get_test('Sub Item '+
|
|
270
|
-
let cart_sub_item = DataItem.get_new(DataType.CART_SUB_ITEM,
|
|
269
|
+
let item_blank = Item_Logic.get_test('Sub Item '+Num.get_id(),DataType.ITEM,0,{generate_id:true});
|
|
270
|
+
let cart_sub_item = DataItem.get_new(DataType.CART_SUB_ITEM,Num.get_guid(),Field_Logic.get_test("Cart Sub Item "+Num.get_id(),option));
|
|
271
271
|
cart_sub_item.cart_number = cart_number;
|
|
272
272
|
cart_sub_item.user_id = user_id;
|
|
273
273
|
cart_sub_item.cart_item_id = cart_item_id;
|
|
@@ -294,7 +294,7 @@ static get_test_list = (option) =>{
|
|
|
294
294
|
for(let b=0;b<option.product_count;b++){
|
|
295
295
|
item_count++;
|
|
296
296
|
let product = Product_Logic.get_test("Product "+String(parseInt(b+1)),option);
|
|
297
|
-
product.category = category_list[
|
|
297
|
+
product.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
298
298
|
product_list.push(product);
|
|
299
299
|
}
|
|
300
300
|
}
|
|
@@ -311,10 +311,10 @@ class Product_Logic {
|
|
|
311
311
|
product.old_cost = Field_Logic.get_test_cost();
|
|
312
312
|
product.cart_count = 0;
|
|
313
313
|
product.order_count = 0;
|
|
314
|
-
product.type = "Type "+String(
|
|
315
|
-
product.sub_type = "Sub Type "+String(
|
|
316
|
-
product.stock = String(
|
|
317
|
-
product.tag = "Tag "+
|
|
314
|
+
product.type = "Type "+String(Num.get_id());
|
|
315
|
+
product.sub_type = "Sub Type "+String(Num.get_id());
|
|
316
|
+
product.stock = String(Num.get_id(3-1));
|
|
317
|
+
product.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
318
318
|
}else{
|
|
319
319
|
product.cost = "";
|
|
320
320
|
product.old_cost = "";
|
|
@@ -331,7 +331,7 @@ class Product_Logic {
|
|
|
331
331
|
static get_test_cart = (cart_number,user_id,option) =>{
|
|
332
332
|
[cart_number,option] = Field_Logic.get_option_title(cart_number,option);
|
|
333
333
|
option = Field_Logic.get_option(DataType.CART,option?option:{});
|
|
334
|
-
let cart = DataItem.get_new(DataType.CART,
|
|
334
|
+
let cart = DataItem.get_new(DataType.CART,Num.get_guid(),Field_Logic.get_test(cart_number,option));
|
|
335
335
|
cart.user_id = user_id;
|
|
336
336
|
cart.cart_number = cart_number;
|
|
337
337
|
if(option.get_cart_item){
|
|
@@ -363,7 +363,7 @@ static get_test_list = (option) =>{
|
|
|
363
363
|
for(let b=0;b<option.product_count;b++){
|
|
364
364
|
item_count++;
|
|
365
365
|
let product = Product_Logic.get_test("Product "+String(parseInt(b+1)),option);
|
|
366
|
-
product.category = category_list[
|
|
366
|
+
product.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
367
367
|
product_list.push(product);
|
|
368
368
|
}
|
|
369
369
|
}
|
|
@@ -377,10 +377,10 @@ class Service_Logic {
|
|
|
377
377
|
let service = DataItem.get_new(DataType.SERVICE,0,Field_Logic.get_test(title,option));
|
|
378
378
|
service.cost = Field_Logic.get_test_cost();
|
|
379
379
|
service.old_cost = Field_Logic.get_test_cost();
|
|
380
|
-
service.type = "Type "+String(
|
|
381
|
-
service.sub_type = "Sub Type "+String(
|
|
382
|
-
service.stock = String(
|
|
383
|
-
service.tag = "Tag "+
|
|
380
|
+
service.type = "Type "+String(Num.get_id());
|
|
381
|
+
service.sub_type = "Sub Type "+String(Num.get_id());
|
|
382
|
+
service.stock = String(Num.get_id(3-1));
|
|
383
|
+
service.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
384
384
|
if(option.get_item){
|
|
385
385
|
service.items = Sub_Item_Logic.get_test_list(service,service,option);
|
|
386
386
|
}
|
|
@@ -403,7 +403,7 @@ class Service_Logic {
|
|
|
403
403
|
for(let b=0;b<option.service_count;b++){
|
|
404
404
|
item_count++;
|
|
405
405
|
let service = Service_Logic.get_test("Service "+String(parseInt(b+1)),option);
|
|
406
|
-
service.category = category_list[
|
|
406
|
+
service.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
407
407
|
service_list.push(service);
|
|
408
408
|
}
|
|
409
409
|
}
|
|
@@ -444,7 +444,7 @@ class Content_Logic {
|
|
|
444
444
|
for(let b=0;b<option.content_count;b++){
|
|
445
445
|
item_count++;
|
|
446
446
|
let content = Content_Logic.get_test("Content "+String(parseInt(b+1)),option);
|
|
447
|
-
content.category = category_list[
|
|
447
|
+
content.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
448
448
|
content_list.push(content);
|
|
449
449
|
}
|
|
450
450
|
}
|
|
@@ -458,8 +458,8 @@ class Blog_Post_Logic {
|
|
|
458
458
|
let blog_post = DataItem.get_new(DataType.BLOG_POST,0,Field_Logic.get_test(title,option));
|
|
459
459
|
|
|
460
460
|
if(!option.get_blank){
|
|
461
|
-
blog_post.author="First Name "+
|
|
462
|
-
blog_post.tag = "Tag "+
|
|
461
|
+
blog_post.author="First Name "+ Num.get_id();
|
|
462
|
+
blog_post.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
463
463
|
}else{
|
|
464
464
|
blog_post.author="";
|
|
465
465
|
blog_post.tag = "";
|
|
@@ -486,7 +486,7 @@ class Blog_Post_Logic {
|
|
|
486
486
|
for(let b=0;b<option.blog_post_count;b++){
|
|
487
487
|
item_count++;
|
|
488
488
|
let blog_post = Blog_Post_Logic.get_test("Blog Post "+String(parseInt(b+1)),option);
|
|
489
|
-
blog_post.category = category_list[
|
|
489
|
+
blog_post.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
490
490
|
blog_post_list.push(blog_post);
|
|
491
491
|
}
|
|
492
492
|
}
|
|
@@ -501,14 +501,14 @@ class Event_Logic {
|
|
|
501
501
|
if(!option.get_blank){
|
|
502
502
|
event.cost = Field_Logic.get_test_cost();
|
|
503
503
|
event.old_cost = Field_Logic.get_test_cost();
|
|
504
|
-
event.date = String(String(
|
|
505
|
-
event.time = String(
|
|
506
|
-
event.website = "Website "+String(
|
|
507
|
-
event.location = "Location "+String(
|
|
508
|
-
event.meeting_link = "Meeting Link "+String(
|
|
509
|
-
event.stock = String(
|
|
510
|
-
event.category ="Category " + String(
|
|
511
|
-
event.tag = "Tag "+
|
|
504
|
+
event.date = String(String(Num.get_id(2030)) + "-" + String(Num.get_id(13)) + "-" + String(Num.get_id(30))).trim();
|
|
505
|
+
event.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
506
|
+
event.website = "Website "+String(Num.get_id());
|
|
507
|
+
event.location = "Location "+String(Num.get_id());
|
|
508
|
+
event.meeting_link = "Meeting Link "+String(Num.get_id());
|
|
509
|
+
event.stock = String(Num.get_id(3-1));
|
|
510
|
+
event.category ="Category " + String(Num.get_id());
|
|
511
|
+
event.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
512
512
|
}else{
|
|
513
513
|
event.cost = "";
|
|
514
514
|
event.old_cost = "";
|
|
@@ -543,7 +543,7 @@ class Event_Logic {
|
|
|
543
543
|
for(let b=0;b<option.event_count;b++){
|
|
544
544
|
item_count++;
|
|
545
545
|
let event = Event_Logic.get_test("Event "+String(parseInt(b+1)),option);
|
|
546
|
-
event.category = category_list[
|
|
546
|
+
event.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
547
547
|
event_list.push(event);
|
|
548
548
|
}
|
|
549
549
|
}
|
|
@@ -552,10 +552,10 @@ class Event_Logic {
|
|
|
552
552
|
}
|
|
553
553
|
class Field_Logic {
|
|
554
554
|
static get_test_cost(){
|
|
555
|
-
return String(
|
|
555
|
+
return String(Num.get_id(999)) + "." + String(Num.get_id(99));
|
|
556
556
|
}
|
|
557
557
|
static get_test_note = () => {
|
|
558
|
-
return "Note "+String(
|
|
558
|
+
return "Note "+String(Num.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.";
|
|
559
559
|
}
|
|
560
560
|
static get_test = (title,option) =>{
|
|
561
561
|
option = !Obj.check_is_empty(option) ? option : {};
|
|
@@ -575,7 +575,7 @@ class Field_Logic {
|
|
|
575
575
|
title:title,
|
|
576
576
|
setting_visible:"1",
|
|
577
577
|
title_url:Str.get_title_url(title),
|
|
578
|
-
sub_note:"Sub Note "+String(
|
|
578
|
+
sub_note:"Sub Note "+String(Num.get_id()),
|
|
579
579
|
note:Field_Logic.get_test_note(),
|
|
580
580
|
view_count:0,
|
|
581
581
|
id:0,
|
|
@@ -584,10 +584,10 @@ class Field_Logic {
|
|
|
584
584
|
}
|
|
585
585
|
}
|
|
586
586
|
if(!Str.check_is_null(option.category_title)){
|
|
587
|
-
item.category = 'Category ' +
|
|
587
|
+
item.category = 'Category ' + Num.get_id();
|
|
588
588
|
}
|
|
589
589
|
if(option.generate_id){
|
|
590
|
-
item.id=
|
|
590
|
+
item.id=Num.get_guid();
|
|
591
591
|
}
|
|
592
592
|
if(option.get_value){
|
|
593
593
|
item = Field_Logic.get_value_list(item,option);
|
|
@@ -601,7 +601,7 @@ class Field_Logic {
|
|
|
601
601
|
}
|
|
602
602
|
}else{
|
|
603
603
|
if(!Str.check_is_null(field_list[a])){
|
|
604
|
-
item[Str.get_title_url(field_list[a])] = Str.get_title(field_list[a]) +"_" +
|
|
604
|
+
item[Str.get_title_url(field_list[a])] = Str.get_title(field_list[a]) +"_" + Num.get_id();
|
|
605
605
|
}
|
|
606
606
|
}
|
|
607
607
|
}
|
|
@@ -715,13 +715,13 @@ class Field_Logic {
|
|
|
715
715
|
option = {};
|
|
716
716
|
}else{
|
|
717
717
|
option = title;
|
|
718
|
-
title = "Test " +
|
|
718
|
+
title = "Test " + Num.get_id();
|
|
719
719
|
}
|
|
720
720
|
}
|
|
721
721
|
}
|
|
722
722
|
}else{
|
|
723
723
|
if(Str.check_is_null(title) && Obj.check_is_empty(option)){
|
|
724
|
-
title = "Test " +
|
|
724
|
+
title = "Test " + Num.get_id();
|
|
725
725
|
option = {};
|
|
726
726
|
}
|
|
727
727
|
}
|
|
@@ -814,7 +814,6 @@ class FieldType {
|
|
|
814
814
|
static CART_NUMBER="CA-";
|
|
815
815
|
static TRANSACTION_ID="TR-";
|
|
816
816
|
|
|
817
|
-
static PAYMENT_PLAN_PENDING="Pending";
|
|
818
817
|
static PAYMENT_PLAN_1="1 Payment";
|
|
819
818
|
static PAYMENT_PLAN_2="2 Payments";
|
|
820
819
|
static PAYMENT_PLAN_3="3 Payments";
|
|
@@ -825,7 +824,7 @@ class FieldType {
|
|
|
825
824
|
static ORDER_STATUS_PAYMENT="Payment Plan";
|
|
826
825
|
static ORDER_STATUS_COMPLETE="Complete";
|
|
827
826
|
|
|
828
|
-
static
|
|
827
|
+
static PAYMENT_PLAN="Open";
|
|
829
828
|
|
|
830
829
|
static ORDER_PAYMENT_TYPE_STRIPE="Stripe";
|
|
831
830
|
static ORDER_PAYMENT_TYPE_CASH="Cash";
|
|
@@ -1019,7 +1018,7 @@ class Blank_Logic {
|
|
|
1019
1018
|
for(let b=0;b<option.blank_count;b++){
|
|
1020
1019
|
item_count++;
|
|
1021
1020
|
let blank = Blank_Logic.get_test("Blank "+String(parseInt(b+1)),option);
|
|
1022
|
-
blank.category = category_list[
|
|
1021
|
+
blank.category = category_list[Num.get_id(category_list.length+1)].title;
|
|
1023
1022
|
blank_list.push(blank);
|
|
1024
1023
|
}
|
|
1025
1024
|
}
|
|
@@ -1035,7 +1034,7 @@ class Faq_Logic {
|
|
|
1035
1034
|
for(let a=0;a<option.question_count+1;a++){
|
|
1036
1035
|
if(!option.get_blank){
|
|
1037
1036
|
let question_title = "FAQ Question " + String(parseInt(a+1));
|
|
1038
|
-
let answer = "My answer "+
|
|
1037
|
+
let answer = "My answer "+ Num.get_id() + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
|
|
1039
1038
|
faq[Str.get_title_url(question_title).toLowerCase()] = answer;
|
|
1040
1039
|
faq['field_'+parseInt(a+1)] =question_title;
|
|
1041
1040
|
}else{
|
|
@@ -1060,7 +1059,7 @@ class Faq_Logic {
|
|
|
1060
1059
|
for(let a=0;a<19;a++){
|
|
1061
1060
|
let row = a + 1;
|
|
1062
1061
|
if(!Str.check_is_null(faq['field_'+a])) {
|
|
1063
|
-
item_list.push({ id:
|
|
1062
|
+
item_list.push({ id: Num.get_id(333), question:faq['field_'+a], answer: String(faq[Str.get_title_url(faq['field_'+a]).toLowerCase() ]) });
|
|
1064
1063
|
}
|
|
1065
1064
|
}
|
|
1066
1065
|
return item_list;
|
|
@@ -1115,10 +1114,10 @@ class Review_Logic {
|
|
|
1115
1114
|
option = Field_Logic.get_option(DataType.REVIEW,option?option:{});
|
|
1116
1115
|
let review = DataItem.get_new(DataType.REVIEW,0);
|
|
1117
1116
|
if(!option.get_blank){
|
|
1118
|
-
review.title = 'Title ' +
|
|
1117
|
+
review.title = 'Title ' + Num.get_id();
|
|
1119
1118
|
review.parent_data_type = parent_data_type;
|
|
1120
1119
|
review.parent_id = parent_id;
|
|
1121
|
-
review.rating =
|
|
1120
|
+
review.rating = Num.get_id(6);
|
|
1122
1121
|
review.user_id = user_id;
|
|
1123
1122
|
review.comment = "My comment "+ Field_Logic.get_test_note();
|
|
1124
1123
|
}else{
|
|
@@ -1157,7 +1156,7 @@ class Admin_Logic {
|
|
|
1157
1156
|
let item = DataItem.get_new(DataType.ADMIN,0);
|
|
1158
1157
|
let admin = DataItem.get_new(DataType.ADMIN,0,Field_Logic.get_test(title,option));
|
|
1159
1158
|
if(!option.get_blank){
|
|
1160
|
-
admin.email="ceo@admin"+
|
|
1159
|
+
admin.email="ceo@admin"+Num.get_id()+".com";
|
|
1161
1160
|
admin.password="1234567";
|
|
1162
1161
|
}else{
|
|
1163
1162
|
admin.email="";
|
|
@@ -1204,18 +1203,18 @@ class Business_Logic {
|
|
|
1204
1203
|
let state_list = ["Georgia","New York","Illinois","Washington","Flordia"];
|
|
1205
1204
|
let business = DataItem.get_new(DataType.BUSINESS,0,Field_Logic.get_test(title,option));
|
|
1206
1205
|
if(!option.get_blank){
|
|
1207
|
-
business.email="ceo@business"+
|
|
1208
|
-
business.phone=
|
|
1209
|
-
business.address_1=
|
|
1210
|
-
business.address_2="PO "+
|
|
1211
|
-
business.city=city_list[
|
|
1212
|
-
business.state=state_list[
|
|
1213
|
-
business.zip=
|
|
1214
|
-
business.website="website_" +
|
|
1215
|
-
business.youtube="youtube_"+
|
|
1216
|
-
business.instagram="instagram_"+
|
|
1217
|
-
business.facebook="facebook_"+
|
|
1218
|
-
business.twitter="twitter_"+
|
|
1206
|
+
business.email="ceo@business"+Num.get_id()+".com";
|
|
1207
|
+
business.phone=Num.get_id(parseInt(777+100)) + "-" + Num.get_id(parseInt(777+100)) + "-"+Num.get_id(parseInt(7777+1000));
|
|
1208
|
+
business.address_1=Num.get_id(99)+" Main St.";
|
|
1209
|
+
business.address_2="PO "+Num.get_id(99);
|
|
1210
|
+
business.city=city_list[Num.get_id(city_list.length-1)];
|
|
1211
|
+
business.state=state_list[Num.get_id(state_list.length-1)];
|
|
1212
|
+
business.zip=Num.get_id(parseInt(77777+1000));
|
|
1213
|
+
business.website="website_" + Num.get_id(9999);
|
|
1214
|
+
business.youtube="youtube_"+Num.get_id(9999);
|
|
1215
|
+
business.instagram="instagram_"+Num.get_id(9999);
|
|
1216
|
+
business.facebook="facebook_"+Num.get_id(9999);
|
|
1217
|
+
business.twitter="twitter_"+Num.get_id(9999);
|
|
1219
1218
|
}else{
|
|
1220
1219
|
business.email="";
|
|
1221
1220
|
business.phone="";
|
|
@@ -1899,11 +1898,11 @@ class User_Logic {
|
|
|
1899
1898
|
return country_state_city;
|
|
1900
1899
|
}
|
|
1901
1900
|
static get_guest(){
|
|
1902
|
-
return DataItem.get_new(DataType.USER,
|
|
1901
|
+
return DataItem.get_new(DataType.USER,Num.get_id(999),{is_guest:true,title:"Guest",country:"United States"});
|
|
1903
1902
|
}
|
|
1904
1903
|
static get_request_user(req){
|
|
1905
1904
|
if(!req || !req.session.user){
|
|
1906
|
-
let user=DataItem.get_new(DataType.USER,
|
|
1905
|
+
let user=DataItem.get_new(DataType.USER,Num.get_id(9999999),{is_guest:true});
|
|
1907
1906
|
req.session.user=user;
|
|
1908
1907
|
}
|
|
1909
1908
|
return req.session.user;
|
|
@@ -1944,11 +1943,11 @@ class User_Logic {
|
|
|
1944
1943
|
user.password="";
|
|
1945
1944
|
user.country="";
|
|
1946
1945
|
}else{
|
|
1947
|
-
user.first_name="First Name "+
|
|
1948
|
-
user.last_name="First Name "+
|
|
1949
|
-
user.email="email"+
|
|
1950
|
-
user.city="City"+
|
|
1951
|
-
user.state="State"+
|
|
1946
|
+
user.first_name="First Name "+ Num.get_id();
|
|
1947
|
+
user.last_name="First Name "+ Num.get_id();
|
|
1948
|
+
user.email="email"+ Num.get_id() + "@email.com";
|
|
1949
|
+
user.city="City"+ Num.get_id();
|
|
1950
|
+
user.state="State"+ Num.get_id();
|
|
1952
1951
|
user.password="1234567";
|
|
1953
1952
|
user.country="United States";
|
|
1954
1953
|
}
|
|
@@ -1975,7 +1974,7 @@ class Sub_Item_Logic {
|
|
|
1975
1974
|
parent_data_type:parent_item.data_type,
|
|
1976
1975
|
title:item_title,
|
|
1977
1976
|
title_url:Str.get_title_url(item_title),
|
|
1978
|
-
sub_note:"Sub Note "+String(
|
|
1977
|
+
sub_note:"Sub Note "+String(Num.get_id()),
|
|
1979
1978
|
note:Field_Logic.get_test_note()
|
|
1980
1979
|
}
|
|
1981
1980
|
);
|
package/main.js
CHANGED
|
@@ -4,7 +4,7 @@ Author: certifiedcoderz@gmail.com (Certified CoderZ)
|
|
|
4
4
|
License GNU General Public License v3.0
|
|
5
5
|
Description: BiZ9 Framework: Logic - Main
|
|
6
6
|
*/
|
|
7
|
-
const { DateTime,
|
|
7
|
+
const { DateTime,Num } = require('biz9-utility');
|
|
8
8
|
const biz9_config_local=__dirname+"/../../"+"biz9_config";
|
|
9
9
|
const get_cloud_param_obj_main = (data_type,filter,sort_by,page_current,page_size) => {
|
|
10
10
|
return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
|
package/main_test.js
CHANGED
|
@@ -1,82 +1,82 @@
|
|
|
1
1
|
const { DataItem,DataType } = require('biz9-logic');
|
|
2
2
|
const get_template_test = () =>{
|
|
3
3
|
let template = DataItem.get_new_full_item(
|
|
4
|
-
DataItem.get_new(DataType.TEMPLATE,
|
|
4
|
+
DataItem.get_new(DataType.TEMPLATE,Num.get_id()),
|
|
5
5
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
6
6
|
DataItem.get_new(DataType.TEMPLATE,0),
|
|
7
7
|
Field.get_test("Primary"));
|
|
8
8
|
let template_sub_title_list = ["Header","Navigation","Body","Footer"];
|
|
9
9
|
for(let a=0;a<template_sub_title_list.length;a++){
|
|
10
|
-
template = Sub_Item.get_test_bind_new_child(
|
|
10
|
+
template = Sub_Item.get_test_bind_new_child(Num.get_id(),template_sub_title_list[a],template,template,template);
|
|
11
11
|
}
|
|
12
12
|
template = Sub_Item.get_test_bind_item_sub_item(template);
|
|
13
13
|
return template;
|
|
14
14
|
};
|
|
15
15
|
const get_page_test = (title) =>{
|
|
16
16
|
let page = DataItem.get_new_full_item(
|
|
17
|
-
DataItem.get_new(DataType.PAGE,
|
|
17
|
+
DataItem.get_new(DataType.PAGE,Num.get_id()),
|
|
18
18
|
DataItem.get_new(DataType.PAGE,0),
|
|
19
19
|
DataItem.get_new(DataType.PAGE,0),
|
|
20
20
|
Field.get_test(title));
|
|
21
21
|
for(let a=0;a<20;a++){
|
|
22
|
-
page=Sub_Item.get_test_bind_new_child(
|
|
22
|
+
page=Sub_Item.get_test_bind_new_child(Num.get_id(),"Section "+a,page,page,page);
|
|
23
23
|
}
|
|
24
24
|
page = Sub_Item.get_test_bind_item_sub_item(page);
|
|
25
25
|
return page;
|
|
26
26
|
}
|
|
27
27
|
const get_product_test = (title) =>{
|
|
28
28
|
let product = DataItem.get_new_full_item(
|
|
29
|
-
DataItem.get_new(DataType.PRODUCT,
|
|
29
|
+
DataItem.get_new(DataType.PRODUCT,Num.get_id()),
|
|
30
30
|
DataItem.get_new(DataType.PRODUCT,0),
|
|
31
31
|
DataItem.get_new(DataType.PRODUCT,0),
|
|
32
32
|
Field.get_test(title));
|
|
33
|
-
product = Sub_Item.get_test_bind_new_child(
|
|
34
|
-
product.cost = String(
|
|
35
|
-
product.old_cost = String(
|
|
36
|
-
product.type = "Type "+String(
|
|
37
|
-
product.sub_type = "Sub Type "+String(
|
|
38
|
-
product.stock = String(
|
|
33
|
+
product = Sub_Item.get_test_bind_new_child(Num.get_id(),title,product,product,product);
|
|
34
|
+
product.cost = String(Num.get_id()) + "." + String(Num.get_id());
|
|
35
|
+
product.old_cost = String(Num.get_id()) + "." + String(Num.get_id());
|
|
36
|
+
product.type = "Type "+String(Num.get_id());
|
|
37
|
+
product.sub_type = "Sub Type "+String(Num.get_id());
|
|
38
|
+
product.stock = String(Num.get_id(3-1));
|
|
39
39
|
for(let a=0;a<10;a++){
|
|
40
|
-
product=Sub_Item.get_test_bind_new_child(
|
|
40
|
+
product=Sub_Item.get_test_bind_new_child(Num.get_id(),"Section " + String(a),product,product,product);
|
|
41
41
|
}
|
|
42
42
|
product = Sub_Item.get_test_bind_item_sub_item(product);
|
|
43
43
|
return product;
|
|
44
44
|
};
|
|
45
45
|
const get_service_test = (title) =>{
|
|
46
46
|
let service = DataItem.get_new_full_item(
|
|
47
|
-
DataItem.get_new(DataType.SERVICE,
|
|
47
|
+
DataItem.get_new(DataType.SERVICE,Num.get_id()),
|
|
48
48
|
DataItem.get_new(DataType.SERVICE,0),
|
|
49
49
|
DataItem.get_new(DataType.SERVICE,0),
|
|
50
50
|
Field.get_test(title));
|
|
51
|
-
service = Sub_Item.get_test_bind_new_child(
|
|
52
|
-
service.cost = String(
|
|
53
|
-
service.old_cost = String(
|
|
54
|
-
service.type = "Type "+String(
|
|
55
|
-
service.sub_type = "Sub Type "+String(
|
|
56
|
-
service.stock = String(
|
|
51
|
+
service = Sub_Item.get_test_bind_new_child(Num.get_id(),title,service,service,service);
|
|
52
|
+
service.cost = String(Num.get_id()) + "." + String(Num.get_id());
|
|
53
|
+
service.old_cost = String(Num.get_id()) + "." + String(Num.get_id());
|
|
54
|
+
service.type = "Type "+String(Num.get_id());
|
|
55
|
+
service.sub_type = "Sub Type "+String(Num.get_id());
|
|
56
|
+
service.stock = String(Num.get_id(3-1));
|
|
57
57
|
for(let a=0;a<10;a++){
|
|
58
|
-
service=Sub_Item.get_test_bind_new_child(
|
|
58
|
+
service=Sub_Item.get_test_bind_new_child(Num.get_id(),"Section " + String(a),service,service,service);
|
|
59
59
|
}
|
|
60
60
|
service = Sub_Item.get_test_bind_item_sub_item(service);
|
|
61
61
|
return service;
|
|
62
62
|
};
|
|
63
63
|
const get_event_test = (title) =>{
|
|
64
64
|
let event = DataItem.get_new_full_item(
|
|
65
|
-
DataItem.get_new(DataType.EVENT,
|
|
65
|
+
DataItem.get_new(DataType.EVENT,Num.get_id()),
|
|
66
66
|
DataItem.get_new(DataType.EVENT,0),
|
|
67
67
|
DataItem.get_new(DataType.EVENT,0),
|
|
68
68
|
Field.get_test(title));
|
|
69
|
-
event = Sub_Item.get_test_bind_new_child(
|
|
70
|
-
event.cost = String(
|
|
71
|
-
event.old_cost = String(
|
|
72
|
-
event.date = String(String(
|
|
73
|
-
event.time = String(
|
|
74
|
-
event.website = "Website "+String(
|
|
75
|
-
event.location = "Location "+String(
|
|
76
|
-
event.meeting_link = "Meeting Link "+String(
|
|
77
|
-
event.stock = String(
|
|
69
|
+
event = Sub_Item.get_test_bind_new_child(Num.get_id(),title,event,event,event);
|
|
70
|
+
event.cost = String(Num.get_id()) + "." + String(Num.get_id());
|
|
71
|
+
event.old_cost = String(Num.get_id()) + "." + String(Num.get_id());
|
|
72
|
+
event.date = String(String(Num.get_id(2030)) + "-" + String(Num.get_id(13)) + "-" + String(Num.get_id(30))).trim();
|
|
73
|
+
event.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
74
|
+
event.website = "Website "+String(Num.get_id());
|
|
75
|
+
event.location = "Location "+String(Num.get_id());
|
|
76
|
+
event.meeting_link = "Meeting Link "+String(Num.get_id());
|
|
77
|
+
event.stock = String(Num.get_id(3-1));
|
|
78
78
|
for(let a=0;a<10;a++){
|
|
79
|
-
event=Sub_Item.get_test_bind_new_child(
|
|
79
|
+
event=Sub_Item.get_test_bind_new_child(Num.get_id(),"Section " + String(a),event,event,event);
|
|
80
80
|
}
|
|
81
81
|
event = Sub_Item.get_test_bind_item_sub_item(event);
|
|
82
82
|
return event;
|
|
@@ -90,8 +90,8 @@ const get_field_test = (title) =>{
|
|
|
90
90
|
setting_visible:"1",
|
|
91
91
|
photo_data:"/images/no_img.jpg",
|
|
92
92
|
title_url:Str.get_title_url(title),
|
|
93
|
-
sub_note : "Sub Note "+String(
|
|
94
|
-
note : "Note "+String(
|
|
93
|
+
sub_note : "Sub Note "+String(Num.get_id()),
|
|
94
|
+
note : "Note "+String(Num.get_id())
|
|
95
95
|
}
|
|
96
96
|
for(let b = 1;b<20;b++){
|
|
97
97
|
item['value_'+String(b)] = 'value ' + String(b);
|
package/package.json
CHANGED
package/test.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const path = require('path');
|
|
2
2
|
const series = require('async-series');
|
|
3
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
|
-
const {Log,
|
|
4
|
+
const {Log,Num} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
7
7
|
/* --- TEST CONFIG START --- */
|
|
@@ -49,12 +49,12 @@ describe("connect", () => {
|
|
|
49
49
|
function(call) {
|
|
50
50
|
//console.log('STORAGE-START');
|
|
51
51
|
//console.log(Storage.get({},'apples'));
|
|
52
|
-
//Log.w('storage-start',Storage.set(
|
|
52
|
+
//Log.w('storage-start',Storage.set(Num.get_id()));
|
|
53
53
|
//console.log('STORAGE-END');
|
|
54
54
|
/* --PAGE--START */
|
|
55
55
|
//let page = Page_Logic.get_test()
|
|
56
|
-
//let page = Page_Logic.get_test("Page "+
|
|
57
|
-
//let page = Page_Logic.get_test("Page "+
|
|
56
|
+
//let page = Page_Logic.get_test("Page "+Num.get_id())
|
|
57
|
+
//let page = Page_Logic.get_test("Page "+Num.get_id(),{get_value:true,value_count:5,get_section:false,section_count:2,get_photo:true,get_blank:true})
|
|
58
58
|
//Log.w("page",page);
|
|
59
59
|
//Log.w("page_section_1",page.section_1);
|
|
60
60
|
//Log.w("page_section_6",page.section_6.items);
|
|
@@ -222,7 +222,7 @@ describe("connect", () => {
|
|
|
222
222
|
Log.w('product_cart_sub_item_list',product_cart.cart_item_list[0].cart_sub_item_list);
|
|
223
223
|
//cart.cart_number = cart_number;
|
|
224
224
|
//Log.w('cart',cart);
|
|
225
|
-
//let product = Product_Logic.get_test("Product "+
|
|
225
|
+
//let product = Product_Logic.get_test("Product "+Num.get_id(),{get_value:false,get_item:false})
|
|
226
226
|
//cart_item_id,cart_number,user_id,parent_data_type,parent_id
|
|
227
227
|
//let cart_item = Cart_Logic.get_test_cart_item(0,Order_Logic.get_cart_number(),user.id,product.data_type,product.id);
|
|
228
228
|
//Log.w('user',user);
|
|
@@ -240,7 +240,7 @@ describe("connect", () => {
|
|
|
240
240
|
|
|
241
241
|
/*
|
|
242
242
|
console.log('PRODUCT-ORDER-START');
|
|
243
|
-
let order_id = "OR"+
|
|
243
|
+
let order_id = "OR"+Num.get_id();
|
|
244
244
|
let user = User_Logic.get_test({generate_id:true});
|
|
245
245
|
let product_order = Product_Logic.get_test_order(order_id,user.id,{get_order_item:true,order_item_count:1,get_order_sub_item:true,order_sub_item_count:2 });
|
|
246
246
|
Log.w('product_order',product_order);
|
|
@@ -271,7 +271,7 @@ describe("connect", () => {
|
|
|
271
271
|
|
|
272
272
|
|
|
273
273
|
/* --ITEM-TEST--START */
|
|
274
|
-
//let item = Item_Logic.get_test("Item_" +
|
|
274
|
+
//let item = Item_Logic.get_test("Item_" +Num.get_id(),DataType.BLOG_POST,0,{get_blank:false});
|
|
275
275
|
//Log.w('item',item);
|
|
276
276
|
/*
|
|
277
277
|
let item_list = Item_Logic.get_test_list(DataType.BLANK,{item_count:10,get_value:true});
|
|
@@ -365,7 +365,7 @@ describe("connect", () => {
|
|
|
365
365
|
/* --REVIEW--START */
|
|
366
366
|
/*
|
|
367
367
|
let parent_data_type = DataType.PRODUCT;
|
|
368
|
-
let parent_id =
|
|
368
|
+
let parent_id = Num.get_id();
|
|
369
369
|
let user = User_Logic.get_test({generate_id:false});
|
|
370
370
|
let product_review = Review_Logic.get_test(parent_data_type,parent_id,user.id);
|
|
371
371
|
let review = Review_Logic.get_new(parent_data_type,parent_id,user,product_review);
|
|
@@ -381,7 +381,7 @@ describe("connect", () => {
|
|
|
381
381
|
/* --REVIEW--END */
|
|
382
382
|
|
|
383
383
|
/* --BUSINESS--START */
|
|
384
|
-
//Log.w("Business",Business_Logic.get_test("Business " +
|
|
384
|
+
//Log.w("Business",Business_Logic.get_test("Business " + Num.get_id()));
|
|
385
385
|
//Log.w("Business",Business_Logic.get_test());
|
|
386
386
|
/* --BUSINESS--END */
|
|
387
387
|
|
|
@@ -421,7 +421,7 @@ describe("connect", () => {
|
|
|
421
421
|
|
|
422
422
|
function(call) {
|
|
423
423
|
console.log('GET_START_STORAGE-START');
|
|
424
|
-
Log.w('storage-start',Storage.set(
|
|
424
|
+
Log.w('storage-start',Storage.set(Num.get_id()));
|
|
425
425
|
console.log('GET_START_STORAGE-END');
|
|
426
426
|
//call();
|
|
427
427
|
},
|
|
@@ -457,16 +457,16 @@ describe("connect", () => {
|
|
|
457
457
|
console.log('SET-ITEM-BIZ-BY-LIST-START');
|
|
458
458
|
let item_test_list = [];
|
|
459
459
|
let item_test = Item_Logic.get_test_item('dt_blank',0);
|
|
460
|
-
item_test.cost = String(
|
|
461
|
-
item_test.old_cost = String(
|
|
462
|
-
item_test.title ='_title_'+
|
|
460
|
+
item_test.cost = String(Num.get_id())+'.55';
|
|
461
|
+
item_test.old_cost = String(Num.get_id())+'.20';
|
|
462
|
+
item_test.title ='_title_'+Num.get_id();
|
|
463
463
|
|
|
464
464
|
item_test_list.push(item_test);
|
|
465
465
|
|
|
466
466
|
let item_test_1 = Item_Logic.get_test_item('dt_blank',0);
|
|
467
467
|
item_test_1.cost = '5.55';
|
|
468
468
|
item_test_1.old_cost = '9.55';
|
|
469
|
-
item_test_1.title ='_title_'+
|
|
469
|
+
item_test_1.title ='_title_'+Num.get_id();
|
|
470
470
|
|
|
471
471
|
item_test_list.push(item_test_1);
|
|
472
472
|
|
|
@@ -498,9 +498,9 @@ describe("connect", () => {
|
|
|
498
498
|
console.log('SET_CATEGORY_DROP_DOWN_LIST-START');
|
|
499
499
|
let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
|
|
500
500
|
let category_list = [];
|
|
501
|
-
category_list.push({data_type:DataType.BLANK,id:0,title:
|
|
502
|
-
category_list.push({data_type:DataType.BLANK,id:0,title:
|
|
503
|
-
category_list.push({data_type:DataType.BLANK,id:0,title:
|
|
501
|
+
category_list.push({data_type:DataType.BLANK,id:0,title:Num.get_id()});
|
|
502
|
+
category_list.push({data_type:DataType.BLANK,id:0,title:Num.get_id()});
|
|
503
|
+
category_list.push({data_type:DataType.BLANK,id:0,title:Num.get_id()});
|
|
504
504
|
Log.w('cat',Cat.set_category_drop_down_list(category_list));
|
|
505
505
|
//let cloud_url = CMS.get_new_query_item_by_item(item);
|
|
506
506
|
//Log.w('connect_url',cloud_url);
|
|
@@ -515,9 +515,9 @@ describe("connect", () => {
|
|
|
515
515
|
console.log('GET-NEW-QUERY-ITEM-BY-ITEM-START');
|
|
516
516
|
let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
|
|
517
517
|
let item = DataItem.get_new(DataType.BLANK,0);
|
|
518
|
-
item.parent_id =
|
|
518
|
+
item.parent_id = Num.get_id();
|
|
519
519
|
item.parent_data_type = DataType.BLANK;
|
|
520
|
-
item.top_id =
|
|
520
|
+
item.top_id = Num.get_id();
|
|
521
521
|
item.top_data_type = DataType.BLANK;
|
|
522
522
|
Log.w('item',item);
|
|
523
523
|
//let cloud_url = CMS.get_new_query_item_by_item(item);
|