law-common 10.68.4 → 10.68.5-beta.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.
@@ -9,6 +9,11 @@
9
9
  // import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
10
10
  // import { GstRateEntityModel } from "./gst_rate.entity.model";
11
11
  // import { TdsRateEntityModel } from "./tds_rate.entity.model";
12
+ // import { VendorEntityModel } from "./vendor.entity.model";
13
+ // import { StateEntityModel } from "./state.entity.model";
14
+ // import { CountryEntityModel } from "./country.entity.model";
15
+ // import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
16
+ // import { OfficeLocationEntityModel } from "./office_location.entity.model";
12
17
  // export class VendorInvoiceItemEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE_ITEM> implements IVendorInvoiceItemEntity {
13
18
  // id: number = 0;
14
19
  // vendorInvoiceId: number = 0;
@@ -89,4 +94,39 @@
89
94
  // getRelationConfigs(): any[] {
90
95
  // return this.constructor.prototype.constructor.relationConfigs || [];
91
96
  // }
97
+ // get vendor(): VendorEntityModel | undefined {
98
+ // // many_to_one -> many_to_one verified
99
+ // // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one'}
100
+ // // ['vendor_invoice_item', 'vendor_invoice'] -> many_to_one
101
+ // // ['vendor_invoice', 'vendor'] -> many_to_one
102
+ // return this.vendorInvoice?.vendor;
103
+ // }
104
+ // get state(): StateEntityModel | undefined {
105
+ // // many_to_one -> many_to_one verified
106
+ // // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->state': 'many_to_one'}
107
+ // // ['vendor_invoice', 'vendor'] -> many_to_one
108
+ // // ['vendor', 'state'] -> many_to_one
109
+ // return this.vendor?.state;
110
+ // }
111
+ // get country(): CountryEntityModel | undefined {
112
+ // // many_to_one -> many_to_one verified
113
+ // // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->country': 'many_to_one'}
114
+ // // ['vendor_invoice', 'vendor'] -> many_to_one
115
+ // // ['vendor', 'country'] -> many_to_one
116
+ // return this.vendor?.country;
117
+ // }
118
+ // get organizationType(): OrganizationTypeEntityModel | undefined {
119
+ // // many_to_one -> many_to_one verified
120
+ // // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->organization_type': 'many_to_one'}
121
+ // // ['vendor_invoice', 'vendor'] -> many_to_one
122
+ // // ['vendor', 'organization_type'] -> many_to_one
123
+ // return this.vendor?.organizationType;
124
+ // }
125
+ // get officeLocation(): OfficeLocationEntityModel | undefined {
126
+ // // many_to_one -> many_to_one verified
127
+ // // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->office_location': 'many_to_one'}
128
+ // // ['vendor_invoice_item', 'vendor_invoice'] -> many_to_one
129
+ // // ['vendor_invoice', 'office_location'] -> many_to_one
130
+ // return this.vendorInvoice?.officeLocation;
131
+ // }
92
132
  // }
@@ -1,22 +1,20 @@
1
1
  import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
2
- import { RelationConfigs } from "../interface/relation-config.interface";
3
2
  import { BaseEntityModel } from "./base.entity.model";
3
+ import { RelationConfigs } from "../interface/relation-config.interface";
4
4
  import { IVendorInvoiceItemEntity } from "../interface/vendor_invoice_item.entity.interface";
5
- import { IGstRateEntity } from "../interface/gst_rate.entity.interface";
6
- import { ITdsRateEntity } from "../interface/tds_rate.entity.interface";
7
- import { IVendorEntity } from "../interface/vendor.entity.interface";
5
+ import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
6
+ import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
8
7
  import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
9
8
  import { GstRateEntityModel } from "./gst_rate.entity.model";
10
9
  import { TdsRateEntityModel } from "./tds_rate.entity.model";
11
10
  import { VendorEntityModel } from "./vendor.entity.model";
12
- import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
13
- import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
14
- export interface IVendorInvoiceItemEntityAmounts {
15
- gstAmount: number;
16
- tdsAmount: number;
17
- invoiceAmount: number;
18
- netAmount: number;
19
- }
11
+ import { StateEntityModel } from "./state.entity.model";
12
+ import { CountryEntityModel } from "./country.entity.model";
13
+ import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
14
+ import { OfficeLocationEntityModel } from "./office_location.entity.model";
15
+ import { IGstRateEntity } from "../interface/gst_rate.entity.interface";
16
+ import { ITdsRateEntity } from "../interface/tds_rate.entity.interface";
17
+ import { IVendorEntity } from "../interface/vendor.entity.interface";
20
18
  export declare class VendorInvoiceItemEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE_ITEM> implements IVendorInvoiceItemEntity {
21
19
  id: number;
22
20
  vendorInvoiceId: number;
@@ -30,13 +28,13 @@ export declare class VendorInvoiceItemEntityModel extends BaseEntityModel<Entity
30
28
  netAmount: number;
31
29
  quantity: number;
32
30
  rate: number;
33
- remark: Nullable<string>;
34
- gstAmount: number;
35
- tdsAmount: number;
36
31
  createdOn: number;
37
32
  updatedOn: number;
38
33
  createdBy: number;
39
34
  updatedBy: number;
35
+ remark: Nullable<string>;
36
+ gstAmount: number;
37
+ tdsAmount: number;
40
38
  vendorInvoice?: VendorInvoiceEntityModel;
41
39
  voucherType?: VoucherTypeEntityModel;
42
40
  expenseHead?: ExpenseHeadEntityModel;
@@ -51,6 +49,11 @@ export declare class VendorInvoiceItemEntityModel extends BaseEntityModel<Entity
51
49
  ], EntityEnum.VENDOR_INVOICE_ITEM>;
