law-common 11.3.16 → 11.3.18

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 (51) hide show
  1. package/dist/src/api/index.d.ts +4 -0
  2. package/dist/src/api/index.js +4 -0
  3. package/dist/src/api/interface/vendor_tds_challan.create.dto.interface.d.ts +5 -0
  4. package/dist/src/api/interface/vendor_tds_challan.create.dto.interface.js +2 -0
  5. package/dist/src/api/interface/vendor_tds_challan.update.dto.interface.d.ts +17 -0
  6. package/dist/src/api/interface/vendor_tds_challan.update.dto.interface.js +17 -0
  7. package/dist/src/api/interface/vendor_tds_liability.create.dto.interface.d.ts +5 -0
  8. package/dist/src/api/interface/vendor_tds_liability.create.dto.interface.js +2 -0
  9. package/dist/src/api/interface/vendor_tds_liability.update.dto.interface.d.ts +22 -0
  10. package/dist/src/api/interface/vendor_tds_liability.update.dto.interface.js +14 -0
  11. package/dist/src/entities/enums/configuration-key.enum.d.ts +4 -0
  12. package/dist/src/entities/enums/configuration-key.enum.js +7 -0
  13. package/dist/src/entities/enums/cron-jobs-name.enum.d.ts +3 -0
  14. package/dist/src/entities/enums/cron-jobs-name.enum.js +3 -0
  15. package/dist/src/entities/enums/vendor_tds_challan_status_enum.d.ts +5 -0
  16. package/dist/src/entities/enums/vendor_tds_challan_status_enum.js +9 -0
  17. package/dist/src/entities/enums/vendor_tds_liability_paid_status_enum.d.ts +4 -0
  18. package/dist/src/entities/enums/vendor_tds_liability_paid_status_enum.js +8 -0
  19. package/dist/src/entities/enums/vendor_tds_liability_status_enum.d.ts +5 -0
  20. package/dist/src/entities/enums/vendor_tds_liability_status_enum.js +9 -0
  21. package/dist/src/entities/flow-configs/vendor_tds_challan_flow.config.d.ts +6 -0
  22. package/dist/src/entities/flow-configs/vendor_tds_challan_flow.config.js +70 -0
  23. package/dist/src/entities/flow-configs/vendor_tds_liability_flow.config.d.ts +13 -0
  24. package/dist/src/entities/flow-configs/vendor_tds_liability_flow.config.js +125 -0
  25. package/dist/src/entities/index.d.ts +9 -0
  26. package/dist/src/entities/index.js +9 -0
  27. package/dist/src/entities/interface/entity.utils.interface.d.ts +9 -3
  28. package/dist/src/entities/interface/entity.utils.interface.js +2 -0
  29. package/dist/src/entities/interface/vendor_tds_challan.entity.interface.d.ts +15 -0
  30. package/dist/src/entities/interface/vendor_tds_challan.entity.interface.js +2 -0
  31. package/dist/src/entities/interface/vendor_tds_liability.entity.interface.d.ts +15 -0
  32. package/dist/src/entities/interface/vendor_tds_liability.entity.interface.js +2 -0
  33. package/dist/src/entities/model/billing.entity.model.d.ts +2 -0
  34. package/dist/src/entities/model/billing.entity.model.js +10 -0
  35. package/dist/src/entities/model/entity.model.interface.js +4 -0
  36. package/dist/src/entities/model/reimbursement-expense.entity.model.d.ts +5 -1
  37. package/dist/src/entities/model/reimbursement-expense.entity.model.js +18 -0
  38. package/dist/src/entities/model/tds_rate.entity.model.autocode.js +225 -1
  39. package/dist/src/entities/model/tds_rate.entity.model.d.ts +7 -1
  40. package/dist/src/entities/model/tds_rate.entity.model.js +18 -0
  41. package/dist/src/entities/model/timesheet.entity.model.d.ts +1 -0
  42. package/dist/src/entities/model/timesheet.entity.model.js +5 -1
  43. package/dist/src/entities/model/vendor_invoice.entity.model.d.ts +8 -1
  44. package/dist/src/entities/model/vendor_invoice.entity.model.js +9 -0
  45. package/dist/src/entities/model/vendor_tds_challan.entity.model.d.ts +69 -0
  46. package/dist/src/entities/model/vendor_tds_challan.entity.model.js +257 -0
  47. package/dist/src/entities/model/vendor_tds_liability.entity.model.d.ts +66 -0
  48. package/dist/src/entities/model/vendor_tds_liability.entity.model.js +222 -0
  49. package/dist/src/enums/error.key.enum.d.ts +2 -1
  50. package/dist/src/enums/error.key.enum.js +1 -0
  51. package/package.json +4 -1
