kcommons 9.21.1 → 9.22.0

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.
@@ -1,6 +1,10 @@
1
1
  import { COMPANY_VENDOR_LIST_TABS } from "../typings/companyVendors.typings";
2
+ import { COMPARATIVE_TABS } from "../typings/comparative.typings";
3
+ import { INDENT_TABS } from "../typings/indent.typings";
2
4
  import { MI_SOURCE } from "../typings/mi.typings";
5
+ import { COMPANY_VIEW_PO_TABS } from "../typings/po.typings";
3
6
  import { PR_SOURCE } from "../typings/pr.typings";
7
+ import { RFQ_TABS } from "../typings/rfq.typings";
4
8
  export declare enum COMPANY_ROUTE_IDS {
5
9
  MAIN_DSHBRD = "MAIN_DSHBRD",
6
10
  LGN = "LGN",
@@ -309,7 +313,9 @@ export declare const companyNavConfig: {
309
313
  id: COMPANY_ROUTE_IDS;
310
314
  };
311
315
  view: {
312
- route: (indent_id: string) => string;
316
+ route: (indent_id: string, queryParams?: {
317
+ active_tab: INDENT_TABS;
318
+ }) => string;
313
319
  id: COMPANY_ROUTE_IDS;
314
320
  };
315
321
  };
@@ -440,7 +446,9 @@ export declare const companyNavConfig: {
440
446
  id: COMPANY_ROUTE_IDS;
441
447
  };
442
448
  view: {
443
- route: (rfq_id: string) => string;
449
+ route: (rfq_id: string, queryParams?: {
450
+ active_tab: RFQ_TABS;
451
+ }) => string;
444
452
  id: COMPANY_ROUTE_IDS;
445
453
  };
446
454
  edit: {
@@ -450,7 +458,10 @@ export declare const companyNavConfig: {
450
458
  };
451
459
  comparative: {
452
460
  view: {
453
- route: (comparative_id: string, activeNegotiationQuoteId?: string) => string;
461
+ route: (comparative_id: string, queryParams?: {
462
+ activeNegotiationQuoteId?: string;
463
+ active_tab?: COMPARATIVE_TABS;
464
+ }) => string;
454
465
  id: COMPANY_ROUTE_IDS;
455
466
  };
456
467
  };
@@ -468,7 +479,9 @@ export declare const companyNavConfig: {
468
479
  id: COMPANY_ROUTE_IDS;
469
480
  };
470
481
  view: {
471
- route: (po_id: string) => string;
482
+ route: (po_id: string, queryParams?: {
483
+ active_tab: COMPANY_VIEW_PO_TABS;
484
+ }) => string;
472
485
  id: COMPANY_ROUTE_IDS;
473
486
  };
474
487
  };
@@ -1,6 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.companyNavConfig = exports.COMPANY_ROUTE_IDS = void 0;
4
+ const comparative_typings_1 = require("../typings/comparative.typings");
5
+ const parseReqString_1 = require("../utils/parseReqString");
4
6
  var COMPANY_ROUTE_IDS;
5
7
  (function (COMPANY_ROUTE_IDS) {
6
8
  COMPANY_ROUTE_IDS["MAIN_DSHBRD"] = "MAIN_DSHBRD";
@@ -310,7 +312,10 @@ exports.companyNavConfig = {
310
312
  id: COMPANY_ROUTE_IDS.IDNT_EDT,
311
313
  },
312
314
  view: {
313
- route: (indent_id) => `/indent/${indent_id}/view?route_id=${COMPANY_ROUTE_IDS.IDNT_VIEW}`,
315
+ route: (indent_id, queryParams) => (0, parseReqString_1.parseReqString)(`/indent/${indent_id}/view`, {
316
+ route_id: COMPANY_ROUTE_IDS.IDNT_VIEW,
317
+ active_tab: queryParams === null || queryParams === void 0 ? void 0 : queryParams.active_tab,
318
+ }),
314
319
  id: COMPANY_ROUTE_IDS.IDNT_VIEW,
315
320
  },
316
321
  },
@@ -441,7 +446,10 @@ exports.companyNavConfig = {
441
446
  id: COMPANY_ROUTE_IDS.RFQ_ADD,
442
447
  },
443
448
  view: {
444
- route: (rfq_id) => `/purchase/request-for-quotation/${rfq_id}/view?route_id=${COMPANY_ROUTE_IDS.RFQ_VIEW}`,
449
+ route: (rfq_id, queryParams) => (0, parseReqString_1.parseReqString)(`/purchase/request-for-quotation/${rfq_id}/view`, {
450
+ route_id: COMPANY_ROUTE_IDS.RFQ_VIEW,
451
+ active_tab: queryParams === null || queryParams === void 0 ? void 0 : queryParams.active_tab,
452
+ }),
445
453
  id: COMPANY_ROUTE_IDS.RFQ_VIEW,
446
454
  },
447
455
  edit: {
@@ -451,7 +459,11 @@ exports.companyNavConfig = {
451
459
  },
452
460
  comparative: {
453
461
  view: {
454
- route: (comparative_id, activeNegotiationQuoteId) => `/purchase/comparative/${comparative_id}?route_id=${COMPANY_ROUTE_IDS.CMPRTV_VIEW}${activeNegotiationQuoteId ? "&opent=" + activeNegotiationQuoteId : ""}`,
462
+ route: (comparative_id, queryParams) => (0, parseReqString_1.parseReqString)(`/purchase/comparative/${comparative_id}`, {
463
+ route_id: COMPANY_ROUTE_IDS.CMPRTV_VIEW,
464
+ opent: queryParams === null || queryParams === void 0 ? void 0 : queryParams.activeNegotiationQuoteId,
465
+ active_tab: comparative_typings_1.COMPARATIVE_TABS,
466
+ }),
455
467
  id: COMPANY_ROUTE_IDS.CMPRTV_VIEW,
456
468
  },
457
469
  },
@@ -469,7 +481,10 @@ exports.companyNavConfig = {
469
481
  id: COMPANY_ROUTE_IDS.PO_EDT,
470
482
  },
471
483
  view: {
472
- route: (po_id) => `/purchase/purchase-order/${po_id}/view?route_id=${COMPANY_ROUTE_IDS.PO_VIEW}`,
484
+ route: (po_id, queryParams) => (0, parseReqString_1.parseReqString)(`/purchase/purchase-order/${po_id}/view`, {
485
+ route_id: COMPANY_ROUTE_IDS.PO_VIEW,
486
+ active_tab: queryParams === null || queryParams === void 0 ? void 0 : queryParams.active_tab,
487
+ }),
473
488
  id: COMPANY_ROUTE_IDS.PO_VIEW,
474
489
  },
475
490
  },
@@ -5,6 +5,12 @@ import { INestedPo, INestedPOItem } from "./po.typings";
5
5
  import { INestedQuote, INestedQuoteItems } from "./quote.typings";
6
6
  import { INestedRFQ } from "./rfq.typings";
7
7
  import { INestedUser } from "./user.typings";
8
+ export declare enum COMPARATIVE_TABS {
9
+ COMMERCIAL = "Commercial",
10
+ TECHNICAL = "Technical",
11
+ APPROVALS = "APPROVALS",
12
+ ANALYTICS = "Analytics"
13
+ }
8
14
  export declare enum COMPARATIVE_STATUS {
9
15
  DRAFT = "DRAFT",
10
16
  PENDING_APPROVAL = "PENDING APPROVAL",
@@ -1,6 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.COMPARATIVE_ITEM_INCLUDE = exports.COMPARATIVE_INCLUDE = exports.COMPARATIVE_STATUS = void 0;
3
+ exports.COMPARATIVE_ITEM_INCLUDE = exports.COMPARATIVE_INCLUDE = exports.COMPARATIVE_STATUS = exports.COMPARATIVE_TABS = void 0;
4
+ var COMPARATIVE_TABS;
5
+ (function (COMPARATIVE_TABS) {
6
+ COMPARATIVE_TABS["COMMERCIAL"] = "Commercial";
7
+ COMPARATIVE_TABS["TECHNICAL"] = "Technical";
8
+ COMPARATIVE_TABS["APPROVALS"] = "APPROVALS";
9
+ COMPARATIVE_TABS["ANALYTICS"] = "Analytics";
10
+ })(COMPARATIVE_TABS || (exports.COMPARATIVE_TABS = COMPARATIVE_TABS = {}));
4
11
  var COMPARATIVE_STATUS;
5
12
  (function (COMPARATIVE_STATUS) {
6
13
  COMPARATIVE_STATUS["DRAFT"] = "DRAFT";
@@ -7,6 +7,10 @@ import { INestedPR, INestedPrItem } from "./pr.typings";
7
7
  import { INestedStoreLocation } from "./storeLocation.typings";
8
8
  import { INestedUser } from "./user.typings";
9
9
  import { INestedEntityApprovalChainEntry } from "./entityApprovalChainEntry.typings";
10
+ export declare enum INDENT_TABS {
11
+ ITEMS = "ITEMS",
12
+ APPROVALS = "APPROVALS"
13
+ }
10
14
  export interface IIndent {
11
15
  id: string;
12
16
  company_id: string;
@@ -1,6 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.INDENT_ITEM_INCLUDE = exports.IndentInclude = exports.INDENT_PRIORITY_TYPES = exports.IndentStatus = void 0;
3
+ exports.INDENT_ITEM_INCLUDE = exports.IndentInclude = exports.INDENT_PRIORITY_TYPES = exports.IndentStatus = exports.INDENT_TABS = void 0;
4
+ var INDENT_TABS;
5
+ (function (INDENT_TABS) {
6
+ INDENT_TABS["ITEMS"] = "ITEMS";
7
+ INDENT_TABS["APPROVALS"] = "APPROVALS";
8
+ })(INDENT_TABS || (exports.INDENT_TABS = INDENT_TABS = {}));
4
9
  var IndentStatus;
5
10
  (function (IndentStatus) {
6
11
  IndentStatus["DRAFT"] = "DRAFT";
@@ -14,6 +14,11 @@ import { INestedQuote } from "./quote.typings";
14
14
  import { INestedStoreLocation } from "./storeLocation.typings";
15
15
  import { INestedUser, IUser } from "./user.typings";
16
16
  import { INestedVendor } from "./vendor.typings";
17
+ export declare enum COMPANY_VIEW_PO_TABS {
18
+ DETAILS = "DETAILS",
19
+ ASNS = "ASNS",
20
+ APPROVALS = "APPROVALS"
21
+ }
17
22
  export declare enum PO_STATUS {
18
23
  DRAFT = "DRAFT",
19
24
  PENDING_APPROVAL = "PENDING APPROVAL",
@@ -1,6 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PO_BOM_INCLUDE = exports.PO_ITEM_INCLUDE = exports.PO_INCLUDE = exports.PO_ITEM_ASCENDENCE_TYPE = exports.PO_TYPE = exports.PO_STATUS = void 0;
3
+ exports.PO_BOM_INCLUDE = exports.PO_ITEM_INCLUDE = exports.PO_INCLUDE = exports.PO_ITEM_ASCENDENCE_TYPE = exports.PO_TYPE = exports.PO_STATUS = exports.COMPANY_VIEW_PO_TABS = void 0;
4
+ var COMPANY_VIEW_PO_TABS;
5
+ (function (COMPANY_VIEW_PO_TABS) {
6
+ COMPANY_VIEW_PO_TABS["DETAILS"] = "DETAILS";
7
+ COMPANY_VIEW_PO_TABS["ASNS"] = "ASNS";
8
+ COMPANY_VIEW_PO_TABS["APPROVALS"] = "APPROVALS";
9
+ })(COMPANY_VIEW_PO_TABS || (exports.COMPANY_VIEW_PO_TABS = COMPANY_VIEW_PO_TABS = {}));
4
10
  var PO_STATUS;
5
11
  (function (PO_STATUS) {
6
12
  PO_STATUS["DRAFT"] = "DRAFT";
@@ -11,6 +11,13 @@ import { INestedStoreLocation } from "./storeLocation.typings";
11
11
  import { INestedUser, IUser } from "./user.typings";
12
12
  import { INestedVendor, IVendor } from "./vendor.typings";
13
13
  import { INestedVendorGroups } from "./vendorGroup.typings";
14
+ export declare enum RFQ_TABS {
15
+ ITEMS = "items",
16
+ QUOTES = "quotes",
17
+ BOMS = "boms",
18
+ VENDORS = "vendors",
19
+ APPROVALS = "approvals"
20
+ }
14
21
  export interface IRFQFilters {
15
22
  company_id?: string;
16
23
  user?: IUser;
@@ -1,6 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.RFQ_BOM_INCLUDE = exports.RFQ_ITEM_INCLUDE = exports.BIDDING_TYPES = exports.RFQ_ITEM_TYPE = exports.RFQ_STATUS = exports.RFQ_INCLUDES = exports.RFQVendorType = void 0;
3
+ exports.RFQ_BOM_INCLUDE = exports.RFQ_ITEM_INCLUDE = exports.BIDDING_TYPES = exports.RFQ_ITEM_TYPE = exports.RFQ_STATUS = exports.RFQ_INCLUDES = exports.RFQVendorType = exports.RFQ_TABS = void 0;
4
+ var RFQ_TABS;
5
+ (function (RFQ_TABS) {
6
+ RFQ_TABS["ITEMS"] = "items";
7
+ RFQ_TABS["QUOTES"] = "quotes";
8
+ RFQ_TABS["BOMS"] = "boms";
9
+ RFQ_TABS["VENDORS"] = "vendors";
10
+ RFQ_TABS["APPROVALS"] = "approvals";
11
+ })(RFQ_TABS || (exports.RFQ_TABS = RFQ_TABS = {}));
4
12
  var RFQVendorType;
5
13
  (function (RFQVendorType) {
6
14
  RFQVendorType["DIRECT"] = "DIRECT";
@@ -0,0 +1 @@
1
+ export declare function parseReqString(base: string, filters?: Record<string, any>): string;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.parseReqString = parseReqString;
4
+ function parseReqString(base, filters) {
5
+ if (!filters)
6
+ return base;
7
+ return Object.entries(filters).reduce((prev, curr, index) => {
8
+ if (curr[1] !== null && curr[1] !== undefined) {
9
+ if (Array.isArray(curr[1])) {
10
+ const reqArrayParams = curr[1].reduce((previous, current, index) => `${previous}${curr[0]}=${current}&`, "");
11
+ return `${prev}${index === 0 ? "?" : ""}${reqArrayParams}`;
12
+ }
13
+ return `${prev.includes("?") ? prev : `${prev}?`}${curr[0]}=${curr[1]}&`;
14
+ }
15
+ return prev;
16
+ }, base);
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "9.21.1",
3
+ "version": "9.22.0",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",