biz9-logic 10.0.35 → 10.0.47
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 +2 -2
- package/index.js +384 -1030
- package/package.json +1 -1
- package/test.js +15 -8
- package/main.js +0 -74
- package/main_test.js +0 -107
package/index.js
CHANGED
|
@@ -5,8 +5,7 @@ License GNU General Public License v3.0
|
|
|
5
5
|
Description: BiZ9 Framework: Logic-JS
|
|
6
6
|
*/
|
|
7
7
|
const moment = require('moment');
|
|
8
|
-
const {
|
|
9
|
-
const { Log,Str,DateTime,Num,Obj } = require('biz9-utility');
|
|
8
|
+
const {Str,Num,Obj} = require('biz9-utility');
|
|
10
9
|
class Message {
|
|
11
10
|
static SUCCESS="Success";
|
|
12
11
|
static CONFIRM="Are You Sure?";
|
|
@@ -32,117 +31,6 @@ class Message {
|
|
|
32
31
|
static REVIEW_REMOVE_SUCCESS="Review Remove Success.";
|
|
33
32
|
static REVIEW_USER_LOGIN="Please Login To Add Review.";
|
|
34
33
|
}
|
|
35
|
-
class Item_Logic {
|
|
36
|
-
static get_new = (title,data_type,option)=>{
|
|
37
|
-
option = option ? option : {};
|
|
38
|
-
const item = Data_Logic.get_new(data_type,0,{title:title,title_url:Str.get_title_url(title),setting_visible:"1"});
|
|
39
|
-
return item;
|
|
40
|
-
};
|
|
41
|
-
static copy = (data_type,item)=>{
|
|
42
|
-
let copy_item = Data_Logic.get_new(data_type,0);
|
|
43
|
-
const keys = Object.keys(item);
|
|
44
|
-
keys.forEach(key => {
|
|
45
|
-
if(
|
|
46
|
-
key!=Type.FIELD_ID&&
|
|
47
|
-
key!=Type.FIELD_SOURCE&&
|
|
48
|
-
key!=Type.FIELD_TITLE&&
|
|
49
|
-
key!=Type.FIELD_TITLE_URL&&
|
|
50
|
-
key!=Type.FIELD_DATE_CREATE&&
|
|
51
|
-
key!=Type.FIELD_DATE_SAVE&&
|
|
52
|
-
key!=Type.TITLE_OBJ&&
|
|
53
|
-
key!=Type.TITLE_USER&&
|
|
54
|
-
key!=Type.TITLE_GROUP&&
|
|
55
|
-
key!=Type.TITLE_ITEM&&
|
|
56
|
-
!Obj.check_is_array(item[key])&&
|
|
57
|
-
Obj.check_is_value(item[key])
|
|
58
|
-
){
|
|
59
|
-
copy_item[key]=item[key];
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
return copy_item;
|
|
63
|
-
};
|
|
64
|
-
static bind_child_parent_obj = (child_obj,parent_obj)=>{
|
|
65
|
-
for(const prop in parent_obj) {
|
|
66
|
-
child_obj['parent_'+prop] = parent_obj[prop];
|
|
67
|
-
}
|
|
68
|
-
return child_obj;
|
|
69
|
-
};
|
|
70
|
-
static get_test = (title,data_type,id,option)=>{
|
|
71
|
-
data_type = data_type ? data_type : Type.DATA_BLANK;
|
|
72
|
-
id = id ? id : 0;
|
|
73
|
-
option = Field_Logic.get_option(data_type,option?option:{});
|
|
74
|
-
let item = Data_Logic.get_new(data_type,0,Field_Logic.get_test(title,option));
|
|
75
|
-
return item;
|
|
76
|
-
}
|
|
77
|
-
static get_test_items = (data_type,option) =>{
|
|
78
|
-
option = Field_Logic.get_option(data_type,option?option:{});
|
|
79
|
-
let items = [];
|
|
80
|
-
for(let a=0;a<parseInt(option.item_count)+1;a++){
|
|
81
|
-
items.push(Item_Logic.get_test("Item " +String(parseInt(a+1)),data_type,option));
|
|
82
|
-
}
|
|
83
|
-
return items;
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
class Title {
|
|
87
|
-
//page
|
|
88
|
-
static PAGE_ABOUT='About';
|
|
89
|
-
static PAGE_BLOG_POST='Blog Post';
|
|
90
|
-
static PAGE_BLOG_POST_HOME='Blog Post Home';
|
|
91
|
-
static PAGE_CONTACT='Contact';
|
|
92
|
-
static PAGE_EVENT='Event';
|
|
93
|
-
static PAGE_EVENT_HOME='Event Home';
|
|
94
|
-
static PAGE_FAQ='FAQs';
|
|
95
|
-
static PAGE_GALLERY='Gallery';
|
|
96
|
-
static PAGE_GALLERY_HOME='Gallery Home';
|
|
97
|
-
static PAGE_HOME='Home';
|
|
98
|
-
static PAGE_LOGIN='Login';
|
|
99
|
-
static PAGE_PRODUCT='Product';
|
|
100
|
-
static PAGE_PRODUCT_HOME='Product Home';
|
|
101
|
-
static PAGE_SERVICE='Service';
|
|
102
|
-
static PAGE_SERVICE_HOME='Service Home';
|
|
103
|
-
static PAGE_REGISTER='Register';
|
|
104
|
-
static PAGE_REVIEW_HOME='Review Home';
|
|
105
|
-
//order
|
|
106
|
-
static ORDER_NUMBER="OR-";
|
|
107
|
-
static ORDER_TRANSACTION_ID="TR-";
|
|
108
|
-
static ORDER_STATUS_CANCELLED="Cancelled";
|
|
109
|
-
static ORDER_STATUS_COMPLETE="Complete";
|
|
110
|
-
static ORDER_STATUS_NEW="New";
|
|
111
|
-
static ORDER_STATUS_OPEN="Open";
|
|
112
|
-
static ORDER_STATUS_ON_HOLD="On Hold";
|
|
113
|
-
static ORDER_STATUS_RETURNED="Returned";
|
|
114
|
-
static ORDER_PAYMENT_PLAN_NEW="New";
|
|
115
|
-
static ORDER_PAYMENT_PLAN_1="1 Payment";
|
|
116
|
-
static ORDER_PAYMENT_PLAN_2="2 Payments";
|
|
117
|
-
static ORDER_PAYMENT_PLAN_3="3 Payments";
|
|
118
|
-
static ORDER_PAYMENT_PLAN_4="4 Payments";
|
|
119
|
-
static ORDER_PAYMENT_METHOD_STRIPE="Stripe";
|
|
120
|
-
static ORDER_PAYMENT_METHOD_CASH="Cash";
|
|
121
|
-
static ORDER_PAYMENT_METHOD_OTHER="Other";
|
|
122
|
-
static ORDER_PAYMENT_METHOD_TEST="Test";
|
|
123
|
-
//cart
|
|
124
|
-
static CART_NUMBER="CA-";
|
|
125
|
-
//role
|
|
126
|
-
static USER_ROLE_SUPER_ADMIN='Super Admin';
|
|
127
|
-
static USER_ROLE_ADMIN='Admin';
|
|
128
|
-
static USER_ROLE_MANAGER='Manager';
|
|
129
|
-
static USER_ROLE_USER='User';
|
|
130
|
-
static USER_ROLE_GUEST='Guest';
|
|
131
|
-
//app
|
|
132
|
-
static APP_MOBILE="Mobile";
|
|
133
|
-
static APP_WEBSITE="Website";
|
|
134
|
-
static APP_LANDING="Landing";
|
|
135
|
-
//social
|
|
136
|
-
static SOCIAL_URL_FACEBOOK="https://facebook.com/";
|
|
137
|
-
static SOCIAL_URL_TWITTER="https://twitter.com/";
|
|
138
|
-
static SOCIAL_URL_INSTAGRAM="https://instagram.com/";
|
|
139
|
-
static SOCIAL_URL_YOUTUBE="https://youtube.com/";
|
|
140
|
-
static SOCIAL_URL_LINKEDIN="https://linkedin.com/";
|
|
141
|
-
//str
|
|
142
|
-
static CATEGORY='Category';
|
|
143
|
-
static DESCRIPTION='Description';
|
|
144
|
-
static TYPE='Type';
|
|
145
|
-
}
|
|
146
34
|
class Type {
|
|
147
35
|
//app_status
|
|
148
36
|
static APP_ENV_TEST='test';
|
|
@@ -152,7 +40,6 @@ class Type {
|
|
|
152
40
|
static APP_LINK_TYPE_GOOGLE_PLAY='google_play';
|
|
153
41
|
static APP_LINK_TYPE_APPLE_STORE='apple_store';
|
|
154
42
|
static APP_LINK_TYPE_CMS='cms';
|
|
155
|
-
|
|
156
43
|
//data
|
|
157
44
|
static DATA_APP='app_biz';
|
|
158
45
|
static DATA_BLANK='blank_biz';
|
|
@@ -186,7 +73,6 @@ class Type {
|
|
|
186
73
|
static DATA_TYPE='type_biz';
|
|
187
74
|
static DATA_USER='user_biz';
|
|
188
75
|
static DATA_VIDEO='video_biz';
|
|
189
|
-
|
|
190
76
|
//field
|
|
191
77
|
static FIELD_AUTHOR = 'author';
|
|
192
78
|
static FIELD_CATEGORY = 'category';
|
|
@@ -235,26 +121,93 @@ class Type {
|
|
|
235
121
|
static FIELD_USER_STATE = 'state';
|
|
236
122
|
static FIELD_VALUE = 'value';
|
|
237
123
|
static FIELD_WEBSITE = 'website';
|
|
124
|
+
static FIELD_RESULT_OK = 'resultOK';
|
|
125
|
+
static FIELD_RESULT_OK_DELETE = 'delete_resultOK';
|
|
126
|
+
static FIELD_RESULT_OK_DELETE_CACHE = 'delete_cache_resultOK';
|
|
127
|
+
static FIELD_RESULT_OK_DELETE_DATABASE = 'delete_database_resultOK';
|
|
128
|
+
static FIELD_RESULT_OK_EMAIL = 'email_resultOK';
|
|
129
|
+
static FIELD_RESULT_OK_USER_NAME = 'user_name_resultOK';
|
|
130
|
+
static FIELD_RESULT_OK_USER = 'user_resultOK';
|
|
131
|
+
static FIELD_RESULT_OK_UNIQUE = 'unique_resultOK';
|
|
132
|
+
static FIELD_RESULT_OK_FAVORITE_ADD = 'favorite_resultOK';
|
|
133
|
+
static FIELD_RESULT_OK_GROUP_DELETE = 'group_delete_resultOK';
|
|
134
|
+
static FIELD_RESULT_OK_IMAGE_DELETE = 'image_delete_resultOK';
|
|
238
135
|
//title
|
|
239
|
-
static
|
|
240
|
-
static
|
|
241
|
-
static
|
|
242
|
-
static
|
|
243
|
-
static
|
|
244
|
-
static
|
|
245
|
-
static
|
|
246
|
-
static
|
|
247
|
-
static
|
|
248
|
-
static
|
|
249
|
-
|
|
250
|
-
static
|
|
251
|
-
static
|
|
252
|
-
static
|
|
253
|
-
static
|
|
254
|
-
static
|
|
255
|
-
static
|
|
256
|
-
static
|
|
257
|
-
|
|
136
|
+
static TITLE_DATA_BLOG_POST = 'Blog Post';
|
|
137
|
+
static TITLE_DATA_CATEGORY = 'Category';
|
|
138
|
+
static TITLE_DATA_CONTENT = 'Content';
|
|
139
|
+
static TITLE_DATA_EVENT = 'Event';
|
|
140
|
+
static TITLE_DATA_FAQ = 'Faq';
|
|
141
|
+
static TITLE_DATA_GALLERY = 'Gallery';
|
|
142
|
+
static TITLE_DATA_USER = 'User';
|
|
143
|
+
static TITLE_DATA_PAGE = 'Page';
|
|
144
|
+
static TITLE_DATA_PRODUCT = 'Product';
|
|
145
|
+
static TITLE_DATA_SERVICE = 'Service';
|
|
146
|
+
//
|
|
147
|
+
static TITLE_APP_ENV_TEST='Test';
|
|
148
|
+
static TITLE_APP_ENV_STAGE='Stage';
|
|
149
|
+
static TITLE_APP_ENV_PROD='Production';
|
|
150
|
+
static TITLE_APP_LINK_TYPE_WEBSITE='Website';
|
|
151
|
+
static TITLE_APP_LINK_TYPE_GOOGLE_PLAY='Google Play';
|
|
152
|
+
static TITLE_APP_LINK_TYPE_APPLE_STORE='Apple Store';
|
|
153
|
+
static TITLE_APP_LINK_TYPE_CMS='CMS';
|
|
154
|
+
//
|
|
155
|
+
static TITLE_BLANK='Blank';
|
|
156
|
+
static TITLE_CART_ITEMS='Cart Items';
|
|
157
|
+
static TITLE_CART_SUB_ITEMS='Cart Sub Items';
|
|
158
|
+
static TITLE_CART_ITEMS='Cart Items';
|
|
159
|
+
static TITLE_CART_SUB_ITEMS='Cart Sub Items';
|
|
160
|
+
static TITLE_COUNT='Count';
|
|
161
|
+
static TITLE_GROUP='Group';
|
|
162
|
+
static TITLE_N_A='N/A';
|
|
163
|
+
static TITLE_IMAGES='Images';
|
|
164
|
+
static TITLE_ITEMS='Items';
|
|
165
|
+
static TITLE_ONE='One';
|
|
166
|
+
static TITLE_ORDER_ITEMS='Order Items';
|
|
167
|
+
static TITLE_ORDER_SUB_ITEMS='order Sub Items';
|
|
168
|
+
static TITLE_PARENT_ITEM='Parent Item';
|
|
169
|
+
static TITLE_USER='User';
|
|
170
|
+
static TITLE_SORT_BY_ASC='ASC';
|
|
171
|
+
static TITLE_SORT_BY_DESC='DESC';
|
|
172
|
+
static TITLE_STAT_ITEMS='Stat Items';
|
|
173
|
+
static TITLE_STAT_SUB_ITEMS='Stat Sub Items';
|
|
174
|
+
static TITLE_ORDER_STATUS_NEW="New";
|
|
175
|
+
static TITLE_ORDER_STATUS_OPEN="Open";
|
|
176
|
+
static TITLE_ORDER_STATUS_COMPLETE="Complete";
|
|
177
|
+
static TITLE_ORDER_STATUS_RETURNED="Returned";
|
|
178
|
+
static TITLE_ORDER_STATUS_ON_HOLD="On Hold";
|
|
179
|
+
static TITLE_ORDER_STATUS_CANCELLED="Cancelled";
|
|
180
|
+
static TITLE_USER_ROLE_SUPER_ADMIN='Super Admin';
|
|
181
|
+
static TITLE_USER_ROLE_ADMIN='Admin';
|
|
182
|
+
static TITLE_USER_ROLE_MANAGER='Manager';
|
|
183
|
+
static TITLE_USER_ROLE_USER='User';
|
|
184
|
+
static TITLE_USER_ROLE_GUEST='Guest';
|
|
185
|
+
static TITLE_PAGE_ABOUT='About';
|
|
186
|
+
static TITLE_PAGE_CONTACT='Contact';
|
|
187
|
+
static TITLE_PAGE_HOME='Home';
|
|
188
|
+
static TITLE_PAGE_FAQ='Faq';
|
|
189
|
+
static TITLE_PAGE_BLOG_POST='Blog Post';
|
|
190
|
+
static TITLE_PAGE_BLOG_POST_HOME='Blog Post Home';
|
|
191
|
+
static TITLE_PAGE_BLOG_POST_SEARCH='Blog Post Search';
|
|
192
|
+
static TITLE_PAGE_EVENT='Event';
|
|
193
|
+
static TITLE_PAGE_EVENT_HOME='Event Home';
|
|
194
|
+
static TITLE_PAGE_EVENT_SEARCH='Event Search';
|
|
195
|
+
static TITLE_PAGE_GALLERY='Gallery';
|
|
196
|
+
static TITLE_PAGE_GALLERY_HOME='Gallery Home';
|
|
197
|
+
static TITLE_PAGE_GALLERY_SEARCH='Gallery Search';
|
|
198
|
+
static TITLE_PAGE_LOGIN='Login';
|
|
199
|
+
static TITLE_PAGE_PRODUCT='Product';
|
|
200
|
+
static TITLE_PAGE_PRODUCT_HOME='Product Home';
|
|
201
|
+
static TITLE_PAGE_PRODUCT_SEARCH='Product Search';
|
|
202
|
+
static TITLE_PAGE_REGISTER='Register';
|
|
203
|
+
static TITLE_PAGE_REVIEW_HOME='Review Home';
|
|
204
|
+
static TITLE_PAGE_SERVICE='Service';
|
|
205
|
+
static TITLE_PAGE_SERVICE_HOME='Service Home';
|
|
206
|
+
static TITLE_PAGE_SERVICE_SEARCH='Service Search';
|
|
207
|
+
static TITLE_SOURCE_DATABASE='Database';
|
|
208
|
+
static TITLE_SOURCE_CACHE='Cache';
|
|
209
|
+
static TITLE_SOURCE_NOT_FOUND='Not-Found';
|
|
210
|
+
|
|
258
211
|
//page
|
|
259
212
|
static PAGE_ABOUT='about';
|
|
260
213
|
static PAGE_CONTACT='contact';
|
|
@@ -339,215 +292,95 @@ class Type {
|
|
|
339
292
|
static ORDER_STATUS_RETURNED="returned";
|
|
340
293
|
static ORDER_STATUS_ON_HOLD="on_hold";
|
|
341
294
|
static ORDER_STATUS_CANCELLED="cancelled";
|
|
295
|
+
//app
|
|
296
|
+
static APP_MOBILE="Mobile";
|
|
297
|
+
static APP_WEBSITE="Website";
|
|
298
|
+
static APP_LANDING="Landing";
|
|
299
|
+
//social
|
|
300
|
+
static SOCIAL_URL_FACEBOOK="https://facebook.com/";
|
|
301
|
+
static SOCIAL_URL_TWITTER="https://twitter.com/";
|
|
302
|
+
static SOCIAL_URL_INSTAGRAM="https://instagram.com/";
|
|
303
|
+
static SOCIAL_URL_YOUTUBE="https://youtube.com/";
|
|
304
|
+
static SOCIAL_URL_LINKEDIN="https://linkedin.com/";
|
|
305
|
+
//str
|
|
306
|
+
static CATEGORY='Category';
|
|
307
|
+
static DESCRIPTION='Description';
|
|
308
|
+
static TYPE='Type';
|
|
342
309
|
static get_order_statuses(){
|
|
343
310
|
return [
|
|
344
|
-
{value:Type.ORDER_STATUS_NEW,label:
|
|
345
|
-
{value:Type.ORDER_STATUS_OPEN,label:
|
|
346
|
-
{value:Type.ORDER_STATUS_COMPLETE,label:
|
|
347
|
-
{value:Type.ORDER_STATUS_RETURNED,label:
|
|
348
|
-
{value:Type.ORDER_STATUS_ON_HOLD,label:
|
|
349
|
-
{value:Type.ORDER_STATUS_CANCELLED,label:
|
|
311
|
+
{value:Type.ORDER_STATUS_NEW,label:Type.TITLE_ORDER_STATUS_NEW,title:Type.TITLE_ORDER_STATUS_NEW},
|
|
312
|
+
{value:Type.ORDER_STATUS_OPEN,label:Type.TITLE_ORDER_STATUS_OPEN,title:Type.TITLE_ORDER_STATUS_OPEN},
|
|
313
|
+
{value:Type.ORDER_STATUS_COMPLETE,label:Type.TITLE_ORDER_STATUS_COMPLETE,title:Type.TITLE_ORDER_STATUS_COMPLETE},
|
|
314
|
+
{value:Type.ORDER_STATUS_RETURNED,label:Type.TITLE_ORDER_STATUS_RETURNED,title:Type.TITLE_ORDER_STATUS_RETURNED},
|
|
315
|
+
{value:Type.ORDER_STATUS_ON_HOLD,label:Type.TITLE_ORDER_STATUS_ON_HOLD,title:Type.TITLE_ORDER_STATUS_ON_HOLD},
|
|
316
|
+
{value:Type.ORDER_STATUS_CANCELLED,label:Type.TITLE_ORDER_STATUS_CANCELLED,title:Type.TITLE_ORDER_STATUS_CANCELLED},
|
|
350
317
|
];
|
|
351
318
|
};
|
|
352
319
|
static get_user_roles(){
|
|
353
320
|
return [
|
|
354
|
-
{value:Type.USER_ROLE_ADMIN,label:
|
|
355
|
-
{value:Type.USER_ROLE_MANAGER,label:
|
|
356
|
-
{value:Type.USER_ROLE_USER,label:
|
|
357
|
-
{value:Type.USER_ROLE_GUEST,label:
|
|
321
|
+
{value:Type.USER_ROLE_ADMIN,label:Type.TITLE_USER_ROLE_ADMIN,title:Type.TITLE_USER_ROLE_ADMIN},
|
|
322
|
+
{value:Type.USER_ROLE_MANAGER,label:Type.TITLE_USER_ROLE_MANAGER,title:Type.TITLE_USER_ROLE_MANAGER},
|
|
323
|
+
{value:Type.USER_ROLE_USER,label:Type.TITLE_USER_ROLE_USER,title:Type.TITLE_USER_ROLE_USER},
|
|
324
|
+
{value:Type.USER_ROLE_GUEST,label:Type.TITLE_USER_ROLE_GUEST,title:Type.TITLE_USER_ROLE_GUEST},
|
|
358
325
|
];
|
|
359
326
|
};
|
|
360
327
|
static get_pages(){
|
|
361
328
|
return [
|
|
362
|
-
{value:Type.PAGE_ABOUT,label:
|
|
363
|
-
{value:Type.PAGE_BLOG_POST,label:
|
|
364
|
-
{value:Type.PAGE_BLOG_POST_HOME,label:
|
|
365
|
-
{value:Type.PAGE_CONTACT,
|
|
366
|
-
{value:Type.PAGE_EVENT,label:
|
|
367
|
-
{value:Type.PAGE_EVENT_HOME,label:
|
|
368
|
-
{value:Type.PAGE_FAQ,label:
|
|
369
|
-
{value:Type.PAGE_HOME,label:
|
|
370
|
-
{value:Type.PAGE_GALLERY,label:
|
|
371
|
-
{value:Type.PAGE_GALLERY_HOME,label:
|
|
372
|
-
{value:Type.PAGE_LOGIN,label:
|
|
373
|
-
{value:Type.PAGE_PRODUCT,label:
|
|
374
|
-
{value:Type.PAGE_PRODUCT_HOME,label:
|
|
375
|
-
{value:Type.PAGE_REGISTER,label:
|
|
376
|
-
{value:Type.PAGE_REVIEW_HOME,label:
|
|
377
|
-
{value:Type.PAGE_SERVICE,label:
|
|
378
|
-
{value:Type.PAGE_SERVICE_HOME,label:
|
|
329
|
+
{value:Type.PAGE_ABOUT,title:Type.TITLE_PAGE_ABOUT,label:Type.TITLE_PAGE_ABOUT,url:Url.PAGE_ABOUT},
|
|
330
|
+
{value:Type.PAGE_BLOG_POST,title:Type.TITLE_PAGE_BLOG_POST,label:Type.TITLE_PAGE_BLOG_POST,url:Url.PAGE_BLOG_POST},
|
|
331
|
+
{value:Type.PAGE_BLOG_POST_HOME,title:Type.TITLE_PAGE_BLOG_POST_HOME,label:Type.TITLE_PAGE_BLOG_POST_HOME,url:Url.PAGE_BLOG_POST_HOME},
|
|
332
|
+
{value:Type.PAGE_CONTACT,title:Type.TITLE_PAGE_CONTACT,label:Type.TITLE_PAGE_CONTACT,url:Url.PAGE_CONTACT},
|
|
333
|
+
{value:Type.PAGE_EVENT,title:Type.TITLE_PAGE_EVENT,label:Type.TITLE_PAGE_EVENT,url:Url.PAGE_EVENT},
|
|
334
|
+
{value:Type.PAGE_EVENT_HOME,title:Type.TITLE_PAGE_EVENT_HOME,label:Type.TITLE_PAGE_EVENT_HOME,url:Url.PAGE_EVENT_HOME},
|
|
335
|
+
{value:Type.PAGE_FAQ,title:Type.TITLE_PAGE_FAQ,label:Type.TITLE_PAGE_FAQ,url:Url.PAGE_FAQ},
|
|
336
|
+
{value:Type.PAGE_HOME,title:Type.TITLE_PAGE_HOME,label:Type.TITLE_PAGE_HOME,url:Url.PAGE_HOME},
|
|
337
|
+
{value:Type.PAGE_GALLERY,title:Type.TITLE_PAGE_GALLERY,label:Type.TITLE_PAGE_GALLERY,url:Url.PAGE_GALLERY},
|
|
338
|
+
{value:Type.PAGE_GALLERY_HOME,title:Type.TITLE_PAGE_GALLERY_HOME,label:Type.TITLE_PAGE_GALLERY_HOME,url:Url.PAGE_GALLERY_HOME},
|
|
339
|
+
{value:Type.PAGE_LOGIN,title:Type.TITLE_PAGE_LOGIN,label:Type.TITLE_PAGE_LOGIN,url:Url.PAGE_LOGIN},
|
|
340
|
+
{value:Type.PAGE_PRODUCT,title:Type.TITLE_PAGE_PRODUCT,label:Type.TITLE_PAGE_PRODUCT,url:Url.PAGE_PRODUCT},
|
|
341
|
+
{value:Type.PAGE_PRODUCT_HOME,title:Type.TITLE_PAGE_PRODUCT_HOME,label:Type.TITLE_PAGE_PRODUCT_HOME,url:Url.PAGE_PRODUCT_HOME},
|
|
342
|
+
{value:Type.PAGE_REGISTER,title:Type.TITLE_PAGE_REGISTER,label:Type.TITLE_PAGE_REGISTER,url:Url.REGISTER},
|
|
343
|
+
{value:Type.PAGE_REVIEW_HOME,title:Type.TITLE_PAGE_REVIEW_HOME,label:Type.TITLE_PAGE_REVIEW_HOME,url:Url.PAGE_REVIEW_HOME},
|
|
344
|
+
{value:Type.PAGE_SERVICE,title:Type.TITLE_PAGE_SERVICE,label:Type.TITLE_PAGE_SERVICE,url:Url.PAGE_SERVICE},
|
|
345
|
+
{value:Type.PAGE_SERVICE_HOME,title:Type.TITLE_PAGE_SERVICE_HOME,label:Type.TITLE_PAGE_SERVICE_HOME,url:Url.PAGE_SERVICE_HOME},
|
|
379
346
|
];
|
|
380
347
|
};
|
|
381
348
|
static get_stat_types = () =>{
|
|
382
349
|
return [
|
|
383
|
-
{title:Type.
|
|
384
|
-
{title:Type.
|
|
385
|
-
{title:Type.
|
|
386
|
-
{title:Type.
|
|
387
|
-
{title:Type.
|
|
388
|
-
{title:Type.
|
|
389
|
-
{title:Type.
|
|
390
|
-
{title:Type.
|
|
391
|
-
{title:Type.
|
|
392
|
-
{title:Type.
|
|
393
|
-
{title:Type.
|
|
394
|
-
{title:Type.
|
|
395
|
-
{title:Type.
|
|
350
|
+
{title:Type.get_data_type_by_type(Type.STAT_CART),type:Type.STAT_CART,label:Type.get_data_type_by_type(Type.STAT_CART),value:Type.STAT_CART},
|
|
351
|
+
{title:Type.get_data_type_by_type(Type.STAT_CART_ITEM),type:Type.STAT_CART_ITEM,label:Type.get_data_type_by_type(Type.STAT_CART_ITEM),value:Type.STAT_CART_ITEM},
|
|
352
|
+
{title:Type.get_data_type_by_type(Type.STAT_CART_SUB_ITEM),type:Type.STAT_CART_SUB_ITEM,label:Type.get_data_type_by_type(Type.STAT_CART_SUB_ITEM),value:Type.STAT_CART_SUB_ITEM},
|
|
353
|
+
{title:Type.get_data_type_by_type(Type.STAT_FAVORITE),type:Type.STAT_FAVORITE,label:Type.get_data_type_by_type(Type.STAT_FAVORITE),value:Type.STAT_FAVORITE},
|
|
354
|
+
{title:Type.get_data_type_by_type(Type.STAT_LIKE),type:Type.STAT_LIKE,label:Type.get_data_type_by_type(Type.STAT_LIKE),value:Type.STAT_LIKE},
|
|
355
|
+
{title:Type.get_data_type_by_type(Type.STAT_LOGIN),type:Type.STAT_LOGIN,label:Type.get_data_type_by_type(Type.STAT_LOGIN),value:Type.STAT_LOGIN},
|
|
356
|
+
{title:Type.get_data_type_by_type(Type.STAT_ORDER),type:Type.STAT_ORDER,label:Type.get_data_type_by_type(Type.STAT_ORDER),value:Type.STAT_ORDER},
|
|
357
|
+
{title:Type.get_data_type_by_type(Type.STAT_ORDER_ITEM),type:Type.STAT_ORDER_ITEM,label:Type.get_data_type_by_type(Type.STAT_ORDER_ITEM),value:Type.STAT_ORDER_ITEM},
|
|
358
|
+
{title:Type.get_data_type_by_type(Type.STAT_ORDER_SUB_ITEM),type:Type.STAT_ORDER_SUB_ITEM,label:Type.get_data_type_by_type(Type.STAT_ORDER_SUB_ITEM),value:Type.STAT_ORDER_ITEM},
|
|
359
|
+
{title:Type.get_data_type_by_type(Type.STAT_ORDER_PAYMENT),type:Type.STAT_ORDER_PAYMENT,label:Type.get_data_type_by_type(Type.STAT_ORDER_PAYMENT),value:Type.STAT_ORDER_PAYMENT},
|
|
360
|
+
{title:Type.get_data_type_by_type(Type.STAT_REGISTER),type:Type.STAT_REGISTER,label:Type.get_data_type_by_type(Type.STAT_REGISTER),value:Type.STAT_REGISTER},
|
|
361
|
+
{title:Type.get_data_type_by_type(Type.STAT_REVIEW),type:Type.STAT_REVIEW,label:Type.get_data_type_by_type(Type.STAT_REVIEW),value:Type.STAT_REVIEW},
|
|
362
|
+
{title:Type.get_data_type_by_type(Type.STAT_VIEW),type:Type.STAT_VIEW,label:Type.get_data_type_by_type(Type.STAT_VIEW),value:Type.STAT_VIEW},
|
|
396
363
|
]
|
|
397
364
|
};
|
|
398
365
|
static get_data_types = () =>{
|
|
399
366
|
return [
|
|
400
|
-
{title:Type.
|
|
401
|
-
{title:Type.
|
|
402
|
-
{title:Type.
|
|
403
|
-
{title:Type.
|
|
404
|
-
{title:Type.
|
|
405
|
-
{title:Type.
|
|
406
|
-
{title:Type.
|
|
407
|
-
{title:Type.
|
|
408
|
-
{title:Type.
|
|
409
|
-
{title:Type.
|
|
410
|
-
]
|
|
411
|
-
};
|
|
412
|
-
static get_types = () =>{
|
|
413
|
-
return [
|
|
414
|
-
{title:Type.get_title(Type.DATA_BLOG_POST),type:Type.DATA_BLOG_POST,label:Type.get_title(Type.DATA_BLOG_POST),value:Type.DATA_BLOG_POST},
|
|
415
|
-
{title:Type.get_title(Type.DATA_CATEGORY),type:Type.DATA_CATEGORY,label:Type.get_title(Type.DATA_CATEGORY),value:Type.DATA_CATEGORY},
|
|
416
|
-
{title:Type.get_title(Type.DATA_CONTENT),type:Type.DATA_CONTENT,label:Type.get_title(Type.DATA_CONTENT),value:Type.DATA_CONTENT},
|
|
417
|
-
{title:Type.get_title(Type.DATA_EVENT),type:Type.DATA_EVENT,label:Type.get_title(Type.DATA_EVENT),value:Type.DATA_EVENT},
|
|
418
|
-
{title:Type.get_title(Type.DATA_GALLERY),type:Type.DATA_GALLERY,label:Type.get_title(Type.DATA_GALLERY),value:Type.DATA_GALLERY},
|
|
419
|
-
{title:Type.get_title(Type.DATA_USER),type:Type.DATA_USER,label:Type.get_title(Type.DATA_USER),value:Type.DATA_USER},
|
|
420
|
-
{title:Type.get_title(Type.DATA_PAGE),type:Type.DATA_PAGE,label:Type.get_title(Type.DATA_PAGE),value:Type.DATA_PAGE},
|
|
421
|
-
{title:Type.get_title(Type.DATA_PRODUCT),type:Type.DATA_PRODUCT,label:Type.get_title(Type.DATA_PRODUCT),value:Type.DATA_PRODUCT},
|
|
422
|
-
{title:Type.get_title(Type.DATA_SERVICE),type:Type.DATA_SERVICE,label:Type.get_title(Type.DATA_SERVICE),value:Type.DATA_SERVICE},
|
|
423
|
-
{title:Type.get_title(Type.DATA_TYPE),type:Type.DATA_TYPE,label:Type.get_title(Type.DATA_TYPE),value:Type.DATA_TYPE}
|
|
424
|
-
]
|
|
425
|
-
};
|
|
426
|
-
static get_app_environments = () =>{
|
|
427
|
-
return [
|
|
428
|
-
{title:Type.get_title(Type.APP_ENV_TEST),type:Type.APP_ENV_TEST,label:Type.get_title(Type.APP_ENV_TEST),value:Type.APP_ENV_TEST},
|
|
429
|
-
{title:Type.get_title(Type.APP_ENV_STAGE),type:Type.APP_ENV_STAGE,label:Type.get_title(Type.APP_ENV_STAGE),value:Type.APP_ENV_STAGE},
|
|
430
|
-
{title:Type.get_title(Type.APP_ENV_PROD),type:Type.APP_ENV_PROD,label:Type.get_title(Type.APP_ENV_PROD),value:Type.APP_ENV_PROD},
|
|
367
|
+
{title:Type.TITLE_DATA_BLOG_POST,label:Type.TITLE_DATA_BLOG_POST,type:Type.DATA_BLOG_POST,value:Type.DATA_BLOG_POST},
|
|
368
|
+
{title:Type.TITLE_DATA_CATEGORY,label:Type.TITLE_DATA_CATEGORY,type:Type.DATA_CATEGORY,value:Type.DATA_CATEGORY},
|
|
369
|
+
{title:Type.TITLE_DATA_CONTENT,label:Type.TITLE_DATA_CONTENT,type:Type.DATA_CONTENT,value:Type.DATA_CONTENT},
|
|
370
|
+
{title:Type.TITLE_DATA_EVENT,type:Type.DATA_EVENT,value:Type.DATA_EVENT},
|
|
371
|
+
{title:Type.TITLE_DATA_FAQ,label:Type.TITLE_DATA_EVENT,type:Type.DATA_FAQ,value:Type.DATA_FAQ},
|
|
372
|
+
{title:Type.TITLE_DATA_GALLERY,label:Type.TITLE_DATA_GALLERY,type:Type.DATA_GALLERY,label:Type.get_data_type_by_type(Type.DATA_GALLERY),value:Type.DATA_GALLERY},
|
|
373
|
+
{title:Type.TITLE_DATA_USER,label:Type.TITLE_DATA_USER,type:Type.DATA_USER,value:Type.DATA_USER},
|
|
374
|
+
{title:Type.TITLE_DATA_PAGE,label:Type.TITLE_DATA_PAGE,type:Type.DATA_PAGE,value:Type.DATA_PAGE},
|
|
375
|
+
{title:Type.TITLE_DATA_PRODUCT,label:Type.TITLE_DATA_PAGE,type:Type.DATA_PRODUCT,value:Type.DATA_PRODUCT},
|
|
376
|
+
{title:Type.TITLE_DATA_SERVICE,label:Type.TITLE_DATA_PRODUCT,type:Type.DATA_SERVICE,value:Type.DATA_SERVICE}
|
|
431
377
|
]
|
|
432
378
|
};
|
|
433
|
-
static
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
{
|
|
437
|
-
|
|
438
|
-
]
|
|
439
|
-
};
|
|
440
|
-
//9_get_title
|
|
441
|
-
static get_title = (type,option)=>{
|
|
442
|
-
/* option
|
|
443
|
-
* lowercase = ex. true,false / def. false
|
|
444
|
-
* plural = ex. true,false / def. false
|
|
445
|
-
* url = ex. true,false / def. false
|
|
446
|
-
*/
|
|
447
|
-
type = type?type:"";
|
|
448
|
-
let r_type = "";
|
|
449
|
-
option = option ? option : {lowercase:false,plural:false,url:false};
|
|
450
|
-
switch(type){
|
|
451
|
-
case Type.STAT_CART:
|
|
452
|
-
r_type = "Cart";
|
|
453
|
-
break;
|
|
454
|
-
case Type.STAT_CART_ITEM:
|
|
455
|
-
r_type = "Cart Item";
|
|
456
|
-
break;
|
|
457
|
-
case Type.STAT_CART_SUB_ITEM:
|
|
458
|
-
r_type = "Cart Sub Item";
|
|
459
|
-
break;
|
|
460
|
-
case Type.STAT_FAVORITE:
|
|
461
|
-
r_type = "Favorite";
|
|
462
|
-
break;
|
|
463
|
-
case Type.STAT_LIKE:
|
|
464
|
-
r_type = "Like";
|
|
465
|
-
break;
|
|
466
|
-
case Type.STAT_LOGIN:
|
|
467
|
-
r_type = "Login";
|
|
468
|
-
break;
|
|
469
|
-
case Type.STAT_ORDER:
|
|
470
|
-
r_type = "Order";
|
|
471
|
-
break;
|
|
472
|
-
case Type.STAT_ORDER_ITEM:
|
|
473
|
-
r_type = "Order Item";
|
|
474
|
-
break;
|
|
475
|
-
case Type.STAT_ORDER_SUB_ITEM:
|
|
476
|
-
r_type = "Order Sub Item";
|
|
477
|
-
break;
|
|
478
|
-
case Type.STAT_ORDER_PAYMENT:
|
|
479
|
-
r_type = "Order Payment";
|
|
480
|
-
break;
|
|
481
|
-
case Type.STAT_REGISTER:
|
|
482
|
-
r_type = "Register";
|
|
483
|
-
break;
|
|
484
|
-
case Type.STAT_REVIEW:
|
|
485
|
-
r_type = "Review";
|
|
486
|
-
break;
|
|
487
|
-
case Type.STAT_VIEW:
|
|
488
|
-
r_type = "View";
|
|
489
|
-
break;
|
|
490
|
-
case Type.APP_ENV_TEST:
|
|
491
|
-
r_type = "Testing";
|
|
492
|
-
break;
|
|
493
|
-
case Type.APP_ENV_STAGE:
|
|
494
|
-
r_type = "Staging";
|
|
495
|
-
break;
|
|
496
|
-
case Type.APP_ENV_PROD:
|
|
497
|
-
r_type = "Production";
|
|
498
|
-
break;
|
|
499
|
-
case Type.APP_LINK_TYPE_WEBSITE:
|
|
500
|
-
r_type = "Website";
|
|
501
|
-
break;
|
|
502
|
-
case Type.APP_LINK_TYPE_GOOGLE_PLAY:
|
|
503
|
-
r_type = "Google Play";
|
|
504
|
-
break;
|
|
505
|
-
case Type.APP_LINK_TYPE_APPLE_STORE:
|
|
506
|
-
r_type = "Apple Store";
|
|
507
|
-
break;
|
|
508
|
-
case Type.APP_LINK_TYPE_CMS:
|
|
509
|
-
r_type = "Content Management System";
|
|
510
|
-
break;
|
|
511
|
-
case Type.ID:
|
|
512
|
-
r_type = "ID";
|
|
513
|
-
case Type.N_A:
|
|
514
|
-
r_type = "N/A";
|
|
515
|
-
case Type.PAGE_ABOUT:
|
|
516
|
-
case Type.PAGE_BLOG_POST:
|
|
517
|
-
case Type.PAGE_BLOG_POST_HOME:
|
|
518
|
-
case Type.PAGE_CONTACT:
|
|
519
|
-
case Type.PAGE_EVENT:
|
|
520
|
-
case Type.PAGE_EVENT_HOME:
|
|
521
|
-
case Type.PAGE_FAQ:
|
|
522
|
-
case Type.PAGE_GALLERY:
|
|
523
|
-
case Type.PAGE_GALLERY_HOME:
|
|
524
|
-
case Type.PAGE_HOME:
|
|
525
|
-
case Type.PAGE_LOGIN:
|
|
526
|
-
case Type.PAGE_PRODUCT:
|
|
527
|
-
case Type.PAGE_PRODUCT_HOME:
|
|
528
|
-
case Type.PAGE_SERVICE:
|
|
529
|
-
case Type.PAGE_SERVICE_HOME:
|
|
530
|
-
case Type.PAGE_REVIEW_HOME:
|
|
531
|
-
case Type.USER_ROLE_SUPER_ADMIN:
|
|
532
|
-
case Type.USER_ROLE_ADMIN:
|
|
533
|
-
case Type.USER_ROLE_MANAGER:
|
|
534
|
-
case Type.USER_ROLE_USER:
|
|
535
|
-
case Type.USER_ROLE_GUEST:
|
|
536
|
-
case Type.ORDER_STATUS_NEW:
|
|
537
|
-
case Type.ORDER_STATUS_OPEN:
|
|
538
|
-
case Type.ORDER_STATUS_COMPLETE:
|
|
539
|
-
case Type.ORDER_STATUS_RETURNED:
|
|
540
|
-
case Type.ORDER_STATUS_ON_HOLD:
|
|
541
|
-
case Type.ORDER_STATUS_CANCELLED:
|
|
542
|
-
case Type.ORDER_PAYMENT_PLAN_NEW:
|
|
543
|
-
case Type.ORDER_PAYMENT_PLAN_1:
|
|
544
|
-
case Type.ORDER_PAYMENT_PLAN_2:
|
|
545
|
-
case Type.ORDER_PAYMENT_PLAN_3:
|
|
546
|
-
case Type.ORDER_PAYMENT_PLAN_4:
|
|
547
|
-
case Type.ORDER_PAYMENT_METHOD_STRIPE:
|
|
548
|
-
case Type.ORDER_PAYMENT_METHOD_CASH:
|
|
549
|
-
case Type.ORDER_PAYMENT_METHOD_OTHER:
|
|
550
|
-
case Type.ORDER_PAYMENT_METHOD_TEST:
|
|
379
|
+
static get_data_type_by_type = (data_type,option) =>{
|
|
380
|
+
data_type = data_type?data_type:"";
|
|
381
|
+
let r_type = "";
|
|
382
|
+
option = option ? option : {lowercase:false,plural:false,url:false};
|
|
383
|
+
switch(data_type){
|
|
551
384
|
case Type.DATA_APP:
|
|
552
385
|
case Type.DATA_BLANK:
|
|
553
386
|
case Type.DATA_BLOG_POST:
|
|
@@ -579,12 +412,9 @@ class Type {
|
|
|
579
412
|
case Type.DATA_TYPE:
|
|
580
413
|
case Type.DATA_USER:
|
|
581
414
|
case Type.DATA_VIDEO:
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
r_type = "N/A";
|
|
586
|
-
break;
|
|
587
|
-
}
|
|
415
|
+
r_type = String(Str.get_title(data_type.replaceAll('_',' ').replaceAll('dt','').replace('biz',''))).trim();
|
|
416
|
+
break;
|
|
417
|
+
};
|
|
588
418
|
if(option.plural){
|
|
589
419
|
r_type = r_type + 's';
|
|
590
420
|
}
|
|
@@ -596,19 +426,46 @@ class Type {
|
|
|
596
426
|
}
|
|
597
427
|
return r_type;
|
|
598
428
|
};
|
|
599
|
-
|
|
600
|
-
|
|
429
|
+
|
|
430
|
+
static get_data_types = () =>{
|
|
431
|
+
return [
|
|
432
|
+
{title:Type.get_data_type_by_type(Type.DATA_BLOG_POST),type:Type.DATA_BLOG_POST,label:Type.get_data_type_by_type(Type.DATA_BLOG_POST),value:Type.DATA_BLOG_POST},
|
|
433
|
+
{title:Type.get_data_type_by_type(Type.DATA_CATEGORY),type:Type.DATA_CATEGORY,label:Type.get_data_type_by_type(Type.DATA_CATEGORY),value:Type.DATA_CATEGORY},
|
|
434
|
+
{title:Type.get_data_type_by_type(Type.DATA_CONTENT),type:Type.DATA_CONTENT,label:Type.get_data_type_by_type(Type.DATA_CONTENT),value:Type.DATA_CONTENT},
|
|
435
|
+
{title:Type.get_data_type_by_type(Type.DATA_EVENT),type:Type.DATA_EVENT,label:Type.get_data_type_by_type(Type.DATA_EVENT),value:Type.DATA_EVENT},
|
|
436
|
+
{title:Type.get_data_type_by_type(Type.DATA_GALLERY),type:Type.DATA_GALLERY,label:Type.get_data_type_by_type(Type.DATA_GALLERY),value:Type.DATA_GALLERY},
|
|
437
|
+
{title:Type.get_data_type_by_type(Type.DATA_USER),type:Type.DATA_USER,label:Type.get_data_type_by_type(Type.DATA_USER),value:Type.DATA_USER},
|
|
438
|
+
{title:Type.get_data_type_by_type(Type.DATA_PAGE),type:Type.DATA_PAGE,label:Type.get_data_type_by_type(Type.DATA_PAGE),value:Type.DATA_PAGE},
|
|
439
|
+
{title:Type.get_data_type_by_type(Type.DATA_PRODUCT),type:Type.DATA_PRODUCT,label:Type.get_data_type_by_type(Type.DATA_PRODUCT),value:Type.DATA_PRODUCT},
|
|
440
|
+
{title:Type.get_data_type_by_type(Type.DATA_SERVICE),type:Type.DATA_SERVICE,label:Type.get_data_type_by_type(Type.DATA_SERVICE),value:Type.DATA_SERVICE},
|
|
441
|
+
{title:Type.get_data_type_by_type(Type.DATA_TYPE),type:Type.DATA_TYPE,label:Type.get_data_type_by_type(Type.DATA_TYPE),value:Type.DATA_TYPE}
|
|
442
|
+
]
|
|
443
|
+
};
|
|
444
|
+
static get_app_environments = () =>{
|
|
445
|
+
return [
|
|
446
|
+
{label:Type.TITLE_APP_ENV_STAGE,title:Type.TITLE_APP_ENV_TEST,type:Type.APP_ENV_TEST,value:Type.APP_ENV_TEST},
|
|
447
|
+
{label:Type.TITLE_APP_ENV_STAGE,title:Type.TITLE_APP_ENV_STAGE,type:Type.APP_ENV_STAGE,value:Type.APP_ENV_STAGE},
|
|
448
|
+
{label:Type.TITLE_APP_ENV_PROD,title:Type.TITLE_APP_ENV_PROD,type:Type.APP_ENV_PROD,value:Type.APP_ENV_PROD},
|
|
449
|
+
]
|
|
450
|
+
};
|
|
451
|
+
static get_app_links = () =>{
|
|
452
|
+
return [
|
|
453
|
+
{title:Type.TITLE_APP_LINK_TYPE_WEBSITE,label:Type.TITLE_APP_LINK_TYPE_WEBSITE,type:Type.APP_LINK_TYPE_WEBSITE,value:Type.APP_LINK_TYPE_WEBSITE},
|
|
454
|
+
{title:Type.TITLE_APP_LINK_TYPE_GOOGLE_PLAY,label:Type.TITLE_APP_LINK_TYPE_GOOGLE_PLAY,type:Type.APP_LINK_TYPE_GOOGLE_PLAY,value:Type.APP_LINK_TYPE_GOOGLE_PLAY},
|
|
455
|
+
{title:Type.TITLE_APP_LINK_TYPE_APPLE_STORE,label:Type.TITLE_APP_LINK_TYPE_APPLE_STORE,type:Type.APP_LINK_TYPE_APPLE_STORE,value:Type.APP_LINK_TYPE_APPLE_STORE},
|
|
456
|
+
{title:Type.TITLE_APP_LINK_TYPE_CMS,label:Type.TITLE_APP_LINK_TYPE_CMS,type:Type.APP_LINK_TYPE_CMS,value:Type.APP_LINK_TYPE_CMS},
|
|
457
|
+
]
|
|
601
458
|
};
|
|
602
459
|
}
|
|
603
460
|
class Stat_Logic {
|
|
604
|
-
static
|
|
605
|
-
let new_stat = Data_Logic.get_new(Type.DATA_STAT,0,
|
|
461
|
+
static get = (parent_data_type,parent_id,type,user_id,post_data) => {
|
|
462
|
+
let new_stat = Data_Logic.get_new(Type.DATA_STAT,0,{option:
|
|
606
463
|
{
|
|
607
464
|
user_id:user_id,
|
|
608
465
|
type:type,
|
|
609
466
|
parent_data_type:parent_data_type,
|
|
610
467
|
parent_id:parent_id
|
|
611
|
-
});
|
|
468
|
+
}});
|
|
612
469
|
if(!Obj.check_is_empty(post_data)){
|
|
613
470
|
new_stat = Obj.merge(new_stat,Stat_Logic.filter_stat(post_data));
|
|
614
471
|
}
|
|
@@ -636,26 +493,10 @@ class Stat_Logic {
|
|
|
636
493
|
return filter_stat;
|
|
637
494
|
}
|
|
638
495
|
}
|
|
639
|
-
class Page_Logic {
|
|
640
|
-
static get_test = (title,option) =>{
|
|
641
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
642
|
-
option = Field_Logic.get_option(Type.DATA_PAGE,option?option:{});
|
|
643
|
-
let page = Data_Logic.get_new(Type.DATA_PAGE,0,Field_Logic.get_test(title,option));
|
|
644
|
-
return page;
|
|
645
|
-
};
|
|
646
|
-
static get_test_items = (option) =>{
|
|
647
|
-
option = Field_Logic.get_option(Type.DATA_PAGE,option?option:{});
|
|
648
|
-
let items = [];
|
|
649
|
-
for(let a=0;a<parseInt(option.page_count)+1;a++){
|
|
650
|
-
items.push(Page_Logic.get_test( "Page " +parseInt(a+1)? !option.get_blank : "",option));
|
|
651
|
-
}
|
|
652
|
-
return items;
|
|
653
|
-
};
|
|
654
|
-
}
|
|
655
496
|
class Order_Logic {
|
|
656
|
-
static
|
|
497
|
+
static get = (cart,option) => {
|
|
657
498
|
option = option?option:{get_payment_plan:false,payment_plan:Title.ORDER_PAYMENT_PLAN_1};
|
|
658
|
-
let order = Data_Logic.get_new(Type.DATA_ORDER,0,{
|
|
499
|
+
let order = Data_Logic.get_new(Type.DATA_ORDER,0,{data:{
|
|
659
500
|
order_number:Title.ORDER_NUMBER + Num.get_id(99999),
|
|
660
501
|
parent_data_type:cart.parent_data_type,
|
|
661
502
|
user_id:cart.user_id,
|
|
@@ -663,7 +504,7 @@ class Order_Logic {
|
|
|
663
504
|
grand_total:cart.grand_total,
|
|
664
505
|
status:Type.ORDER_STATUS_NEW,
|
|
665
506
|
order_items:[]
|
|
666
|
-
});
|
|
507
|
+
}});
|
|
667
508
|
for(const key in cart) {
|
|
668
509
|
if(!Str.check_is_null(cart[key])
|
|
669
510
|
&& key != Type.FIELD_ID && key != Type.FIELD_DATA_TYPE
|
|
@@ -678,8 +519,9 @@ class Order_Logic {
|
|
|
678
519
|
if(option.get_payment_plan){
|
|
679
520
|
order.payment_plan = option.payment_plan;
|
|
680
521
|
}
|
|
522
|
+
/*
|
|
681
523
|
cart.cart_items.forEach(cart_item => {
|
|
682
|
-
let order_item = Data_Logic.get_new(Type.DATA_ORDER_ITEM,0,{
|
|
524
|
+
let order_item = Data_Logic.get_new(Type.DATA_ORDER_ITEM,0,{data:{
|
|
683
525
|
order_number:order.order_number,
|
|
684
526
|
parent_data_type:cart_item.parent_data_type,
|
|
685
527
|
parent_id:cart_item.parent_id,
|
|
@@ -687,36 +529,31 @@ class Order_Logic {
|
|
|
687
529
|
quanity:cart_item.quanity?cart_item.quanity:0,
|
|
688
530
|
cost:cart_item.cost?cart_item.cost:0,
|
|
689
531
|
order_sub_items:[]
|
|
690
|
-
});
|
|
532
|
+
}});
|
|
533
|
+
});
|
|
691
534
|
for(const key in cart_item){
|
|
692
|
-
if(!Str.check_is_null(cart_item[key])
|
|
535
|
+
if(!Str.check_is_null(cart_item[key]){
|
|
693
536
|
&& key != Type.FIELD_ID && key != Type.FIELD_DATA_TYPE
|
|
694
537
|
&& key != Type.TITLE_PARENT_ITEM && key != Type.TITLE_USER
|
|
695
538
|
&& key != Type.TITLE_CART_ITEMS && key != Type.TITLE_CART_SUB_ITEMS
|
|
696
539
|
&& key != Type.TITLE_ORDER_ITEMS && key != Type.TITLE_ORDER_SUB_ITEMS
|
|
697
540
|
&& key != Type.FIELD_SOURCE && key != Type.FIELD_SOURCE_ID
|
|
698
|
-
&& key != Type.FIELD_DATE_CREATE && key != Type.FIELD_DATE_SAVE
|
|
699
|
-
order_item[key] = cart_item[key]
|
|
541
|
+
&& key != Type.FIELD_DATE_CREATE && key != Type.FIELD_DATE_SAVE
|
|
542
|
+
order_item[key] = cart_item[key]
|
|
700
543
|
}
|
|
701
544
|
}
|
|
702
545
|
cart_item.cart_sub_items.forEach(cart_sub_item => {
|
|
703
|
-
let order_sub_item = Data_Logic.get_new(Type.DATA_ORDER_SUB_ITEM,0,
|
|
704
|
-
order_number:order.order_number,
|
|
705
|
-
parent_data_type:cart_sub_item.parent_data_type,
|
|
706
|
-
parent_id:cart_sub_item.parent_id,
|
|
707
|
-
user_id:order.user_id,
|
|
708
|
-
quanity:cart_sub_item.quanity?cart_sub_item.quanity:0,
|
|
709
|
-
cost:cart_sub_item.cost?cart_sub_item.cost:0
|
|
710
|
-
})
|
|
546
|
+
let order_sub_item = Data_Logic.get_new(Type.DATA_ORDER_SUB_ITEM,0,
|
|
547
|
+
{data:{order_number:order.order_number,parent_data_type:cart_sub_item.parent_data_type,parent_id:cart_sub_item.parent_id,user_id:order.user_id,quanity:cart_sub_item.quanity?cart_sub_item.quanity:0,cost:cart_sub_item.cost?cart_sub_item.cost:0}};
|
|
711
548
|
for(const key in cart_sub_item){
|
|
712
|
-
if(!Str.check_is_null(cart_sub_item[key])
|
|
549
|
+
if(!Str.check_is_null(cart_sub_item[key])){
|
|
713
550
|
&& key != Type.FIELD_ID && key != Type.DATA_TYPE
|
|
714
551
|
&& key != Type.TITLE_PARENT_ITEM && key != Type.TITLE_USER
|
|
715
552
|
&& key != Type.TITLE_CART_ITEMS && key != Type.TITLE_CART_SUB_ITEMS
|
|
716
553
|
&& key != Type.TITLE_ORDER_ITEMS && key != Type.TITLE_ORDER_SUB_ITEMS
|
|
717
554
|
&& key != Type.FIELD_SOURCE && key != Type.FIELD_SOURCE_ID
|
|
718
|
-
&& key != Type.FIELD_DATE_CREATE && key != Type.FIELD_DATE_SAVE
|
|
719
|
-
order_sub_item[key] = cart_sub_item[key]
|
|
555
|
+
&& key != Type.FIELD_DATE_CREATE && key != Type.FIELD_DATE_SAVE{
|
|
556
|
+
order_sub_item[key] = cart_sub_item[key]{
|
|
720
557
|
}
|
|
721
558
|
}
|
|
722
559
|
order_item.order_sub_items.push(order_sub_item);
|
|
@@ -724,15 +561,17 @@ class Order_Logic {
|
|
|
724
561
|
order.order_items.push(order_item);
|
|
725
562
|
});
|
|
726
563
|
return order;
|
|
564
|
+
*/
|
|
727
565
|
};
|
|
728
|
-
|
|
729
|
-
|
|
566
|
+
/*
|
|
567
|
+
static get_order_payment = (order_number,payment_method_type,payment_amount) => {
|
|
568
|
+
return Data_Logic.get_new(Type.DATA_ORDER_PAYMENT,0,{data:
|
|
730
569
|
{
|
|
731
570
|
order_number:order_number,
|
|
732
571
|
payment_method_type:payment_method_type,
|
|
733
572
|
payment_amount:payment_amount,
|
|
734
573
|
transaction_id:Title.ORDER_TRANSACTION_ID + Num.get_id(99999)
|
|
735
|
-
});
|
|
574
|
+
}});
|
|
736
575
|
};
|
|
737
576
|
static get_total = (order) => {
|
|
738
577
|
let grand_total = 0;
|
|
@@ -753,16 +592,17 @@ class Order_Logic {
|
|
|
753
592
|
order.grand_total = grand_total;
|
|
754
593
|
return order;
|
|
755
594
|
};
|
|
595
|
+
*/
|
|
756
596
|
}
|
|
757
597
|
class Cart_Logic {
|
|
758
|
-
static
|
|
759
|
-
return Data_Logic.get_new(Type.DATA_CART,0,{user_id:user_id,cart_number:Title.CART_NUMBER + Num.get_id(99999),parent_data_type:parent_data_type,grand_total:0,cart_items:[]});
|
|
598
|
+
static get = (parent_data_type,user_id) => {
|
|
599
|
+
return Data_Logic.get_new(Type.DATA_CART,0,{data:{user_id:user_id,cart_number:Title.CART_NUMBER + Num.get_id(99999),parent_data_type:parent_data_type,grand_total:0,cart_items:[]}});
|
|
760
600
|
};
|
|
761
|
-
static
|
|
762
|
-
return Data_Logic.get_new(Type.DATA_CART_ITEM,0,{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity?quanity:0,cost:cost?cost:0,cart_sub_items:[]});
|
|
601
|
+
static get_cart_item = (parent_data_type,parent_id,cart_number,quanity,cost) =>{
|
|
602
|
+
return Data_Logic.get_new(Type.DATA_CART_ITEM,0,{data:{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity?quanity:0,cost:cost?cost:0,cart_sub_items:[]}});
|
|
763
603
|
};
|
|
764
|
-
static
|
|
765
|
-
return Data_Logic.get_new(Type.DATA_CART_SUB_ITEM,0,{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity?quanity:0,cost:cost?cost:0});
|
|
604
|
+
static get_cart_sub_item = (parent_data_type,parent_id,cart_number,quanity,cost) =>{
|
|
605
|
+
return Data_Logic.get_new(Type.DATA_CART_SUB_ITEM,0,{data:{parent_data_type:parent_data_type,parent_id:parent_id,cart_number:cart_number,quanity:quanity?quanity:0,cost:cost?cost:0}});
|
|
766
606
|
};
|
|
767
607
|
static get_total = (cart) => {
|
|
768
608
|
let grand_total = 0;
|
|
@@ -785,13 +625,6 @@ class Cart_Logic {
|
|
|
785
625
|
};
|
|
786
626
|
}
|
|
787
627
|
class Product_Logic {
|
|
788
|
-
static get_new = (title,type,category,option) => {
|
|
789
|
-
option = option ? option : {};
|
|
790
|
-
const item = Item_Logic.get_new(title,Type.DATA_PRODUCT);
|
|
791
|
-
item.type = type;
|
|
792
|
-
item.category = category = category?category:"";
|
|
793
|
-
return item;
|
|
794
|
-
};
|
|
795
628
|
static get_stocks = () => {
|
|
796
629
|
const stocks=
|
|
797
630
|
[
|
|
@@ -822,67 +655,16 @@ class Product_Logic {
|
|
|
822
655
|
break;
|
|
823
656
|
}
|
|
824
657
|
};
|
|
825
|
-
static get_test = (
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
product.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
836
|
-
}else{
|
|
837
|
-
product.cost = "";
|
|
838
|
-
product.old_cost = "";
|
|
839
|
-
product.type = "";
|
|
840
|
-
product.sub_type = "";
|
|
841
|
-
product.stock = "";
|
|
842
|
-
product.tag = "";
|
|
843
|
-
}
|
|
844
|
-
return product;
|
|
845
|
-
};
|
|
846
|
-
static get_test_cart = (cart_number,user_id,option) =>{
|
|
847
|
-
[cart_number,option] = ield_Logic.get_option_title(cart_number,option);
|
|
848
|
-
option = Field_Logic.get_option(Type.DATA_CART,option?option:{});
|
|
849
|
-
let cart = Data_Logic.get_new(Type.DATA_CART,Num.get_guid(),Field_Logic.get_test(cart_number,option));
|
|
850
|
-
cart.user_id = user_id;
|
|
851
|
-
cart.cart_number = cart_number;
|
|
852
|
-
if(option.get_cart_item){
|
|
853
|
-
let product_option = {product_count:option.cart_item_count,generate_id:true};
|
|
854
|
-
let products = Product_Logic.get_test_items(product_option);
|
|
855
|
-
cart.cart_items = [];
|
|
856
|
-
for(let a = 0;a<products.length;a++){
|
|
857
|
-
let product_cart_item =Cart_Logic.get_test_item(cart_number,cart.id,user_id,products[a].data_type,products[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});
|
|
858
|
-
product_cart_item.item_item = products[a];
|
|
859
|
-
cart.cart_items.push(product_cart_item);
|
|
860
|
-
}
|
|
861
|
-
}
|
|
862
|
-
return cart;
|
|
863
|
-
};
|
|
864
|
-
static get_test_items = (option) =>{
|
|
865
|
-
option = Field_Logic.get_option(Type.DATA_PRODUCT,option?option:{});
|
|
866
|
-
let items = [];
|
|
867
|
-
for(let a=0;a<option.product_count+1;a++){
|
|
868
|
-
items.push(Product_Logic.get_test("Product "+String(parseInt(a+1)),option));
|
|
869
|
-
}
|
|
870
|
-
return items;
|
|
871
|
-
}
|
|
872
|
-
static get_test_items_by_category = (option) =>{
|
|
873
|
-
option = Field_Logic.get_option(Type.DATA_PRODUCT,option?option:{});
|
|
874
|
-
let products = [];
|
|
875
|
-
let categorys = Category_Logic.get_type_categorys(Type.DATA_PRODUCT,option.category_count);
|
|
876
|
-
let item_count = 0;
|
|
877
|
-
for(let a=0;a<categorys.length;a++){
|
|
878
|
-
for(let b=0;b<option.product_count;b++){
|
|
879
|
-
item_count++;
|
|
880
|
-
let product = Product_Logic.get_test("Product "+String(parseInt(b+1)),option);
|
|
881
|
-
product.category = categorys[Num.get_id(categorys.length+1)].title;
|
|
882
|
-
products.push(product);
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
return [categorys,products]
|
|
658
|
+
static get_test = (option) =>{
|
|
659
|
+
let data = {};
|
|
660
|
+
data.cost = Field_Logic.get_test_cost();
|
|
661
|
+
data.old_cost = Field_Logic.get_test_cost();
|
|
662
|
+
data.category = "Category "+String(Num.get_id());
|
|
663
|
+
data.type = "Type "+String(Num.get_id());
|
|
664
|
+
data.sub_type = "Sub Type "+String(Num.get_id());
|
|
665
|
+
data.stock = String(Num.get_id(3-1));
|
|
666
|
+
data.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
667
|
+
return data;
|
|
886
668
|
};
|
|
887
669
|
}
|
|
888
670
|
class Service_Logic {
|
|
@@ -909,147 +691,44 @@ class Service_Logic {
|
|
|
909
691
|
break;
|
|
910
692
|
}
|
|
911
693
|
};
|
|
912
|
-
static get_test = (
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
service.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
922
|
-
return service;
|
|
923
|
-
};
|
|
924
|
-
static get_test_items = (option) =>{
|
|
925
|
-
option = Field_Logic.get_option(Type.DATA_SERVICE,option?option:{});
|
|
926
|
-
let items = [];
|
|
927
|
-
for(let a=0;a<parseInt(option.service_count)+1;a++){
|
|
928
|
-
items.push(Service_Logic.get_test("Service "+String(parseInt(a+1)),option));
|
|
929
|
-
}
|
|
930
|
-
return items;
|
|
931
|
-
}
|
|
932
|
-
static get_test_items_by_category = (option) =>{
|
|
933
|
-
option = Field_Logic.get_option(Type.DATA_SERVICE,option?option:{});
|
|
934
|
-
let services = [];
|
|
935
|
-
let categorys = Category_Logic.get_type_categorys(Type.DATA_SERVICE,option.category_count);
|
|
936
|
-
let item_count = 0;
|
|
937
|
-
for(let a=0;a<categorys.length;a++){
|
|
938
|
-
for(let b=0;b<parseInt(option.service_count);b++){
|
|
939
|
-
item_count++;
|
|
940
|
-
let service = Service_Logic.get_test("Service "+String(parseInt(b+1)),option);
|
|
941
|
-
service.category = categorys[Num.get_id(categorys.length+1)].title;
|
|
942
|
-
services.push(service);
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
return [categorys,services]
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
class Content_Logic {
|
|
949
|
-
static get_test = (title,option) =>{
|
|
950
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
951
|
-
option = Field_Logic.get_option(Type.DATA_CONTENT,option?option:{});
|
|
952
|
-
let content = Data_Logic.get_new(Type.DATA_CONTENT,0,Field_Logic.get_test(title,option));
|
|
953
|
-
return content;
|
|
954
|
-
};
|
|
955
|
-
static get_test_items = (option) =>{
|
|
956
|
-
option = Field_Logic.get_option(Type.DATA_CONTENT,option?option:{});
|
|
957
|
-
let items = [];
|
|
958
|
-
for(let a=0;a<parseInt(option.content_count)+1;a++){
|
|
959
|
-
items.push(Content_Logic.get_test("Content " +String(parseInt(a+1)),option));
|
|
960
|
-
}
|
|
961
|
-
return items;
|
|
962
|
-
}
|
|
963
|
-
static get_test_items_by_category = (option) =>{
|
|
964
|
-
option = Field_Logic.get_option(Type.DATA_CONTENT,option?option:{});
|
|
965
|
-
let contents = [];
|
|
966
|
-
let categorys = Category_Logic.get_type_categorys(Type.DATA_CONTENT,option.category_count);
|
|
967
|
-
let item_count = 0;
|
|
968
|
-
for(let a=0;a<categorys.length;a++){
|
|
969
|
-
for(let b=0;b<parseInt(option.content_count);b++){
|
|
970
|
-
item_count++;
|
|
971
|
-
let content = Content_Logic.get_test("Content "+String(parseInt(b+1)),option);
|
|
972
|
-
content.category = categorys[Num.get_id(categorys.length+1)].title;
|
|
973
|
-
contents.push(content);
|
|
974
|
-
}
|
|
975
|
-
}
|
|
976
|
-
return [categorys,contents]
|
|
977
|
-
};
|
|
978
|
-
}
|
|
979
|
-
class Template_Logic {
|
|
980
|
-
static get_test = (title,option) =>{
|
|
981
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
982
|
-
option = Field_Logic.get_option(Type.DATA_TEMPLATE,option?option:{});
|
|
983
|
-
let template = Data_Logic.get_new(Type.DATA_TEMPLATE,0,Field_Logic.get_test(title,option));
|
|
984
|
-
return template;
|
|
694
|
+
static get_test = () =>{
|
|
695
|
+
let data = {};
|
|
696
|
+
data.cost = Field_Logic.get_test_cost();
|
|
697
|
+
data.old_cost = Field_Logic.get_test_cost();
|
|
698
|
+
data.type = "Type "+String(Num.get_id());
|
|
699
|
+
data.sub_type = "Sub Type "+String(Num.get_id());
|
|
700
|
+
data.stock = String(Num.get_id(3-1));
|
|
701
|
+
data.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
702
|
+
return data;
|
|
985
703
|
};
|
|
986
704
|
}
|
|
987
705
|
class Blank_Logic {
|
|
988
|
-
static get_test = (
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
blog_post.field_1="Field 1 "+ Num.get_id();
|
|
994
|
-
blog_post.field_2="Field 2 "+ Num.get_id();
|
|
995
|
-
}else{
|
|
996
|
-
blog_post.field_1="";
|
|
997
|
-
blog_post.field_2 = "";
|
|
998
|
-
}
|
|
999
|
-
return blog_post;
|
|
706
|
+
static get_test = (option) =>{
|
|
707
|
+
let data = {};
|
|
708
|
+
data.field_1="Field 1 "+ Num.get_id();
|
|
709
|
+
data.field_2="Field 2 "+ Num.get_id();
|
|
710
|
+
return data;
|
|
1000
711
|
};
|
|
1001
712
|
};
|
|
1002
713
|
class Blog_Post_Logic {
|
|
1003
|
-
static get_test = (
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
blog_post.tag = "";
|
|
1013
|
-
}
|
|
1014
|
-
return blog_post;
|
|
1015
|
-
};
|
|
1016
|
-
static get_test_items = (option) =>{
|
|
1017
|
-
option = Field_Logic.get_option(Type.DATA_BLOG_POST,option?option:{});
|
|
1018
|
-
let items = [];
|
|
1019
|
-
for(let a=0;a<parseInt(option.blog_post_count)+1;a++){
|
|
1020
|
-
items.push(Blog_Post_Logic.get_test("Blog Post " +String(parseInt(a+1)),option));
|
|
1021
|
-
}
|
|
1022
|
-
return items;
|
|
1023
|
-
}
|
|
1024
|
-
static get_test_items_by_category = (option) =>{
|
|
1025
|
-
option = Field_Logic.get_option(Type.DATA_BLOG_POST,option?option:{});
|
|
1026
|
-
let blog_posts = [];
|
|
1027
|
-
let categorys = Category_Logic.get_type_categorys(Type.DATA_BLOG_POST,option.category_count);
|
|
1028
|
-
let item_count = 0;
|
|
1029
|
-
for(let a=0;a<categorys.length;a++){
|
|
1030
|
-
for(let b=0;b<parseInt(option.blog_post_count);b++){
|
|
1031
|
-
item_count++;
|
|
1032
|
-
let blog_post = Blog_Post_Logic.get_test("Blog Post "+String(parseInt(b+1)),option);
|
|
1033
|
-
blog_post.category = categorys[Num.get_id(categorys.length+1)].title;
|
|
1034
|
-
blog_posts.push(blog_post);
|
|
1035
|
-
}
|
|
1036
|
-
}
|
|
1037
|
-
return [categorys,blog_posts]
|
|
714
|
+
static get_test = (option) =>{
|
|
715
|
+
let data = {};
|
|
716
|
+
data.author="First Name "+ Num.get_id();
|
|
717
|
+
data.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id(), " Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
718
|
+
data.category = "Category "+String(Num.get_id());
|
|
719
|
+
data.type = "Type "+String(Num.get_id());
|
|
720
|
+
data.sub_type = "Sub Type "+String(Num.get_id());
|
|
721
|
+
|
|
722
|
+
return data;
|
|
1038
723
|
};
|
|
1039
724
|
}
|
|
1040
725
|
class Gallery_Logic {
|
|
1041
|
-
static get_test = (
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
gallery.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
1048
|
-
gallery.website = "Website "+String(Num.get_id());
|
|
1049
|
-
}else{
|
|
1050
|
-
gallery.website = "";
|
|
1051
|
-
}
|
|
1052
|
-
return gallery;
|
|
726
|
+
static get_test = () =>{
|
|
727
|
+
let data = {};
|
|
728
|
+
data.date = String(String(Num.get_id(2030)) + "-" + String(Num.get_id(13)) + "-" + String(Num.get_id(30))).trim();
|
|
729
|
+
data.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
730
|
+
data.website = "Website "+String(Num.get_id());
|
|
731
|
+
return data;
|
|
1053
732
|
};
|
|
1054
733
|
};
|
|
1055
734
|
class Event_Logic {
|
|
@@ -1080,60 +759,44 @@ class Event_Logic {
|
|
|
1080
759
|
break;
|
|
1081
760
|
}
|
|
1082
761
|
};
|
|
1083
|
-
static get_test = (
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
event.category ="Category " + String(Num.get_id());
|
|
1097
|
-
event.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
1098
|
-
}else{
|
|
1099
|
-
event.cost = "";
|
|
1100
|
-
event.old_cost = "";
|
|
1101
|
-
event.date = "";
|
|
1102
|
-
event.time = "";
|
|
1103
|
-
event.website = "";
|
|
1104
|
-
event.location = "";
|
|
1105
|
-
event.meeting_link = "";
|
|
1106
|
-
event.stock = "";
|
|
1107
|
-
event.category ="";
|
|
1108
|
-
event.tag = "";
|
|
1109
|
-
}
|
|
1110
|
-
return event;
|
|
762
|
+
static get_test = () =>{
|
|
763
|
+
let data = {};
|
|
764
|
+
data.cost = Field_Logic.get_test_cost();
|
|
765
|
+
data.old_cost = Field_Logic.get_test_cost();
|
|
766
|
+
data.date = String(String(Num.get_id(2030)) + "-" + String(Num.get_id(13)) + "-" + String(Num.get_id(30))).trim();
|
|
767
|
+
data.time = String(Num.get_id(24)) + ":" + String(Num.get_id(59));
|
|
768
|
+
data.website = "Website "+String(Num.get_id());
|
|
769
|
+
data.location = "Location "+String(Num.get_id());
|
|
770
|
+
data.meeting_link = "Meeting Link "+String(Num.get_id());
|
|
771
|
+
data.stock = String(Num.get_id(3-1));
|
|
772
|
+
data.category ="Category " + String(Num.get_id());
|
|
773
|
+
data.tag = "Tag "+ Num.get_id() + ", Tag "+Num.get_id() + ", Tag "+ Num.get_id();
|
|
774
|
+
return data;
|
|
1111
775
|
};
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
776
|
+
}
|
|
777
|
+
class Field_Logic {
|
|
778
|
+
static get_base_option = (data,option) => {
|
|
779
|
+
if(option.title){
|
|
780
|
+
data[Type.FIELD_TITLE] = option.title;
|
|
781
|
+
data[Type.FIELD_TITLE_URL] = Str.get_title_url(option.title);
|
|
1117
782
|
}
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
783
|
+
if(option.title){
|
|
784
|
+
data[Type.FIELD_TITLE] = Type.get_data_type_by_type(data.data_type);
|
|
785
|
+
data[Type.FIELD_TITLE_URL] = Str.get_title_url(data[Type.FIELD_TITLE]);
|
|
786
|
+
}
|
|
787
|
+
if(option.generate_title || option.test){
|
|
788
|
+
data[Type.FIELD_TITLE] = Type.get_data_type_by_type(data.data_type) + " " +Num.get_id(999);
|
|
789
|
+
data[Type.FIELD_TITLE_URL] = Str.get_title_url(data[Type.FIELD_TITLE]);
|
|
790
|
+
}
|
|
791
|
+
if(option.parent){
|
|
792
|
+
data[Type.FIELD_PARENT_DATA_TYPE] = option.parent[Type.FIELD_DATA_TYPE] ? option.parent[Type.FIELD_DATA_TYPE] : Type.DATA_BLANK;
|
|
793
|
+
data[Type.FIELD_PARENT_ID] = option.parent[Type.FIELD_ID] ? option.parent[Type.FIELD_ID] : 0;
|
|
794
|
+
}
|
|
795
|
+
if(option.data){
|
|
796
|
+
data = Obj.merge(data,option.data);
|
|
1132
797
|
}
|
|
1133
|
-
return
|
|
798
|
+
return data;
|
|
1134
799
|
};
|
|
1135
|
-
}
|
|
1136
|
-
class Field_Logic {
|
|
1137
800
|
static get_item_max_group_id = (value_id,item) => {
|
|
1138
801
|
let max_group_id = 0;
|
|
1139
802
|
let full_prop_str = "";
|
|
@@ -1240,7 +903,7 @@ class Field_Logic {
|
|
|
1240
903
|
static get_test = (title,option) =>{
|
|
1241
904
|
option = !Obj.check_is_empty(option) ? option : {};
|
|
1242
905
|
let item = {};
|
|
1243
|
-
if(option.
|
|
906
|
+
if(option.blank == true){
|
|
1244
907
|
option.category_title = "";
|
|
1245
908
|
item = {
|
|
1246
909
|
title:title,
|
|
@@ -1272,7 +935,7 @@ class Field_Logic {
|
|
|
1272
935
|
if(option.fields){
|
|
1273
936
|
let field_items = String(option.fields).split(',');
|
|
1274
937
|
for(let a = 0; a<field_items.length;a++){
|
|
1275
|
-
if(option.
|
|
938
|
+
if(option.blank == true){
|
|
1276
939
|
if(item[field_items[a]]){
|
|
1277
940
|
item[field_items[a]] = "";
|
|
1278
941
|
}
|
|
@@ -1291,7 +954,6 @@ class Field_Logic {
|
|
|
1291
954
|
static get_value_items_group(item,value_id,group_id){
|
|
1292
955
|
let full_str = 'items_value_'+value_id+"_group_"+group_id;
|
|
1293
956
|
let items = [];
|
|
1294
|
-
Log.w(full_str,full_str);
|
|
1295
957
|
let count = 0;
|
|
1296
958
|
for(const prop in item){
|
|
1297
959
|
let new_item = {};
|
|
@@ -1305,7 +967,7 @@ class Field_Logic {
|
|
|
1305
967
|
}
|
|
1306
968
|
static get_values(item,option){
|
|
1307
969
|
for(let b=0;b<parseInt(option.value_count);b++){
|
|
1308
|
-
if(option.
|
|
970
|
+
if(option.blank == false){
|
|
1309
971
|
item['value_'+String(b+1)] = 'value ' + String(b+1);
|
|
1310
972
|
item['field_'+String(b+1)] = Str.get_title_url(item['value_'+String(b+1)]);
|
|
1311
973
|
item[Str.get_title_url('value ' + String(b+1))] = item.title + ' value ' + String(b+1);
|
|
@@ -1317,152 +979,14 @@ class Field_Logic {
|
|
|
1317
979
|
}
|
|
1318
980
|
return item;
|
|
1319
981
|
};
|
|
1320
|
-
static get_option(data_type,option){
|
|
1321
|
-
data_type = data_type ? data_type : Type.DATA_BLANK;
|
|
1322
|
-
option = !Obj.check_is_empty(option) ? option : {get_value:false,item_count:9,value_count:9};
|
|
1323
|
-
option.generate_id = option.generate_id ? option.generate_id : false;
|
|
1324
|
-
option.get_value = option.get_value ? true : false;
|
|
1325
|
-
option.get_blank = option.get_blank ? true : false;
|
|
1326
|
-
option.value_count = option.value_count ? option.value_count : 9;
|
|
1327
|
-
option.section_count = option.section_count ? option.section_count : 9;
|
|
1328
|
-
option.item_count = option.item_count ? option.item_count : 9;
|
|
1329
|
-
option.category_count = option.category_count ? option.category_count : 9;
|
|
1330
|
-
option.category_title = option.category_title ? option.category_title : "";
|
|
1331
|
-
option.fields = option.fields ? option.fields : [];
|
|
1332
|
-
if(option.data_type==Type.DATA_PAGE){
|
|
1333
|
-
option.page_count = option.page_count ? option.page_count : 9;
|
|
1334
|
-
option.section_count = option.section_count ? option.section_count : 9;
|
|
1335
|
-
option.get_section = option.get_section ? true : false;
|
|
1336
|
-
}
|
|
1337
|
-
if(data_type==Type.DATA_PRODUCT){
|
|
1338
|
-
option.product_count = option.product_count ? option.product_count : 9;
|
|
1339
|
-
}
|
|
1340
|
-
if(data_type==Type.DATA_SERVICE){
|
|
1341
|
-
option.service_count = option.service_count ? option.service_count : 9;
|
|
1342
|
-
}
|
|
1343
|
-
if(data_type==Type.DATA_BLOG_POST){
|
|
1344
|
-
option.blog_post_count = option.blog_post_count ? option.blog_post_count : 9;
|
|
1345
|
-
}
|
|
1346
|
-
if(data_type==Type.DATA_EVENT){
|
|
1347
|
-
option.event_count = option.event_count ? option.event_count : 9;
|
|
1348
|
-
}
|
|
1349
|
-
if(data_type==Type.DATA_FAQ){
|
|
1350
|
-
option.question_count = option.question_count ? option.question_count : 9;
|
|
1351
|
-
}
|
|
1352
|
-
if(data_type==Type.DATA_CONTENT){
|
|
1353
|
-
option.content_count = option.content_count ? option.content_count : 9;
|
|
1354
|
-
}
|
|
1355
|
-
if(data_type==Type.DATA_SUB_ITEM){
|
|
1356
|
-
option.item_count = option.item_count ? option.item_count : 9;
|
|
1357
|
-
}
|
|
1358
|
-
if(data_type==Type.DATA_USER){
|
|
1359
|
-
option.user_count = option.user_count ? option.user_count : 9;
|
|
1360
|
-
}
|
|
1361
|
-
if(data_type==Type.DATA_CART){
|
|
1362
|
-
option.category_title = option.category_title ? option.category_title : "";
|
|
1363
|
-
option.value_count = option.value_count ? option.value_count : 9;
|
|
1364
|
-
option.get_cart_item = option.get_cart_item ? option.get_cart_item : false;
|
|
1365
|
-
option.cart_item_count = option.cart_item_count ? option.cart_item_count : 5;
|
|
1366
|
-
option.get_cart_sub_item = option.get_cart_sub_item ? option.get_cart_sub_item : false;
|
|
1367
|
-
option.cart_sub_item_count = option.cart_sub_item_count ? option.cart_sub_item_count : 3;
|
|
1368
|
-
}
|
|
1369
|
-
if(data_type==Type.DATA_CART_ITEM){
|
|
1370
|
-
option.category_title = option.category_title ? option.category_title : "";
|
|
1371
|
-
option.value_count = option.value_count ? option.value_count : 9;
|
|
1372
|
-
option.get_cart_sub_item = option.get_cart_sub_item ? option.get_cart_sub_item : false;
|
|
1373
|
-
option.cart_sub_item_count = option.cart_sub_item_count ? option.cart_sub_item_count : 1;
|
|
1374
|
-
}
|
|
1375
|
-
if(data_type==Type.DATA_ORDER){
|
|
1376
|
-
option.category_title = option.category_title ? option.category_title : "";
|
|
1377
|
-
option.value_count = option.value_count ? option.value_count : 9;
|
|
1378
|
-
option.get_order_item = option.get_order_item ? option.get_order_item : false;
|
|
1379
|
-
option.order_item_count = option.order_item_count ? option.order_item_count : 5;
|
|
1380
|
-
option.get_order_sub_item = option.get_order_sub_item ? option.get_order_sub_item : false;
|
|
1381
|
-
option.order_sub_item_count = option.order_sub_item_count ? option.order_sub_item_count : 3;
|
|
1382
|
-
}
|
|
1383
|
-
if(data_type==Type.DATA_ORDER_ITEM){
|
|
1384
|
-
option.category_title = option.category_title ? option.category_title : "";
|
|
1385
|
-
option.value_count = option.value_count ? option.value_count : 9;
|
|
1386
|
-
option.get_order_sub_item = option.get_order_sub_item ? option.get_order_sub_item : false;
|
|
1387
|
-
option.order_sub_item_count = option.order_sub_item_count ? option.order_sub_item_count : 1;
|
|
1388
|
-
}
|
|
1389
|
-
return option;
|
|
1390
|
-
}
|
|
1391
|
-
static get_option_title = (title,option) =>{
|
|
1392
|
-
if(!title){
|
|
1393
|
-
let title = '';
|
|
1394
|
-
}
|
|
1395
|
-
if(!option){
|
|
1396
|
-
let option = {};
|
|
1397
|
-
}
|
|
1398
|
-
if(!Str.check_is_null(title) && Obj.check_is_empty(option)){
|
|
1399
|
-
if(Obj.check_is_empty(option)){
|
|
1400
|
-
if(!Str.check_is_null(title) && Obj.check_is_empty(option)){
|
|
1401
|
-
if(typeof title === 'string'){
|
|
1402
|
-
option = {};
|
|
1403
|
-
}else{
|
|
1404
|
-
option = title;
|
|
1405
|
-
title = "Test " + Num.get_id();
|
|
1406
|
-
}
|
|
1407
|
-
}
|
|
1408
|
-
}
|
|
1409
|
-
}else{
|
|
1410
|
-
if(Str.check_is_null(title) && Obj.check_is_empty(option)){
|
|
1411
|
-
title = "Test " + Num.get_id();
|
|
1412
|
-
option = {};
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
return [title,option];
|
|
1416
|
-
}
|
|
1417
|
-
static get_option_admin(req){
|
|
1418
|
-
let option = {};
|
|
1419
|
-
option.value_count = req.query.value_count ? req.query.value_count : 9;
|
|
1420
|
-
option.section_count = req.query.section_count ? req.query.section_count : 9;
|
|
1421
|
-
|
|
1422
|
-
option.get_faq = req.query.get_faq ? req.query.get_faq : false;
|
|
1423
|
-
option.question_count = req.query.question_count ? req.query.question_count : 9;
|
|
1424
|
-
|
|
1425
|
-
option.get_blog_post = req.query.get_blog_post ? req.query.get_blog_post : false;
|
|
1426
|
-
option.get_category_blog_post = req.query.get_category_blog_post ? req.query.get_category_blog_post : false;
|
|
1427
|
-
option.category_blog_post_count = req.query.category_blog_post_count ? req.query.category_blog_post_count : 9;
|
|
1428
|
-
option.blog_post_count = req.query.blog_post_count ? req.query.blog_post_count : 9;
|
|
1429
|
-
|
|
1430
|
-
option.get_product = req.query.get_product ? req.query.get_product : false;
|
|
1431
|
-
option.get_category_product = req.query.get_category_product ? req.query.get_category_product : false;
|
|
1432
|
-
option.category_product_count = req.query.category_product_count ? req.query.category_product_count : 9;
|
|
1433
|
-
option.product_count = req.query.product_count ? req.query.product_count : 9;
|
|
1434
|
-
|
|
1435
|
-
option.get_service = req.query.get_service ? req.query.get_service : false;
|
|
1436
|
-
option.get_category_service = req.query.get_category_service ? req.query.get_category_service : false;
|
|
1437
|
-
option.category_service_count = req.query.category_service_count ? req.query.category_service_count : 9;
|
|
1438
|
-
option.service_count = req.query.service_count ? req.query.service_count : 9;
|
|
1439
|
-
|
|
1440
|
-
option.get_event = req.query.get_event ? req.query.get_event : false;
|
|
1441
|
-
option.get_category_event = req.query.get_category_event ? req.query.get_category_event : false;
|
|
1442
|
-
option.category_event_count = req.query.category_event_count ? req.query.category_event_count : 9;
|
|
1443
|
-
option.event_count = req.query.event_count ? req.query.event_count : 9;
|
|
1444
|
-
|
|
1445
|
-
option.get_product_review = req.query.get_product_review ? req.query.get_product_review : false;
|
|
1446
|
-
option.product_review_count = req.query.product_review_count ? req.query.product_review_count : 19;
|
|
1447
|
-
|
|
1448
|
-
option.get_business_review = req.query.get_business_review ? req.query.get_business_review : false;
|
|
1449
|
-
option.business_review_count = req.query.business_review_count ? req.query.business_review_count : 19;
|
|
1450
|
-
|
|
1451
|
-
option.user_count = req.query.user_count ? req.query.user_count : 9;
|
|
1452
|
-
option.get_admin = req.query.get_admin ? req.query.get_admin : false;
|
|
1453
|
-
option.get_template = req.query.get_template ? req.query.get_template : false;
|
|
1454
|
-
option.get_page = req.query.get_page ? req.query.get_page : false;
|
|
1455
|
-
|
|
1456
|
-
return option;
|
|
1457
|
-
}
|
|
1458
982
|
}
|
|
1459
983
|
class Favorite_Logic {
|
|
1460
|
-
static
|
|
1461
|
-
return Data_Logic.get_new(Type.DATA_FAVORITE,0,{
|
|
984
|
+
static get = (parent_data_type,parent_id,user_id) =>{
|
|
985
|
+
return Data_Logic.get_new(Type.DATA_FAVORITE,0,{data:{
|
|
1462
986
|
parent_data_type:parent_data_type,
|
|
1463
987
|
parent_id:parent_id,
|
|
1464
988
|
user_id:user_id
|
|
1465
|
-
});
|
|
989
|
+
}});
|
|
1466
990
|
}
|
|
1467
991
|
static get_user_search_filter = (item_data_type,user_id) =>{
|
|
1468
992
|
return {
|
|
@@ -1481,15 +1005,15 @@ class Favorite_Logic {
|
|
|
1481
1005
|
}
|
|
1482
1006
|
}
|
|
1483
1007
|
class Review_Logic {
|
|
1484
|
-
static
|
|
1485
|
-
return Data_Logic.get_new(Type.DATA_REVIEW,0,{
|
|
1008
|
+
static get = (parent_data_type,parent_id,user_id,title,comment,rating) =>{
|
|
1009
|
+
return Data_Logic.get_new(Type.DATA_REVIEW,0,{data:{
|
|
1486
1010
|
parent_data_type:parent_data_type,
|
|
1487
1011
|
parent_id:parent_id,
|
|
1488
1012
|
user_id:user_id,
|
|
1489
1013
|
title:title ? title : "",
|
|
1490
1014
|
comment:comment ? comment : "",
|
|
1491
1015
|
rating:rating ? rating : 5
|
|
1492
|
-
});
|
|
1016
|
+
}});
|
|
1493
1017
|
}
|
|
1494
1018
|
static get_user_search_filter = (item_data_type,user_id) =>{
|
|
1495
1019
|
return {
|
|
@@ -1505,101 +1029,17 @@ class Review_Logic {
|
|
|
1505
1029
|
{ parent_id: { $regex:String(parent_id), $options: "i" } },
|
|
1506
1030
|
] };
|
|
1507
1031
|
}
|
|
1508
|
-
static get_test = (
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
review.user_id = user_id;
|
|
1517
|
-
review.comment = "My comment "+ Field_Logic.get_test_note();
|
|
1518
|
-
}else{
|
|
1519
|
-
review.title = '';
|
|
1520
|
-
review.item_data_type = item_data_type;
|
|
1521
|
-
review.item_id = item_id;
|
|
1522
|
-
review.rating = 0;
|
|
1523
|
-
review.user_id = user_id;
|
|
1524
|
-
review.comment = "";
|
|
1525
|
-
}
|
|
1526
|
-
return review;
|
|
1527
|
-
};
|
|
1528
|
-
static get_test_items=(option)=>{
|
|
1529
|
-
option = !Obj.check_is_empty(option) ? option : {review_count:19};
|
|
1530
|
-
let items = [];
|
|
1531
|
-
for(let a=0;a<option.review_count;a++){
|
|
1532
|
-
items.push(Review_Logic.get_test(option));
|
|
1533
|
-
}
|
|
1534
|
-
return items;
|
|
1032
|
+
static get_test = () =>{
|
|
1033
|
+
let data = {};
|
|
1034
|
+
data.item_data_type = item_data_type;
|
|
1035
|
+
data.item_id = item_id;
|
|
1036
|
+
data.rating = Num.get_id(6);
|
|
1037
|
+
data.user_id = user_id;
|
|
1038
|
+
data.comment = "My comment "+ Field_Logic.get_test_note();
|
|
1039
|
+
return data;
|
|
1535
1040
|
};
|
|
1536
1041
|
}
|
|
1537
|
-
class Admin_Logic {
|
|
1538
|
-
static get_new = (title,option) =>{
|
|
1539
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
1540
|
-
return Data_Logic.get_new_full_item(
|
|
1541
|
-
Data_Logic.get_new(Type.DATA_ADMIN,0),
|
|
1542
|
-
Data_Logic.get_new(Type.DATA_ADMIN,0),
|
|
1543
|
-
Data_Logic.get_new(Type.DATA_ADMIN,0),{
|
|
1544
|
-
title:title,
|
|
1545
|
-
email:"",
|
|
1546
|
-
});
|
|
1547
|
-
};
|
|
1548
|
-
static get_test = (title,option) =>{
|
|
1549
|
-
[title,option] = Field_Logic.get_option_title(title,option);
|
|
1550
|
-
option = Field_Logic.get_option(Type.DATA_ADMIN,option?option:{});
|
|
1551
|
-
let item = Data_Logic.get_new(Type.DATA_ADMIN,0);
|
|
1552
|
-
let admin = Data_Logic.get_new(Type.DATA_ADMIN,0,Field_Logic.get_test(title,option));
|
|
1553
|
-
if(!option.get_blank){
|
|
1554
|
-
admin.email="ceo@admin"+Num.get_id()+".com";
|
|
1555
|
-
admin.password="1234567";
|
|
1556
|
-
}else{
|
|
1557
|
-
admin.email="";
|
|
1558
|
-
admin.password="";
|
|
1559
|
-
}
|
|
1560
|
-
return admin;
|
|
1561
|
-
};
|
|
1562
|
-
static get_full_address(admin){
|
|
1563
|
-
admin.address_1 = (admin.address_1) ? admin.address_1 : "";
|
|
1564
|
-
admin.address_2 = (admin.address_2) ? admin.address_2 : "";
|
|
1565
|
-
admin.city = (admin.city) ? admin.city : "";
|
|
1566
|
-
admin.state = (admin.state) ? admin.state : "";
|
|
1567
|
-
admin.zip = (admin.zip) ? admin.zip : "";
|
|
1568
|
-
return admin.address_1 + " "+ admin.address_2 + " " + admin.city + " " + admin.state + " " + admin.zip;
|
|
1569
|
-
}
|
|
1570
|
-
}
|
|
1571
1042
|
class Category_Logic {
|
|
1572
|
-
static get_new = (title,type,category,option) => {
|
|
1573
|
-
option = option ? option : {};
|
|
1574
|
-
const item = Item_Logic.get_new(title,Type.DATA_CATEGORY);
|
|
1575
|
-
item.type = type;
|
|
1576
|
-
item.category = category = category?category:"";
|
|
1577
|
-
return item;
|
|
1578
|
-
};
|
|
1579
|
-
static get_test = (title,option) =>{
|
|
1580
|
-
title = (title) ? title : "Category 1";
|
|
1581
|
-
option = Field_Logic.get_option(Type.DATA_CATEGORY,option?option:{});
|
|
1582
|
-
let category = Data_Logic.get_new(Type.DATA_CATEGORY,0,Field_Logic.get_test(title,option));
|
|
1583
|
-
return category;
|
|
1584
|
-
};
|
|
1585
|
-
static get_test_items = (option) =>{
|
|
1586
|
-
option = Field_Logic.get_option(Type.DATA_CATEGORY,option);
|
|
1587
|
-
let items = [];
|
|
1588
|
-
for(let a=0;a<option.category_count;a++){
|
|
1589
|
-
items.push(Category_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1590
|
-
}
|
|
1591
|
-
return items;
|
|
1592
|
-
}
|
|
1593
|
-
static get_test_items_by_type = (type,option) =>{
|
|
1594
|
-
option = Field_Logic.get_option(Type.DATA_CATEGORY,option);
|
|
1595
|
-
let categorys = [];
|
|
1596
|
-
for(let a=0;a<option.category_count;a++){
|
|
1597
|
-
let category = Data_Logic.get_new(Type.DATA_CATEGORY,0,Field_Logic.get_test("Category " +String(parseInt(a+1)),option));
|
|
1598
|
-
category.type = type;
|
|
1599
|
-
categorys.push(category);
|
|
1600
|
-
}
|
|
1601
|
-
return categorys;
|
|
1602
|
-
};
|
|
1603
1043
|
static get_category_drop_down_by_items = (items) => {
|
|
1604
1044
|
let categorys = [];
|
|
1605
1045
|
for(let a=0;a<items.length;a++){
|
|
@@ -1643,18 +1083,6 @@ class Storage {
|
|
|
1643
1083
|
}
|
|
1644
1084
|
}
|
|
1645
1085
|
class User_Logic {
|
|
1646
|
-
static url_register = (app_id,url,param) => {
|
|
1647
|
-
let action_url="user/register";
|
|
1648
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1649
|
-
};
|
|
1650
|
-
static url_login = (app_id,url,param) => {
|
|
1651
|
-
let action_url="user/login";
|
|
1652
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1653
|
-
};
|
|
1654
|
-
static url_logout = (app_id,url,param) => {
|
|
1655
|
-
let action_url="user/logout";
|
|
1656
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1657
|
-
};
|
|
1658
1086
|
static get_country_state_city(item){
|
|
1659
1087
|
let country_state_city = "";
|
|
1660
1088
|
if(item.country == "United States"){
|
|
@@ -1683,10 +1111,9 @@ class User_Logic {
|
|
|
1683
1111
|
let str_first_name = !Str.check_is_null(first_name) ? first_name : "";
|
|
1684
1112
|
let str_last_name = !Str.check_is_null(last_name) ? last_name : "";
|
|
1685
1113
|
return !Str.check_is_null(String(str_first_name + " " + str_last_name)) ? String(str_first_name + " " + str_last_name).trim() : "N/A";
|
|
1686
|
-
|
|
1687
1114
|
}
|
|
1688
1115
|
static get_guest(){
|
|
1689
|
-
return Data_Logic.get_new(Type.DATA_USER,0,{is_guest:true,title_url:'guest',first_name:'Guest',last_name:'User',email:'guest@email.com',title:"Guest",country:"United States"});
|
|
1116
|
+
return Data_Logic.get_new(Type.DATA_USER,0,{data:{guest:{is_guest:true,title_url:'guest',first_name:'Guest',last_name:'User',email:'guest@email.com',title:"Guest",country:"United States"}}});
|
|
1690
1117
|
}
|
|
1691
1118
|
static get_request_user(req){
|
|
1692
1119
|
if(!req || !req.session.user){
|
|
@@ -1702,88 +1129,62 @@ class User_Logic {
|
|
|
1702
1129
|
req.session.user=null;
|
|
1703
1130
|
delete req.session.user;
|
|
1704
1131
|
}
|
|
1705
|
-
static get_test = (
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
user.state="";
|
|
1716
|
-
user.password="";
|
|
1717
|
-
user.country="";
|
|
1718
|
-
}else{
|
|
1719
|
-
user.first_name="First Name "+ Num.get_id();
|
|
1720
|
-
user.last_name="First Name "+ Num.get_id();
|
|
1721
|
-
user.email="email"+ Num.get_id() + "@email.com";
|
|
1722
|
-
user.city="City"+ Num.get_id();
|
|
1723
|
-
user.state="State"+ Num.get_id();
|
|
1724
|
-
user.password="1234567";
|
|
1725
|
-
user.country="United States";
|
|
1726
|
-
}
|
|
1727
|
-
return user;
|
|
1132
|
+
static get_test = () =>{
|
|
1133
|
+
let data = {};
|
|
1134
|
+
data.first_name="First Name "+ Num.get_id();
|
|
1135
|
+
data.last_name="First Name "+ Num.get_id();
|
|
1136
|
+
data.email="email"+ Num.get_id() + "@email.com";
|
|
1137
|
+
data.city="City"+ Num.get_id();
|
|
1138
|
+
data.state="State"+ Num.get_id();
|
|
1139
|
+
data.password="1234567";
|
|
1140
|
+
data.country="United States";
|
|
1141
|
+
return data;
|
|
1728
1142
|
};
|
|
1729
|
-
static get_test_items = (option) =>{
|
|
1730
|
-
option = Field_Logic.get_option(Type.DATA_USER,option?option:{});
|
|
1731
|
-
let items = [];
|
|
1732
|
-
for(let a=0;a<option.user_count+1;a++){
|
|
1733
|
-
items.push(User_Logic.get_test("User " +String(parseInt(a+1)),option));
|
|
1734
|
-
}
|
|
1735
|
-
return items;
|
|
1736
|
-
}
|
|
1737
1143
|
}
|
|
1738
1144
|
class Data_Logic {
|
|
1739
|
-
static
|
|
1740
|
-
return
|
|
1145
|
+
static get = (data_type,id,option) => {
|
|
1146
|
+
return Data_Logic.get_new(data_type,id,option);
|
|
1741
1147
|
};
|
|
1742
|
-
static
|
|
1148
|
+
static get_new = (data_type,id,option) => {
|
|
1149
|
+
let data = {data_type:data_type,id:id};
|
|
1743
1150
|
option = option ? option : {};
|
|
1744
|
-
|
|
1151
|
+
data = Field_Logic.get_base_option(data,option);
|
|
1745
1152
|
if(option.test){
|
|
1746
1153
|
switch(data_type)
|
|
1747
1154
|
{
|
|
1748
|
-
case Type.DATA_CATEGORY:
|
|
1749
|
-
option.data = Obj.merge(Category_Logic.get_test(),option.data);
|
|
1750
|
-
break;
|
|
1751
1155
|
case Type.DATA_BLOG_POST:
|
|
1752
|
-
|
|
1156
|
+
data = Obj.merge(Blog_Post_Logic.get_test(),data);
|
|
1753
1157
|
break;
|
|
1754
1158
|
case Type.DATA_SERVICE:
|
|
1755
|
-
|
|
1159
|
+
data = Obj.merge(Service_Logic.get_test(),data);
|
|
1160
|
+
break;
|
|
1161
|
+
case Type.DATA_EVENT:
|
|
1162
|
+
data = Obj.merge(Event_Logic.get_test(),data);
|
|
1756
1163
|
break;
|
|
1757
1164
|
case Type.DATA_PRODUCT:
|
|
1758
|
-
|
|
1165
|
+
data = Obj.merge(Product_Logic.get_test(),data);
|
|
1759
1166
|
break;
|
|
1167
|
+
case Type.DATA_CONTENT:
|
|
1168
|
+
case Type.DATA_CATEGORY:
|
|
1760
1169
|
case Type.DATA_BLANK:
|
|
1761
|
-
|
|
1170
|
+
data = Obj.merge(Blank_Logic.get_test(),data);
|
|
1762
1171
|
break;
|
|
1763
1172
|
case Type.DATA_USER:
|
|
1764
|
-
|
|
1173
|
+
data = Obj.merge(User_Logic.get_test(),data);
|
|
1765
1174
|
break;
|
|
1766
1175
|
default:
|
|
1767
|
-
|
|
1768
|
-
|
|
1176
|
+
data = Obj.merge(Blank_Logic.get_test(),data);
|
|
1177
|
+
data.data_type = data_type;
|
|
1769
1178
|
break;
|
|
1770
1179
|
}
|
|
1771
1180
|
}
|
|
1772
|
-
if(option.
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
}
|
|
1779
|
-
if(option.title){
|
|
1780
|
-
option.data[Type.FIELD_TITLE] = option.title;
|
|
1781
|
-
option.data[Type.FIELD_TITLE_URL] = Str.get_title_url(option.title);
|
|
1782
|
-
}else{
|
|
1783
|
-
option.data[Type.FIELD_TITLE] = Type.get_title(data_type);
|
|
1784
|
-
option.data[Type.FIELD_TITLE_URL] = Str.get_title_url(Type.get_title(data_type));
|
|
1181
|
+
if(option.test_blank){
|
|
1182
|
+
for(const field in data){
|
|
1183
|
+
if(field != Type.FIELD_ID && field != Type.FIELD_DATA_TYPE){
|
|
1184
|
+
data[field] = '';
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1785
1187
|
}
|
|
1786
|
-
let data = Data_Logic.get_new(data_type,id,option.data?option.data:{});
|
|
1787
1188
|
return data;
|
|
1788
1189
|
};
|
|
1789
1190
|
static get_search = (data_type,filter,sort_by,page_current,page_size) => {
|
|
@@ -1802,11 +1203,11 @@ class Data_Logic {
|
|
|
1802
1203
|
static get_search_foreign = (type,foreign_data_type,foreign_field,parent_field,option) => {
|
|
1803
1204
|
option = option ? option : {};
|
|
1804
1205
|
type = type ? type : Type.TITLE_ITEMS;
|
|
1805
|
-
foreign_data_type = foreign_data_type ? foreign_data_type : Str.get_title_url(Type.
|
|
1206
|
+
foreign_data_type = foreign_data_type ? foreign_data_type : Str.get_title_url(Type.get_data_type_by_type(foreign_data_type,{plural:true}));
|
|
1806
1207
|
foreign_field = foreign_field ? foreign_field : Type.FIELD_PARENT_ID;
|
|
1807
1208
|
parent_field = parent_field ? parent_field : parent_field;
|
|
1808
1209
|
let field = option.field ? option.field : {};
|
|
1809
|
-
let title = option.title ? option.title : Str.get_title_url(Type.
|
|
1210
|
+
let title = option.title ? option.title : Str.get_title_url(Type.get_data_type_by_type(foreign_data_type,{plural:true}));
|
|
1810
1211
|
let page_current = option.page_current ? option.page_current : 0;
|
|
1811
1212
|
let page_size = option.page_size ? option.page_size : 0;
|
|
1812
1213
|
return {type:type,foreign_data_type:foreign_data_type,foreign_field:foreign_field,parent_field:parent_field,type:type,field:field,title:title,page_current:page_current,page_size:page_size};
|
|
@@ -1816,11 +1217,34 @@ class Data_Logic {
|
|
|
1816
1217
|
type = type ? type : Type.TITLE_ITEMS;
|
|
1817
1218
|
search = search ? search : Data_Logic.get_search(Type.DATA_BLANK,{},{},1,0);
|
|
1818
1219
|
let field = option.field ? option.field : {};
|
|
1819
|
-
let title = option.title ? option.title : Str.get_title_url(Type.
|
|
1220
|
+
let title = option.title ? option.title : Str.get_title_url(Type.get_data_type_by_type(search.data_type,{plural:true}));
|
|
1820
1221
|
let page_current = option.page_current ? option.page_current : 1;
|
|
1821
1222
|
let page_size = option.page_size ? option.page_size : 0;
|
|
1822
1223
|
return {type:type,search:search,field:field,title:title,page_current:page_current,page_size:page_size};
|
|
1823
1224
|
}
|
|
1225
|
+
static get_copy = (data_type,item)=>{
|
|
1226
|
+
let copy_item = Data_Logic.get_new(data_type,0);
|
|
1227
|
+
const keys = Object.keys(item);
|
|
1228
|
+
keys.forEach(key => {
|
|
1229
|
+
if(
|
|
1230
|
+
key!=Type.FIELD_ID&&
|
|
1231
|
+
key!=Type.FIELD_SOURCE&&
|
|
1232
|
+
key!=Type.FIELD_TITLE&&
|
|
1233
|
+
key!=Type.FIELD_TITLE_URL&&
|
|
1234
|
+
key!=Type.FIELD_DATE_CREATE&&
|
|
1235
|
+
key!=Type.FIELD_DATE_SAVE&&
|
|
1236
|
+
key!=Type.TITLE_OBJ&&
|
|
1237
|
+
key!=Type.TITLE_USER&&
|
|
1238
|
+
key!=Type.TITLE_GROUP&&
|
|
1239
|
+
key!=Type.TITLE_ITEM&&
|
|
1240
|
+
!Obj.check_is_array(item[key])&&
|
|
1241
|
+
Obj.check_is_value(item[key])
|
|
1242
|
+
){
|
|
1243
|
+
copy_item[key]=item[key];
|
|
1244
|
+
}
|
|
1245
|
+
});
|
|
1246
|
+
return copy_item;
|
|
1247
|
+
};
|
|
1824
1248
|
static get_not_found = (data_type,id,option) =>{
|
|
1825
1249
|
option=option?option:{};
|
|
1826
1250
|
if(!data_type){
|
|
@@ -1833,78 +1257,40 @@ class Data_Logic {
|
|
|
1833
1257
|
if(!id){
|
|
1834
1258
|
id=0;
|
|
1835
1259
|
}
|
|
1836
|
-
let item =
|
|
1260
|
+
let item = Data_Logic.get(data_type,id);
|
|
1837
1261
|
item.id = 0;
|
|
1838
1262
|
item.id_key = id;
|
|
1839
1263
|
item.title = "Item Not Found";
|
|
1840
1264
|
item.title_url = Str.get_title_url(item.title);
|
|
1841
|
-
item.
|
|
1842
|
-
item.items = [];
|
|
1265
|
+
item.source = Type.TITLE_SOURCE_NOT_FOUND;
|
|
1843
1266
|
return item;
|
|
1844
1267
|
}else{
|
|
1845
|
-
let user =
|
|
1268
|
+
let user = Data_Logic.get(data_type,id);
|
|
1846
1269
|
user.id = 0;
|
|
1847
1270
|
user.id_key = id;
|
|
1848
1271
|
user.title = "User Not Found";
|
|
1849
1272
|
user.first_name = "User Not Found";
|
|
1850
1273
|
user.title_url = Str.get_title_url(user.title);
|
|
1851
|
-
user.
|
|
1852
|
-
user.items = [];
|
|
1274
|
+
user.source = Type.TITLE_SOURCE_NOT_FOUND;
|
|
1853
1275
|
return user;
|
|
1854
1276
|
}
|
|
1855
1277
|
};
|
|
1856
|
-
|
|
1857
1278
|
}
|
|
1858
1279
|
class App_Logic {
|
|
1859
|
-
|
|
1860
|
-
return get_cloud_url_main(app_id,host,url,param);
|
|
1861
|
-
};
|
|
1862
|
-
static bind_item_parent_users = (item,parent_item,user)=>{
|
|
1863
|
-
for(const prop in parent_item) {
|
|
1864
|
-
item['parent_'+prop] = parent_item[prop];
|
|
1865
|
-
}
|
|
1866
|
-
for(const prop in user) {
|
|
1867
|
-
item['user_'+prop] = user[prop];
|
|
1868
|
-
}
|
|
1869
|
-
return item;
|
|
1870
|
-
};
|
|
1871
|
-
static bind_item_parent_users = (items)=>{
|
|
1872
|
-
for(let item of items) {
|
|
1873
|
-
item = App_Logic.bind_item_parent_user_obj(item);
|
|
1874
|
-
}
|
|
1875
|
-
return items;
|
|
1876
|
-
};
|
|
1877
|
-
static bind_item_parent_user_obj = (item)=>{
|
|
1878
|
-
if(!item.user){
|
|
1879
|
-
item.user = {};
|
|
1880
|
-
}
|
|
1881
|
-
if(!item.parent_item){
|
|
1882
|
-
item.parent_item = {};
|
|
1883
|
-
}
|
|
1884
|
-
for(const prop in item.parent_item) {
|
|
1885
|
-
item['parent_'+prop] = item.parent_item[prop];
|
|
1886
|
-
}
|
|
1887
|
-
for(const prop in item.user) {
|
|
1888
|
-
item['user_'+prop] = item.user[prop];
|
|
1889
|
-
}
|
|
1890
|
-
return item;
|
|
1891
|
-
};
|
|
1892
|
-
static url_dashboard_user_home = (app_id,url,param) => {
|
|
1893
|
-
let action_url="dashboard/user_home";
|
|
1894
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1895
|
-
};
|
|
1896
|
-
static url_dashboard_app_home = (app_id,url,param) => {
|
|
1897
|
-
let action_url="dashboard/app_home";
|
|
1898
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1899
|
-
};
|
|
1900
|
-
static get_new = (title,user_id,type,option) =>{
|
|
1901
|
-
option = Field_Logic.get_option(Type.DATA_APP,option?option:{});
|
|
1280
|
+
static get = (title,user_id,type) =>{
|
|
1902
1281
|
let app = Data_Logic.get_new(Type.DATA_APP,0);
|
|
1903
1282
|
app.title = title;
|
|
1904
1283
|
app.user_id = user_id;
|
|
1905
1284
|
app.type = type;
|
|
1906
1285
|
return app;
|
|
1907
1286
|
}
|
|
1287
|
+
static get_url = (app_id,host,url,param) => {
|
|
1288
|
+
if(!param){
|
|
1289
|
+
param='';
|
|
1290
|
+
}
|
|
1291
|
+
var app_id_url='?app_id='+app_id;
|
|
1292
|
+
return host+"/"+url+app_id_url + param;
|
|
1293
|
+
};
|
|
1908
1294
|
static get_search_query(search){
|
|
1909
1295
|
let url = "";
|
|
1910
1296
|
if(search.data_type){
|
|
@@ -1953,26 +1339,8 @@ class App_Logic {
|
|
|
1953
1339
|
}
|
|
1954
1340
|
return Data_Logic.get_search(query.data_type,filter,sort_by,query.page_current,query.page_size);
|
|
1955
1341
|
}
|
|
1956
|
-
static get_data_search_result = (app_id,data_type,item_count,page_count,filter,items,option) =>{
|
|
1957
|
-
return{
|
|
1958
|
-
option:option?option:{},
|
|
1959
|
-
data_type:data_type?data_type:Type.DATA_BLANK,
|
|
1960
|
-
item_count:item_count?item_count:0,
|
|
1961
|
-
page_count:page_count?page_count:1,
|
|
1962
|
-
filter:filter?filter:{},
|
|
1963
|
-
items:items?items:[]
|
|
1964
|
-
}
|
|
1965
|
-
}
|
|
1966
1342
|
}
|
|
1967
1343
|
class File_Logic {
|
|
1968
|
-
static url_post = (app_id,url,param) => {
|
|
1969
|
-
let action_url="main/file/post";
|
|
1970
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1971
|
-
};
|
|
1972
|
-
static url_post_cdn = (app_id,url,param) => {
|
|
1973
|
-
let action_url="main/file/post_cdn";
|
|
1974
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1975
|
-
};
|
|
1976
1344
|
static url = (host,file_filename,size,param) =>{
|
|
1977
1345
|
host = host ? host : "";
|
|
1978
1346
|
file_filename = file_filename ? file_filename : "";
|
|
@@ -1980,8 +1348,8 @@ class File_Logic {
|
|
|
1980
1348
|
param = param ? param : "";
|
|
1981
1349
|
return host+"/"+size + "_"+file_filename+param;
|
|
1982
1350
|
}
|
|
1983
|
-
static
|
|
1984
|
-
let item = Data_Logic.get_new(Type.DATA_FILE,0,item_file);
|
|
1351
|
+
static get_by_base64 = (item_file) =>{
|
|
1352
|
+
let item = Data_Logic.get_new(Type.DATA_FILE,0,{data:item_file});
|
|
1985
1353
|
item.extension = !Str.check_is_null(Str.get_file_type_from_base64(item.file_data)) ? Str.get_file_type_from_base64(item.file_data).extension : 'txt';
|
|
1986
1354
|
item.file_filename = !Str.check_is_null(Str.get_file_type_from_base64(item.file_data)) ? Str.get_guid()+ "." + item.extension : 'not_found.txt';
|
|
1987
1355
|
item.buffer = !Str.check_is_null(Str.get_file_type_from_base64(item_file.file_data)) ? Buffer.from(item_file.file_data.split(';base64,').pop(), 'base64') : null;
|
|
@@ -1989,14 +1357,6 @@ class File_Logic {
|
|
|
1989
1357
|
};
|
|
1990
1358
|
};
|
|
1991
1359
|
class Image_Logic {
|
|
1992
|
-
static url_post = (app_id,url,param) => {
|
|
1993
|
-
let action_url="main/image/post";
|
|
1994
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1995
|
-
};
|
|
1996
|
-
static url_post_cdn = (app_id,url,param) => {
|
|
1997
|
-
let action_url="main/image/post_cdn";
|
|
1998
|
-
return get_cloud_url_main(app_id,url,action_url,param);
|
|
1999
|
-
};
|
|
2000
1360
|
static url = (host,image_filename,size,param) =>{
|
|
2001
1361
|
host = host ? host : "";
|
|
2002
1362
|
image_filename = image_filename ? image_filename : "";
|
|
@@ -2004,8 +1364,8 @@ class Image_Logic {
|
|
|
2004
1364
|
param = param ? param : "";
|
|
2005
1365
|
return host+"/"+size + "_"+image_filename+param;
|
|
2006
1366
|
}
|
|
2007
|
-
static
|
|
2008
|
-
let item = Data_Logic.get_new(Type.DATA_IMAGE,0,item_image);
|
|
1367
|
+
static get_by_base64 = (item_image) =>{
|
|
1368
|
+
let item = Data_Logic.get_new(Type.DATA_IMAGE,0,{data:item_image});
|
|
2009
1369
|
item.extension = !Str.check_is_null(Str.get_file_type_from_base64(item.image_data)) ? Str.get_file_type_from_base64(item.image_data).extension : 'jpeg';
|
|
2010
1370
|
item.image_filename = !Str.check_is_null(Str.get_file_type_from_base64(item.image_data)) ? Str.get_guid()+ "." + item.extension : 'not_found.jpeg';
|
|
2011
1371
|
item.buffer = !Str.check_is_null(Str.get_file_type_from_base64(item_image.image_data)) ? Buffer.from(item_image.image_data.split(';base64,').pop(), 'base64') : null;
|
|
@@ -2144,31 +1504,25 @@ class Url {
|
|
|
2144
1504
|
}
|
|
2145
1505
|
module.exports = {
|
|
2146
1506
|
App_Logic,
|
|
2147
|
-
Admin_Logic,
|
|
2148
1507
|
Blank_Logic,
|
|
2149
1508
|
Blog_Post_Logic,
|
|
2150
1509
|
Cart_Logic,
|
|
2151
1510
|
Category_Logic,
|
|
2152
|
-
Content_Logic,
|
|
2153
1511
|
Data_Logic,
|
|
2154
1512
|
Event_Logic,
|
|
2155
1513
|
File_Logic,
|
|
2156
1514
|
Field_Logic,
|
|
2157
1515
|
Favorite_Logic,
|
|
2158
1516
|
Gallery_Logic,
|
|
2159
|
-
Item_Logic,
|
|
2160
1517
|
Image_Logic,
|
|
2161
1518
|
Message,
|
|
2162
1519
|
Order_Logic,
|
|
2163
|
-
Page_Logic,
|
|
2164
1520
|
Product_Logic,
|
|
2165
1521
|
Review_Logic,
|
|
2166
1522
|
Service_Logic,
|
|
2167
1523
|
Stat_Logic,
|
|
2168
1524
|
Storage,
|
|
2169
|
-
Template_Logic,
|
|
2170
1525
|
Type,
|
|
2171
|
-
Title,
|
|
2172
1526
|
User_Logic,
|
|
2173
1527
|
Url
|
|
2174
1528
|
};
|