biz9-logic 4.8.161 → 4.8.163
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 +30 -42
- package/package.json +2 -2
- package/test.js +11 -2
package/biz9_config
CHANGED
package/index.js
CHANGED
|
@@ -23,11 +23,7 @@ class Item_Logic {
|
|
|
23
23
|
data_type = data_type ? data_type : DataType.BLANK;
|
|
24
24
|
id = id ? id : 0;
|
|
25
25
|
option = Field_Logic.get_option(data_type,option?option:{});
|
|
26
|
-
let item = DataItem.
|
|
27
|
-
DataItem.get_new(data_type,0),
|
|
28
|
-
DataItem.get_new(data_type,0),
|
|
29
|
-
DataItem.get_new(data_type,0),
|
|
30
|
-
Field_Logic.get_test(title,option));
|
|
26
|
+
let item = DataItem.get_new(data_type,0,Field_Logic.get_test(title,option));
|
|
31
27
|
if(option.get_item){
|
|
32
28
|
item.items = Sub_Item_Logic.get_test_list(item,item,option);
|
|
33
29
|
item = Sub_Item_Logic.bind_parent_child_list(item,item.items);
|
|
@@ -133,11 +129,7 @@ class Template_Logic {
|
|
|
133
129
|
title = "Test " + Num.get_id();
|
|
134
130
|
}
|
|
135
131
|
option = Field_Logic.get_option(DataType.TEMPLATE,option?option:{});
|
|
136
|
-
let template = DataItem.
|
|
137
|
-
DataItem.get_new(DataType.TEMPLATE,0),
|
|
138
|
-
DataItem.get_new(DataType.TEMPLATE,0),
|
|
139
|
-
DataItem.get_new(DataType.TEMPLATE,0),
|
|
140
|
-
Field_Logic.get_test(title,option));
|
|
132
|
+
let template = DataItem.get_new(DataType.TEMPLATE,0,Field_Logic.get_test(title,option));
|
|
141
133
|
if(option.get_item){
|
|
142
134
|
let title_list = ['Header','Body','Footer','Navigation']
|
|
143
135
|
//template.items = Sub_Item_Logic.get_test_list(template,template,option);
|
|
@@ -160,11 +152,7 @@ class Team_Logic {
|
|
|
160
152
|
static get_test = (title,option) =>{
|
|
161
153
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
162
154
|
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
163
|
-
let team = DataItem.
|
|
164
|
-
DataItem.get_new(DataType.TEAM,0),
|
|
165
|
-
DataItem.get_new(DataType.TEAM,0),
|
|
166
|
-
DataItem.get_new(DataType.TEAM,0),
|
|
167
|
-
Field_Logic.get_test(title,option));
|
|
155
|
+
let team = DataItem.get_new(DataType.TEAM,0,Field_Logic.get_test(title,option));
|
|
168
156
|
team.members = [];
|
|
169
157
|
if(option.get_member){
|
|
170
158
|
for(let a=0;a<option.member_count+1;a++){
|
|
@@ -176,11 +164,7 @@ class Team_Logic {
|
|
|
176
164
|
static get_test_member = (team,title,option) =>{
|
|
177
165
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
178
166
|
option = Field_Logic.get_option(DataType.TEAM,option?option:{});
|
|
179
|
-
let team_member = DataItem.
|
|
180
|
-
DataItem.get_new(DataType.ITEM,0),
|
|
181
|
-
DataItem.get_new(DataType.TEAM,team.id),
|
|
182
|
-
DataItem.get_new(DataType.TEAM,team.id),
|
|
183
|
-
Field_Logic.get_test(title,option));
|
|
167
|
+
let team_member = DataItem.get_new(DataType.TEAM,team.id,Field_Logic.get_test(title,option));
|
|
184
168
|
team_member.first_name = "First Name "+ Num.get_id();
|
|
185
169
|
team_member.last_name = "Last Name "+ Num.get_id();
|
|
186
170
|
team_member.position = "Position "+ Num.get_id();
|
|
@@ -209,11 +193,7 @@ class Page_Logic {
|
|
|
209
193
|
static get_test = (title,option) =>{
|
|
210
194
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
211
195
|
option = Field_Logic.get_option(DataType.PAGE,option?option:{});
|
|
212
|
-
let page = DataItem.
|
|
213
|
-
DataItem.get_new(DataType.PAGE,0),
|
|
214
|
-
DataItem.get_new(DataType.PAGE,0),
|
|
215
|
-
DataItem.get_new(DataType.PAGE,0),
|
|
216
|
-
Field_Logic.get_test(title,option));
|
|
196
|
+
let page = DataItem.get_new(DataType.PAGE,0,Field_Logic.get_test(title,option));
|
|
217
197
|
if(option.get_section){
|
|
218
198
|
page.items = Sub_Item_Logic.get_test_section_list(page,page,option);
|
|
219
199
|
page = Sub_Item_Logic.bind_parent_child_list(page,page.items);
|
|
@@ -414,11 +394,7 @@ class Content_Logic {
|
|
|
414
394
|
static get_test = (title,option) =>{
|
|
415
395
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
416
396
|
option = Field_Logic.get_option(DataType.CONTENT,option?option:{});
|
|
417
|
-
let content = DataItem.
|
|
418
|
-
DataItem.get_new(DataType.CONTENT,0),
|
|
419
|
-
DataItem.get_new(DataType.CONTENT,0),
|
|
420
|
-
DataItem.get_new(DataType.CONTENT,0),
|
|
421
|
-
Field_Logic.get_test(title,option));
|
|
397
|
+
let content = DataItem.get_new(DataType.CONTENT,0,Field_Logic.get_test(title,option));
|
|
422
398
|
if(option.get_item){
|
|
423
399
|
content.items = Sub_Item_Logic.get_test_section_list(content,content,option);
|
|
424
400
|
if(option.get_item_bind){
|
|
@@ -456,7 +432,6 @@ class Blog_Post_Logic {
|
|
|
456
432
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
457
433
|
option = Field_Logic.get_option(DataType.BLOG_POST,option?option:{});
|
|
458
434
|
let blog_post = DataItem.get_new(DataType.BLOG_POST,0,Field_Logic.get_test(title,option));
|
|
459
|
-
|
|
460
435
|
if(!option.get_blank){
|
|
461
436
|
blog_post.author="First Name "+ Num.get_id();
|
|
462
437
|
blog_post.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
@@ -577,7 +552,6 @@ class Field_Logic {
|
|
|
577
552
|
title_url:Str.get_title_url(title),
|
|
578
553
|
sub_note:"Sub Note "+String(Num.get_id()),
|
|
579
554
|
note:Field_Logic.get_test_note(),
|
|
580
|
-
view_count:0,
|
|
581
555
|
id:0,
|
|
582
556
|
date_create:new moment().toISOString(),
|
|
583
557
|
date_save:new moment().toISOString()
|
|
@@ -811,6 +785,7 @@ class FieldType {
|
|
|
811
785
|
static KEY_GUEST="key_guest";
|
|
812
786
|
static KEY_ORDER="key_order";
|
|
813
787
|
static KEY_USER="key_user";
|
|
788
|
+
static KEY_DASHBOARD_APP="key_dashboard_app";
|
|
814
789
|
|
|
815
790
|
static ORDER_NUMBER="OR-";
|
|
816
791
|
static CART_NUMBER="CA-";
|
|
@@ -832,6 +807,10 @@ class FieldType {
|
|
|
832
807
|
static ORDER_PAYMENT_TYPE_CASH="Cash";
|
|
833
808
|
static ORDER_PAYMENT_TYPE_OTHER="Other";
|
|
834
809
|
static ORDER_PAYMENT_TYPE_TEST="Test";
|
|
810
|
+
|
|
811
|
+
static APP_TYPE_MOBILE="Mobile";
|
|
812
|
+
static APP_TYPE_WEBSITE="Website";
|
|
813
|
+
static APP_TYPE_LANDING="Landing";
|
|
835
814
|
}
|
|
836
815
|
class Social {
|
|
837
816
|
static FACEBOOK_URL="https://facebook.com/";
|
|
@@ -987,16 +966,14 @@ class DataType {
|
|
|
987
966
|
static TEAM='team_biz';
|
|
988
967
|
static USER='user_biz';
|
|
989
968
|
static VIDEO='video_biz';
|
|
969
|
+
|
|
970
|
+
static APP='app_biz';
|
|
990
971
|
}
|
|
991
972
|
class Blank_Logic {
|
|
992
973
|
static get_test = (title,option) =>{
|
|
993
974
|
[title,option] = Field_Logic.get_option_title(title,option);
|
|
994
975
|
option = Field_Logic.get_option(DataType.BLANK,option?option:{});
|
|
995
|
-
let blank = DataItem.
|
|
996
|
-
DataItem.get_new(DataType.BLANK,0),
|
|
997
|
-
DataItem.get_new(DataType.BLANK,0),
|
|
998
|
-
DataItem.get_new(DataType.BLANK,0),
|
|
999
|
-
Field_Logic.get_test(title,option));
|
|
976
|
+
let blank = DataItem.get_new(DataType.BLANK,0,Field_Logic.get_test(title,option));
|
|
1000
977
|
if(option.get_item){
|
|
1001
978
|
blank.items = Sub_Item_Logic.get_test_list(blank,blank,option);
|
|
1002
979
|
blank = Sub_Item_Logic.bind_parent_child_list(blank,blank.items);
|
|
@@ -1441,6 +1418,10 @@ class Gallery_Url {
|
|
|
1441
1418
|
};
|
|
1442
1419
|
}
|
|
1443
1420
|
class User_Url {
|
|
1421
|
+
static info = (biz9_config,user_id,params) => {
|
|
1422
|
+
let action_url="user/info/"+user_id;
|
|
1423
|
+
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
1424
|
+
};
|
|
1444
1425
|
static register = (biz9_config,params) => {
|
|
1445
1426
|
let action_url="user/register";
|
|
1446
1427
|
return get_cloud_url_main(biz9_config.APP_ID,biz9_config.URL,action_url,params);
|
|
@@ -1571,11 +1552,7 @@ class Category_Logic {
|
|
|
1571
1552
|
option = Field_Logic.get_option(DataType.CATEGORY,option);
|
|
1572
1553
|
let category_list = [];
|
|
1573
1554
|
for(let a=0;a<option.category_count;a++){
|
|
1574
|
-
let category = DataItem.
|
|
1575
|
-
DataItem.get_new(DataType.CATEGORY,0),
|
|
1576
|
-
DataItem.get_new(DataType.CATEGORY,0),
|
|
1577
|
-
DataItem.get_new(DataType.CATEGORY,0),
|
|
1578
|
-
Field_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1555
|
+
let category = DataItem.get_new(DataType.CATEGORY,0,Field_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1579
1556
|
category.type = type;
|
|
1580
1557
|
category_list.push(category);
|
|
1581
1558
|
}
|
|
@@ -2030,7 +2007,18 @@ class Sub_Item_Logic {
|
|
|
2030
2007
|
return item;
|
|
2031
2008
|
}
|
|
2032
2009
|
}
|
|
2010
|
+
class App_Logic {
|
|
2011
|
+
static get_new = (title,user_id,type,option) =>{
|
|
2012
|
+
option = Field_Logic.get_option(DataType.APP,option?option:{});
|
|
2013
|
+
let app = DataItem.get_new(DataType.APP,0);
|
|
2014
|
+
app.title = title;
|
|
2015
|
+
app.user_id = user_id;
|
|
2016
|
+
app.type = type;
|
|
2017
|
+
return app;
|
|
2018
|
+
}
|
|
2019
|
+
}
|
|
2033
2020
|
module.exports = {
|
|
2021
|
+
App_Logic,
|
|
2034
2022
|
Admin_Logic,
|
|
2035
2023
|
Business_Logic,
|
|
2036
2024
|
Blank_Logic,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "biz9-logic",
|
|
3
|
-
"version": "4.8.
|
|
3
|
+
"version": "4.8.163",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"async-series": "^0.0.1",
|
|
12
12
|
"biz9-scriptz": "^5.8.1",
|
|
13
|
-
"biz9-utility": "^3.8.
|
|
13
|
+
"biz9-utility": "^3.8.36",
|
|
14
14
|
"jest": "^29.7.0",
|
|
15
15
|
"moment": "^2.30.1"
|
|
16
16
|
},
|
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,Cart_Logic,Faq_Url} = 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,Faq_Url,App_Logic,FieldType} = require('./index');
|
|
4
4
|
const {Log,Num} = require('biz9-utility');
|
|
5
5
|
const {Scriptz}= require('biz9-scriptz');
|
|
6
6
|
|
|
@@ -47,6 +47,15 @@ describe("connect", () => {
|
|
|
47
47
|
},
|
|
48
48
|
|
|
49
49
|
function(call) {
|
|
50
|
+
|
|
51
|
+
/* --APP--START */
|
|
52
|
+
let title = "Food Truck " + Num.get_id();
|
|
53
|
+
let user_id = Num.get_id();
|
|
54
|
+
let type = FieldType.APP_TYPE_MOBILE;
|
|
55
|
+
let app = App_Logic.get_new(title,user_id,type);
|
|
56
|
+
Log.w('app',app);
|
|
57
|
+
/* --APP--ENDI */
|
|
58
|
+
|
|
50
59
|
//console.log('STORAGE-START');
|
|
51
60
|
//console.log(Storage.get({},'apples'));
|
|
52
61
|
//Log.w('storage-start',Storage.set(Num.get_id()));
|
|
@@ -345,7 +354,7 @@ describe("connect", () => {
|
|
|
345
354
|
|
|
346
355
|
|
|
347
356
|
/* --FAQ--START */
|
|
348
|
-
Log.w('faq',Faq_Url.get(biz9_config,'primary'));
|
|
357
|
+
//Log.w('faq',Faq_Url.get(biz9_config,'primary'));
|
|
349
358
|
//Log.w("FAQ",Faq_Logic.get_test());
|
|
350
359
|
//Log.w("FAQ List",Faq_Logic.get_test_list(Faq_Logic.get_test({question_count:3})));
|
|
351
360
|
//let faq = Faq_Logic.get_test('Cool Quest',{question_count:2});
|