biz9-logic 3.0.2 → 3.0.6

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.0.2'
1
+ VERSION='3.0.6'
2
2
  TITLE='BiZ9-Logic';
3
3
  REPO='git@github.com:biz9framework/biz9-logic.git';
4
4
  BRANCH='main';
package/index.js CHANGED
@@ -5,6 +5,12 @@ License GNU General Public License v3.0
5
5
  Description: BiZ9 Framework: Logic-JS
6
6
  */
7
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');
8
+
9
+ class DataType {
10
+ static DT_BLANK='blank_biz';
11
+ static DT_BLOG_POST='blog_post_biz';
12
+ static DT_SERVICE='service_biz';
13
+ }
8
14
  class Logic {
9
15
  static get_new_item = (data_type,id) => {
10
16
  return get_new_item_main(data_type,id);
@@ -48,5 +54,6 @@ class Logic {
48
54
  }
49
55
  };
50
56
  module.exports = {
51
- Logic
57
+ Logic,
58
+ DataType
52
59
  };
package/main.js CHANGED
@@ -5,15 +5,12 @@ License GNU General Public License v3.0
5
5
  Description: BiZ9 Framework: Logic - Main
6
6
  */
7
7
 
8
- const moment = require('moment');
9
8
  const { DateTime } = require('biz9-utility');
10
- const fs = require('fs');
11
9
  const biz9_config_local=__dirname+"/../../"+"biz9_config";
12
10
 
13
11
  const get_cloud_filter_obj_main = (data_type,filter,sort_by,page_current,page_size) => {
14
12
  return {data_type:data_type,filter:filter,sort_by:sort_by,page_current:page_current,page_size:page_size};
15
13
  }
16
-
17
14
  const get_new_item_main = (data_type,id) => {
18
15
  if(!id){
19
16
  id=0;
@@ -74,8 +71,8 @@ const get_biz_item_main=(biz9_config,item,options) =>{
74
71
  if(options.get_date){
75
72
  let no_date_str='';
76
73
  if(!item.date_create){
77
- item.date_create= new moment().toISOString();
78
- item.date_save= new moment().toISOString();
74
+ item.date_create = DateTime.get_new_date();
75
+ item.date_save = DateTime.get_new_date();
79
76
  }
80
77
  item.date_obj={
81
78
  pretty_create: (item.date_create) ? DateTime.get_pretty(item.date_create) : no_date_str,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "biz9-logic",
3
- "version": "3.0.2",
3
+ "version": "3.0.6",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -9,8 +9,8 @@
9
9
  "license": "MIT",
10
10
  "dependencies": {
11
11
  "async-series": "^0.0.1",
12
- "biz9-scriptz": "^5.5.3",
13
- "biz9-utility": "^2.0.24",
12
+ "biz9-scriptz": "^5.5.4",
13
+ "biz9-utility": "^2.0.27",
14
14
  "jest": "^29.7.0"
15
15
  },
16
16
  "repository": {
package/test.js CHANGED
@@ -1,6 +1,6 @@
1
1
  const path = require('path');
2
2
  const series = require('async-series');
3
- const {Logic} = require('./');
3
+ const {Logic,DataType} = require('./');
4
4
  const {Log,Test} = require('biz9-utility');
5
5
  const { Scriptz }= require('biz9-scriptz');
6
6
 
@@ -34,6 +34,11 @@ describe("connect", () => {
34
34
  Log.w('APP_TITLE_ID',biz9_config.APP_TITLE_ID);
35
35
  Log.w('APP_TITLE',biz9_config.TITLE);
36
36
  Log.w('URL',biz9_config.URL);
37
+ console.log('----------------------');
38
+ Log.w('DATA_TYPE',DataType.DT_BLANK);
39
+ Log.w('BLOG_POST',DataType.DT_BLOG_POST);
40
+ Log.w('SERVICE',DataType.DT_SERVICE);
41
+ console.log('----------------------');
37
42
  console.log('GET-BIZ9-CONFIG-FILE-SUCCESS');
38
43
  call()
39
44
  },