@@ -84,6 +84,8 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
84
84
  EntityEnum.BILLING_TRANSACTION
85
85
  ], EntityEnum.BILLING>;
86
86
  static fromEntity(entity: IBillingEntity): BillingEntityModel;
87
+ get nonDeletedBillingTimesheets(): BillingTimesheetEntityModel[];
88
+ get nonDeletedBillingReimbursementExpenses(): BillingReimbursementExpneseEntityModel[];
87
89
  getStatusCategory(): BillingStatusCategoryEnum;
88
90
  getStatusLabel(): string;
89
91
  getTotalAmountInINR(): string;
@@ -6,10 +6,12 @@ const enums_1 = require("../../enums");
6
6
  const error_key_enum_1 = require("../../enums/error.key.enum");
7
7
  const exceptions_1 = require("../../exceptions");
8
8
  const utils_1 = require("../../utils");
9
+ const billing_reimbursement_expense_change_status_enum_1 = require("../enums/billing-reimbursement-expense-change-status.enum");
9
10
  const billing_status_category_enum_1 = require("../enums/billing-status-category.enum");
10
11
  const billing_transaction_status_enum_1 = require("../enums/billing-transaction-status.enum");
11
12
  const billing_type_enum_1 = require("../enums/billing-type.enum");
12
13
  const billing_status_enum_1 = require("../enums/billing.status.enum");
14
+ const billing_timesheet_change_status_enum_1 = require("../enums/billing.timesheet.change.status.enum");
13
15
  const billing_transaction_enum_1 = require("../enums/billing.transaction.enum");
14
16
  const billing_invoice_type_enum_1 = require("../enums/billing_invoice_type.enum");
15
17
  const billing_profile_enum_1 = require("../enums/billing_profile.enum");
@@ -75,6 +77,14 @@ class BillingEntityModel extends base_entity_model_1.BaseEntityModel {
75
77
  Object.assign(result, entity);
76
78
  return result;
77
79
  }
80
+ get nonDeletedBillingTimesheets() {
81
+ var _a, _b;
82
+ return (_b = (_a = this.billingTimesheets) === null || _a === void 0 ? void 0 : _a.filter((ts) => ts.changedStatus !== billing_timesheet_change_status_enum_1.BillingTimesheetStatusEnum.DELETED)) !== null && _b !== void 0 ? _b : [];
83
+ }
84
+ get nonDeletedBillingReimbursementExpenses() {
85
+ var _a, _b;
86
+ return (_b = (_a = this.billingReimbursementExpenses) === null || _a === void 0 ? void 0 : _a.filter((ts) => ts.changedStatus !== billing_reimbursement_expense_change_status_enum_1.BillingReimbursementExpenseChangedStatusEnum.DELETED)) !== null && _b !== void 0 ? _b : [];
87
+ }
78
88
  getStatusCategory() {
79
89
  return this.mapStatusCategory(this.status);
80
90
  }
