biz9-logic 3.9.6 → 3.9.9

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='3.9.6'
1
+ VERSION='3.9.9'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -4,7 +4,7 @@ Author: certifiedcoderz@gmail.com (Certified CoderZ)
4
4
  License GNU General Public License v3.0
5
5
  Description: BiZ9 Framework: Logic-JS
6
6
  */
7
- const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_main,get_cloud_filter_obj_main,get_title_url_main } = require('./main');
7
+ const { get_new_item_main,get_data_config_main,get_cloud_url_main,get_biz_item_main,get_cloud_filter_obj_main } = require('./main');
8
8
  const { Log,Test,Str,DateTime } = require('biz9-utility');
9
9
 
10
10
  class Message {
@@ -12,7 +12,6 @@ class Message {
12
12
  static SUCCESS="Update Success";
13
13
  static LOGIN_GOOD="Login Success";
14
14
  static LOGIN_BAD="Login Incorrect";
15
-
16
15
  }
17
16
 
18
17
  class TemplateType {
@@ -24,6 +23,35 @@ class TemplateType {
24
23
  static FOOTER='footer';
25
24
  }
26
25
 
26
+ class FieldType {
27
+
28
+ static APP_TITLE_ID='app_title_id';
29
+ static ID='id';
30
+ static DATA_TYPE='data_type';
31
+
32
+ static PARENT_ID='parent_id';
33
+ static PARENT_DATA_TYPE='parent_data_type';
34
+ static PHOTO_DATA='photo_data';
35
+
36
+ static TOP_ID='top_id';
37
+ static TOP_DATA_TYPE='top_data_type';
38
+
39
+ static DATE_CREATE='date_create';
40
+ static DATE_SAVE='date_save';
41
+
42
+ static TITLE='title';
43
+ static TITLE_URL='title_url';
44
+
45
+ static SETTING_DELETE_PROTECTION='setting_delete_protection';
46
+ static SETTING_VISIBLE='setting_visible';
47
+ static SETTING_ORDER='setting_order';
48
+
49
+ static SOURCE='source';
50
+
51
+ static DATE_CREATE='date_create';
52
+ static DATE_SAVE='date_save';
53
+ }
54
+
27
55
  class PageType {
28
56
 
29
57
  static HOME='home';
@@ -107,6 +135,25 @@ class DataType {
107
135
  static USER='user_biz';
108
136
  static VIDEO='video_biz';
109
137
  }
138
+ class Business {
139
+
140
+ static get_full_address(business){
141
+ if(!business.address_1){
142
+ business.address_1 = "";
143
+ }
144
+ if(!business.address_2){
145
+ business.address_2 = "";
146
+ }
147
+ if(!business.city){
148
+ business.city = "";
149
+ }
150
+ if(!business.state){
151
+ business.state = "";
152
+ }
153
+
154
+ return business.address_1 + " "+ business.address_2 + " " + business.city + " " + business.state + " " + business.zip;
155
+ }
156
+ }
110
157
 
111
158
  class DataItem {
112
159
 
@@ -192,6 +239,11 @@ class Url {
192
239
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
193
240
  };
194
241
 
242
+ static copy_item = (biz9_config,data_type,id) => {
243
+ let action_url= "main/biz_item/copy/"+data_type + "/" + id;
244
+ return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
245
+ };
246
+
195
247
  static get_list = (biz9_config,data_type) => {
196
248
  let action_url= "main/crud/get_list/"+data_type;
197
249
  return get_cloud_url_main(biz9_config.APP_TITLE_ID,biz9_config.URL,action_url,null);
@@ -554,16 +606,18 @@ class Storage {
554
606
  }
555
607
  module.exports = {
556
608
  BiZ_Url,
609
+ Business,
557
610
  Cat,
558
611
  CMS,
559
612
  DataItem,
560
613
  DataType,
561
- PageType,
562
- TemplateType,
614
+ FieldType,
563
615
  Message,
564
616
  Obj,
617
+ PageType,
618
+ TemplateType,
619
+ Url,
565
620
  Storage,
566
621
  Schedule,
567
622
  Stock,
568
- Url,
569
623
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.9.6",
3
+ "version": "3.9.9",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
package/test.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
  const series = require('async-series');
3
- const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage} = require('./');
3
+ const {DataItem,DataType,Url,Obj,BiZ_Url,Cat,Stock,Schedule,Storage,Business} = require('./');
4
4
  const {Log,Test,Number} = require('biz9-utility');
5
5
  const {Scriptz}= require('biz9-scriptz');
6
6
 
@@ -37,8 +37,10 @@ describe("connect", () => {
37
37
  //let cloud_url = BiZ_Url.get_item(biz9_config,item.data_type,item.id);
38
38
  let title_url = 'primary';
39
39
  //let cloud_url = BiZ_Url.get_template(biz9_config,title_url);
40
- let cloud_url = BiZ_Url.get_page(biz9_config,title_url);
41
- Log.w('connect_url',cloud_url);
40
+ //let cloud_url = BiZ_Url.get_page(biz9_config,title_url);
41
+ let business = {address_1:"addrress 1", address_2:"address 2",city:"city",state:"Geogia",zip:30003};
42
+ Log.w('kusiness',Business.get_full_address(business));
43
+ //Log.w('connect_url',cloud_url);
42
44
  console.log('GET-BiZ-Url-Item-Get-Item-SUCCESS');
43
45
  //call()
44
46
  },