kcommons 4.5.0 → 5.0.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.
Files changed (44) hide show
  1. package/build/index.d.ts +5 -0
  2. package/build/index.js +5 -0
  3. package/build/typings/approvalChain.typings.d.ts +14 -14
  4. package/build/typings/approvalConfig.typings.d.ts +27 -0
  5. package/build/typings/approvalConfig.typings.js +2 -0
  6. package/build/typings/company.typings.d.ts +42 -1
  7. package/build/typings/companyVendors.typings.d.ts +5 -1
  8. package/build/typings/comparative.typings.d.ts +5 -0
  9. package/build/typings/comparative.typings.js +2 -0
  10. package/build/typings/department.typings.d.ts +56 -0
  11. package/build/typings/docItems.typings.d.ts +31 -0
  12. package/build/typings/docItems.typings.js +16 -0
  13. package/build/typings/documentTaxes.typings.d.ts +17 -2
  14. package/build/typings/entityApprovalChainEntry.typings.d.ts +44 -0
  15. package/build/typings/entityApprovalChainEntry.typings.js +2 -0
  16. package/build/typings/gate.typings.d.ts +11 -0
  17. package/build/typings/gate.typings.js +2 -0
  18. package/build/typings/grn.typings.d.ts +5 -0
  19. package/build/typings/grn.typings.js +2 -0
  20. package/build/typings/indent.typings.d.ts +32 -0
  21. package/build/typings/item.typings.d.ts +19 -8
  22. package/build/typings/itemCategory.typings.d.ts +18 -0
  23. package/build/typings/itemSubcategory.typings.d.ts +4 -0
  24. package/build/typings/itemSubcategory.typings.js +2 -0
  25. package/build/typings/mi.typings.d.ts +38 -0
  26. package/build/typings/mrn.typings.d.ts +5 -0
  27. package/build/typings/mrn.typings.js +2 -0
  28. package/build/typings/offices.typings.d.ts +36 -0
  29. package/build/typings/po.typings.d.ts +18 -0
  30. package/build/typings/pr.typings.d.ts +47 -0
  31. package/build/typings/purchaseLocation.typings.d.ts +36 -0
  32. package/build/typings/quote.typings.d.ts +25 -2
  33. package/build/typings/quote.typings.js +12 -1
  34. package/build/typings/rfq.typings.d.ts +11 -8
  35. package/build/typings/roles.typings.d.ts +63 -0
  36. package/build/typings/roles.typings.js +1 -0
  37. package/build/typings/storeInventory.typings.d.ts +20 -0
  38. package/build/typings/storeLocation.typings.d.ts +43 -0
  39. package/build/typings/taxes.typings.d.ts +5 -0
  40. package/build/typings/taxes.typings.js +2 -0
  41. package/build/typings/user.typings.d.ts +66 -0
  42. package/build/typings/vendor.typings.d.ts +5 -9
  43. package/build/typings/vendorGroup.typings.d.ts +8 -6
  44. package/package.json +1 -1
package/build/index.d.ts CHANGED
@@ -18,6 +18,11 @@ export * from "./typings/vendorGroup.typings";
18
18
  export * from "./typings/item.typings";
19
19
  export * from "./typings/documentTaxes.typings";
20
20
  export * from "./typings/po.typings";
21
+ export * from "./typings/comparative.typings";
22
+ export * from "./typings/gate.typings";
23
+ export * from "./typings/grn.typings";
24
+ export * from "./typings/mrn.typings";
25
+ export * from "./typings/taxes.typings";
21
26
  export * from "./constants/permission.constants";
22
27
  export * from "./constants/entityTypes.constants";
23
28
  export * from "./constants/documentStatus.typings";
package/build/index.js CHANGED
@@ -31,6 +31,11 @@ __exportStar(require("./typings/vendorGroup.typings"), exports);
31
31
  __exportStar(require("./typings/item.typings"), exports);
32
32
  __exportStar(require("./typings/documentTaxes.typings"), exports);
33
33
  __exportStar(require("./typings/po.typings"), exports);
34
+ __exportStar(require("./typings/comparative.typings"), exports);
35
+ __exportStar(require("./typings/gate.typings"), exports);
36
+ __exportStar(require("./typings/grn.typings"), exports);
37
+ __exportStar(require("./typings/mrn.typings"), exports);
38
+ __exportStar(require("./typings/taxes.typings"), exports);
34
39
  // Constants
35
40
  __exportStar(require("./constants/permission.constants"), exports);
36
41
  __exportStar(require("./constants/entityTypes.constants"), exports);
