biz9-logic 4.8.102 → 4.8.105
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 +85 -25
- package/main.js +12 -12
- package/package.json +1 -1
- package/test.js +18 -8
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -430,7 +430,7 @@ class Field_Logic {
|
|
|
430
430
|
static get_test = (title,option) =>{
|
|
431
431
|
option = !Obj.check_is_empty(option) ? option : {};
|
|
432
432
|
let sub_note = "Sub Note "+String(Number.get_id());
|
|
433
|
-
let note = "Note "+String(Number.get_id());
|
|
433
|
+
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.";
|
|
434
434
|
option.category_title = !Str.check_is_null(option.category_title) ? option.category_title : 'Category '+String(Number.get_id());
|
|
435
435
|
if(option.get_blank == true){
|
|
436
436
|
date_create:"";
|
|
@@ -875,6 +875,40 @@ class Review_Logic {
|
|
|
875
875
|
return item_list;
|
|
876
876
|
};
|
|
877
877
|
}
|
|
878
|
+
class Admin_Logic {
|
|
879
|
+
static get_new = (title,option) =>{
|
|
880
|
+
[title,option] = Field_Logic.get_option_title(title,option);
|
|
881
|
+
return DataItem.get_new_full_item(
|
|
882
|
+
DataItem.get_new(DataType.ADMIN,0),
|
|
883
|
+
DataItem.get_new(DataType.ADMIN,0),
|
|
884
|
+
DataItem.get_new(DataType.ADMIN,0),{
|
|
885
|
+
title:title,
|
|
886
|
+
email:"",
|
|
887
|
+
});
|
|
888
|
+
};
|
|
889
|
+
static get_test = (title,option) =>{
|
|
890
|
+
[title,option] = Field_Logic.get_option_title(title,option);
|
|
891
|
+
option = Field_Logic.get_option(DataType.ADMIN,option?option:{});
|
|
892
|
+
let item = DataItem.get_new(DataType.ADMIN,0);
|
|
893
|
+
let admin = DataItem.get_new_full_item(
|
|
894
|
+
DataItem.get_new(DataType.ADMIN,Number.get_id()),
|
|
895
|
+
DataItem.get_new(DataType.ADMIN,0),
|
|
896
|
+
DataItem.get_new(DataType.ADMIN,0),
|
|
897
|
+
Field_Logic.get_test(title,option));
|
|
898
|
+
admin.email="ceo@admin"+Number.get_id()+".com";
|
|
899
|
+
admin.password="1234567";
|
|
900
|
+
return admin;
|
|
901
|
+
};
|
|
902
|
+
static get_full_address(admin){
|
|
903
|
+
admin.address_1 = (admin.address_1) ? admin.address_1 : "";
|
|
904
|
+
admin.address_2 = (admin.address_2) ? admin.address_2 : "";
|
|
905
|
+
admin.city = (admin.city) ? admin.city : "";
|
|
906
|
+
admin.state = (admin.state) ? admin.state : "";
|
|
907
|
+
admin.zip = (admin.zip) ? admin.zip : "";
|
|
908
|
+
return admin.address_1 + " "+ admin.address_2 + " " + admin.city + " " + admin.state + " " + admin.zip;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
878
912
|
class Business_Logic {
|
|
879
913
|
static get_new = (title,option) =>{
|
|
880
914
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
@@ -908,7 +942,7 @@ class Business_Logic {
|
|
|
908
942
|
DataItem.get_new(DataType.BUSINESS,0),
|
|
909
943
|
DataItem.get_new(DataType.BUSINESS,0),
|
|
910
944
|
Field_Logic.get_test(title,option));
|
|
911
|
-
business.email="ceo@business.com";
|
|
945
|
+
business.email="ceo@business"+Number.get_id()+".com";
|
|
912
946
|
business.phone=Number.get_id(parseInt(777+100)) + "-" + Number.get_id(parseInt(777+100)) + "-"+Number.get_id(parseInt(7777+1000));
|
|
913
947
|
business.address_1=Number.get_id(99)+" Main St.";
|
|
914
948
|
business.address_2="PO "+Number.get_id(99);
|
|
@@ -976,6 +1010,10 @@ class Blog_Post_Url {
|
|
|
976
1010
|
let action_url="blog_post/category/"+category;
|
|
977
1011
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
978
1012
|
};
|
|
1013
|
+
static search = (biz9_config,params) => {
|
|
1014
|
+
let action_url="blog_post/search";
|
|
1015
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1016
|
+
};
|
|
979
1017
|
}
|
|
980
1018
|
class Custom_Field_Url {
|
|
981
1019
|
static get = (biz9_config,data_type,key,params) => {
|
|
@@ -997,6 +1035,28 @@ class FAQ_Url {
|
|
|
997
1035
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
998
1036
|
};
|
|
999
1037
|
}
|
|
1038
|
+
class Order_Url {
|
|
1039
|
+
static single-stripe-checkout = (biz9_config,data_type,key,params) => {
|
|
1040
|
+
let action_url="order/single-stripe-checkout/"+data_type+"/"+key;
|
|
1041
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1042
|
+
};
|
|
1043
|
+
static user-stripe-checkout = (biz9_config,user_id,params) => {
|
|
1044
|
+
let action_url="order/cart-stripe-checkout/"+user_id;
|
|
1045
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1046
|
+
};
|
|
1047
|
+
static checkout-success = (biz9_config,order_id,params) => {
|
|
1048
|
+
let action_url="order/cart-stripe-checkout/"+order_id;
|
|
1049
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1050
|
+
};
|
|
1051
|
+
static user-cart = (biz9_config,user_id,params) => {
|
|
1052
|
+
let action_url="order/user-cart/"+order_id;
|
|
1053
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1054
|
+
};
|
|
1055
|
+
static cart-update = (biz9_config,user_id,data_type,id,params) => {
|
|
1056
|
+
let action_url="order/cart-update/"+user_id+"/"+data_type+"/"+id;
|
|
1057
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1058
|
+
};
|
|
1059
|
+
}
|
|
1000
1060
|
class Product_Url {
|
|
1001
1061
|
static get = (biz9_config,key,params) => {
|
|
1002
1062
|
let action_url="product/get/"+key;
|
|
@@ -1010,12 +1070,8 @@ class Product_Url {
|
|
|
1010
1070
|
let action_url="product/category/"+category;
|
|
1011
1071
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1012
1072
|
};
|
|
1013
|
-
static
|
|
1014
|
-
let action_url="product/
|
|
1015
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1016
|
-
};
|
|
1017
|
-
static checkout = (biz9_config,params) => {
|
|
1018
|
-
let action_url="product/checkout";
|
|
1073
|
+
static search = (biz9_config,params) => {
|
|
1074
|
+
let action_url="product/search";
|
|
1019
1075
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1020
1076
|
};
|
|
1021
1077
|
}
|
|
@@ -1032,12 +1088,8 @@ class Event_Url {
|
|
|
1032
1088
|
let action_url="event/category/"+category;
|
|
1033
1089
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1034
1090
|
};
|
|
1035
|
-
static
|
|
1036
|
-
let action_url="event/
|
|
1037
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1038
|
-
};
|
|
1039
|
-
static checkout = (biz9_config,params) => {
|
|
1040
|
-
let action_url="event/checkout";
|
|
1091
|
+
static search = (biz9_config,params) => {
|
|
1092
|
+
let action_url="event/search";
|
|
1041
1093
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1042
1094
|
};
|
|
1043
1095
|
}
|
|
@@ -1054,12 +1106,8 @@ class Service_Url {
|
|
|
1054
1106
|
let action_url="service/category/"+category;
|
|
1055
1107
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1056
1108
|
};
|
|
1057
|
-
static
|
|
1058
|
-
let action_url="service/
|
|
1059
|
-
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1060
|
-
};
|
|
1061
|
-
static checkout = (biz9_config,params) => {
|
|
1062
|
-
let action_url="service/checkout";
|
|
1109
|
+
static search = (biz9_config,params) => {
|
|
1110
|
+
let action_url="service/search";
|
|
1063
1111
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1064
1112
|
};
|
|
1065
1113
|
}
|
|
@@ -1076,6 +1124,10 @@ class Content_Url {
|
|
|
1076
1124
|
let action_url="content/category/"+category;
|
|
1077
1125
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1078
1126
|
};
|
|
1127
|
+
static search = (biz9_config,params) => {
|
|
1128
|
+
let action_url="content/search";
|
|
1129
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1130
|
+
};
|
|
1079
1131
|
}
|
|
1080
1132
|
class Gallery_Url {
|
|
1081
1133
|
static get = (biz9_config,key,params) => {
|
|
@@ -1090,6 +1142,10 @@ class Gallery_Url {
|
|
|
1090
1142
|
let action_url="gallery/category/"+category;
|
|
1091
1143
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1092
1144
|
};
|
|
1145
|
+
static search = (biz9_config,params) => {
|
|
1146
|
+
let action_url="gallery/search";
|
|
1147
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1148
|
+
};
|
|
1093
1149
|
}
|
|
1094
1150
|
class Category_Url {
|
|
1095
1151
|
static get = (biz9_config,key,params) => {
|
|
@@ -1100,6 +1156,10 @@ class Category_Url {
|
|
|
1100
1156
|
let action_url="category/browse";
|
|
1101
1157
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1102
1158
|
};
|
|
1159
|
+
static search = (biz9_config,params) => {
|
|
1160
|
+
let action_url="category/search";
|
|
1161
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1162
|
+
};
|
|
1103
1163
|
}
|
|
1104
1164
|
class Page_Url {
|
|
1105
1165
|
static get = (biz9_config,title_url,params) => {
|
|
@@ -1515,21 +1575,17 @@ class User_Logic {
|
|
|
1515
1575
|
if(item.country == "United States"){
|
|
1516
1576
|
let state = "";
|
|
1517
1577
|
if(!Str.check_is_null(item.state)){
|
|
1518
|
-
console.log('aaaa');
|
|
1519
1578
|
country_state_city = item.state;
|
|
1520
1579
|
}
|
|
1521
1580
|
if(!Str.check_is_null(item.city)){
|
|
1522
1581
|
if(!Str.check_is_null(item.state)){
|
|
1523
|
-
console.log('bbbb');
|
|
1524
1582
|
country_state_city = item.city + ", " + item.state;
|
|
1525
1583
|
}else{
|
|
1526
|
-
console.log('cccccc');
|
|
1527
1584
|
country_state_city = item.city;
|
|
1528
1585
|
}
|
|
1529
1586
|
}
|
|
1530
1587
|
}
|
|
1531
1588
|
else{
|
|
1532
|
-
console.log('cccc');
|
|
1533
1589
|
if(!Str.check_is_null(item.city)){
|
|
1534
1590
|
country_state_city = item.city + ", " + item.country;
|
|
1535
1591
|
}else{
|
|
@@ -1537,7 +1593,6 @@ class User_Logic {
|
|
|
1537
1593
|
}
|
|
1538
1594
|
}
|
|
1539
1595
|
return country_state_city;
|
|
1540
|
-
|
|
1541
1596
|
}
|
|
1542
1597
|
static get_user(req){
|
|
1543
1598
|
if(!req || !req.session.user){
|
|
@@ -1564,6 +1619,9 @@ class User_Logic {
|
|
|
1564
1619
|
user.first_name="First Name "+ Number.get_id();
|
|
1565
1620
|
user.last_name="First Name "+ Number.get_id();
|
|
1566
1621
|
user.email="email"+ Number.get_id() + "@email.com";
|
|
1622
|
+
user.city="City"+ Number.get_id();
|
|
1623
|
+
user.state="State"+ Number.get_id();
|
|
1624
|
+
user.country="United States";
|
|
1567
1625
|
return user;
|
|
1568
1626
|
};
|
|
1569
1627
|
static get_test_list = (option) =>{
|
|
@@ -1632,6 +1690,7 @@ class Sub_Item_Logic {
|
|
|
1632
1690
|
}
|
|
1633
1691
|
}
|
|
1634
1692
|
module.exports = {
|
|
1693
|
+
Admin_Logic,
|
|
1635
1694
|
Business_Logic,
|
|
1636
1695
|
Blank_Logic,
|
|
1637
1696
|
Blank_Url,
|
|
@@ -1659,6 +1718,7 @@ module.exports = {
|
|
|
1659
1718
|
PageType,
|
|
1660
1719
|
Product_Logic,
|
|
1661
1720
|
Review_Logic,
|
|
1721
|
+
Review_Url,
|
|
1662
1722
|
Service_Logic,
|
|
1663
1723
|
Service_Url,
|
|
1664
1724
|
Social,
|
package/main.js
CHANGED
|
@@ -9,24 +9,24 @@ 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};
|
|
11
11
|
}
|
|
12
|
-
const get_new_item_main = (data_type,id,
|
|
12
|
+
const get_new_item_main = (data_type,id,option) => {
|
|
13
13
|
if(!id){
|
|
14
14
|
id='0';
|
|
15
15
|
}
|
|
16
16
|
let item = {data_type:data_type,id:id};
|
|
17
|
-
if(!
|
|
18
|
-
|
|
17
|
+
if(!option){
|
|
18
|
+
option = {};
|
|
19
19
|
}
|
|
20
|
-
if(
|
|
21
|
-
for (const key in
|
|
22
|
-
item[key] =
|
|
20
|
+
if(option){
|
|
21
|
+
for (const key in option) {
|
|
22
|
+
item[key] = option[key];
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
return item;
|
|
26
26
|
}
|
|
27
|
-
const get_new_full_item_main = (org_item,parent_item,top_item,
|
|
28
|
-
if(!
|
|
29
|
-
|
|
27
|
+
const get_new_full_item_main = (org_item,parent_item,top_item,option) => {
|
|
28
|
+
if(!option){
|
|
29
|
+
option = {};
|
|
30
30
|
}
|
|
31
31
|
let item = {
|
|
32
32
|
data_type:org_item.data_type,
|
|
@@ -36,9 +36,9 @@ const get_new_full_item_main = (org_item,parent_item,top_item,options) => {
|
|
|
36
36
|
top_id:top_item.id,
|
|
37
37
|
top_data_type:top_item.data_type
|
|
38
38
|
};
|
|
39
|
-
if(
|
|
40
|
-
for (const key in
|
|
41
|
-
item[key] =
|
|
39
|
+
if(option){
|
|
40
|
+
for (const key in option) {
|
|
41
|
+
item[key] = option[key];
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
return item;
|
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} = 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} = require('./index');
|
|
4
4
|
const {Log,Number} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -83,15 +83,26 @@ describe("connect", () => {
|
|
|
83
83
|
//Log.w('team_list',team_list);
|
|
84
84
|
/* --TEAM--END */
|
|
85
85
|
|
|
86
|
-
/* --
|
|
87
|
-
let
|
|
88
|
-
|
|
89
|
-
|
|
86
|
+
/* --FIELD-LOGIC--START */
|
|
87
|
+
//let field_logic = Field_Logic.get_test();
|
|
88
|
+
//Log.w('field_logic',field_logic);
|
|
89
|
+
//let country_state = User_Logic.get_user_country_state_city(user);
|
|
90
|
+
//Log.w('country_state',country_state);
|
|
90
91
|
//let user = User_Logic.get_test();
|
|
91
92
|
//let user_list = User_Logic.get_test_list();
|
|
92
93
|
//Log.w('user',user);
|
|
93
94
|
//Log.w('user_list',user_list);
|
|
95
|
+
/* --FIELD-LOGIC--END */
|
|
96
|
+
|
|
94
97
|
|
|
98
|
+
/* --USER--START */
|
|
99
|
+
//let user = {country:"United States",state:"",city:"Atlanta"};
|
|
100
|
+
//let country_state = User_Logic.get_user_country_state_city(user);
|
|
101
|
+
//Log.w('country_state',country_state);
|
|
102
|
+
//let user = User_Logic.get_test();
|
|
103
|
+
//let user_list = User_Logic.get_test_list();
|
|
104
|
+
//Log.w('user',user);
|
|
105
|
+
//Log.w('user_list',user_list);
|
|
95
106
|
/* --USER--END */
|
|
96
107
|
|
|
97
108
|
/* --SEARCH--START */
|
|
@@ -105,7 +116,6 @@ describe("connect", () => {
|
|
|
105
116
|
let search_filter_value_2 = 'value2';
|
|
106
117
|
*/
|
|
107
118
|
|
|
108
|
-
|
|
109
119
|
//let query = "?app_id=19&data_type="+data_type+"&sort_by={}&page_current=1&page_size=99&search_filter_key_1="+search_filter_key_1+"&search_filter_value_1="+search_filter_value_1+"&search_filter_key_2="+search_filter_key_2+"&search_filter_value_2="+search_filter_value_2;
|
|
110
120
|
|
|
111
121
|
//Log.w('query',query);
|
|
@@ -217,8 +227,8 @@ describe("connect", () => {
|
|
|
217
227
|
|
|
218
228
|
|
|
219
229
|
/* --ITEM-TEST--START */
|
|
220
|
-
|
|
221
|
-
|
|
230
|
+
let item = Item_Logic.get_test("Item_" +Number.get_id(),DataType.BLOG_POST,0);
|
|
231
|
+
Log.w('item',item);
|
|
222
232
|
/*
|
|
223
233
|
let item_list = Item_Logic.get_test_list(DataType.BLANK,{item_count:10,get_value:true});
|
|
224
234
|
Log.w('item_list',item_list);
|