kcommons 13.10.3 → 13.11.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.
package/build/index.d.ts CHANGED
@@ -65,6 +65,7 @@ export * from "./typings/common/uploadMedia.typings";
65
65
  export * from "./typings/common/retrieveMedia.typings";
66
66
  export * from "./typings/common/lifecycleLogger.typings";
67
67
  export * from "./typings/common/openUOM.typings";
68
+ export * from "./typings/common/ocr/ocrGst.typings";
68
69
  export * from "./constants/permission.constants";
69
70
  export * from "./constants/entityTypes.constants";
70
71
  export * from "./constants/statuses.constants";
@@ -127,6 +128,8 @@ export * from "./typings/kpis/vendor/main/vHomeDashboardKpi.typings";
127
128
  export * from "./typings/vendor/companyProfile.typings";
128
129
  export * from "./helpers/padNumber.helper";
129
130
  export * from "./typings/plugins/plugin.typings";
131
+ export * from "./utils/validators/gst.validator";
132
+ export * from "./utils/validators/pan.validator";
130
133
  export interface ITesting {
131
134
  message: string;
132
135
  age: number;
package/build/index.js CHANGED
@@ -85,6 +85,7 @@ __exportStar(require("./typings/common/uploadMedia.typings"), exports);
85
85
  __exportStar(require("./typings/common/retrieveMedia.typings"), exports);
86
86
  __exportStar(require("./typings/common/lifecycleLogger.typings"), exports);
87
87
  __exportStar(require("./typings/common/openUOM.typings"), exports);
88
+ __exportStar(require("./typings/common/ocr/ocrGst.typings"), exports);
88
89
  // Constants
89
90
  __exportStar(require("./constants/permission.constants"), exports);
90
91
  __exportStar(require("./constants/entityTypes.constants"), exports);
@@ -162,3 +163,6 @@ __exportStar(require("./typings/vendor/companyProfile.typings"), exports);
162
163
  __exportStar(require("./helpers/padNumber.helper"), exports);
163
164
  // Plugins
164
165
  __exportStar(require("./typings/plugins/plugin.typings"), exports);
166
+ // Validators
167
+ __exportStar(require("./utils/validators/gst.validator"), exports);
168
+ __exportStar(require("./utils/validators/pan.validator"), exports);
@@ -0,0 +1,6 @@
1
+ export interface IOcrGstUploadAckReq {
2
+ upload_key: string;
3
+ }
4
+ export interface IOcrGstUploadAckRes {
5
+ extracted_data: string[] | null;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,11 @@
1
+ /** --- For Downloads--- */
2
+ export interface IRequestDownloadURLReq {
3
+ key: string;
4
+ }
5
+ export interface IRequestDownloadURLRes {
6
+ publicUrl: string;
7
+ }
8
+ /** --- For Uploads --- */
1
9
  export declare enum UPLOAD_MEDIA_TYPE {
2
10
  DOCUMENT = "documents",
3
11
  IMAGE = "images"
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.OPEN_DOCUMENT_TYPE = exports.MEDIA_ACCEESS_TYPE = exports.UPLOAD_MEDIA_TYPE = void 0;
4
+ /** --- For Uploads --- */
4
5
  var UPLOAD_MEDIA_TYPE;
5
6
  (function (UPLOAD_MEDIA_TYPE) {
6
7
  UPLOAD_MEDIA_TYPE["DOCUMENT"] = "documents";
@@ -36,6 +36,9 @@ import { INestedVendorOnboardingRequest } from "./company/vendorOnboardingReques
36
36
  import { INestedVendorManagementBody } from "./company/masters/vendorManagementBody.typings";
37
37
  import { INestedVendorOnboardingRequestCategory } from "./company/vendorOnboardingRequest/vendorOnboardingRequestCategory.typings";
38
38
  import { INestedItemManagementBody } from "./company/masters/itemManagementbody.typings";
39
+ import { INestedQuote } from "./quote.typings";
40
+ import { INestedASN } from "./asn.typings";
41
+ import { INestedInvoice } from "./invoices.typings";
39
42
  export interface IUser {
40
43
  id: string;
41
44
  is_enabled?: boolean | null;
@@ -64,6 +67,7 @@ export interface IUser {
64
67
  active_company?: null | INestedCompany;
65
68
  active_role?: null | INestedRole;
66
69
  subordinates?: null | INestedUser[];
70
+ otps?: null | INestedUser[];
67
71
  as_incharge_in_purchase_locations?: null | INestedPurchaseLocation[];
68
72
  as_incharge_in_store_locations?: null | INestedStoreLocation[];
69
73
  as_incharge_in_offices?: null | INestedOffice[];
@@ -79,7 +83,6 @@ export interface IUser {
79
83
  created_items: INestedItem[] | null;
80
84
  items_sent_for_approval: INestedItem[] | null;
81
85
  approval_chains?: null | INestedApprovalChainEntry[];
82
- created_indents?: null | INestedIndent[];
83
86
  indents_created_for_user?: null | INestedIndent[];
84
87
  mi_issued_for_user?: null | INestedMI[];
85
88
  created_mis?: null | INestedMI[];
@@ -158,10 +161,18 @@ export interface IUser {
158
161
  last_updated_item_management_bodies: INestedItemManagementBody[] | null;
159
162
  as_head_of_item_management_bodies: INestedItemManagementBody[] | null;
160
163
  cancelled_items: INestedItem[] | null;
164
+ as_contact_person_for_rfqs: INestedRFQ[] | null;
165
+ as_contact_person_for_quotes: INestedQuote[] | null;
166
+ cancelled_asns: INestedASN[] | null;
167
+ created_payment_terms: INestedUser | null;
168
+ invoices_marked_as_paid_or_rejected: INestedInvoice[] | null;
169
+ onboarded_company_vendors: INestedCompanyVendors[] | null;
170
+ created_indents: INestedIndent | null;
161
171
  }
162
- export interface INestedUser extends Omit<IUser, "updated_at" | "created_at" | "deleted_at" | "reporting_to" | "active_company" | "active_role" | "subordinates" | "otps" | "as_incharge_in_purchase_locations" | "as_incharge_in_store_locations" | "as_incharge_in_offices" | "as_incharge_in_gates" | "as_contact_person_companies" | "as_contact_person_offices" | "as_contact_person_gates" | "owned_companies" | "head_for_departments" | "created_item_subcategories" | "last_updated_item_subcategories" | "head_for_departments" | "approval_chains" | "created_indents" | "indents_created_for_user" | "created_mis" | "mis_issued_for_user" | "mis_sent_for_approval" | "mis_issued" | "mis_last_updated" | "created_prs" | "pr_sent_for_approval" | "pr_sent_to_purchase_location" | "last_updated_prs" | "created_rfqs" | "entity_approval_chains" | "as_contact_person_for_rfqs" | "as_contact_person_for_quotes" | "rfqs_sent_for_approval" | "rfqs_sent_to_vendors" | "created_rfq_items" | "negotiations" | "created_pos" | "last_updated_pos" | "as_contact_person_for_pos" | "pos_sent_for_approval" | "pos_sent_to_vendors" | "created_grns" | "last_updated_grns" | "as_contact_person_for_grns" | "grns_sent_for_approval" | "grns_sent_to_store" | "mrns_sent_for_approval" | "as_contact_person_for_mrns" | "created_boms" | "last_updated_boms" | "created_vendor_groups" | "last_updated_vendor_groups" | "comparatives_sent_for_approval" | "user_notifications" | "created_extra_quesstions" | "updated_extra_quesstions" | "answered_questions" | "created_extra_core_question_for_companies" | "updated_extra_core_question_for_companies" | "cancelled_asns" | "created_contact_people" | "updated_contact_people" | "last_updated_company_item_vendor_version" | "items_last_updated_by_user" | "company_vendors_last_updated_by_user" | "created_istds" | "last_updated_istds" | "source_contact_person_for_istd" | "dest_contact_person_for_istd" | "istds_sent_for_source_approval" | "istds_sent_for_dest_approval" | "istds_sent_for_dest_store" | "istds_marked_as_processed" | "istds_terminated" | "created_payment_terms" | "created_iads" | "user_last_updated_iads" | "as_approver_for_iads" | "iads_terminated_by_user" | "finalised_iads" | "assigned_roles" | "initiated_inventory_logs" | "logs" | "vendor_onboarding_requests_created_by_user" | "vendor_onboarding_requests_last_updated" | "vendor_onboarding_requests_sent_for_approval" | "invitation_sent_for_vendor_onboarding_requests" | "created_vendor_management_bodies" | "last_updated_vendor_management_bodies" | "head_of_vendor_management_bodies" | "cancelled_vendor_onboarding_requests" | "company_vendor_created_by_user" | "company_vendors_last_updated_by_user" | "sent_for_approval_company_vendors" | "sent_questions_to_company_vendors" | "cancelled_company_vendors" | "created_vendor_onboarding_request_categories" | "last_updated_vendor_onboarding_request_categories" | "created_item_management_bodies" | "last_updated_item_management_bodies" | "as_head_of_item_management_bodies" | "created_items" | "items_sent_for_approval" | "cancelled_items"> {
172
+ export interface INestedUser extends Omit<IUser, "updated_at" | "created_at" | "deleted_at" | "reporting_to" | "active_company" | "active_role" | "subordinates" | "otps" | "as_incharge_in_purchase_locations" | "as_incharge_in_store_locations" | "as_incharge_in_offices" | "as_incharge_in_gates" | "as_contact_person_companies" | "as_contact_person_offices" | "as_contact_person_gates" | "owned_companies" | "head_for_departments" | "created_item_subcategories" | "last_updated_item_subcategories" | "head_for_departments" | "approval_chains" | "indents_created_for_user" | "created_mis" | "mis_issued_for_user" | "mis_sent_for_approval" | "mis_issued" | "mis_last_updated" | "created_prs" | "pr_sent_for_approval" | "pr_sent_to_purchase_location" | "last_updated_prs" | "created_rfqs" | "entity_approval_chains" | "as_contact_person_for_rfqs" | "as_contact_person_for_quotes" | "rfqs_sent_for_approval" | "rfqs_sent_to_vendors" | "created_rfq_items" | "negotiations" | "created_pos" | "last_updated_pos" | "as_contact_person_for_pos" | "pos_sent_for_approval" | "pos_sent_to_vendors" | "created_grns" | "last_updated_grns" | "as_contact_person_for_grns" | "grns_sent_for_approval" | "grns_sent_to_store" | "mrns_sent_for_approval" | "as_contact_person_for_mrns" | "created_boms" | "last_updated_boms" | "created_vendor_groups" | "last_updated_vendor_groups" | "comparatives_sent_for_approval" | "user_notifications" | "created_extra_quesstions" | "updated_extra_quesstions" | "answered_questions" | "created_extra_core_question_for_companies" | "updated_extra_core_question_for_companies" | "cancelled_asns" | "created_contact_people" | "updated_contact_people" | "last_updated_company_item_vendor_version" | "items_last_updated_by_user" | "company_vendors_last_updated_by_user" | "created_istds" | "last_updated_istds" | "source_contact_person_for_istd" | "dest_contact_person_for_istd" | "istds_sent_for_source_approval" | "istds_sent_for_dest_approval" | "istds_sent_for_dest_store" | "istds_marked_as_processed" | "istds_terminated" | "created_payment_terms" | "created_iads" | "user_last_updated_iads" | "as_approver_for_iads" | "iads_terminated_by_user" | "finalised_iads" | "assigned_roles" | "initiated_inventory_logs" | "logs" | "vendor_onboarding_requests_created_by_user" | "vendor_onboarding_requests_last_updated" | "vendor_onboarding_requests_sent_for_approval" | "invitation_sent_for_vendor_onboarding_requests" | "created_vendor_management_bodies" | "last_updated_vendor_management_bodies" | "head_of_vendor_management_bodies" | "cancelled_vendor_onboarding_requests" | "company_vendor_created_by_user" | "company_vendors_last_updated_by_user" | "sent_for_approval_company_vendors" | "sent_questions_to_company_vendors" | "cancelled_company_vendors" | "created_vendor_onboarding_request_categories" | "last_updated_vendor_onboarding_request_categories" | "created_item_management_bodies" | "last_updated_item_management_bodies" | "as_head_of_item_management_bodies" | "created_items" | "items_sent_for_approval" | "cancelled_items" | "invoices_marked_as_paid_or_rejected" | "onboarded_company_vendors" | "created_indents"> {
163
173
  }
164
174
  export declare enum UserInclude {
175
+ subordinates = "subordinates",
165
176
  as_incharge_in_purchase_locations = "as_incharge_in_purchase_locations",
166
177
  as_incharge_in_store_locations = "as_incharge_in_store_locations",
167
178
  as_incharge_in_offices = "as_incharge_in_offices",
@@ -192,7 +203,7 @@ export declare enum UserInclude {
192
203
  pos_sent_for_approval = "pos_sent_for_approval",
193
204
  pos_sent_to_vendors = "pos_sent_to_vendors",
194
205
  created_grns = "created_grns",
195
- last_updated_grns = "lalst_updated_grns",
206
+ last_updated_grns = "last_updated_grns",
196
207
  grns_sent_for_approval = "grns_sent_for_approval",
197
208
  grns_sent_to_store = "grns_sent_to_store",
198
209
  mrns_sent_for_approval = "mrns_sent_for_approval",
@@ -250,7 +261,21 @@ export declare enum UserInclude {
250
261
  as_head_of_item_management_bodies = "as_head_of_item_management_bodies",
251
262
  created_items = "created_items",
252
263
  items_sent_for_approval = "items_sent_for_approval",
253
- cancelled_items = "cancelled_items"
264
+ cancelled_items = "cancelled_items",
265
+ otps = "otps",
266
+ created_indents = "created_indents",
267
+ created_prs = "created_prs",
268
+ created_rfqs = "created_rfqs",
269
+ entity_approval_chains = "entity_approval_chains",
270
+ as_contact_person_for_rfqs = "as_contact_person_for_rfqs",
271
+ as_contact_person_for_quotes = "as_contact_person_for_quotes",
272
+ rfqs_sent_for_approval = "rfqs_sent_for_approval",
273
+ rfqs_sent_to_vendors = "rfqs_sent_to_vendors",
274
+ created_rfq_items = "created_rfq_items",
275
+ cancelled_asns = "cancelled_asns",
276
+ created_payment_terms = "created_payment_terms",
277
+ invoices_marked_as_paid_or_rejected = "invoices_marked_as_paid_or_rejected",
278
+ onboarded_company_vendors = "onboarded_company_vendors"
254
279
  }
255
280
  export interface IUserFilters {
256
281
  name?: string | null;
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.UserInclude = void 0;
4
4
  var UserInclude;
5
5
  (function (UserInclude) {
6
- // subordinates = "subordinates",
6
+ UserInclude["subordinates"] = "subordinates";
7
7
  UserInclude["as_incharge_in_purchase_locations"] = "as_incharge_in_purchase_locations";
8
8
  UserInclude["as_incharge_in_store_locations"] = "as_incharge_in_store_locations";
9
9
  UserInclude["as_incharge_in_offices"] = "as_incharge_in_offices";
@@ -34,7 +34,7 @@ var UserInclude;
34
34
  UserInclude["pos_sent_for_approval"] = "pos_sent_for_approval";
35
35
  UserInclude["pos_sent_to_vendors"] = "pos_sent_to_vendors";
36
36
  UserInclude["created_grns"] = "created_grns";
37
- UserInclude["last_updated_grns"] = "lalst_updated_grns";
37
+ UserInclude["last_updated_grns"] = "last_updated_grns";
38
38
  UserInclude["grns_sent_for_approval"] = "grns_sent_for_approval";
39
39
  UserInclude["grns_sent_to_store"] = "grns_sent_to_store";
40
40
  UserInclude["mrns_sent_for_approval"] = "mrns_sent_for_approval";
@@ -95,4 +95,18 @@ var UserInclude;
95
95
  UserInclude["created_items"] = "created_items";
96
96
  UserInclude["items_sent_for_approval"] = "items_sent_for_approval";
97
97
  UserInclude["cancelled_items"] = "cancelled_items";
98
+ UserInclude["otps"] = "otps";
99
+ UserInclude["created_indents"] = "created_indents";
100
+ UserInclude["created_prs"] = "created_prs";
101
+ UserInclude["created_rfqs"] = "created_rfqs";
102
+ UserInclude["entity_approval_chains"] = "entity_approval_chains";
103
+ UserInclude["as_contact_person_for_rfqs"] = "as_contact_person_for_rfqs";
104
+ UserInclude["as_contact_person_for_quotes"] = "as_contact_person_for_quotes";
105
+ UserInclude["rfqs_sent_for_approval"] = "rfqs_sent_for_approval";
106
+ UserInclude["rfqs_sent_to_vendors"] = "rfqs_sent_to_vendors";
107
+ UserInclude["created_rfq_items"] = "created_rfq_items";
108
+ UserInclude["cancelled_asns"] = "cancelled_asns";
109
+ UserInclude["created_payment_terms"] = "created_payment_terms";
110
+ UserInclude["invoices_marked_as_paid_or_rejected"] = "invoices_marked_as_paid_or_rejected";
111
+ UserInclude["onboarded_company_vendors"] = "onboarded_company_vendors";
98
112
  })(UserInclude || (exports.UserInclude = UserInclude = {}));
@@ -33,6 +33,11 @@ export interface IVendor extends IAddress {
33
33
  beneficiary_name: string | null;
34
34
  vkraya_id: string;
35
35
  password: string;
36
+ is_bank_details_verified: boolean;
37
+ is_gst_verified: boolean;
38
+ is_pan_verified: boolean;
39
+ is_cin_verified: boolean;
40
+ is_udyam_verified: boolean;
36
41
  is_profile_complete: boolean;
37
42
  is_profile_verified: boolean;
38
43
  is_self_verified: boolean;
@@ -0,0 +1,14 @@
1
+ export declare const GST_REGEX: RegExp;
2
+ /**
3
+ * Returns boolean based on whether the provided GST is valid or not.
4
+ * * @param gst_no Gst No to be validated
5
+ * @returns Boolean
6
+ *
7
+ * Validation Rules:
8
+ * 1. First 2 Characters should be Numbers.
9
+ * 2. Next 10 characters should be a valid PAN Number.
10
+ * 3. The 13th character can be 1-9 or A-Z.
11
+ * 4. The 14th character has to be "Z".
12
+ * 5. The 15th character has to be 1-9.
13
+ */
14
+ export declare function isValidGST(gst_no: string): boolean;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.GST_REGEX = void 0;
4
+ exports.isValidGST = isValidGST;
5
+ exports.GST_REGEX = /^(0[1-9]|1[0-9]|2[0-9]|3[0-7])[A-Z]{5}\d{4}[A-Z][A-Z0-9]Z[A-Z0-9]$/i;
6
+ /**
7
+ * Returns boolean based on whether the provided GST is valid or not.
8
+ * * @param gst_no Gst No to be validated
9
+ * @returns Boolean
10
+ *
11
+ * Validation Rules:
12
+ * 1. First 2 Characters should be Numbers.
13
+ * 2. Next 10 characters should be a valid PAN Number.
14
+ * 3. The 13th character can be 1-9 or A-Z.
15
+ * 4. The 14th character has to be "Z".
16
+ * 5. The 15th character has to be 1-9.
17
+ */
18
+ function isValidGST(gst_no) {
19
+ return exports.GST_REGEX.test(gst_no);
20
+ }
@@ -0,0 +1,12 @@
1
+ export declare const PAN_REGEX: RegExp;
2
+ /**
3
+ * Checks whether the provided PAN No. is valid or not.
4
+ * @param pan_no Pan No. to be validated
5
+ * @returns Boolean
6
+ *
7
+ * Validation Rules:
8
+ * 1. First 5 characters should be alphabets in uppercase.
9
+ * 2. The next 4 characters should be numbers.
10
+ * 3. The last character should be again alphabet in uppercase.
11
+ */
12
+ export declare function isValidPan(pan_no: string): boolean;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PAN_REGEX = void 0;
4
+ exports.isValidPan = isValidPan;
5
+ exports.PAN_REGEX = /^[A-Z]{5}\d{4}[A-Z]$/i;
6
+ /**
7
+ * Checks whether the provided PAN No. is valid or not.
8
+ * @param pan_no Pan No. to be validated
9
+ * @returns Boolean
10
+ *
11
+ * Validation Rules:
12
+ * 1. First 5 characters should be alphabets in uppercase.
13
+ * 2. The next 4 characters should be numbers.
14
+ * 3. The last character should be again alphabet in uppercase.
15
+ */
16
+ function isValidPan(pan_no) {
17
+ return exports.PAN_REGEX.test(pan_no);
18
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "13.10.3",
3
+ "version": "13.11.0",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -1,6 +0,0 @@
1
- export declare enum SETTINGS_TABS {
2
- USERPROFILE = "userprofile",
3
- COMPANY_SETTINGS = "company_settings",
4
- BILLING = "billing",
5
- COMPANY_VENDORS = "company_vendors"
6
- }
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SETTINGS_TABS = void 0;
4
- var SETTINGS_TABS;
5
- (function (SETTINGS_TABS) {
6
- SETTINGS_TABS["USERPROFILE"] = "userprofile";
7
- SETTINGS_TABS["COMPANY_SETTINGS"] = "company_settings";
8
- SETTINGS_TABS["BILLING"] = "billing";
9
- SETTINGS_TABS["COMPANY_VENDORS"] = "company_vendors";
10
- })(SETTINGS_TABS || (exports.SETTINGS_TABS = SETTINGS_TABS = {}));