@@ -1,3 +1,6 @@
1
+ import { INestedApprovalConfig } from "./approvalConfig.typings";
2
+ import { INestedRole } from "./roles.typings";
3
+ import { INestedUser } from "./user.typings";
1
4
  export declare enum ApprovalAction {
2
5
  APPROVED = "APPROVED",
3
6
  REJECTED = "REJECTED",
@@ -6,23 +9,20 @@ export declare enum ApprovalAction {
6
9
  export declare enum ApprovalConfigInlcude {
7
10
  approval_chain = "approval_chain"
8
11
  }
9
- export interface IEntityApprovalChainEntry {
12
+ export interface IApprovalChainEntry {
10
13
  id: string;
14
+ created_by_id: string;
15
+ approval_config_id?: string;
11
16
  user_id: string;
12
17
  role_id: string;
13
18
  order: number;
14
19
  action: string;
15
- message: string;
16
- indent_id?: string;
17
- mi_id?: string;
18
- pr_id?: string;
19
- rfq_id?: string;
20
- comparative_id?: string;
21
- po_id?: string;
22
- mrn_id?: string;
23
- grn_id?: string;
24
- deleted_at: Date | null;
25
- is_deleted: boolean | null;
26
- created_at: Date | null;
27
- updated_at: Date | null;
20
+ active: boolean;
21
+ created_at: string;
22
+ updated_at: string;
23
+ user?: INestedUser | null;
24
+ role?: INestedRole | null;
25
+ approval_config?: INestedApprovalConfig | null;
26
+ }
27
+ export interface INestedApprovalChainEntry extends Omit<IApprovalChainEntry, "user" | "role" | "company"> {
28
28
  }
@@ -0,0 +1,27 @@
1
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
2
+ import { INestedCompany } from "./company.typings";
3
+ import { INestedGate } from "./gate.typings";
4
+ import { INestedOffice } from "./offices.typings";
5
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
6
+ import { INestedStoreLocation } from "./storeLocation.typings";
7
+ export interface IApprovalConfig {
8
+ id: string;
9
+ company_id: string;
10
+ document_type: string;
11
+ is_enabled: boolean;
12
+ notes?: string;
13
+ office_id?: string;
14
+ purchase_location_id?: string;
15
+ store_location_id?: string;
16
+ gate_id?: string;
17
+ created_at: string;
18
+ updated_at: string;
19
+ company?: INestedCompany | null;
20
+ office?: INestedOffice | null;
21
+ store_location?: INestedStoreLocation | null;
22
+ purchase_location?: INestedPurchaseLocation | null;
23
+ gate?: INestedGate | null;
24
+ approval_chain?: INestedApprovalChainEntry[] | null;
25
+ }
26
+ export interface INestedApprovalConfig extends Omit<IApprovalConfig, "approval_chain" | "company" | "office" | "store_location" | "purchase_location" | "gate"> {
27
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,21 @@
1
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
2
+ import { INestedApprovalConfig } from "./approvalConfig.typings";
3
+ import { INestedDepartment, INestedSubdepartment } from "./department.typings";
4
+ import { INestedIndent, INestedIndentItem } from "./indent.typings";
5
+ import { INestedItem } from "./item.typings";
6
+ import { INestedItemCategory } from "./itemCategory.typings";
7
+ import { IItemSubcategory } from "./itemSubcategory.typings";
8
+ import { INestedMI, INestedMIItem } from "./mi.typings";
9
+ import { INestedOffice } from "./offices.typings";
10
+ import { INestedPR, INestedPrItem } from "./pr.typings";
11
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
12
+ import { INestedQuote } from "./quote.typings";
13
+ import { INestedRFQ } from "./rfq.typings";
14
+ import { INestedPermission, INestedRole } from "./roles.typings";
15
+ import { INestedStoreLocation } from "./storeLocation.typings";
16
+ import { INestedUser } from "./user.typings";
17
+ import { INestedVendor } from "./vendor.typings";
18
+ import { INestedVendorGroups } from "./vendorGroup.typings";
1
19
  export interface ICompany {
2
20
  id: string;
3
21
  trade_name: string;
@@ -26,8 +44,31 @@ export interface ICompany {
26
44
  cin?: string | null;
27
45
  uaadhar?: string | null;
28
46
  pancard?: string | null;
47
+ associated_purchase_locations?: null | INestedPurchaseLocation[];
48
+ associated_vendors?: null | INestedVendor[];
49
+ associated_permissions?: null | INestedPermission[];
50
+ associated_roles?: null | INestedRole[];
51
+ approval_configs?: null | INestedApprovalConfig[];
52
+ subdepartments?: null | INestedSubdepartment[];
53
+ subcategories?: null | IItemSubcategory[];
54
+ categories?: null | INestedItemCategory[];
55
+ items?: null | INestedItem[];
56
+ offices?: null | INestedOffice[];
57
+ stores?: null | INestedStoreLocation[];
58
+ employees?: null | INestedUser[];
59
+ departments?: null | INestedDepartment[];
60
+ vendor_groups?: null | INestedVendorGroups[];
61
+ company_indents?: null | INestedIndent[];
62
+ indent_items?: null | INestedIndentItem[];
63
+ company_mis?: null | INestedMI[];
64
+ mi_items?: null | INestedMIItem[];
65
+ company_prs?: null | INestedPR[];
66
+ pr_items?: null | INestedPrItem[];
67
+ company_rfqs?: null | INestedRFQ[];
68
+ company_quotes?: null | INestedQuote[];
69
+ entity_approval_chain_entries?: null | INestedApprovalChainEntry[];
29
70
  }
30
- export interface INestedCompany {
71
+ export interface INestedCompany extends Omit<ICompany, "associated_purchase_locations" | "associated_vendors" | "associated_permissions" | "associated_roles" | "approval_configs" | "subdepartments" | "subcategories" | "categories" | "items" | "offices" | "stores" | "employees" | "departments" | "vendor_groups" | "company_indents" | "indent_items" | "company_mis" | "mi_items" | "company_prs" | "pr_items" | "company_rfqs" | "company_quotes" | "entity_approval_chain_entries"> {
31
72
  }
32
73
  export declare enum COMPANY_INCLUDE {
33
74
  associated_purchase_locations = "associated_purchase_locations",
@@ -1,5 +1,7 @@
1
1
  import { ICompany } from "./company.typings";
2
+ import { INestedRFQ } from "./rfq.typings";
2
3
  import { IVendor } from "./vendor.typings";
4
+ import { INestedVendorGroups } from "./vendorGroup.typings";
3
5
  export declare enum CompanyVendorsInclude {
4
6
  COMPANY = "company",
5
7
  VENDOR = "vendor"
@@ -18,6 +20,8 @@ export interface ICompanyVendor {
18
20
  updated_at?: string | null;
19
21
  company?: ICompany;
20
22
  vendor?: IVendor;
23
+ rfqs_sent?: INestedRFQ[] | null;
24
+ vendor_groups?: INestedVendorGroups[] | null;
21
25
  }
22
- export interface IVendorInputs extends Omit<IVendor, "id" | "created_at" | "updated_at" | "is_profile_complete" | "is_profile_verified" | "is_self_verified" | "deleted_at" | "is_deleted" | "vendor" | "vkraya_id" | "password">, Pick<ICompanyVendor, "vendor_code" | "company_id"> {
26
+ export interface INestedCompanyVendors extends Omit<ICompanyVendor, "company" | "vendor" | "rfqs_sent" | "vendor_groups"> {
23
27
  }
@@ -0,0 +1,5 @@
1
+ export interface IComparative {
2
+ id: string;
3
+ }
4
+ export interface INestedComparative extends Omit<IComparative, ""> {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,43 @@
1
+ import { INestedCompany } from "./company.typings";
2
+ import { INestedGate } from "./gate.typings";
3
+ import { INestedIndent } from "./indent.typings";
4
+ import { INestedMI } from "./mi.typings";
5
+ import { INestedOffice } from "./offices.typings";
6
+ import { INestedPR } from "./pr.typings";
7
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
8
+ import { INestedRole } from "./roles.typings";
9
+ import { INestedStoreLocation } from "./storeLocation.typings";
10
+ import { INestedUser } from "./user.typings";
11
+ export interface IDepartment {
12
+ id: string;
13
+ type: string;
14
+ company_id: string;
15
+ hod_id?: string;
16
+ office_id?: string | null;
17
+ store_location_id?: string | null;
18
+ purchase_location_id?: string | null;
19
+ department_name: string;
20
+ department_code: string;
21
+ created_by_id: string;
22
+ is_enabled: boolean;
23
+ is_deleted: boolean;
24
+ deleted_at: string;
25
+ created_at: string;
26
+ updated_at: string;
27
+ company?: null | INestedCompany;
28
+ hod?: null | INestedUser;
29
+ parent_office?: null | INestedOffice;
30
+ parent_store_location?: null | INestedStoreLocation;
31
+ parent_purchase_location?: null | INestedPurchaseLocation;
32
+ parent_gate?: null | INestedGate;
33
+ indents?: null | INestedIndent[];
34
+ mis?: null | INestedMI[];
35
+ prs?: null | INestedPR[];
36
+ subdepartments?: null | INestedSubdepartment[];
37
+ roles?: null | INestedRole[];
38
+ }
39
+ export interface INestedDepartment extends Omit<IDepartment, "company" | "hod" | "parent_office" | "parent_store_location" | "parent_purchase_location" | "parent_gate" | "indents" | "mis" | "prs" | "subdepartments" | "roles"> {
40
+ }
1
41
  export declare const DEPT_TYPES: {
2
42
  PURCHASE: string;
3
43
  STORE: string;
@@ -8,3 +48,19 @@ export declare enum DepartmentInclude {
8
48
  roles = "roles",
9
49
  hod = "hod"
10
50
  }
51
+ export interface ISubDepartment {
52
+ id: string;
53
+ employees: string;
54
+ company_id: string;
55
+ subdepartment_code: string;
56
+ subdepartment_name: string;
57
+ parent_department_id: string;
58
+ created_by_id: string;
59
+ is_enabled: boolean;
60
+ is_deleted: boolean;
61
+ deleted_at: string;
62
+ created_at: string;
63
+ updated_at: string;
64
+ }
65
+ export interface INestedSubdepartment extends Omit<ISubDepartment, "company" | "department"> {
66
+ }
@@ -0,0 +1,31 @@
1
+ export interface IDocItem {
2
+ id: string;
3
+ item_id: string;
4
+ company_id: string;
5
+ code_sku: string;
6
+ item_name: string;
7
+ quantity: number;
8
+ uom: string;
9
+ item_description?: string | null;
10
+ attachment_link?: string | null;
11
+ is_deleted?: boolean | null;
12
+ deleted_at?: string | null;
13
+ created_at?: string | null;
14
+ updated_at?: string | null;
15
+ }
16
+ export declare class DocItem implements IDocItem {
17
+ constructor(partial: DocItem);
18
+ id: string;
19
+ item_id: string;
20
+ company_id: string;
21
+ code_sku: string;
22
+ item_name: string;
23
+ quantity: number;
24
+ uom: string;
25
+ item_description?: string | null;
26
+ attachment_link?: string | null;
27
+ is_deleted?: boolean | null;
28
+ deleted_at?: string | null;
29
+ created_at?: string | null;
30
+ updated_at?: string | null;
31
+ }
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DocItem = void 0;
4
+ class DocItem {
5
+ constructor(partial) {
6
+ this.id = "";
7
+ this.item_id = "";
8
+ this.company_id = "";
9
+ this.code_sku = "";
10
+ this.item_name = "";
11
+ this.quantity = 0;
12
+ this.uom = "";
13
+ Object.assign(this, partial);
14
+ }
15
+ }
16
+ exports.DocItem = DocItem;
@@ -1,6 +1,21 @@
1
+ import { INestedPo } from "./po.typings";
2
+ import { INestedQuote } from "./quote.typings";
3
+ export interface IDocumentTaxes {
4
+ id: string;
5
+ quote_id: string;
6
+ po_id: string;
7
+ tax_name: string;
8
+ tax_type: string;
9
+ tax_value: string;
10
+ tax_resultant: number;
11
+ created_at: string;
12
+ updated_at: string;
13
+ parent_quote?: INestedQuote | null;
14
+ parent_po?: INestedPo | null;
15
+ }
16
+ export interface INestedDocumentTaxes extends Omit<IDocumentTaxes, "parent_quote" | "parent_po"> {
17
+ }
1
18
  export declare enum TAX_TYPE {
2
19
  FIXED = "FIXED",
3
20
  PERCENTAGE = "PERCENTAGE"
4
21
  }
5
- export interface IDocumentTaxes {
6
- }
@@ -0,0 +1,44 @@
1
+ import { INestedCompany } from "./company.typings";
2
+ import { INestedComparative } from "./comparative.typings";
3
+ import { INestedGRN } from "./grn.typings";
4
+ import { INestedIndent } from "./indent.typings";
5
+ import { INestedMI } from "./mi.typings";
6
+ import { INestedMRN } from "./mrn.typings";
7
+ import { INestedPo } from "./po.typings";
8
+ import { INestedPR } from "./pr.typings";
9
+ import { INestedRFQ } from "./rfq.typings";
10
+ import { INestedRole } from "./roles.typings";
11
+ import { INestedUser } from "./user.typings";
12
+ export interface IEntityApprovalChainEntry {
13
+ id: string;
14
+ user_id: string;
15
+ role_id: string;
16
+ order: number;
17
+ action: string;
18
+ message: string;
19
+ indent_id?: string;
20
+ mi_id?: string;
21
+ pr_id?: string;
22
+ rfq_id?: string;
23
+ comparative_id?: string;
24
+ po_id?: string;
25
+ mrn_id?: string;
26
+ grn_id?: string;
27
+ deleted_at: string | null;
28
+ is_deleted: boolean | null;
29
+ created_at: string | null;
30
+ updated_at: string | null;
31
+ company?: INestedCompany | null;
32
+ user?: INestedUser | null;
33
+ role?: INestedRole | null;
34
+ indent?: INestedIndent | null;
35
+ mi?: INestedMI | null;
36
+ pr?: INestedPR | null;
37
+ rfq?: INestedRFQ | null;
38
+ comparative?: INestedComparative | null;
39
+ po?: INestedPo | null;
40
+ grn?: INestedGRN | null;
41
+ mrn?: INestedMRN | null;
42
+ }
43
+ export interface INestedEntityApprovalChainEntry extends Omit<IEntityApprovalChainEntry, "company" | "user" | "role" | "indent" | "mi" | "pr" | "rfq" | "comparative" | "po" | "grn" | "mrn"> {
44
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,11 @@
1
+ import { INestedApprovalConfig } from "./approvalConfig.typings";
2
+ import { INestedDepartment } from "./department.typings";
3
+ import { INestedRole } from "./roles.typings";
4
+ export interface IGate {
5
+ id: string;
6
+ approval_configs?: INestedApprovalConfig[] | null;
7
+ departments?: INestedDepartment[] | null;
8
+ roles?: INestedRole[] | null;
9
+ }
10
+ export interface INestedGate extends Omit<IGate, " approval_config" | "departments" | "roles"> {
11
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,5 @@
1
+ export interface IGRN {
2
+ id: string;
3
+ }
4
+ export interface INestedGRN extends Omit<IGRN, ""> {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,29 @@
1
+ import { IDocItem } from "./docItems.typings";
2
+ export interface IIndent {
3
+ id: string;
4
+ company_id: string;
5
+ indent_no: string;
6
+ department_id: string;
7
+ priority: string;
8
+ status: string;
9
+ created_by_user_id: string;
10
+ target_store_location_id: string;
11
+ location?: string | null;
12
+ mesage?: string | null;
13
+ custom_fields?: string | null;
14
+ budget_code_id?: string | null;
15
+ priority_date?: string | null;
16
+ attachment_link?: string | null;
17
+ deleted_at?: string | null;
18
+ is_enabled: boolean;
19
+ is_deleted: boolean;
20
+ created_at: string;
21
+ updated_at: string;
22
+ items?: string[] | null;
23
+ approval_chain?: string[] | null;
24
+ }
25
+ export interface INestedIndent extends Omit<IIndent, "department" | "company" | "budget_code" | "created_by_user" | "target_store_location" | "items" | "approval_chain" | "corresponding_mis" | "prs"> {
26
+ }
1
27
  export declare enum IndentStatus {
2
28
  DRAFT = "DRAFT",
3
29
  PENDING_APPROVAL = "PENDING APPROVAL",
@@ -14,3 +40,9 @@ export declare enum IndentInclude {
14
40
  items = "items",
15
41
  approval_chain = "approval_chain"
16
42
  }
43
+ export interface IIndentItem extends IDocItem {
44
+ indent_id: string;
45
+ remaining_quantity: number;
46
+ }
47
+ export interface INestedIndentItem extends Omit<IIndentItem, "company" | "item" | "parent_indent"> {
48
+ }
@@ -1,4 +1,12 @@
1
- import { FormTypes } from "../constants/form.constants";
1
+ import { INestedCompany } from "./company.typings";
2
+ import { INestedIndentItem } from "./indent.typings";
3
+ import { INestedItemCategory } from "./itemCategory.typings";
4
+ import { INestedItemSubcategory } from "./itemSubcategory.typings";
5
+ import { INestedMIItem } from "./mi.typings";
6
+ import { INestedPrItem } from "./pr.typings";
7
+ import { INestedQuoteItems } from "./quote.typings";
8
+ import { INestedInventoryItem } from "./storeInventory.typings";
9
+ import { INestedUser } from "./user.typings";
2
10
  export interface IItem {
3
11
  id: string;
4
12
  item_type: string;
@@ -25,14 +33,17 @@ export interface IItem {
25
33
  updated_at: string;
26
34
  deleted_at?: string;
27
35
  approved_at?: string;
36
+ inventory_entries?: INestedInventoryItem[] | null;
37
+ approved_by?: INestedUser | null;
38
+ item_category?: INestedItemCategory | null;
39
+ item_subcategory?: INestedItemSubcategory | null;
40
+ company?: INestedCompany | null;
41
+ used_in_indent_items?: INestedIndentItem[] | null;
42
+ used_in_mi_items?: INestedMIItem[] | null;
43
+ used_in_pr_items?: INestedPrItem[] | null;
44
+ used_in_quote_items?: INestedQuoteItems[] | null;
28
45
  }
29
- export interface INestedItem extends IItem {
30
- }
31
- export interface IAddItemInputs extends Omit<IItem, "id" | "created_by" | "created_at" | "is_deleted" | "deleted_at" | "updated_at" | "is_approved" | "approved_at" | "approved_by_id"> {
32
- type: FormTypes.CREATE;
33
- }
34
- export interface IUpdateItemInputs extends Partial<Omit<IAddItemInputs, "type">> {
35
- type: FormTypes.EDIT;
46
+ export interface INestedItem extends Omit<IItem, "inventory_entries" | "approved_by" | "item_category" | "item_subcategory" | "company" | "used_in_indent_items" | "used_in_mi_items" | "used_in_pr_items" | "used_in_quote_items"> {
36
47
  }
37
48
  export declare const ITEM_CLASSIFICATION: {
38
49
  DIRECT: string;
@@ -1,3 +1,21 @@
1
+ import { INestedCompany } from "./company.typings";
2
+ import { INestedItemSubcategory } from "./itemSubcategory.typings";
3
+ export interface ICategory {
4
+ category_name: string;
5
+ category_code: string;
6
+ company_id: string;
7
+ is_enabled: boolean;
8
+ id: string;
9
+ is_deleted: boolean;
10
+ created_by_id: string;
11
+ deleted_at: string;
12
+ created_at: string;
13
+ updated_at: string;
14
+ company?: INestedCompany | null;
15
+ subcategories?: INestedItemSubcategory[] | null;
16
+ }
17
+ export interface INestedItemCategory extends Omit<ICategory, "company" | "subcategories"> {
18
+ }
1
19
  export declare enum ItemCategoryInclude {
2
20
  subcategories = "subcategories"
3
21
  }
@@ -0,0 +1,4 @@
1
+ export interface IItemSubcategory {
2
+ }
3
+ export interface INestedItemSubcategory extends Omit<IItemSubcategory, "company" | "category" | "items"> {
4
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,35 @@
1
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
2
+ import { INestedCompany } from "./company.typings";
3
+ import { INestedDepartment } from "./department.typings";
4
+ import { IDocItem } from "./docItems.typings";
5
+ import { INestedIndent } from "./indent.typings";
6
+ import { INestedItem } from "./item.typings";
7
+ import { INestedUser } from "./user.typings";
8
+ export interface IMI {
9
+ id: string;
10
+ mi_no: string;
11
+ created_by_user_id: string;
12
+ indent_id: string;
13
+ indent_source_dept_id: string;
14
+ parent_company_id: string;
15
+ status: string;
16
+ parent_store_location_id: string;
17
+ message?: string | null;
18
+ is_deleted?: boolean | null;
19
+ approved_at?: string | null;
20
+ closed_at?: string | null;
21
+ deleted_at?: string | null;
22
+ created_at?: string | null;
23
+ updated_at?: string | null;
24
+ company?: INestedCompany | null;
25
+ parent_department?: INestedDepartment | null;
26
+ created_by_user?: INestedUser | null;
27
+ parent_indent?: INestedIndent | null;
28
+ items?: INestedItem[] | null;
29
+ approval_chain?: INestedApprovalChainEntry[] | null;
30
+ }
31
+ export interface INestedMI extends Omit<IMI, "store_location" | "company" | "paretn_department" | "created_by_user" | "parent_indent" | "items" | "approval_chain"> {
32
+ }
1
33
  export declare enum MI_STATUS {
2
34
  DRAFT = "DRAFT",
3
35
  PENDING_APPROVAL = "PENDING APPROVAL",
@@ -9,3 +41,9 @@ export declare enum MiInclude {
9
41
  items = "items",
10
42
  approval_chain = "approval_chain"
11
43
  }
44
+ export interface IMIItems extends IDocItem {
45
+ mi_id: string;
46
+ supplied_quantity: number;
47
+ }
48
+ export interface INestedMIItem extends IMIItems {
49
+ }
@@ -0,0 +1,5 @@
1
+ export interface IMRN {
2
+ id: string;
3
+ }
4
+ export interface INestedMRN extends Omit<IMRN, ""> {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,39 @@
1
+ import { INestedApprovalConfig } from "./approvalConfig.typings";
2
+ import { INestedCompany } from "./company.typings";
3
+ import { INestedDepartment } from "./department.typings";
4
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
5
+ import { INestedRole } from "./roles.typings";
6
+ import { INestedStoreLocation } from "./storeLocation.typings";
7
+ import { INestedUser } from "./user.typings";
8
+ export interface IOffice {
9
+ id: string;
10
+ office_name: string;
11
+ office_code: string;
12
+ company_id: string;
13
+ created_by_id: string;
14
+ is_deleted: boolean;
15
+ is_enabled: boolean;
16
+ primary_contact_person_id?: string;
17
+ pincode?: string;
18
+ area?: string;
19
+ state?: string;
20
+ city?: string;
21
+ country?: string;
22
+ address?: string;
23
+ deleted_at?: string;
24
+ created_at: string;
25
+ updated_at: string;
26
+ company?: INestedCompany | null;
27
+ primary_contact_person?: INestedUser | null;
28
+ office_incharge?: INestedOffice | null;
29
+ associated_roles?: INestedRole[] | null;
30
+ approval_configs?: INestedApprovalConfig[] | null;
31
+ departments?: INestedDepartment[] | null;
32
+ served_by_store_locations?: INestedStoreLocation[] | null;
33
+ associated_purchase_locations?: INestedPurchaseLocation[] | null;
34
+ }
35
+ export interface INestedOffice extends Omit<IOffice, "company" | "primary_contact_person" | "office_incharge" | "associated_roles" | "approval_configs" | "departments" | "served_by_store_locations" | "associated_purchase_locations"> {
36
+ }
1
37
  export declare enum OfficeInclude {
2
38
  associated_roles = "associated_roles",
3
39
  approval_configs = "approval_configs",
@@ -1,3 +1,21 @@
1
+ import { IApprovalChainEntry } from "./approvalChain.typings";
2
+ import { INestedTaxes } from "./taxes.typings";
3
+ export interface IPurchaseOrder {
4
+ id: string;
5
+ creation_date: Date;
6
+ delivery_location: string;
7
+ contact_person: string;
8
+ delivery_by_date: Date;
9
+ vendor: string;
10
+ terms_and_condition: string;
11
+ payment: string;
12
+ delivery_schedule: string;
13
+ remarks: string;
14
+ approval_chain?: IApprovalChainEntry[] | null;
15
+ taxes?: INestedTaxes[] | null;
16
+ }
17
+ export interface INestedPo extends Omit<"approval_chain", "taxes"> {
18
+ }
1
19
  export declare enum PO_INCLUDE {
2
20
  approval_chain = "approval_chain",
3
21
  taxes = "taxes"
@@ -1,3 +1,50 @@
1
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
2
+ import { INestedCompany } from "./company.typings";
3
+ import { INestedDepartment } from "./department.typings";
4
+ import { IDocItem } from "./docItems.typings";
5
+ import { INestedIndent } from "./indent.typings";
6
+ import { INestedItem } from "./item.typings";
7
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
8
+ import { INestedRFQItem } from "./rfq.typings";
9
+ import { INestedUser } from "./user.typings";
10
+ export interface IPR {
11
+ id: string;
12
+ pr_no: string;
13
+ status: string;
14
+ created_by_user_id: string;
15
+ company_id: string;
16
+ target_purchase_location_id: string;
17
+ priority_date: string;
18
+ priority: string;
19
+ is_deleted: boolean;
20
+ budget_code_id?: string | null;
21
+ notes?: string | null;
22
+ indent_source_dept_id?: string | null;
23
+ sent_to_purchase_location_at?: string | null;
24
+ parent_indent_id?: string | null;
25
+ approved_at?: string | null;
26
+ deleted_at?: string | null;
27
+ created_at?: string | null;
28
+ updated_at?: string | null;
29
+ created_by_user?: null | INestedUser;
30
+ company?: null | INestedCompany;
31
+ parent_indent?: null | INestedIndent;
32
+ parent_department?: null | INestedDepartment;
33
+ target_purchase_location?: null | INestedPurchaseLocation;
34
+ approval_chain?: null | INestedApprovalChainEntry[];
35
+ items?: null | INestedItem[];
36
+ referenced_rfq_items?: null | INestedRFQItem[];
37
+ }
38
+ export interface INestedPR extends Omit<IPR, "created_by_user" | "company" | "parent_indent" | "parent_department" | "target_purchase_location" | "approval_chain" | "items" | "referenced_rfq_items"> {
39
+ }
40
+ export interface IPRItems extends IDocItem {
41
+ pr_id: string;
42
+ pr_no: string;
43
+ quantity: number;
44
+ pending_quantity: number;
45
+ }
46
+ export interface INestedPrItem extends Omit<IPRItems, "company" | "parent_pr" | "related_rfq_items" | "item"> {
47
+ }
1
48
  export declare const PR_PRIORITY_TYPES: {
2
49
  LOW: string;
3
50
  MEDIUM: string;
@@ -1,6 +1,42 @@
1
+ import { FormTypes } from "../constants/form.constants";
2
+ import { INestedApprovalConfig } from "./approvalConfig.typings";
3
+ import { INestedCompany } from "./company.typings";
4
+ import { INestedUser } from "./user.typings";
1
5
  export declare enum PurchaseLocationInclude {
2
6
  departments = "departments",
3
7
  roles = "roles",
4
8
  associated_offices = "associated_offices",
5
9
  target_store_locations = "target_store_locations"
6
10
  }
11
+ export interface IPurchaseLocation {
12
+ id: string;
13
+ purchase_location_name: string;
14
+ purchase_location_code: string;
15
+ company_id: string;
16
+ created_by_id: string;
17
+ associated_offices: string[];
18
+ target_store_locations: string[];
19
+ incharge_id?: string;
20
+ pincode: string;
21
+ area?: string;
22
+ state?: string;
23
+ city?: string;
24
+ country?: string;
25
+ address?: string;
26
+ is_enabled: boolean;
27
+ is_deleted: boolean;
28
+ deleted_at: string | null;
29
+ created_at: string;
30
+ updated_at: string;
31
+ company?: INestedCompany | null;
32
+ incharge?: INestedUser | null;
33
+ approvalConfigs?: INestedApprovalConfig[] | null;
34
+ }
35
+ export interface INestedPurchaseLocation extends Omit<IPurchaseLocation, "company" | "office" | "store_location" | "purchase_location" | "gate" | "approval_chain"> {
36
+ }
37
+ export interface IAddPurchaseLocationInputs extends Omit<IPurchaseLocation, "id" | "deleted_at" | "created_at" | "updated_at" | "created_by_id"> {
38
+ type: FormTypes.CREATE;
39
+ }
40
+ export interface IUpdatePurchaseLocationInputs extends Partial<Omit<IAddPurchaseLocationInputs, "type">> {
41
+ type: FormTypes.EDIT;
42
+ }
@@ -1,6 +1,7 @@
1
1
  import { INestedCompany } from "./company.typings";
2
2
  import { INestedItem } from "./item.typings";
3
3
  import { INestedRFQ, INestedRFQItem } from "./rfq.typings";
4
+ import { INestedTaxes } from "./taxes.typings";
4
5
  import { INestedVendor } from "./vendor.typings";
5
6
  export declare enum QUOTE_STATUS {
6
7
  PENDING = "PENDING",
@@ -38,8 +39,9 @@ export interface IQuote {
38
39
  vendor?: INestedVendor | null;
39
40
  company?: INestedCompany | null;
40
41
  quote_items?: INestedQuoteItems[] | null;
42
+ taxes?: INestedTaxes[] | null;
41
43
  }
42
- export interface INestedQuote extends Omit<IQuote, "parent_rfq" | "vendor" | "company" | "quote_items"> {
44
+ export interface INestedQuote extends Omit<IQuote, "parent_rfq" | "vendor" | "company" | "quote_items" | "taxes"> {
43
45
  }
44
46
  export interface IQuoteInputs extends Omit<IQuote, "id" | "quoted_at" | "is_deleted" | "deleted_at" | "created_at" | "updated_at"> {
45
47
  }
@@ -63,5 +65,26 @@ export interface IQuoteItems {
63
65
  item?: INestedItem | null;
64
66
  rfq_item?: INestedRFQItem | null;
65
67
  }
66
- export interface INestedQuoteItems {
68
+ export interface INestedQuoteItems extends Omit<IQuoteItems, "quote" | "item" | "rfq_item"> {
69
+ }
70
+ export declare class QuoteItemFactory implements IQuoteItems {
71
+ constructor(partial: IQuoteItems);
72
+ id: string;
73
+ quote_id: string;
74
+ item_id: string;
75
+ rfq_item_id: string;
76
+ requested_quantity: number;
77
+ gst?: number | null;
78
+ per_unit_rate?: number | null;
79
+ quoted_quantity?: number | null;
80
+ discount_type?: string | null;
81
+ discount_value?: number | null;
82
+ remark?: string | null;
83
+ is_deleted?: boolean | null;
84
+ deleted_at?: string | null;
85
+ created_at?: string | null;
86
+ updated_at?: string | null;
87
+ quote?: INestedQuote | null;
88
+ item?: INestedItem | null;
89
+ rfq_item?: INestedRFQItem | null;
67
90
  }
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.QUOTE_ITEM_INCLUDES = exports.QUOTE_INCLUDES = exports.QUOTE_STATUS = void 0;
3
+ exports.QuoteItemFactory = exports.QUOTE_ITEM_INCLUDES = exports.QUOTE_INCLUDES = exports.QUOTE_STATUS = void 0;
4
4
  var QUOTE_STATUS;
5
5
  (function (QUOTE_STATUS) {
6
6
  QUOTE_STATUS["PENDING"] = "PENDING";
@@ -20,3 +20,14 @@ var QUOTE_ITEM_INCLUDES;
20
20
  QUOTE_ITEM_INCLUDES["item"] = "item";
21
21
  QUOTE_ITEM_INCLUDES["parent_rfq_item"] = "parent_rfq_item";
22
22
  })(QUOTE_ITEM_INCLUDES = exports.QUOTE_ITEM_INCLUDES || (exports.QUOTE_ITEM_INCLUDES = {}));
23
+ class QuoteItemFactory {
24
+ constructor(partial) {
25
+ this.id = "";
26
+ this.quote_id = "";
27
+ this.item_id = "";
28
+ this.rfq_item_id = "";
29
+ this.requested_quantity = 0;
30
+ Object.assign(this, partial);
31
+ }
32
+ }
33
+ exports.QuoteItemFactory = QuoteItemFactory;
@@ -1,6 +1,7 @@
1
- import { IEntityApprovalChainEntry } from "./approvalChain.typings";
2
- import { ICompanyVendor } from "./companyVendors.typings";
3
- import { IVendorGroup } from "./vendorGroup.typings";
1
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
2
+ import { INestedCompanyVendors } from "./companyVendors.typings";
3
+ import { INestedUser } from "./user.typings";
4
+ import { INestedVendorGroups } from "./vendorGroup.typings";
4
5
  export declare enum RFQ_INCLUDES {
5
6
  approval_chain = "approval_chain",
6
7
  items = "items",
@@ -47,10 +48,10 @@ export interface IRFQ {
47
48
  deleted_at?: string | null;
48
49
  created_at?: string | null;
49
50
  updated_at?: string | null;
50
- items?: IRFQItem[] | null;
51
- approval_chain?: IEntityApprovalChainEntry[] | null;
52
- rfq_vendor_groups?: IVendorGroup[] | null;
53
- rfq_vendors?: ICompanyVendor[] | null;
51
+ items?: INestedRFQItem[] | null;
52
+ approval_chain?: INestedApprovalChainEntry[] | null;
53
+ rfq_vendor_groups?: INestedVendorGroups[] | null;
54
+ rfq_vendors?: INestedCompanyVendors[] | null;
54
55
  }
55
56
  export interface INestedRFQ extends Omit<IRFQ, "items" | "approval_chain" | "rfq_vendor_groups" | "rfq_vendors"> {
56
57
  }
@@ -77,8 +78,10 @@ export interface IRFQItem {
77
78
  deleted_at?: string | null;
78
79
  created_at?: string | null;
79
80
  updated_at?: string | null;
81
+ parent_rfq?: INestedRFQ | null;
82
+ created_by_user?: INestedUser | null;
80
83
  }
81
- export interface INestedRFQItem extends IRFQItem {
84
+ export interface INestedRFQItem extends Omit<IRFQItem, "parent_rfq" | "created_by_user" | "parent_pr" | "corresponding_pr_item" | "associated_quote_items"> {
82
85
  }
83
86
  export interface IRFQItemInputs extends Omit<IRFQItem, "created_by_user_id" | "created_at" | "parent_rfq_id"> {
84
87
  }
@@ -1,3 +1,66 @@
1
+ import { IPERMISSION_ENTITIES, PERMISSION_ACTIONS } from "../constants/permission.constants";
2
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
3
+ import { INestedCompany } from "./company.typings";
4
+ import { INestedDepartment } from "./department.typings";
5
+ import { INestedEntityApprovalChainEntry } from "./entityApprovalChainEntry.typings";
6
+ import { INestedGate } from "./gate.typings";
7
+ import { INestedOffice } from "./offices.typings";
8
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
9
+ import { INestedStoreLocation } from "./storeLocation.typings";
10
+ import { INestedUser } from "./user.typings";
11
+ export interface IRoles {
12
+ id: string;
13
+ company_id: string;
14
+ role_name: string;
15
+ role_code: string;
16
+ created_by_id: string;
17
+ type: string;
18
+ department_id: string;
19
+ office_id?: string;
20
+ store_location_id?: string;
21
+ purchase_location_id?: string;
22
+ gate_id?: string;
23
+ is_enabled: boolean;
24
+ is_deleted: boolean;
25
+ deleted_at: string;
26
+ created_at: string;
27
+ updated_at: string;
28
+ company?: null | INestedCompany;
29
+ department?: null | INestedDepartment;
30
+ office?: null | INestedOffice;
31
+ store_location?: null | INestedStoreLocation;
32
+ purchase_location?: null | INestedPurchaseLocation;
33
+ gates?: null | INestedGate;
34
+ permissions?: null | INestedPermission[];
35
+ assigned_active_users?: null | INestedUser[];
36
+ approval_chains?: null | INestedApprovalChainEntry[];
37
+ entity_approval_chain_entries?: null | INestedEntityApprovalChainEntry[];
38
+ assigned_users?: null | INestedUser[];
39
+ }
40
+ export interface INestedRole extends Omit<IRoles, "company" | "department" | "office" | "store_location" | "purchase_location" | "gates" | "permissions" | "assigned_active_users" | "approval_chains" | "entity_approval_chain_entries" | "assigned_users"> {
41
+ }
42
+ export interface IPermissions extends Record<string | PERMISSION_ACTIONS, any> {
43
+ id: string;
44
+ company_id: string;
45
+ role_id: string;
46
+ created_by_id: string;
47
+ is_enabled: boolean;
48
+ is_deleted: boolean;
49
+ deleted_at: string;
50
+ created_at: string;
51
+ updated_at: string;
52
+ entity_type: IPERMISSION_ENTITIES;
53
+ [PERMISSION_ACTIONS.APPROVALS]: boolean;
54
+ [PERMISSION_ACTIONS.STV]: boolean;
55
+ [PERMISSION_ACTIONS.CREATE]: boolean;
56
+ [PERMISSION_ACTIONS.READ_ONLY]: boolean;
57
+ [PERMISSION_ACTIONS.UPDATE]: boolean;
58
+ [PERMISSION_ACTIONS.DELETE]: boolean;
59
+ [PERMISSION_ACTIONS.CANCEL]: boolean;
60
+ [PERMISSION_ACTIONS.SEND_FOR_APPROVAL]: boolean;
61
+ }
62
+ export interface INestedPermission extends Omit<IPermissions, "company" | "parent_role"> {
63
+ }
1
64
  export declare enum RolesInclude {
2
65
  permissions = "permissions",
3
66
  assigned_active_users = "assigned_active_users",
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RolesInclude = void 0;
4
+ const permission_constants_1 = require("../constants/permission.constants");
4
5
  var RolesInclude;
5
6
  (function (RolesInclude) {
6
7
  RolesInclude["permissions"] = "permissions";
@@ -1,3 +1,23 @@
1
+ import { INestedItem } from "./item.typings";
2
+ import { INestedStoreLocation } from "./storeLocation.typings";
3
+ export interface IInventoryItem {
4
+ id: string;
5
+ store_location_id: string;
6
+ item_id: string;
7
+ created_by_id: string;
8
+ stock_in_hand: number;
9
+ min_reorder_level: number;
10
+ max_reorder_level: number;
11
+ is_enabled: boolean;
12
+ is_deleted?: boolean | null;
13
+ deleted_at?: string | null;
14
+ created_at?: string | null;
15
+ updated_at?: string | null;
16
+ store?: INestedStoreLocation | null;
17
+ item?: INestedItem | null;
18
+ }
19
+ export interface INestedInventoryItem extends Omit<IInventoryItem, "store" | "item"> {
20
+ }
1
21
  export declare enum STORE_INVENTORY_INCLUDE {
2
22
  store = "store",
3
23
  item = "item"
@@ -1,3 +1,46 @@
1
+ import { INestedApprovalConfig } from "./approvalConfig.typings";
2
+ import { INestedCompany } from "./company.typings";
3
+ import { INestedDepartment } from "./department.typings";
4
+ import { INestedIndent } from "./indent.typings";
5
+ import { INestedMI } from "./mi.typings";
6
+ import { INestedOffice } from "./offices.typings";
7
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
8
+ import { INestedRFQ } from "./rfq.typings";
9
+ import { INestedRole } from "./roles.typings";
10
+ import { INestedInventoryItem } from "./storeInventory.typings";
11
+ import { INestedUser } from "./user.typings";
12
+ export interface IStoreLocation {
13
+ id: string;
14
+ store_location_name: string;
15
+ store_location_code: string;
16
+ company_id: string;
17
+ created_by_id: string;
18
+ incharge_id?: string | null;
19
+ pincode?: string | null;
20
+ area?: string | null;
21
+ state?: string | null;
22
+ city?: string | null;
23
+ country?: string | null;
24
+ address?: string | null;
25
+ is_deleted: boolean;
26
+ is_enabled: boolean;
27
+ deleted_at: string | null;
28
+ created_at: string;
29
+ updated_at: string;
30
+ company?: null | INestedCompany;
31
+ store_incharge?: null | INestedUser;
32
+ approval_configs?: null | INestedApprovalConfig;
33
+ inventory_entries?: null | INestedInventoryItem[];
34
+ departments?: null | INestedDepartment[];
35
+ roles?: null | INestedRole[];
36
+ indents?: null | INestedIndent[];
37
+ mis?: null | INestedMI[];
38
+ as_shipping_location_for_rfqs?: null | INestedRFQ[];
39
+ target_offices?: null | INestedOffice[];
40
+ served_by_purchase_locations?: null | INestedPurchaseLocation[];
41
+ }
42
+ export interface INestedStoreLocation extends Omit<IStoreLocation, "company" | "store_incharge" | "approval_configs" | "inventory_entries" | "departments" | "roles" | "indents" | "mis" | "as_shipping_location_for_rfqs" | "target_offices" | "served_by_purchase_locations"> {
43
+ }
1
44
  export declare enum StoreLocationInclude {
2
45
  approval_configs = "approval_configs",
3
46
  inventory_entries = "inventory_entries",
@@ -0,0 +1,5 @@
1
+ export interface ITaxes {
2
+ id: string;
3
+ }
4
+ export interface INestedTaxes extends Omit<ITaxes, ""> {
5
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,3 +1,69 @@
1
+ import { FormTypes } from "../constants/form.constants";
2
+ import { INestedApprovalChainEntry } from "./approvalChain.typings";
3
+ import { INestedCompany } from "./company.typings";
4
+ import { INestedDepartment } from "./department.typings";
5
+ import { INestedEntityApprovalChainEntry } from "./entityApprovalChainEntry.typings";
6
+ import { INestedIndent } from "./indent.typings";
7
+ import { INestedItem } from "./item.typings";
8
+ import { INestedMI } from "./mi.typings";
9
+ import { INestedOffice } from "./offices.typings";
10
+ import { INestedPR } from "./pr.typings";
11
+ import { INestedPurchaseLocation } from "./purchaseLocation.typings";
12
+ import { INestedRFQ } from "./rfq.typings";
13
+ import { INestedRole, IRoles } from "./roles.typings";
14
+ import { INestedStoreLocation } from "./storeLocation.typings";
15
+ export interface IUser {
16
+ id: string;
17
+ is_enabled?: boolean | null;
18
+ contact: string;
19
+ email: string;
20
+ firstname: string;
21
+ kraya_id: string;
22
+ password: string;
23
+ company_id: string;
24
+ active_role_id?: string | null;
25
+ reporting_to_id?: string | null;
26
+ is_admin?: boolean | null;
27
+ is_deleted?: boolean | null;
28
+ employee_code: string;
29
+ profile_img?: string | null;
30
+ middlename?: string | null;
31
+ created_by_id: string;
32
+ lastname: string;
33
+ deleted_at?: string | null;
34
+ created_at?: string | null;
35
+ updated_at?: string | null;
36
+ reporting_to?: null | INestedUser;
37
+ active_company?: null | INestedCompany;
38
+ active_role?: null | INestedRole;
39
+ subordinates?: null | INestedUser[];
40
+ as_incharge_in_purchase_locations?: null | INestedPurchaseLocation[];
41
+ as_incharge_in_store_locations?: null | INestedStoreLocation[];
42
+ as_incharge_in_offices?: null | INestedOffice[];
43
+ as_contact_person_companies?: null | INestedCompany[];
44
+ as_contact_person_offices?: null | INestedOffice[];
45
+ owned_companies?: null | INestedCompany[];
46
+ head_for_departments?: null | INestedDepartment[];
47
+ approved_items?: null | INestedItem[];
48
+ approval_chains?: null | INestedApprovalChainEntry[];
49
+ created_indents?: null | INestedIndent[];
50
+ created_mis?: null | INestedMI[];
51
+ created_prs?: null | INestedPR[];
52
+ created_rfqs?: null | INestedRFQ[];
53
+ entity_approval_chains?: null | INestedEntityApprovalChainEntry[];
54
+ rfqs_sent_for_approval?: null | INestedRFQ[];
55
+ rfqs_sent_to_vendors?: null | INestedRFQ[];
56
+ created_rfq_items?: null | INestedRFQ[];
57
+ assigned_roles?: null | IRoles[];
58
+ }
59
+ export interface INestedUser extends Omit<IUser, "reporting_to" | "active_company" | "active_role" | "subordinates" | "otps" | "as_incharge_in_purchase_locations" | "as_incharge_in_store_locations" | "as_incharge_in_offices" | "as_contact_person_companies" | "as_contact_person_offices" | "owned_companies" | "head_for_departments" | "approved_items" | "approval_chains" | "created_indents" | "created_mis" | "created_prs" | "created_rfqs" | "entity_approval_chains" | "rfqs_sent_for_approval" | "rfqs_sent_to_vendors" | "created_rfq_items" | "assigned_roles"> {
60
+ }
61
+ export interface IAddUserInputs extends Omit<IUser, "id" | "created_by_id" | "created_at" | "updated_at" | "active_role_id" | "is_admin" | "deleted_at" | "is_deleted" | "subordiantes"> {
62
+ type: FormTypes.CREATE;
63
+ }
64
+ export interface IUpdateUserInputs extends Partial<Omit<IAddUserInputs, "type" | "password">> {
65
+ type: FormTypes.EDIT;
66
+ }
1
67
  export declare enum UserInclude {
2
68
  as_incharge_in_purchase_locations = "as_incharge_in_purchase_locations",
3
69
  as_incharge_in_store_locations = "as_incharge_in_store_locations",
@@ -1,5 +1,5 @@
1
- import { FormTypes } from "../constants/form.constants";
2
- import { ICompanyVendor } from "./companyVendors.typings";
1
+ import { INestedCompany } from "./company.typings";
2
+ import { INestedQuote } from "./quote.typings";
3
3
  export interface IVendor {
4
4
  id: string;
5
5
  gst_no?: string;
@@ -37,14 +37,10 @@ export interface IVendor {
37
37
  deleted_at?: string | null;
38
38
  created_at?: string | null;
39
39
  updated_at?: string | null;
40
+ quotes?: INestedQuote[] | null;
41
+ associated_companies?: INestedCompany[] | null;
40
42
  }
41
- export interface INestedVendor {
42
- }
43
- export interface IAddVendorInputs extends Omit<IVendor, "id" | "created_at" | "updated_at" | "is_profile_complete" | "is_profile_verified" | "is_self_verified" | "deleted_at" | "is_deleted" | "vendor" | "vkraya_id" | "password">, Pick<ICompanyVendor, "vendor_code" | "company_id"> {
44
- type: FormTypes.CREATE;
45
- }
46
- export interface IUpdateVendorInputs extends Partial<Omit<IVendor, "type">> {
47
- type: FormTypes.EDIT;
43
+ export interface INestedVendor extends Omit<IVendor, "quotes" | "associated_companies"> {
48
44
  }
49
45
  export declare enum VENDOR_INCLUDE {
50
46
  quotes = "quotes",
@@ -1,3 +1,5 @@
1
+ import { INestedCompany } from "./company.typings";
2
+ import { INestedRFQ } from "./rfq.typings";
1
3
  export declare enum VENDOR_GROUP_INCLUDE {
2
4
  vendors = "vendors",
3
5
  rfqs = "rfqs"
@@ -12,11 +14,11 @@ export interface IVendorGroup {
12
14
  vendors: string[];
13
15
  is_enabled: boolean;
14
16
  is_deleted?: boolean;
15
- deleted_at?: Date;
16
- created_at: Date;
17
- updated_at: Date;
17
+ deleted_at?: string;
18
+ created_at: string;
19
+ updated_at: string;
20
+ company?: INestedCompany | null;
21
+ rfqs?: INestedRFQ[] | null;
18
22
  }
19
- export interface IAddVendorGroupInputs extends Omit<IVendorGroup, "id" | "company_id" | "created_by_id" | "vendors" | "is_enabled" | "is_deleted" | "deleted_at" | "created_at" | "updated_at"> {
20
- }
21
- export interface IUpdateVendorGroupInputs extends Partial<Omit<IAddVendorGroupInputs, "type">> {
23
+ export interface INestedVendorGroups extends Omit<IVendorGroup, "company" | "vendors" | "rfqs"> {
22
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kcommons",
3
- "version": "4.5.0",
3
+ "version": "5.0.0",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.js",