@@ -76,6 +76,8 @@ const vendor_invoice_history_entity_model_1 = require("./vendor_invoice_history.
76
76
  const vendor_invoice_item_entity_model_1 = require("./vendor_invoice_item.entity.model");
77
77
  const vendor_invoice_item_history_entity_model_1 = require("./vendor_invoice_item_history.entity.model");
78
78
  const vendor_invoice_payment_entity_model_1 = require("./vendor_invoice_payment.entity.model");
79
+ const vendor_tds_challan_entity_model_1 = require("./vendor_tds_challan.entity.model");
80
+ const vendor_tds_liability_entity_model_1 = require("./vendor_tds_liability.entity.model");
79
81
  const voucher_type_entity_model_1 = require("./voucher_type.entity.model");
80
82
  const website_lead_entity_model_1 = require("./website_lead.entity.model");
81
83
  const website_newsletter_subscription_entity_model_1 = require("./website_newsletter_subscription.entity.model");
@@ -180,6 +182,8 @@ exports.entityEnumToEntityModel = {
180
182
  [entity_utils_interface_1.EntityEnum.ENTITY_HISTORY]: entity_history_entity_model_1.EntityHistoryEntityModel.fromEntity,
181
183
  [entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_PAYMENT]: vendor_invoice_payment_entity_model_1.VendorInvoicePaymentEntityModel.fromEntity,
182
184
  [entity_utils_interface_1.EntityEnum.LEAVE_APPROVAL]: leave_approval_entity_model_1.LeaveApprovalEntityModel.fromEntity,
185
+ [entity_utils_interface_1.EntityEnum.VENDOR_TDS_LIABILITY]: vendor_tds_liability_entity_model_1.VendorTdsLiabilityEntityModel.fromEntity,
186
+ [entity_utils_interface_1.EntityEnum.VENDOR_TDS_CHALLAN]: vendor_tds_challan_entity_model_1.VendorTdsChallanEntityModel.fromEntity,
183
187
  };
184
188
  function entityMapToModels(entityMap) {
185
189
  for (const entityName in entityMap) {
@@ -3,7 +3,9 @@ import { EntityEnum } from "../interface/entity.utils.interface";
3
3
  import { IReimbursementExpenseEntity } from "../interface/reimbursement_expense.entity.interface";
4
4
  import { RelationConfigs } from "../interface/relation-config.interface";
5
5
  import { BaseEntityModel } from "./base.entity.model";
6
+ import { ProjectEntityModel } from "./project.entity.model";
6
7
  import { ReimbursementEntityModel } from "./reimbursement.entity.model";
8
+ import { UserEntityModel } from "./user.entity.model";
7
9
  export declare class ReimbursementExpenseEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT_EXPENSE> implements IReimbursementExpenseEntity {
8
10
  id: number;
9
11
  reimbursementId: number;
@@ -19,7 +21,9 @@ export declare class ReimbursementExpenseEntityModel extends BaseEntityModel<Ent
19
21
  createdOn: number;
20
22
  updatedOn: number;
21
23
  reimbursement?: ReimbursementEntityModel;
24
+ user?: UserEntityModel;
25
+ project?: ProjectEntityModel;
22
26
  static fromEntity(apiEntity: IReimbursementExpenseEntity): ReimbursementExpenseEntityModel;
23
- static relationConfigs: RelationConfigs<[EntityEnum.REIMBURSEMENT], EntityEnum.REIMBURSEMENT_EXPENSE>;
27
+ static relationConfigs: RelationConfigs<[EntityEnum.REIMBURSEMENT, EntityEnum.USER, EntityEnum.PROJECT], EntityEnum.REIMBURSEMENT_EXPENSE>;
24
28
  getRelationConfigs(): any;
25
29
  }
@@ -40,4 +40,22 @@ ReimbursementExpenseEntityModel.relationConfigs = [
40
40
  key: "reimbursementId",
41
41
  },
42
42
  },
43
+ {
44
+ name: entity_utils_interface_1.EntityEnum.USER,
45
+ key: "user",
46
+ relation: relation_type_enum_1.RelationType.ONE,
47
+ mapKeyConfig: {
48
+ relationKey: "id",
49
+ key: "userId",
50
+ },
51
+ },
52
+ {
53
+ name: entity_utils_interface_1.EntityEnum.PROJECT,
54
+ key: "project",
55
+ relation: relation_type_enum_1.RelationType.ONE,
56
+ mapKeyConfig: {
57
+ relationKey: "id",
58
+ key: "projectId",
59
+ },
60
+ },
43
61
  ];
@@ -1,6 +1,34 @@
1
1
  "use strict";
2
2
  // import { EntityEnum } from "../interface/entity.utils.interface";
3
3
  // import { BaseEntityModel } from "./base.entity.model";
4
+ // import { RelationConfigs } from "../interface/relation-config.interface";
5
+ // import { RelationType } from "../enums/relation-type.enum";
6
+ // import { IUserEntity } from "../interface/user.entity.interface";
7
+ // import { AppBadRequestException } from "../../exceptions";
8
+ // import { ErrorKeyEnum } from "../../enums/error.key.enum";
9
+ // import { UserEntityModel } from "./user.entity.model";
10
+ // import { IRowActions } from "./interface/row-actions.interface";
11
+ // import { EntityActionFlowResolverV2 } from "../../utils";
12
+ // import { ITdsRateEntity } from "../interface/tds_rate.entity.interface";
13
+ // import { TdsRateStatusEnum } from "../enums/tds_rate_status_enum";
14
+ // import { OrganizationTypeTdsRateMappingEntityModel } from "./organization_type_tds_rate_mapping.entity.model";
15
+ // import { TdsRateVoucherTypeMappingEntityModel } from "./tds_rate_voucher_type_mapping.entity.model";
16
+ // import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
17
+ // import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
18
+ // import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
19
+ // import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
20
+ // import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
21
+ // import { VendorEntityModel } from "./vendor.entity.model";
22
+ // import { StateEntityModel } from "./state.entity.model";
23
+ // import { CountryEntityModel } from "./country.entity.model";
24
+ // import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
25
+ // import { OfficeLocationEntityModel } from "./office_location.entity.model";
26
+ // import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
27
+ // import { GstRateEntityModel } from "./gst_rate.entity.model";
28
+ // import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
29
+ // import { BankEntityModel } from "./bank.entity.model";
30
+ // import { TdsRateActionEnum } from "../../api";
31
+ // import { ITdsRateFlowConfigContextData, tdsRateFlowConfig } from "../flow-configs/tds_rate_flow.config";
4
32
  // export class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_RATE> implements ITdsRateEntity {
5
33
  // id: number = 0;
6
34
  // section: string = "";
@@ -15,7 +43,20 @@
15
43
  // createdBy: number = 0;
16
44
  // updatedBy: number = 0;
17
45
  // organizationTypeTdsRateMappings?: OrganizationTypeTdsRateMappingEntityModel[];
18
- // static relationConfigs: RelationConfigs<[EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING], EnumEntityType<EntityEnum.TDS_RATE>> = [
46
+ // tdsRateVoucherTypeMappings?: TdsRateVoucherTypeMappingEntityModel[];
47
+ // vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
48
+ // vendorTdsLiabilitys?: VendorTdsLiabilityEntityModel[];
49
+ // vendorTdsChallans?: VendorTdsChallanEntityModel[];
50
+ // static relationConfigs: RelationConfigs<
51
+ // [
52
+ // EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
53
+ // EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
54
+ // EntityEnum.VENDOR_INVOICE_ITEM,
55
+ // EntityEnum.VENDOR_TDS_LIABILITY,
56
+ // EntityEnum.VENDOR_TDS_CHALLAN,
57
+ // ],
58
+ // EntityEnum.TDS_RATE
59
+ // > = [
19
60
  // {
20
61
  // name: EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
21
62
  // relation: RelationType.MANY,
@@ -25,6 +66,42 @@
25
66
  // key: "id",
26
67
  // },
27
68
  // },
69
+ // {
70
+ // name: EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
71
+ // relation: RelationType.MANY,
72
+ // key: "tdsRateVoucherTypeMappings",
73
+ // mapKeyConfig: {
74
+ // relationKey: "tdsRateId",
75
+ // key: "id",
76
+ // },
77
+ // },
78
+ // {
79
+ // name: EntityEnum.VENDOR_INVOICE_ITEM,
80
+ // relation: RelationType.MANY,
81
+ // key: "vendorInvoiceItems",
82
+ // mapKeyConfig: {
83
+ // relationKey: "tdsRateId",
84
+ // key: "id",
85
+ // },
86
+ // },
87
+ // {
88
+ // name: EntityEnum.VENDOR_TDS_LIABILITY,
89
+ // relation: RelationType.MANY,
90
+ // key: "vendorTdsLiabilitys",
91
+ // mapKeyConfig: {
92
+ // relationKey: "tdsRateId",
93
+ // key: "id",
94
+ // },
95
+ // },
96
+ // {
97
+ // name: EntityEnum.VENDOR_TDS_CHALLAN,
98
+ // relation: RelationType.MANY,
99
+ // key: "vendorTdsChallans",
100
+ // mapKeyConfig: {
101
+ // relationKey: "tdsRateId",
102
+ // key: "id",
103
+ // },
104
+ // },
28
105
  // ];
29
106
  // static fromEntity(entity: ITdsRateEntity): TdsRateEntityModel {
30
107
  // const result = new TdsRateEntityModel(EntityEnum.TDS_RATE);
@@ -34,4 +111,151 @@
34
111
  // getRelationConfigs(): any[] {
35
112
  // return this.constructor.prototype.constructor.relationConfigs || [];
36
113
  // }
114
+ // get organizationTypes(): OrganizationTypeEntityModel[] {
115
+ // if (this.organizationTypeTdsRateMappings) {
116
+ // return this.organizationTypeTdsRateMappings.filter((mapping) => mapping.organizationType).map((mapping) => mapping.organizationType!);
117
+ // }
118
+ // return [];
119
+ // }
120
+ // get voucherTypes(): VoucherTypeEntityModel[] {
121
+ // if (this.tdsRateVoucherTypeMappings) {
122
+ // return this.tdsRateVoucherTypeMappings.filter((mapping) => mapping.voucherType).map((mapping) => mapping.voucherType!);
123
+ // }
124
+ // return [];
125
+ // }
126
+ // get vendors(): VendorEntityModel[] | undefined {
127
+ // // many_to_many -> many_to_many verified
128
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many'}
129
+ // // ['tds_rate', 'organization_type'] -> many_to_many
130
+ // // ['organization_type', 'vendor'] -> one_to_many
131
+ // return this.organizationTypes
132
+ // ?.flatMap((organizationType) => organizationType.vendors)
133
+ // .filter((vendor): vendor is VendorEntityModel => !!vendor)
134
+ // .reduce((accumulator: VendorEntityModel[], current) => {
135
+ // if (!accumulator.some((vendor) => vendor.id === current.id)) {
136
+ // accumulator.push(current);
137
+ // }
138
+ // return accumulator;
139
+ // }, []);
140
+ // }
141
+ // get states(): StateEntityModel[] | undefined {
142
+ // // many_to_many -> many_to_many verified
143
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->state': 'many_to_one'}
144
+ // // ['organization_type', 'vendor'] -> one_to_many
145
+ // // ['vendor', 'state'] -> many_to_one
146
+ // return this.vendors
147
+ // ?.flatMap((vendor) => vendor.state)
148
+ // .filter((state): state is StateEntityModel => !!state)
149
+ // .reduce((accumulator: StateEntityModel[], current) => {
150
+ // if (!accumulator.some((state) => state.id === current.id)) {
151
+ // accumulator.push(current);
152
+ // }
153
+ // return accumulator;
154
+ // }, []);
155
+ // }
156
+ // get countrys(): CountryEntityModel[] | undefined {
157
+ // // many_to_many -> many_to_many verified
158
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->country': 'many_to_one'}
159
+ // // ['organization_type', 'vendor'] -> one_to_many
160
+ // // ['vendor', 'country'] -> many_to_one
161
+ // return this.vendors
162
+ // ?.flatMap((vendor) => vendor.country)
163
+ // .filter((country): country is CountryEntityModel => !!country)
164
+ // .reduce((accumulator: CountryEntityModel[], current) => {
165
+ // if (!accumulator.some((country) => country.id === current.id)) {
166
+ // accumulator.push(current);
167
+ // }
168
+ // return accumulator;
169
+ // }, []);
170
+ // }
171
+ // get vendorInvoices(): VendorInvoiceEntityModel[] | undefined {
172
+ // // one_to_many -> many_to_many mismatch
173
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many'}
174
+ // // ['organization_type', 'vendor'] -> one_to_many
175
+ // // ['vendor', 'vendor_invoice'] -> one_to_many
176
+ // return this.vendors
177
+ // ?.flatMap((vendor) => vendor.vendorInvoices)
178
+ // .filter((vendorInvoice): vendorInvoice is VendorInvoiceEntityModel => !!vendorInvoice)
179
+ // .reduce((accumulator: VendorInvoiceEntityModel[], current) => {
180
+ // if (!accumulator.some((vendorInvoice) => vendorInvoice.id === current.id)) {
181
+ // accumulator.push(current);
182
+ // }
183
+ // return accumulator;
184
+ // }, []);
185
+ // }
186
+ // get officeLocations(): OfficeLocationEntityModel[] | undefined {
187
+ // // many_to_many -> many_to_many verified
188
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->office_location': 'many_to_one'}
189
+ // // ['vendor', 'vendor_invoice'] -> one_to_many
190
+ // // ['vendor_invoice', 'office_location'] -> many_to_one
191
+ // return this.vendorInvoices
192
+ // ?.flatMap((vendorInvoice) => vendorInvoice.officeLocation)
193
+ // .filter((officeLocation): officeLocation is OfficeLocationEntityModel => !!officeLocation)
194
+ // .reduce((accumulator: OfficeLocationEntityModel[], current) => {
195
+ // if (!accumulator.some((officeLocation) => officeLocation.id === current.id)) {
196
+ // accumulator.push(current);
197
+ // }
198
+ // return accumulator;
199
+ // }, []);
200
+ // }
201
+ // get expenseHeads(): ExpenseHeadEntityModel[] | undefined {
202
+ // // many_to_many -> many_to_many verified
203
+ // // {'tds_rate->voucher_type': 'many_to_many', 'voucher_type->expense_head': 'one_to_many'}
204
+ // // ['tds_rate', 'voucher_type'] -> many_to_many
205
+ // // ['voucher_type', 'expense_head'] -> one_to_many
206
+ // return this.voucherTypes
207
+ // ?.flatMap((voucherType) => voucherType.expenseHeads)
208
+ // .filter((expenseHead): expenseHead is ExpenseHeadEntityModel => !!expenseHead)
209
+ // .reduce((accumulator: ExpenseHeadEntityModel[], current) => {
210
+ // if (!accumulator.some((expenseHead) => expenseHead.id === current.id)) {
211
+ // accumulator.push(current);
212
+ // }
213
+ // return accumulator;
214
+ // }, []);
215
+ // }
216
+ // get gstRates(): GstRateEntityModel[] | undefined {
217
+ // // many_to_many -> many_to_many verified
218
+ // // {'tds_rate->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->gst_rate': 'many_to_one'}
219
+ // // ['tds_rate', 'vendor_invoice_item'] -> one_to_many
220
+ // // ['vendor_invoice_item', 'gst_rate'] -> many_to_one
221
+ // return this.vendorInvoiceItems
222
+ // ?.flatMap((vendorInvoiceItem) => vendorInvoiceItem.gstRate)
223
+ // .filter((gstRate): gstRate is GstRateEntityModel => !!gstRate)
224
+ // .reduce((accumulator: GstRateEntityModel[], current) => {
225
+ // if (!accumulator.some((gstRate) => gstRate.id === current.id)) {
226
+ // accumulator.push(current);
227
+ // }
228
+ // return accumulator;
229
+ // }, []);
230
+ // }
231
+ // get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined {
232
+ // // one_to_many -> many_to_many mismatch
233
+ // // {'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_payment': 'one_to_many'}
234
+ // // ['vendor', 'vendor_invoice'] -> one_to_many
235
+ // // ['vendor_invoice', 'vendor_invoice_payment'] -> one_to_many
236
+ // return this.vendorInvoices
237
+ // ?.flatMap((vendorInvoice) => vendorInvoice.vendorInvoicePayments)
238
+ // .filter((vendorInvoicePayment): vendorInvoicePayment is VendorInvoicePaymentEntityModel => !!vendorInvoicePayment)
239
+ // .reduce((accumulator: VendorInvoicePaymentEntityModel[], current) => {
240
+ // if (!accumulator.some((vendorInvoicePayment) => vendorInvoicePayment.id === current.id)) {
241
+ // accumulator.push(current);
242
+ // }
243
+ // return accumulator;
244
+ // }, []);
245
+ // }
246
+ // get banks(): BankEntityModel[] | undefined {
247
+ // // many_to_many -> many_to_many verified
248
+ // // {'tds_rate->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->bank': 'many_to_one'}
249
+ // // ['tds_rate', 'vendor_tds_challan'] -> one_to_many
250
+ // // ['vendor_tds_challan', 'bank'] -> many_to_one
251
+ // return this.vendorTdsChallans
252
+ // ?.flatMap((vendorTdsChallan) => vendorTdsChallan.bank)
253
+ // .filter((bank): bank is BankEntityModel => !!bank)
254
+ // .reduce((accumulator: BankEntityModel[], current) => {
255
+ // if (!accumulator.some((bank) => bank.id === current.id)) {
256
+ // accumulator.push(current);
257
+ // }
258
+ // return accumulator;
259
+ // }, []);
260
+ // }
37
261
  // }
@@ -15,6 +15,8 @@ import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
15
15
  import { OfficeLocationEntityModel } from "./office_location.entity.model";
16
16
  import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
17
17
  import { GstRateEntityModel } from "./gst_rate.entity.model";
18
+ import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
19
+ import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
18
20
  export declare class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_RATE> implements ITdsRateEntity {
19
21
  id: number;
20
22
  section: string;
@@ -31,10 +33,14 @@ export declare class TdsRateEntityModel extends BaseEntityModel<EntityEnum.TDS_R
31
33
  organizationTypeTdsRateMappings?: OrganizationTypeTdsRateMappingEntityModel[];
32
34
  tdsRateVoucherTypeMappings?: TdsRateVoucherTypeMappingEntityModel[];
33
35
  vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
36
+ vendorTdsLiabilitys?: VendorTdsLiabilityEntityModel[];
37
+ vendorTdsChallans?: VendorTdsChallanEntityModel[];
34
38
  static relationConfigs: RelationConfigs<[
35
39
  EntityEnum.ORGANIZATION_TYPE_TDS_RATE_MAPPING,
36
40
  EntityEnum.TDS_RATE_VOUCHER_TYPE_MAPPING,
37
- EntityEnum.VENDOR_INVOICE_ITEM
41
+ EntityEnum.VENDOR_INVOICE_ITEM,
42
+ EntityEnum.VENDOR_TDS_LIABILITY,
43
+ EntityEnum.VENDOR_TDS_CHALLAN
38
44
  ], EntityEnum.TDS_RATE>;
39
45
  static fromEntity(entity: ITdsRateEntity): TdsRateEntityModel;
40
46
  getRelationConfigs(): any[];
@@ -171,4 +171,22 @@ TdsRateEntityModel.relationConfigs = [
171
171
  key: "id",
172
172
  },
173
173
  },
174
+ {
175
+ name: entity_utils_interface_1.EntityEnum.VENDOR_TDS_LIABILITY,
176
+ relation: relation_type_enum_1.RelationType.MANY,
177
+ key: "vendorTdsLiabilitys",
178
+ mapKeyConfig: {
179
+ relationKey: "tdsRateId",
180
+ key: "id",
181
+ },
182
+ },
183
+ {
184
+ name: entity_utils_interface_1.EntityEnum.VENDOR_TDS_CHALLAN,
185
+ relation: relation_type_enum_1.RelationType.MANY,
186
+ key: "vendorTdsChallans",
187
+ mapKeyConfig: {
188
+ relationKey: "tdsRateId",
189
+ key: "id",
190
+ },
191
+ },
174
192
  ];
