kcommons 9.11.3 → 9.13.1

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.
@@ -33,7 +33,7 @@ export declare const PERMISSION_CONFIG: {
33
33
  ISTD: PERMISSION_ACTIONS[];
34
34
  };
35
35
  export declare const EntitySpecificDocuments: {
36
- gate: never[];
36
+ gate: DOCUMENTS[];
37
37
  office: never[];
38
38
  store_location: DOCUMENTS[];
39
39
  purchase_location: DOCUMENTS[];
@@ -85,7 +85,7 @@ exports.PERMISSION_CONFIG = {
85
85
  ],
86
86
  };
87
87
  exports.EntitySpecificDocuments = {
88
- [entityTypes_constants_1.EntityTypes.GATE]: [],
88
+ [entityTypes_constants_1.EntityTypes.GATE]: [DOCUMENTS.GRN],
89
89
  [entityTypes_constants_1.EntityTypes.OFFICE]: [],
90
90
  [entityTypes_constants_1.EntityTypes.STORE_LOCATION]: [
91
91
  DOCUMENTS.MRN,
@@ -0,0 +1 @@
1
+ export declare function padNumber(num: number | string, reqLength?: number): string;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.padNumber = padNumber;
4
+ function padNumber(num, reqLength = 6) {
5
+ if (typeof num === 'string' && isNaN(Number(num)))
6
+ return num;
7
+ const targetNum = Number(num);
8
+ return targetNum.toString().padStart(reqLength, '0');
9
+ }
package/build/index.d.ts CHANGED
@@ -69,8 +69,8 @@ export * from "./utils/parseQueryParams.util";
69
69
  export * from "./utils/getContactPerson.util";
70
70
  export * from "./utils/quote.util";
71
71
  export * from "./utils/getCompanyQuestionFormLinktoken.util";
72
+ export * from "./utils/getMediaName.util";
72
73
  export * from "./templates/notifications/rfq.notifications";
73
- export * from "./templates/notifications/po.notifications";
74
74
  export * from "./templates/notifications/quote.notifications";
75
75
  export * from "./typings/verification_apis/pincode.typings";
76
76
  export * from "./typings/verification_apis/gstVerification.typings";
@@ -82,6 +82,7 @@ export * from "./typings/vendor/companyProfile.typings";
82
82
  export * from "./typings/company/rootEntityApproval/rootEntityApprovalChain.typings";
83
83
  export * from "./typings/company/rootEntityApproval/rootEntityApprovalConfig.typings";
84
84
  export * from "./typings/company/rootEntityApproval/rootEntityApprovalEntries.typings";
85
+ export * from "./helpers/padNumber.helper";
85
86
  export interface ITesting {
86
87
  message: string;
87
88
  age: number;
package/build/index.js CHANGED
@@ -89,9 +89,9 @@ __exportStar(require("./utils/parseQueryParams.util"), exports);
89
89
  __exportStar(require("./utils/getContactPerson.util"), exports);
90
90
  __exportStar(require("./utils/quote.util"), exports);
91
91
  __exportStar(require("./utils/getCompanyQuestionFormLinktoken.util"), exports);
92
+ __exportStar(require("./utils/getMediaName.util"), exports);
92
93
  // Templates
93
94
  __exportStar(require("./templates/notifications/rfq.notifications"), exports);
94
- __exportStar(require("./templates/notifications/po.notifications"), exports);
95
95
  __exportStar(require("./templates/notifications/quote.notifications"), exports);
96
96
  // Verification APIs
97
97
  __exportStar(require("./typings/verification_apis/pincode.typings"), exports);
@@ -108,3 +108,5 @@ __exportStar(require("./typings/vendor/companyProfile.typings"), exports);
108
108
  __exportStar(require("./typings/company/rootEntityApproval/rootEntityApprovalChain.typings"), exports);
109
109
  __exportStar(require("./typings/company/rootEntityApproval/rootEntityApprovalConfig.typings"), exports);
110
110
  __exportStar(require("./typings/company/rootEntityApproval/rootEntityApprovalEntries.typings"), exports);
111
+ // Helpers
112
+ __exportStar(require("./helpers/padNumber.helper"), exports);
@@ -1,16 +0,0 @@
1
- import { INotificationTemplate } from "../../typings/notifications.typings";
2
- export declare const PO_NOTIFICATIONS: {
3
- /** For company users who belong to same purchase location as PO,
4
- * to send the PO to vendors as it has been approved */
5
- poApproved: (po_id: string, po_no: string) => INotificationTemplate;
6
- /** For company user who precceds the rejecting user*/
7
- poRejection: (po_id: string, po_no: string, rejectedBy: string) => INotificationTemplate;
8
- /** For Company users whose chance is for approving the PO */
9
- chanceForPoApproval: (po_id: string, po_no: string, name: string) => INotificationTemplate;
10
- /** For Vendor when company approves and sends the PO to vendor */
11
- poRequestToVendor(po_no: string, company_trade_name: string, po_id: string): INotificationTemplate;
12
- /** For Company when vendor accepts PO */
13
- poAcceptanceByVendor(po_no: string, vendor_trade_name: string, po_id: string): INotificationTemplate;
14
- /** For Company when vendor rejects PO */
15
- poRejectedByVendor(po_no: string, vendor_trade_name: string, po_id: string): INotificationTemplate;
16
- };
@@ -1,56 +1 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.PO_NOTIFICATIONS = void 0;
4
- const companyRoutes_constants_1 = require("../../constants/companyRoutes.constants");
5
- const vendorRoutes_constants_1 = require("../../constants/vendorRoutes.constants");
6
- exports.PO_NOTIFICATIONS = {
7
- /** For company users who belong to same purchase location as PO,
8
- * to send the PO to vendors as it has been approved */
9
- poApproved: (po_id, po_no) => {
10
- return {
11
- action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view.route(po_id),
12
- description: `${po_no} has been approved and is ready to send to the vendors`,
13
- title: `Send ${po_no} to vendor`,
14
- };
15
- },
16
- /** For company user who precceds the rejecting user*/
17
- poRejection: (po_id, po_no, rejectedBy) => {
18
- return {
19
- action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view.route(po_id),
20
- description: `PO ${po_no} has been rejeted by ${rejectedBy}.`,
21
- title: `PO ${po_no} rejected`,
22
- };
23
- },
24
- /** For Company users whose chance is for approving the PO */
25
- chanceForPoApproval: (po_id, po_no, name) => {
26
- return {
27
- action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view.route(po_id),
28
- description: `${name} requested for approval on ${po_no}`,
29
- title: ` Approve ${po_no}`,
30
- };
31
- },
32
- /** For Vendor when company approves and sends the PO to vendor */
33
- poRequestToVendor(po_no, company_trade_name, po_id) {
34
- return {
35
- title: "PO Received",
36
- description: `Received PO ${po_no} from ${company_trade_name}`,
37
- action_link: vendorRoutes_constants_1.vendorNavRoutes.purchase.po.view(po_id),
38
- };
39
- },
40
- /** For Company when vendor accepts PO */
41
- poAcceptanceByVendor(po_no, vendor_trade_name, po_id) {
42
- return {
43
- title: "PO was accepted",
44
- description: `${vendor_trade_name} accepted PO ${po_no}`,
45
- action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view.route(po_id),
46
- };
47
- },
48
- /** For Company when vendor rejects PO */
49
- poRejectedByVendor(po_no, vendor_trade_name, po_id) {
50
- return {
51
- title: "PO was rejected",
52
- description: `${vendor_trade_name} rejected PO ${po_no}`,
53
- action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view.route(po_id),
54
- };
55
- },
56
- };
@@ -15,6 +15,7 @@ export declare enum ApprovalAction {
15
15
  APPROVED = "APPROVED",
16
16
  REJECTED = "REJECTED",
17
17
  CANCELLED = "CANCELLED",
18
+ SKIPPED = "SKIPPED",
18
19
  PENDING = "PENDING" /**For user whose approval was rejected by the user next in the approval config */
19
20
  }
20
21
  export declare enum ApprovalConfigInlcude {
@@ -17,6 +17,7 @@ var ApprovalAction;
17
17
  ApprovalAction["APPROVED"] = "APPROVED";
18
18
  ApprovalAction["REJECTED"] = "REJECTED";
19
19
  ApprovalAction["CANCELLED"] = "CANCELLED";
20
+ ApprovalAction["SKIPPED"] = "SKIPPED";
20
21
  ApprovalAction["PENDING"] = "PENDING"; /**For user whose approval was rejected by the user next in the approval config */
21
22
  })(ApprovalAction || (exports.ApprovalAction = ApprovalAction = {}));
22
23
  var ApprovalConfigInlcude;
@@ -43,6 +43,11 @@ export interface IASN {
43
43
  cancelled_by_entity: ASN_CANCELLED_BY_ENTITY | null;
44
44
  cancellation_remark: string | null;
45
45
  cancelled_by_user_id: string | null;
46
+ remarks: string | null;
47
+ eway_bill: string | null;
48
+ mode_of_transport: string | null;
49
+ tracking_no: string | null;
50
+ vehicle_no: string | null;
46
51
  is_deleted: boolean;
47
52
  deleted_at: string;
48
53
  cancelled_at: string | null;
@@ -34,6 +34,7 @@ export interface IEntityApprovalChainEntry {
34
34
  message: string;
35
35
  rejection_remark: string | null;
36
36
  chain_entry_id: string;
37
+ is_from_root_template: boolean;
37
38
  indent_id?: string;
38
39
  mi_id?: string;
39
40
  pr_id?: string;
@@ -61,6 +61,7 @@ export interface IPurchaseOrder {
61
61
  contact_person_id: string | null;
62
62
  external_contact_person_id: string | null;
63
63
  status: string;
64
+ invoices: string[];
64
65
  total: number | null;
65
66
  subtotal: number | null;
66
67
  sent_for_approval_by_id: string | null;
@@ -0,0 +1 @@
1
+ export declare function getMediaNameFromLink(link?: string | null): string | null;
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getMediaNameFromLink = getMediaNameFromLink;
4
+ function getMediaNameFromLink(link) {
5
+ if (!link)
6
+ return null;
7
+ const linkBase = link === null || link === void 0 ? void 0 : link.split("?")[0];
8
+ const mediaName = linkBase === null || linkBase === void 0 ? void 0 : linkBase.split("/").pop();
9
+ return mediaName || null;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "9.11.3",
3
+ "version": "9.13.1",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",