asv-hlps 1.3.33 → 1.3.34

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.
@@ -0,0 +1,6 @@
1
+ import { IParam } from "../models/shared/IParam";
2
+ declare class HlpQBuilder {
3
+ userWhereParams(qb: any, prms: IParam): void;
4
+ }
5
+ declare const _default: HlpQBuilder;
6
+ export default _default;
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ class HlpQBuilder {
4
+ // userWhereParams(qb: SelectQueryBuilder<any>, prms: IParam) {
5
+ userWhereParams(qb, prms) {
6
+ var _a, _b, _c, _d, _e, _f, _g, _h;
7
+ if (prms === null || prms === void 0 ? void 0 : prms.steId) {
8
+ qb.andWhere("ste.id = :id", { id: prms.steId });
9
+ }
10
+ if (prms === null || prms === void 0 ? void 0 : prms.clientId) {
11
+ // qb.andWhere("u.clientId = :clientId", { clientId: prms.clientId })
12
+ qb.andWhere("u.id = :clientId", { clientId: prms.clientId });
13
+ }
14
+ if (prms === null || prms === void 0 ? void 0 : prms.roleCode) {
15
+ qb.andWhere("LOWER(role.code) = :roleCode", { roleCode: prms.roleCode });
16
+ }
17
+ if ((_a = prms === null || prms === void 0 ? void 0 : prms.steGrpCodes) === null || _a === void 0 ? void 0 : _a.ins) {
18
+ qb.andWhere("LOWER(steGrp.code) IN (:...steGrpCodes)", { steGrpCodes: prms.steGrpCodes.ins }).andWhere("role.code = :role", {
19
+ role: "ceo",
20
+ });
21
+ }
22
+ if ((_b = prms === null || prms === void 0 ? void 0 : prms.steGrpCodes) === null || _b === void 0 ? void 0 : _b.notIns) {
23
+ qb.andWhere("LOWER(steGrp.code) NOT IN (:...steGrpCodes)", { steGrpCodes: prms.steGrpCodes.notIns });
24
+ }
25
+ if ((_c = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _c === void 0 ? void 0 : _c.ins) {
26
+ qb.andWhere("LOWER(grp.code) IN (:...grpCodes)", { grpCodes: prms.grpCodes.ins });
27
+ }
28
+ if ((_d = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _d === void 0 ? void 0 : _d.notIns) {
29
+ qb.andWhere("LOWER(grp.code) NOT IN (:...grpCodes)", { grpCodes: prms.grpCodes.notIns });
30
+ }
31
+ if ((_e = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _e === void 0 ? void 0 : _e.steId) {
32
+ qb.andWhere("LOWER(ste.id) = :grpCodesSteId", { grpCodesSteId: prms.grpCodes.steId });
33
+ }
34
+ if ((_f = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _f === void 0 ? void 0 : _f.steName) {
35
+ qb.orWhere("LOWER(ste.name) = :grpCodesSteName", { grpCodesSteName: prms.grpCodes.steName });
36
+ }
37
+ if ((_g = prms === null || prms === void 0 ? void 0 : prms.roleCodes) === null || _g === void 0 ? void 0 : _g.ins) {
38
+ qb.andWhere("LOWER(role.code) IN (:...roleCodes)", { roleCodes: prms.roleCodes.ins });
39
+ }
40
+ if ((_h = prms === null || prms === void 0 ? void 0 : prms.roleCodes) === null || _h === void 0 ? void 0 : _h.notIns) {
41
+ qb.andWhere("LOWER(role.code) NOT IN (:...roleCodes)", { roleCodes: prms.roleCodes.notIns });
42
+ }
43
+ }
44
+ }
45
+ exports.default = new HlpQBuilder();
@@ -0,0 +1 @@
1
+ export { default as HlpQBuilder } from "./hlpQbuilder";
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.HlpQBuilder = void 0;
7
+ var hlpQbuilder_1 = require("./hlpQbuilder");
8
+ Object.defineProperty(exports, "HlpQBuilder", { enumerable: true, get: function () { return __importDefault(hlpQbuilder_1).default; } });
@@ -21,6 +21,7 @@ import "./sale";
21
21
  import "./services/authService";
22
22
  import "./user";
23
23
  import "./utils";
24
+ export * from "./back-end";
24
25
  export * from "./bill";
25
26
  export * from "./bootstrap";
26
27
  export * from "./core/estates/index";
@@ -35,4 +36,4 @@ export * from "./react-utils";
35
36
  export * from "./sale";
36
37
  export * from "./user";
37
38
  export * from "./utils";
38
- export { AuthParam, getAuth, AuthService, StorageService, HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe, };
39
+ export { AmountOnBillPipe, AmountOnListBillPipe, AuthParam, AuthService, HlpEntry, HlpProduct, StockPipe, StorageService, getAuth, };
package/lib/cjs/index.js CHANGED
@@ -17,7 +17,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
17
17
  return (mod && mod.__esModule) ? mod : { "default": mod };
18
18
  };
19
19
  Object.defineProperty(exports, "__esModule", { value: true });
20
- exports.AmountOnBillPipe = exports.AmountOnListBillPipe = exports.StockPipe = exports.HlpEntry = exports.HlpProduct = exports.StorageService = exports.AuthService = exports.getAuth = void 0;
20
+ exports.getAuth = exports.StorageService = exports.StockPipe = exports.HlpProduct = exports.HlpEntry = exports.AuthService = exports.AmountOnListBillPipe = exports.AmountOnBillPipe = void 0;
21
21
  const auth_1 = require("./auth");
22
22
  Object.defineProperty(exports, "getAuth", { enumerable: true, get: function () { return auth_1.getAuth; } });
23
23
  const hlpEntry_1 = require("./helpers/hlpEntry");
@@ -54,6 +54,7 @@ require("./services/authService");
54
54
  require("./user");
55
55
  require("./utils");
56
56
  // export * from "./auth";
57
+ __exportStar(require("./back-end"), exports);
57
58
  __exportStar(require("./bill"), exports);
58
59
  __exportStar(require("./bootstrap"), exports);
59
60
  __exportStar(require("./core/estates/index"), exports);
@@ -0,0 +1,7 @@
1
+ export declare enum EDate {
2
+ CURRENT_DATE = "currentDate",
3
+ CURRENT_MONTH = "currentMonth",
4
+ SUB_CURRENT_MONTH = "subCurrentMonth",
5
+ CURRENT_YEAR = "currentYear",
6
+ SUB_CURRENT_YEAR = "subCurrentYear"
7
+ }
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EDate = void 0;
4
+ var EDate;
5
+ (function (EDate) {
6
+ EDate["CURRENT_DATE"] = "currentDate";
7
+ EDate["CURRENT_MONTH"] = "currentMonth";
8
+ EDate["SUB_CURRENT_MONTH"] = "subCurrentMonth";
9
+ EDate["CURRENT_YEAR"] = "currentYear";
10
+ EDate["SUB_CURRENT_YEAR"] = "subCurrentYear";
11
+ })(EDate || (exports.EDate = EDate = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum EPayMethod {
2
+ CASH = "esp\u00E8ces",
3
+ TRANSFER = "virement",
4
+ BANKCHECK = "ch\u00E8que"
5
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EPayMethod = void 0;
4
+ var EPayMethod;
5
+ (function (EPayMethod) {
6
+ EPayMethod["CASH"] = "esp\u00E8ces";
7
+ EPayMethod["TRANSFER"] = "virement";
8
+ EPayMethod["BANKCHECK"] = "ch\u00E8que";
9
+ })(EPayMethod || (exports.EPayMethod = EPayMethod = {}));
@@ -0,0 +1,26 @@
1
+ import { EDate } from "./EDate";
2
+ export interface IInOrNot {
3
+ ins?: string[];
4
+ notIns?: string[];
5
+ steId?: number;
6
+ steName?: string;
7
+ }
8
+ export interface IParam {
9
+ steId?: number;
10
+ userId?: number;
11
+ clientId?: number;
12
+ code?: string;
13
+ role?: string;
14
+ steName?: string;
15
+ steNames?: string[];
16
+ steGrpCodes?: IInOrNot;
17
+ grpCodes?: IInOrNot;
18
+ roleCodes?: IInOrNot;
19
+ roleCode?: string;
20
+ opDate?: EDate;
21
+ store?: string;
22
+ dates?: any;
23
+ storeName?: string;
24
+ grpByYear?: boolean;
25
+ grpByYearMonth?: boolean;
26
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,6 @@
1
+ import { IParam } from "../models/shared/IParam";
2
+ declare class HlpQBuilder {
3
+ userWhereParams(qb: any, prms: IParam): void;
4
+ }
5
+ declare const _default: HlpQBuilder;
6
+ export default _default;
@@ -0,0 +1,43 @@
1
+ class HlpQBuilder {
2
+ // userWhereParams(qb: SelectQueryBuilder<any>, prms: IParam) {
3
+ userWhereParams(qb, prms) {
4
+ var _a, _b, _c, _d, _e, _f, _g, _h;
5
+ if (prms === null || prms === void 0 ? void 0 : prms.steId) {
6
+ qb.andWhere("ste.id = :id", { id: prms.steId });
7
+ }
8
+ if (prms === null || prms === void 0 ? void 0 : prms.clientId) {
9
+ // qb.andWhere("u.clientId = :clientId", { clientId: prms.clientId })
10
+ qb.andWhere("u.id = :clientId", { clientId: prms.clientId });
11
+ }
12
+ if (prms === null || prms === void 0 ? void 0 : prms.roleCode) {
13
+ qb.andWhere("LOWER(role.code) = :roleCode", { roleCode: prms.roleCode });
14
+ }
15
+ if ((_a = prms === null || prms === void 0 ? void 0 : prms.steGrpCodes) === null || _a === void 0 ? void 0 : _a.ins) {
16
+ qb.andWhere("LOWER(steGrp.code) IN (:...steGrpCodes)", { steGrpCodes: prms.steGrpCodes.ins }).andWhere("role.code = :role", {
17
+ role: "ceo",
18
+ });
19
+ }
20
+ if ((_b = prms === null || prms === void 0 ? void 0 : prms.steGrpCodes) === null || _b === void 0 ? void 0 : _b.notIns) {
21
+ qb.andWhere("LOWER(steGrp.code) NOT IN (:...steGrpCodes)", { steGrpCodes: prms.steGrpCodes.notIns });
22
+ }
23
+ if ((_c = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _c === void 0 ? void 0 : _c.ins) {
24
+ qb.andWhere("LOWER(grp.code) IN (:...grpCodes)", { grpCodes: prms.grpCodes.ins });
25
+ }
26
+ if ((_d = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _d === void 0 ? void 0 : _d.notIns) {
27
+ qb.andWhere("LOWER(grp.code) NOT IN (:...grpCodes)", { grpCodes: prms.grpCodes.notIns });
28
+ }
29
+ if ((_e = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _e === void 0 ? void 0 : _e.steId) {
30
+ qb.andWhere("LOWER(ste.id) = :grpCodesSteId", { grpCodesSteId: prms.grpCodes.steId });
31
+ }
32
+ if ((_f = prms === null || prms === void 0 ? void 0 : prms.grpCodes) === null || _f === void 0 ? void 0 : _f.steName) {
33
+ qb.orWhere("LOWER(ste.name) = :grpCodesSteName", { grpCodesSteName: prms.grpCodes.steName });
34
+ }
35
+ if ((_g = prms === null || prms === void 0 ? void 0 : prms.roleCodes) === null || _g === void 0 ? void 0 : _g.ins) {
36
+ qb.andWhere("LOWER(role.code) IN (:...roleCodes)", { roleCodes: prms.roleCodes.ins });
37
+ }
38
+ if ((_h = prms === null || prms === void 0 ? void 0 : prms.roleCodes) === null || _h === void 0 ? void 0 : _h.notIns) {
39
+ qb.andWhere("LOWER(role.code) NOT IN (:...roleCodes)", { roleCodes: prms.roleCodes.notIns });
40
+ }
41
+ }
42
+ }
43
+ export default new HlpQBuilder();
@@ -0,0 +1 @@
1
+ export { default as HlpQBuilder } from "./hlpQbuilder";
@@ -0,0 +1 @@
1
+ export { default as HlpQBuilder } from "./hlpQbuilder";
@@ -21,6 +21,7 @@ import "./sale";
21
21
  import "./services/authService";
22
22
  import "./user";
23
23
  import "./utils";
24
+ export * from "./back-end";
24
25
  export * from "./bill";
25
26
  export * from "./bootstrap";
26
27
  export * from "./core/estates/index";
@@ -35,4 +36,4 @@ export * from "./react-utils";
35
36
  export * from "./sale";
36
37
  export * from "./user";
37
38
  export * from "./utils";
38
- export { AuthParam, getAuth, AuthService, StorageService, HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe, };
39
+ export { AmountOnBillPipe, AmountOnListBillPipe, AuthParam, AuthService, HlpEntry, HlpProduct, StockPipe, StorageService, getAuth, };
package/lib/esm/index.js CHANGED
@@ -26,6 +26,7 @@ import "./services/authService";
26
26
  import "./user";
27
27
  import "./utils";
28
28
  // export * from "./auth";
29
+ export * from "./back-end";
29
30
  export * from "./bill";
30
31
  export * from "./bootstrap";
31
32
  export * from "./core/estates/index";
@@ -41,6 +42,6 @@ export * from "./sale";
41
42
  export * from "./user";
42
43
  export * from "./utils";
43
44
  // export * from "./helpers/hlpProduct";
44
- export { getAuth, AuthService, StorageService,
45
+ export { AmountOnBillPipe, AmountOnListBillPipe, AuthService, HlpEntry,
45
46
  // CapacitorStorageService,
46
- HlpProduct, HlpEntry, StockPipe, AmountOnListBillPipe, AmountOnBillPipe, };
47
+ HlpProduct, StockPipe, StorageService, getAuth, };
@@ -0,0 +1,7 @@
1
+ export declare enum EDate {
2
+ CURRENT_DATE = "currentDate",
3
+ CURRENT_MONTH = "currentMonth",
4
+ SUB_CURRENT_MONTH = "subCurrentMonth",
5
+ CURRENT_YEAR = "currentYear",
6
+ SUB_CURRENT_YEAR = "subCurrentYear"
7
+ }
@@ -0,0 +1,8 @@
1
+ export var EDate;
2
+ (function (EDate) {
3
+ EDate["CURRENT_DATE"] = "currentDate";
4
+ EDate["CURRENT_MONTH"] = "currentMonth";
5
+ EDate["SUB_CURRENT_MONTH"] = "subCurrentMonth";
6
+ EDate["CURRENT_YEAR"] = "currentYear";
7
+ EDate["SUB_CURRENT_YEAR"] = "subCurrentYear";
8
+ })(EDate || (EDate = {}));
@@ -0,0 +1,5 @@
1
+ export declare enum EPayMethod {
2
+ CASH = "esp\u00E8ces",
3
+ TRANSFER = "virement",
4
+ BANKCHECK = "ch\u00E8que"
5
+ }
@@ -0,0 +1,6 @@
1
+ export var EPayMethod;
2
+ (function (EPayMethod) {
3
+ EPayMethod["CASH"] = "esp\u00E8ces";
4
+ EPayMethod["TRANSFER"] = "virement";
5
+ EPayMethod["BANKCHECK"] = "ch\u00E8que";
6
+ })(EPayMethod || (EPayMethod = {}));
@@ -0,0 +1,26 @@
1
+ import { EDate } from "./EDate";
2
+ export interface IInOrNot {
3
+ ins?: string[];
4
+ notIns?: string[];
5
+ steId?: number;
6
+ steName?: string;
7
+ }
8
+ export interface IParam {
9
+ steId?: number;
10
+ userId?: number;
11
+ clientId?: number;
12
+ code?: string;
13
+ role?: string;
14
+ steName?: string;
15
+ steNames?: string[];
16
+ steGrpCodes?: IInOrNot;
17
+ grpCodes?: IInOrNot;
18
+ roleCodes?: IInOrNot;
19
+ roleCode?: string;
20
+ opDate?: EDate;
21
+ store?: string;
22
+ dates?: any;
23
+ storeName?: string;
24
+ grpByYear?: boolean;
25
+ grpByYearMonth?: boolean;
26
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.3.33",
3
+ "version": "1.3.34",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",
@@ -32,6 +32,7 @@
32
32
  "lodash": "^4.17.21",
33
33
  "pdfmake": "^0.2.7",
34
34
  "randomatic": "^3.1.1",
35
+ "typeorm": "^0.3.17",
35
36
  "yup": "^1.3.2"
36
37
  }
37
38
  }