biz9-logic 4.0.25 → 4.0.28

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 CHANGED
@@ -1,4 +1,4 @@
1
- VERSION='4.2.5'
1
+ VERSION='4.2.8'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -35,31 +35,34 @@ class Template{
35
35
  };
36
36
  }
37
37
  class Page{
38
- static get_test = (title) =>{
38
+ static get_test = (option) =>{
39
+ if(!option){
40
+ option = {item_count:9,page_count:9,get_value:false,get_item:false};
41
+ }
39
42
  let page = DataItem.get_new_full_item(
40
43
  DataItem.get_new(DataType.PAGE,Number.get_id()),
41
44
  DataItem.get_new(DataType.PAGE,0),
42
45
  DataItem.get_new(DataType.PAGE,0),
43
- Field.get_test(title));
44
-
45
- for(let a=0;a<20;a++){
46
- page=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section "+a,page,page,page);
46
+ Field.get_test("Page "+ String(Number.get_id()),option));
47
+ if(option.get_item){
48
+ for(let a=0;a<option.item_count;a++){
49
+ page=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section "+a,page,page,page);
50
+ }
51
+ page=Sub_Item.get_test_bind_item_sub_item(page);
47
52
  }
48
- page = Sub_Item.get_test_bind_item_sub_item(page);
49
-
50
53
  return page;
51
54
  };
52
55
  }
53
56
  class Product{
54
57
  static get_test = (option) =>{
55
58
  if(!option){
56
- option={};
59
+ option = {item_count:9,product_count:9,get_value:false,get_item:false};
57
60
  }
58
61
  let product = DataItem.get_new_full_item(
59
62
  DataItem.get_new(DataType.PRODUCT,Number.get_id()),
60
63
  DataItem.get_new(DataType.PRODUCT,0),
61
64
  DataItem.get_new(DataType.PRODUCT,0),
62
- Field.get_test("Product "+Number.get_id(),{get_value:false}));
65
+ Field.get_test("Product "+Number.get_id(),option));
63
66
  product.cost = String(Number.get_id()) + "." + String(Number.get_id());
64
67
  product.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
65
68
  product.type = "Type "+String(Number.get_id());
@@ -67,14 +70,14 @@ class Product{
67
70
  product.stock = String(Number.get_id(3-1));
68
71
  product.category ="Category " + String(Number.get_id());
69
72
  if(option.get_item){
70
- product = Sub_Item.get_test_bind_new_child(Number.get_id(),"Product "+Number.get_id(),product,product,product);
71
- for(let a=0;a<10;a++){
72
- product=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section " + String(a),product,product,product);
73
+ for(let a=0;a<option.item_count;a++){
74
+ product=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section "+a,product,product,product);
73
75
  }
74
- product = Sub_Item.get_test_bind_item_sub_item(product);
76
+ product=Sub_Item.get_test_bind_item_sub_item(product);
75
77
  }
76
78
  return product;
77
79
  };
80
+
78
81
  static get_test_list_by_category = (option) =>{
79
82
  let product_list = [];
80
83
  let category_count = 9;
@@ -106,13 +109,13 @@ class Product{
106
109
  class Service{
107
110
  static get_test = (option) =>{
108
111
  if(!option){
109
- option = {get_value:false,get_item:false};
110
- }
112
+ option = {item_count:9,service_count:9,get_value:false,get_item:false};
113
+ }
111
114
  let service = DataItem.get_new_full_item(
112
115
  DataItem.get_new(DataType.SERVICE,Number.get_id()),
113
116
  DataItem.get_new(DataType.SERVICE,0),
114
117
  DataItem.get_new(DataType.SERVICE,0),
115
- Field.get_test("Service "+Number.get_id(),{get_value:false}));
118
+ Field.get_test("Service "+ String(Number.get_id()),option));
116
119
  service = Sub_Item.get_test_bind_new_child(Number.get_id(),"Service "+Number.get_id(),service,service,service);
117
120
  service.cost = String(Number.get_id()) + "." + String(Number.get_id());
118
121
  service.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
@@ -121,13 +124,12 @@ class Service{
121
124
  service.stock = String(Number.get_id(3-1));
122
125
  service.category ="Category " + String(Number.get_id());
123
126
  if(option.get_item){
124
- service = Sub_Item.get_test_bind_new_child(Number.get_id(),"Service "+Number.get_id(),service,service,service);
125
- for(let a=0;a<10;a++){
126
- service=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section " + String(a),service,service,service);
127
+ for(let a=0;a<option.item_count;a++){
128
+ service=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section "+a,service,service,service);
127
129
  }
128
- service = Sub_Item.get_test_bind_item_sub_item(service);
130
+ service=Sub_Item.get_test_bind_item_sub_item(service);
129
131
  }
130
- return service;
132
+ return service;
131
133
  };
132
134
  static get_test_list=(option)=>{
133
135
  if(!option){
@@ -143,13 +145,13 @@ class Service{
143
145
  class Event{
144
146
  static get_test = (option) =>{
145
147
  if(!option){
146
- option = {get_value:false,get_item:false};
148
+ option = {item_count:9,event_count:9,get_value:false,get_item:false};
147
149
  }
148
150
  let event = DataItem.get_new_full_item(
149
151
  DataItem.get_new(DataType.EVENT,Number.get_id()),
150
152
  DataItem.get_new(DataType.EVENT,0),
151
153
  DataItem.get_new(DataType.EVENT,0),
152
- Field.get_test("Event "+Number.get_id(),{get_value:false}));
154
+ Field.get_test("Event "+ String(Number.get_id()),option));
153
155
  event = Sub_Item.get_test_bind_new_child(Number.get_id(),"Event "+Number.get_id(),event,event,event);
154
156
  event.cost = String(Number.get_id()) + "." + String(Number.get_id());
155
157
  event.old_cost = String(Number.get_id()) + "." + String(Number.get_id());
@@ -161,13 +163,12 @@ class Event{
161
163
  event.stock = String(Number.get_id(3-1));
162
164
  event.category ="Category " + String(Number.get_id());
163
165
  if(option.get_item){
164
- event=Sub_Item.get_test_bind_new_child(Number.get_id(),"Event "+Number.get_id(),event,event,event);
165
- for(let a=0;a<10;a++){
166
- event=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section " +String(a),event,event,event);
166
+ for(let a=0;a<option.item_count;a++){
167
+ event=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section "+a,event,event,event);
167
168
  }
168
169
  event=Sub_Item.get_test_bind_item_sub_item(event);
169
170
  }
170
- return event;
171
+ return event;
171
172
  };
172
173
  static get_test_list=(option)=>{
173
174
  if(!option){
@@ -188,7 +189,6 @@ class Field{
188
189
  if(!option){
189
190
  option={get_value:true};
190
191
  }
191
- Log.w('option',option);
192
192
  let item = {
193
193
  date_create:new moment().toISOString(),
194
194
  date_save:new moment().toISOString(),
@@ -326,20 +326,19 @@ class DataType {
326
326
  class Blog_Post{
327
327
  static get_test = (option) =>{
328
328
  if(!option){
329
- option = {get_value:false,get_item:false};
329
+ option = {item_count:9,blog_post_count:9,get_value:false,get_item:false};
330
330
  }
331
331
  let blog_post = DataItem.get_new_full_item(
332
332
  DataItem.get_new(DataType.BLOG_POST,Number.get_id()),
333
333
  DataItem.get_new(DataType.BLOG_POST,0),
334
334
  DataItem.get_new(DataType.BLOG_POST,0),
335
- Field.get_test("Blog Post "+Number.get_id(),{get_value:false}));
335
+ Field.get_test("Blog Post "+Number.get_id(),option));
336
336
  blog_post.author="First Name "+ Number.get_id();
337
337
  blog_post.tag="tag 1,tag 2,tag 3";
338
338
  blog_post.category ="Category " + String(Number.get_id());
339
339
  if(option.get_item){
340
- blog_post=Sub_Item.get_test_bind_new_child(Number.get_id(),"Blog Post "+Number.get_id(),blog_post,blog_post,blog_post);
341
- for(let a=0;a<10;a++){
342
- blog_post=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section " +String(a),blog_post,blog_post,blog_post);
340
+ for(let a=0;a<option.item_count;a++){
341
+ blog_post=Sub_Item.get_test_bind_new_child(Number.get_id(),"Section "+a,blog_post,blog_post,blog_post);
343
342
  }
344
343
  blog_post=Sub_Item.get_test_bind_item_sub_item(blog_post);
345
344
  }
@@ -347,11 +346,11 @@ class Blog_Post{
347
346
  };
348
347
  static get_test_list=(option)=>{
349
348
  if(!option){
350
- option={blog_post_count:19};
349
+ option = {item_count:9,blog_post_count:9,get_value:false,get_item:false};
351
350
  }
352
351
  let item_list=[];
353
352
  for(let a=0;a<option.blog_post_count;a++){
354
- item_list.push(Blog_Post.get_test());
353
+ item_list.push(Blog_Post.get_test(option));
355
354
  }
356
355
  return item_list;
357
356
  };
@@ -369,7 +368,7 @@ class Review{
369
368
  review.first_name="First Name "+ Number.get_id();
370
369
  review.last_name="Last Name "+ Number.get_id();
371
370
  review.position="Position "+ Number.get_id();
372
- review.comment="My comment "+ Number.get_id();
371
+ review.comment="My comment "+ Number.get_id() + "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
373
372
  review.city=city_list[Number.get_id(city_list.length-1)];
374
373
  review.state=state_list[Number.get_id(state_list.length-1)];
375
374
  return review;
@@ -418,7 +417,7 @@ class Business {
418
417
  item.address_2="PO Box "+Number.get_id();
419
418
  item.city=city_list[Number.get_id(city_list.length-1)];
420
419
  item.state=state_list[Number.get_id(state_list.length-1)];
421
- item.zip="123"+Number.get_id();
420
+ item.zip=Number.get_id(9999);
422
421
  return item;
423
422
  };
424
423
  static get_full_address(business){
package/main_test.js CHANGED
@@ -1,9 +1,4 @@
1
1
  const { DataItem,DataType } = require('biz9-logic');
2
- console.log('aaaaaa');
3
- console.log('aaaaaa');
4
- console.log('aaaaaa');
5
- console.log(DataType);
6
- console.log('bbbbbbbb');
7
2
  const get_template_test = () =>{
8
3
  let template = DataItem.get_new_full_item(
9
4
  DataItem.get_new(DataType.TEMPLATE,Number.get_id()),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "4.0.25",
3
+ "version": "4.0.28",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -29,7 +29,7 @@ describe("connect", () => {
29
29
  it("_connect", () => {
30
30
  series([
31
31
 
32
- function(call) {
32
+ function(call) {
33
33
  console.log('CONNECT-START');
34
34
 
35
35
  /* --CONFIG--START */
@@ -37,58 +37,57 @@ describe("connect", () => {
37
37
  //let cloud_url = Url.connect(biz9_config);
38
38
  /* --CONFIG--END */
39
39
 
40
-
41
- /* --DATA_TYPE--START */
42
- //Log.w('data_type_list',DataType.get_item_list());
43
- /* --DATA_TYPE--END */
44
-
45
- /* --REVIEW--START */
46
- //Log.w("Review",Review.get_test());
47
- //Log.w("Review List",Review.get_test_list());
40
+ /* --PAGE--START */
48
41
  /*
49
- let review_list = Review.get_test_list({review_count:3,get_item:true})
50
- Log.w("Review List",review_list);
42
+ let page = Page.get_test({item_count:9,page_count:19,get_item:true,get_value:true})
43
+ //let page = Page.get_test()
44
+ Log.w("Page",page);
45
+ Log.w("Page_section_1",page.section_1);
46
+ Log.w("Page_section_1_section_1_section_1",page.section_1.section_1.section_1);
51
47
  */
52
- /* --REVIEW--END */
48
+ /* --PAGE--END */
53
49
 
54
- /* --BLOG_POST--START */
50
+ /* --PRODUCT--START */
51
+ //let product = Product.get_test({item_count:9,product_count:19,get_item:true,get_value:true})
55
52
  /*
56
- let blog_post_list = Blog_Post.get_test_list({blog_post_count:3,get_item:true})
57
- Log.w("Blog Post List",blog_post_list);
53
+ let product = Product.get_test()
54
+ Log.w("Product",product);
55
+ Log.w("Product_section_1",product.section_1);
56
+ Log.w("Product_section_1_section_1_section_1",product.section_1.section_1.section_1);
58
57
  */
58
+ /* --PRODUCT--END */
59
+
60
+ /* --SERVICE--START */
59
61
  /*
60
- let blog_post = Blog_Post.get_test({get_item:true})
61
- Log.w("Blog Post",blog_post);
62
- Log.w("Blog Post Section 1",blog_post.section_1);
63
- Log.w("Blog Post Section 1, Section 1",blog_post.section_1.section_1);
62
+ let service = Service.get_test({item_count:9,service_count:19,get_item:true,get_value:true})
63
+ //let service = Service.get_test()
64
+ Log.w("Service",service);
65
+ Log.w("Service_section_1",service.section_1);
66
+ Log.w("Service_section_1_section_1_section_1",service.section_1.section_1.section_1);
64
67
  */
65
- /* --BLOG_POST--END */
68
+ /* --SERVICE--END */
66
69
 
67
70
  /* --SERVICE--START */
68
- let service_list = Service.get_test_list({service_count:3,get_item:true})
69
- Log.w("Service List",service_list);
71
+ /*
72
+ let event = Event.get_test({item_count:9,event_count:19,get_item:true,get_value:true})
73
+ //let service = Service.get_test()
74
+ Log.w("Event",event);
75
+ Log.w("Event_section_1",event.section_1);
76
+ Log.w("Event_section_1_section_1_section_1",event.section_1.section_1.section_1);
77
+ */
70
78
  /* --SERVICE--END */
71
79
 
72
80
 
73
- /* --EVENT--START */
74
- /*
75
- let event_list = Event.get_test_list({event_count:3,get_item:true})
76
- Log.w("Event List",event_list);
77
- */
78
- //let event = Event.get_test({get_item:true})
79
- //Log.w("Event",event);
80
- //Log.w("Event Section 1",event.section_1);
81
- //Log.w("Event Section 1, Section 1",event.section_1.section_1);
82
- /* --EVENT--END */
83
81
 
84
- /* --PRODUCT--START */
82
+ /* --REVIEW--START */
83
+ //Log.w("Review",Review.get_test());
84
+ //Log.w("Review List",Review.get_test_list());
85
85
  /*
86
- let product = Product.get_test({get_item:true})
87
- Log.w("Product",product);
88
- Log.w("Product Section 1",product.section_1);
89
- Log.w("Product Section 1, Section 1",product.section_1.section_1);
86
+ let review_list = Review.get_test_list({review_count:3,get_item:true})
87
+ Log.w("Review List",review_list);
90
88
  */
91
- /* --PRODUCT--END */
89
+ /* --REVIEW--END */
90
+
92
91
 
93
92
 
94
93
 
@@ -99,36 +98,6 @@ describe("connect", () => {
99
98
 
100
99
 
101
100
 
102
- /* --CATEGORY--START */
103
- //Log.w("Category",Category.get_test("Category " + Number.get_id(),{get_items:false}));
104
- //let category = Category.get_test_list_by_category();
105
- /* --CATEGORY--END */
106
-
107
-
108
- /* --PRODUCT--START */
109
- //let product = Product.get_test_list_by_category();
110
- //Log.w('product_test',Product.get_test("Product " + Number.get_id(),{get_items:false}));
111
- //Log.w('product_list_test',Product.get_test_list_by_category({get_items:false,product_count:9,category_count:3}));
112
- //console.log(Product.get_test("Product " + Number.get_id(),{get_items:false}));
113
- /* --PRODUCT--END */
114
-
115
- //console.log(Template.get_test()); //get_template_test
116
- //console.log(Business.get_test()); // get_business_test
117
- // console.log(Page.get_test("Page " +String(Number.get_id()))); // get_page_test
118
- //console.log(Page.get_test("Page " +String("Cool"))); // get_page_test
119
- //console.log(Event.get_test());
120
- //console.log(Product.get_test("Product " +String(Number.get_id()))); // get_product_test
121
- //console.log(Service.get_test("Service " +String(Number.get_id()))); // get_service_test
122
- //console.log(Event.get_test("Event " +String(Number.get_id()))); // get_service_test
123
- //console.log(Category.get_test()); // get_category_test
124
- //console.log(product.section_1);
125
- //get page
126
-
127
- //Log.w('product',product);
128
- //Log.w('product_section_1',product.section_1);
129
-
130
- //console.log(Product.get_test());
131
- //Log.w('connect_url',cloud_url);
132
101
  console.log('CONNECT-SUCCESS');
133
102
  //call()
134
103
  },
@@ -244,10 +213,10 @@ describe("connect", () => {
244
213
  category_list.push({data_type:DataType.BLANK,id:0,title:Number.get_id()});
245
214
  category_list.push({data_type:DataType.BLANK,id:0,title:Number.get_id()});
246
215
  Log.w('cat',Cat.set_category_drop_down_list(category_list));
247
- //let cloud_url = CMS.get_new_query_item_by_item(item);
248
- //Log.w('connect_url',cloud_url);
249
- //console.log('SET_CATEGORY_DROP_DOWN_LIST-END');
250
- //call()
216
+ //let cloud_url = CMS.get_new_query_item_by_item(item);
217
+ //Log.w('connect_url',cloud_url);
218
+ //console.log('SET_CATEGORY_DROP_DOWN_LIST-END');
219
+ //call()
251
220
  },
252
221
 
253
222
 
@@ -262,10 +231,10 @@ describe("connect", () => {
262
231
  item.top_id = Number.get_id();
263
232
  item.top_data_type = DataType.BLANK;
264
233
  Log.w('item',item);
265
- //let cloud_url = CMS.get_new_query_item_by_item(item);
266
- //Log.w('connect_url',cloud_url);
234
+ //let cloud_url = CMS.get_new_query_item_by_item(item);
235
+ //Log.w('connect_url',cloud_url);
267
236
  console.log('GET-NEW-QUERY-ITEM-BY-ITEM-SUCCESS');
268
- //call()
237
+ //call()
269
238
  },
270
239
 
271
240
 
@@ -279,7 +248,7 @@ describe("connect", () => {
279
248
  let cloud_url = BiZ_Url.get_full_item(biz9_config,item,parent_item,top_item);
280
249
  Log.w('connect_url',cloud_url);
281
250
  console.log('GET-BiZ-Full-Url-Item-Get-Item-SUCCESS');
282
- //call()
251
+ //call()
283
252
  },
284
253
 
285
254
 
@@ -395,21 +364,21 @@ describe("connect", () => {
395
364
  console.log('GET_URL-BIZ-ITEM-START');
396
365
  let biz9_config = Scriptz.get_biz9_config({biz9_config_file:path.resolve('../../biz9_config')});
397
366
  let data_type = 'dt_blank';
398
- //let cloud_url = Url.get_biz_item(biz9_config,data_type,ID);
367
+ //let cloud_url = Url.get_biz_item(biz9_config,data_type,ID);
399
368
  let cloud_url = Url.delete_biz_item(biz9_config,data_type,ID);
400
369
  Log.w('get_url_biz_item',cloud_url);
401
370
  console.log('GET_URL-BIZ-ITEM-SUCCESS');
402
371
  call()
403
372
  },
404
- */
405
- function(call) {
406
- // never happens, because "second thing"
407
- // passed an error to the done() callback
408
- }
373
+ */
374
+ function(call) {
375
+ // never happens, because "second thing"
376
+ // passed an error to the done() callback
377
+ }
409
378
  ], function(err) {
410
379
  console.log(err.message) // "another thing"
411
380
  })
412
- });
381
+ });
413
382
  });
414
383
 
415
384