@@ -43,6 +43,7 @@ export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIM
43
43
  getTimesheetAmount(projectCurrency: CurrencyEnum): number;
44
44
  get formattedDate(): string;
45
45
  get userName(): string | undefined;
46
+ get approvers(): UserEntityModel[];
46
47
  get latestStatusFromHistory(): TimesheetStatusEnum | undefined;
47
48
  getDateCodeDay(): number;
48
49
  getClassificationDeadline(config: IClassificationWindowConfig): Date;
@@ -45,6 +45,10 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
45
45
  var _a;
46
46
  return (_a = this.user) === null || _a === void 0 ? void 0 : _a.name;
47
47
  }
48
+ get approvers() {
49
+ var _a, _b, _c;
50
+ return (_c = (_b = (_a = this.project) === null || _a === void 0 ? void 0 : _a.partnersOwnerUsersOfProject) === null || _b === void 0 ? void 0 : _b.filter((u) => u.email)) !== null && _c !== void 0 ? _c : [];
51
+ }
48
52
  get latestStatusFromHistory() {
49
53
  var _a;
50
54
  const sorted = [...(this.history || [])].sort((a, b) => b.id - a.id);
@@ -92,7 +96,7 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
92
96
  const year = targetDate.getFullYear();
93
97
  const month = targetDate.getMonth();
94
98
  const actualEndDay = (_a = window.endDay) !== null && _a !== void 0 ? _a : (0, date_fns_1.lastDayOfMonth)(targetDate).getDate();
95
- const triggerDate = (0, date_fns_1.addDays)(new Date(year, month, actualEndDay), bufferDays);
99
+ const triggerDate = (0, date_fns_1.addDays)(new Date(year, month, actualEndDay), bufferDays + 1);
96
100
  if (triggerDate.getFullYear() === today.getFullYear() && triggerDate.getMonth() === today.getMonth() && triggerDate.getDate() === today.getDate()) {
97
101
  return {
98
102
  windowStart: (0, date_fns_1.format)(new Date(year, month, window.startDay), "yyyyMMdd"),
@@ -12,6 +12,7 @@ import { OfficeLocationEntityModel } from "./office_location.entity.model";
12
12
  import { UserEntityModel } from "./user.entity.model";
13
13
  import { VendorEntityModel } from "./vendor.entity.model";
14
14
  import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
15
+ import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
15
16
  export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum.VENDOR_INVOICE> implements IVendorInvoiceEntity {
16
17
  id: number;
17
18
  vendorId: number;
@@ -39,7 +40,13 @@ export declare class VendorInvoiceEntityModel extends BaseEntityModel<EntityEnum
39
40
  vendor?: VendorEntityModel;
40
41
  officeLocation?: OfficeLocationEntityModel;
41
42
  vendorInvoiceItems?: VendorInvoiceItemEntityModel[];
42
- static relationConfigs: RelationConfigs<[EntityEnum.VENDOR, EntityEnum.OFFICE_LOCATION, EntityEnum.VENDOR_INVOICE_ITEM], EntityEnum.VENDOR_INVOICE>;
43
+ vendorInvoicePayments?: VendorInvoicePaymentEntityModel[];
44
+ static relationConfigs: RelationConfigs<[
45
+ EntityEnum.VENDOR,
46
+ EntityEnum.OFFICE_LOCATION,
47
+ EntityEnum.VENDOR_INVOICE_ITEM,
48
+ EntityEnum.VENDOR_INVOICE_PAYMENT
49
+ ], EntityEnum.VENDOR_INVOICE>;
43
50
  static fromEntity(entity: IVendorInvoiceEntity): VendorInvoiceEntityModel;
44
51
  getRelationConfigs(): any[];
45
52
  getAvailableActions(currentUser: UserEntityModel, config?: {
@@ -272,4 +272,13 @@ VendorInvoiceEntityModel.relationConfigs = [
272
272
  key: "id",
273
273
  },
274
274
  },
275
+ {
276
+ name: entity_utils_interface_1.EntityEnum.VENDOR_INVOICE_PAYMENT,
277
+ relation: relation_type_enum_1.RelationType.MANY,
278
+ key: "vendorInvoicePayments",
279
+ mapKeyConfig: {
280
+ relationKey: "vendorInvoiceId",
281
+ key: "id",
282
+ },
283
+ },
275
284
  ];
@@ -0,0 +1,69 @@
1
+ import { EntityEnum } from "../interface/entity.utils.interface";
2
+ import { BaseEntityModel } from "./base.entity.model";
3
+ import { RelationConfigs } from "../interface/relation-config.interface";
4
+ import { IUserEntity } from "../interface/user.entity.interface";
5
+ import { UserEntityModel } from "./user.entity.model";
6
+ import { IRowActions } from "./interface/row-actions.interface";
7
+ import { IVendorTdsChallanEntity } from "../interface/vendor_tds_challan.entity.interface";
8
+ import { VendorTdsChallanStatusEnum } from "../enums/vendor_tds_challan_status_enum";
9
+ import { BankEntityModel } from "./bank.entity.model";
10
+ import { TdsRateEntityModel } from "./tds_rate.entity.model";
11
+ import { OrganizationTypeEntityModel } from "./organization_type.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 { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
16
+ import { OfficeLocationEntityModel } from "./office_location.entity.model";
17
+ import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
18
+ import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
19
+ import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
20
+ import { GstRateEntityModel } from "./gst_rate.entity.model";
21
+ import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
22
+ import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
23
+ import { VendorTdsChallanActionEnum } from "../../api";
24
+ import { IVendorTdsChallanFlowConfigContextData } from "../flow-configs/vendor_tds_challan_flow.config";
25
+ export declare class VendorTdsChallanEntityModel extends BaseEntityModel<EntityEnum.VENDOR_TDS_CHALLAN> implements IVendorTdsChallanEntity {
26
+ id: number;
27
+ challanDate: number;
28
+ period: number;
29
+ tdsRateId: number;
30
+ challanNo: string;
31
+ bankId: number;
32
+ amount: number;
33
+ interest?: number;
34
+ remark?: string;
35
+ status: VendorTdsChallanStatusEnum;
36
+ createdOn: number;
37
+ updatedOn: number;
38
+ createdBy: number;
39
+ updatedBy: number;
40
+ bank?: BankEntityModel;
41
+ tdsRate?: TdsRateEntityModel;
42
+ static relationConfigs: RelationConfigs<[EntityEnum.BANK, EntityEnum.TDS_RATE], EntityEnum.VENDOR_TDS_CHALLAN>;
43
+ static fromEntity(entity: IVendorTdsChallanEntity): VendorTdsChallanEntityModel;
44
+ getRelationConfigs(): any[];
45
+ get organizationTypes(): OrganizationTypeEntityModel[] | undefined;
46
+ get vendors(): VendorEntityModel[] | undefined;
47
+ get states(): StateEntityModel[] | undefined;
48
+ get countrys(): CountryEntityModel[] | undefined;
49
+ get vendorInvoices(): VendorInvoiceEntityModel[] | undefined;
50
+ get officeLocations(): OfficeLocationEntityModel[] | undefined;
51
+ get vendorInvoiceItems(): VendorInvoiceItemEntityModel[] | undefined;
52
+ get voucherTypes(): VoucherTypeEntityModel[] | undefined;
53
+ get expenseHeads(): ExpenseHeadEntityModel[] | undefined;
54
+ get gstRates(): GstRateEntityModel[] | undefined;
55
+ get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined;
56
+ get vendorTdsLiabilitys(): VendorTdsLiabilityEntityModel[] | undefined;
57
+ getNextStatus(currentUser: IUserEntity, action: VendorTdsChallanActionEnum, vendorTdsChallanFlowConfigContextData: IVendorTdsChallanFlowConfigContextData): VendorTdsChallanStatusEnum;
58
+ getAvailableActions(currentUser: UserEntityModel, config?: {
59
+ combinedActions?: Record<string, {
60
+ combineActions: VendorTdsChallanActionEnum[];
61
+ label: string;
62
+ }>;
63
+ customLabels?: Partial<Record<VendorTdsChallanActionEnum, string>>;
64
+ }): IRowActions<EntityEnum.VENDOR_TDS_CHALLAN>[];
65
+ getUpdateActionVisibility(currentUser: UserEntityModel): {
66
+ [key: string]: () => boolean;
67
+ };
68
+ formatPeriod(formatStr?: string): string;
69
+ }