kcommons 6.2.17 → 6.2.19
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/build/index.d.ts
CHANGED
|
@@ -58,6 +58,7 @@ export * from "./classes/asnWrapper.class";
|
|
|
58
58
|
export * from "./utils/permission.utils";
|
|
59
59
|
export * from "./utils/taxes.util";
|
|
60
60
|
export * from "./utils/parseQueryParams.util";
|
|
61
|
+
export * from "./utils/getContactPerson.util";
|
|
61
62
|
export * from "./templates/notifications/rfq.notifications";
|
|
62
63
|
export * from "./templates/notifications/po.notifications";
|
|
63
64
|
export * from "./templates/notifications/quote.notifications";
|
package/build/index.js
CHANGED
|
@@ -78,6 +78,7 @@ __exportStar(require("./classes/asnWrapper.class"), exports);
|
|
|
78
78
|
__exportStar(require("./utils/permission.utils"), exports);
|
|
79
79
|
__exportStar(require("./utils/taxes.util"), exports);
|
|
80
80
|
__exportStar(require("./utils/parseQueryParams.util"), exports);
|
|
81
|
+
__exportStar(require("./utils/getContactPerson.util"), exports);
|
|
81
82
|
// Templates
|
|
82
83
|
__exportStar(require("./templates/notifications/rfq.notifications"), exports);
|
|
83
84
|
__exportStar(require("./templates/notifications/po.notifications"), exports);
|
|
@@ -8,6 +8,7 @@ var CONTACT_PEOPLE_INCLUDE;
|
|
|
8
8
|
CONTACT_PEOPLE_INCLUDE["company"] = "company";
|
|
9
9
|
CONTACT_PEOPLE_INCLUDE["referred_pos"] = "referred_pos";
|
|
10
10
|
})(CONTACT_PEOPLE_INCLUDE || (exports.CONTACT_PEOPLE_INCLUDE = CONTACT_PEOPLE_INCLUDE = {}));
|
|
11
|
+
// updates for lable change on FE
|
|
11
12
|
var CONTACT_PERSON_TYPE;
|
|
12
13
|
(function (CONTACT_PERSON_TYPE) {
|
|
13
14
|
CONTACT_PERSON_TYPE["COMPANY_USER"] = "COMPANY_USER";
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CONTACT_PERSON_TYPE, IContactPeople } from "../typings/contactPeople.typings";
|
|
2
|
+
import { IUser } from "../typings/user.typings";
|
|
3
|
+
export interface IContactPersonDetails {
|
|
4
|
+
id?: string | null;
|
|
5
|
+
name?: string | null;
|
|
6
|
+
emp_code?: string | null;
|
|
7
|
+
contact?: string | null;
|
|
8
|
+
email?: string | null;
|
|
9
|
+
}
|
|
10
|
+
interface IProps {
|
|
11
|
+
company_user?: IUser | null;
|
|
12
|
+
contact_person?: IContactPeople | null;
|
|
13
|
+
contact_person_type: CONTACT_PERSON_TYPE;
|
|
14
|
+
}
|
|
15
|
+
export declare function getContactPerson({ contact_person_type, company_user, contact_person, }: IProps): IContactPersonDetails | null;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getContactPerson = getContactPerson;
|
|
4
|
+
const contactPeople_typings_1 = require("../typings/contactPeople.typings");
|
|
5
|
+
function getContactPerson({ contact_person_type, company_user, contact_person, }) {
|
|
6
|
+
if (contact_person_type === contactPeople_typings_1.CONTACT_PERSON_TYPE.COMPANY_USER) {
|
|
7
|
+
if (!company_user)
|
|
8
|
+
return null;
|
|
9
|
+
return {
|
|
10
|
+
contact: company_user === null || company_user === void 0 ? void 0 : company_user.contact,
|
|
11
|
+
id: company_user === null || company_user === void 0 ? void 0 : company_user.id,
|
|
12
|
+
email: company_user === null || company_user === void 0 ? void 0 : company_user.email,
|
|
13
|
+
emp_code: company_user === null || company_user === void 0 ? void 0 : company_user.employee_code,
|
|
14
|
+
name: `${company_user === null || company_user === void 0 ? void 0 : company_user.firstname} ${company_user === null || company_user === void 0 ? void 0 : company_user.lastname}`,
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
else if (contact_person_type === contactPeople_typings_1.CONTACT_PERSON_TYPE.EXTERNAL_USER) {
|
|
18
|
+
if (!contact_person)
|
|
19
|
+
return null;
|
|
20
|
+
return {
|
|
21
|
+
contact: contact_person === null || contact_person === void 0 ? void 0 : contact_person.contact,
|
|
22
|
+
id: contact_person === null || contact_person === void 0 ? void 0 : contact_person.id,
|
|
23
|
+
email: contact_person === null || contact_person === void 0 ? void 0 : contact_person.email,
|
|
24
|
+
emp_code: null,
|
|
25
|
+
name: contact_person.name,
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
return null;
|
|
29
|
+
}
|