52
50
  static fromEntity(entity: IVendorInvoiceItemEntity): VendorInvoiceItemEntityModel;
53
51
  getRelationConfigs(): any[];
52
+ get vendor(): VendorEntityModel | undefined;
53
+ get state(): StateEntityModel | undefined;
54
+ get country(): CountryEntityModel | undefined;
55
+ get organizationType(): OrganizationTypeEntityModel | undefined;
56
+ get officeLocation(): OfficeLocationEntityModel | undefined;
54
57
  static calculateAmounts(params: {
55
58
  basicAmount: number;
56
59
  gstRateEntity: IGstRateEntity;
@@ -60,3 +63,9 @@ export declare class VendorInvoiceItemEntityModel extends BaseEntityModel<Entity
60
63
  static tdsRate(vendorEntity: IVendorEntity, tdsRateEntity: ITdsRateEntity): number;
61
64
  static AMOUNT_KEYS: (keyof IVendorInvoiceItemEntityAmounts)[];
62
65
  }
66
+ export interface IVendorInvoiceItemEntityAmounts {
67
+ gstAmount: number;
68
+ tdsAmount: number;
69
+ invoiceAmount: number;
70
+ netAmount: number;
71
+ }
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VendorInvoiceItemEntityModel = void 0;
4
- const relation_type_enum_1 = require("../enums/relation-type.enum");
5
4
  const entity_utils_interface_1 = require("../interface/entity.utils.interface");
6
5
  const base_entity_model_1 = require("./base.entity.model");
6
+ const relation_type_enum_1 = require("../enums/relation-type.enum");
7
7
  const vendor_pan_type_enum_1 = require("../enums/vendor_pan_type_enum");
8
8
  class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
9
9
  constructor() {
@@ -20,14 +20,13 @@ class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
20
20
  this.netAmount = 0;
21
21
  this.quantity = 0;
22
22
  this.rate = 0;
23
- // status: VendorInvoiceItemStatus = VendorInvoiceItemStatus.PENDING;
24
- this.remark = null;
25
- this.gstAmount = 0;
26
- this.tdsAmount = 0;
27
23
  this.createdOn = 0;
28
24
  this.updatedOn = 0;
29
25
  this.createdBy = 0;
30
26
  this.updatedBy = 0;
27
+ this.remark = null;
28
+ this.gstAmount = 0;
29
+ this.tdsAmount = 0;
31
30
  // getAvailableActions(
32
31
  // currentUser: UserEntityModel,
33
32
  // config?: {
@@ -65,6 +64,46 @@ class VendorInvoiceItemEntityModel extends base_entity_model_1.BaseEntityModel {
65
64
  getRelationConfigs() {
66
65
  return this.constructor.prototype.constructor.relationConfigs || [];
67
66
  }
67
+ get vendor() {
68
+ // many_to_one -> many_to_one verified
69
+ // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one'}
70
+ // ['vendor_invoice_item', 'vendor_invoice'] -> many_to_one
71
+ // ['vendor_invoice', 'vendor'] -> many_to_one
72
+ var _a;
73
+ return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.vendor;
74
+ }
75
+ get state() {
76
+ // many_to_one -> many_to_one verified
77
+ // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->state': 'many_to_one'}
78
+ // ['vendor_invoice', 'vendor'] -> many_to_one
79
+ // ['vendor', 'state'] -> many_to_one
80
+ var _a;
81
+ return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.stateModel;
82
+ }
83
+ get country() {
84
+ // many_to_one -> many_to_one verified
85
+ // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->country': 'many_to_one'}
86
+ // ['vendor_invoice', 'vendor'] -> many_to_one
87
+ // ['vendor', 'country'] -> many_to_one
88
+ throw new Error("Relation 'country' is not defined in VendorEntityModel. Please define the relation to access country from VendorInvoiceItemEntityModel.");
89
+ // return this.vendor?.country;
90
+ }
91
+ get organizationType() {
92
+ // many_to_one -> many_to_one verified
93
+ // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->vendor': 'many_to_one', 'vendor->organization_type': 'many_to_one'}
94
+ // ['vendor_invoice', 'vendor'] -> many_to_one
95
+ // ['vendor', 'organization_type'] -> many_to_one
96
+ var _a;
97
+ return (_a = this.vendor) === null || _a === void 0 ? void 0 : _a.organizationType;
98
+ }
99
+ get officeLocation() {
100
+ // many_to_one -> many_to_one verified
101
+ // {'vendor_invoice_item->vendor_invoice': 'many_to_one', 'vendor_invoice->office_location': 'many_to_one'}
102
+ // ['vendor_invoice_item', 'vendor_invoice'] -> many_to_one
103
+ // ['vendor_invoice', 'office_location'] -> many_to_one
104
+ var _a;
105
+ return (_a = this.vendorInvoice) === null || _a === void 0 ? void 0 : _a.officeLocation;
106
+ }
68
107
  // getNextStatus(dto: IVendorInvoiceItemUpdateDto, currentUser: IUserEntity): VendorInvoiceItemStatus {
69
108
  // // const flow = vendorInvoiceConfigFlow as FlowConfig<
70
109
  // // VendorInvoiceActionStatusEnum,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "10.68.4",
3
+ "version": "10.68.5-beta.1",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [