kcommons 5.20.0 → 5.20.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.
@@ -1,6 +1,14 @@
1
1
  import { INotificationTemplate } from "../../typings/notifications.typings";
2
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 */
3
5
  poApproved: (po_id: string, po_no: string) => INotificationTemplate;
6
+ /** For Company users whose chance is for approving the PO */
4
7
  chanceForPoApproval: (po_id: string, po_no: string, name: string) => INotificationTemplate;
5
- poRejection: (po_id: string, po_no: string, name: string) => INotificationTemplate;
8
+ /** For Vendor when company approves and sends the PO to vendor */
9
+ poRequestToVendor(po_no: string, company_trade_name: string, po_id: string): INotificationTemplate;
10
+ /** For Company when vendor accepts PO */
11
+ poAcceptanceByVendor(po_no: string, vendor_trade_name: string, po_id: string): INotificationTemplate;
12
+ /** For Company when vendor rejects PO */
13
+ poRejectedByVendor(po_no: string, vendor_trade_name: string, po_id: string): INotificationTemplate;
6
14
  };
@@ -2,7 +2,10 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PO_NOTIFICATIONS = void 0;
4
4
  const companyRoutes_constants_1 = require("../../constants/companyRoutes.constants");
5
+ const vendorRoutes_constants_1 = require("../../constants/vendorRoutes.constants");
5
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 */
6
9
  poApproved: (po_id, po_no) => {
7
10
  return {
8
11
  action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view(po_id),
@@ -10,6 +13,7 @@ exports.PO_NOTIFICATIONS = {
10
13
  title: `Send ${po_no} to vendor`,
11
14
  };
12
15
  },
16
+ /** For Company users whose chance is for approving the PO */
13
17
  chanceForPoApproval: (po_id, po_no, name) => {
14
18
  return {
15
19
  action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view(po_id),
@@ -17,11 +21,28 @@ exports.PO_NOTIFICATIONS = {
17
21
  title: ` Approve ${po_no}`,
18
22
  };
19
23
  },
20
- poRejection: (po_id, po_no, name) => {
24
+ /** For Vendor when company approves and sends the PO to vendor */
25
+ poRequestToVendor(po_no, company_trade_name, po_id) {
21
26
  return {
27
+ title: "PO Received",
28
+ description: `Received PO ${po_no} from ${company_trade_name}`,
29
+ action_link: vendorRoutes_constants_1.vendorNavRoutes.purchase.po.view(po_id),
30
+ };
31
+ },
32
+ /** For Company when vendor accepts PO */
33
+ poAcceptanceByVendor(po_no, vendor_trade_name, po_id) {
34
+ return {
35
+ title: "PO was accepted",
36
+ description: `${vendor_trade_name} accepted PO ${po_no}`,
37
+ action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view(po_id),
38
+ };
39
+ },
40
+ /** For Company when vendor rejects PO */
41
+ poRejectedByVendor(po_no, vendor_trade_name, po_id) {
42
+ return {
43
+ title: "PO was rejected",
44
+ description: `${vendor_trade_name} rejected PO ${po_no}`,
22
45
  action_link: companyRoutes_constants_1.companyNavConfig.purchase.po.view(po_id),
23
- description: `${po_no} has been rejected by ${name}`,
24
- title: `${po_no} rejected`,
25
46
  };
26
47
  },
27
48
  };
@@ -0,0 +1,7 @@
1
+ import { INotificationTemplate } from "../../typings/notifications.typings";
2
+ export declare const QUOTE_NOTIFICATION_TEMPLATES: {
3
+ /** For company to notify that the vendor has quoted */
4
+ vendorHasQuoted(comparative_id: string, vendor_trade_name: string, rfq_no: string): INotificationTemplate;
5
+ /** For vendor to notify new negotiation message has been received from company */
6
+ companyInitiatedNegotiation(company_trade_name: string, rfq_no: string, quote_id: string): INotificationTemplate;
7
+ };
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.QUOTE_NOTIFICATION_TEMPLATES = void 0;
4
+ const companyRoutes_constants_1 = require("../../constants/companyRoutes.constants");
5
+ const vendorRoutes_constants_1 = require("../../constants/vendorRoutes.constants");
6
+ exports.QUOTE_NOTIFICATION_TEMPLATES = {
7
+ /** For company to notify that the vendor has quoted */
8
+ vendorHasQuoted(comparative_id, vendor_trade_name, rfq_no) {
9
+ return {
10
+ title: `New Quote Received`,
11
+ description: `${vendor_trade_name} has quoted on ${rfq_no}`,
12
+ action_link: companyRoutes_constants_1.companyNavConfig.purchase.comparative.view(comparative_id),
13
+ };
14
+ },
15
+ /** For vendor to notify new negotiation message has been received from company */
16
+ companyInitiatedNegotiation(company_trade_name, rfq_no, quote_id) {
17
+ return {
18
+ title: `Negotiation request received`,
19
+ description: `${company_trade_name} has asked for negotiation on ${rfq_no}`,
20
+ action_link: vendorRoutes_constants_1.vendorNavRoutes.purchase.quotes.view(quote_id),
21
+ };
22
+ },
23
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "5.20.0",
3
+ "version": "5.20.1",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.js",