law-common 14.0.3-beta.1 → 14.0.3-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/index.d.ts +2 -2
- package/dist/src/api/index.js +28 -2
- package/dist/src/api/v1/index.d.ts +9 -0
- package/dist/src/api/v1/index.js +25 -0
- package/dist/src/api/{interface → v1/interface}/to_do_list.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{interface → v1/interface}/to_do_list.update.dto.interface.d.ts +1 -1
- package/dist/src/api/v2/index.d.ts +11 -0
- package/dist/src/api/v2/index.js +29 -0
- package/dist/src/api/v2/interface/to_do_list.create.dto.interface.d.ts +5 -0
- package/dist/src/api/v2/interface/to_do_list.create.dto.interface.js +2 -0
- package/dist/src/api/v2/interface/to_do_list.update.dto.interface.d.ts +12 -0
- package/dist/src/api/v2/interface/to_do_list.update.dto.interface.js +2 -0
- package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.d.ts +0 -7
- package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.js +10 -16
- package/dist/src/entities/interface/to_do_list.entity.interface.d.ts +2 -2
- package/dist/src/entities/model/to_do_list.entity.model.d.ts +63 -9
- package/dist/src/entities/model/to_do_list.entity.model.js +367 -11
- package/package.json +1 -1
- /package/dist/src/api/{interface → v1/interface}/to_do_list.create.dto.interface.js +0 -0
- /package/dist/src/api/{interface → v1/interface}/to_do_list.update.dto.interface.js +0 -0
package/dist/src/api/index.d.ts
CHANGED
|
@@ -80,9 +80,7 @@ export * from "./interface/leave.create.dto.interface";
|
|
|
80
80
|
export * from "./interface/leave.update.dto.interface";
|
|
81
81
|
export * from "./interface/cron_jobs.entity.response";
|
|
82
82
|
export * from "./interface/cron_jobs_manual_trigger.dto.interface";
|
|
83
|
-
export * from "./interface/to_do_list.create.dto.interface";
|
|
84
83
|
export * from "./interface/to_do_list.filter.dto.interface";
|
|
85
|
-
export * from "./interface/to_do_list.update.dto.interface";
|
|
86
84
|
export * from "./interface/project_user_mapping.create.dto.interface";
|
|
87
85
|
export * from "./interface/project_user_mapping.filter.dto.interface";
|
|
88
86
|
export * from "./interface/project_user_mapping.update.dto.interface";
|
|
@@ -177,3 +175,5 @@ export * from "./interface/bank.filter.dto.interface";
|
|
|
177
175
|
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
178
176
|
export * from "./interface/intermediary_bank.filter.dto.interface";
|
|
179
177
|
export * from "./interface/intermediary_bank.update.dto.interface";
|
|
178
|
+
export * as v1 from "./v1";
|
|
179
|
+
export * as v2 from "./v2";
|
package/dist/src/api/index.js
CHANGED
|
@@ -10,10 +10,33 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
13
18
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
19
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
20
|
};
|
|
21
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
22
|
+
var ownKeys = function(o) {
|
|
23
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
24
|
+
var ar = [];
|
|
25
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
26
|
+
return ar;
|
|
27
|
+
};
|
|
28
|
+
return ownKeys(o);
|
|
29
|
+
};
|
|
30
|
+
return function (mod) {
|
|
31
|
+
if (mod && mod.__esModule) return mod;
|
|
32
|
+
var result = {};
|
|
33
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
34
|
+
__setModuleDefault(result, mod);
|
|
35
|
+
return result;
|
|
36
|
+
};
|
|
37
|
+
})();
|
|
16
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.v2 = exports.v1 = void 0;
|
|
17
40
|
__exportStar(require("./interface/base.response.interface"), exports);
|
|
18
41
|
__exportStar(require("./interface/jwt.payload.interface"), exports);
|
|
19
42
|
__exportStar(require("./interface/login.response.interface"), exports);
|
|
@@ -96,9 +119,7 @@ __exportStar(require("./interface/leave.create.dto.interface"), exports);
|
|
|
96
119
|
__exportStar(require("./interface/leave.update.dto.interface"), exports);
|
|
97
120
|
__exportStar(require("./interface/cron_jobs.entity.response"), exports);
|
|
98
121
|
__exportStar(require("./interface/cron_jobs_manual_trigger.dto.interface"), exports);
|
|
99
|
-
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
100
122
|
__exportStar(require("./interface/to_do_list.filter.dto.interface"), exports);
|
|
101
|
-
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
102
123
|
// export * from "./interface/billing-reimbursement-expense.api";
|
|
103
124
|
// export * from "./interface/billing-reimbursement-expense-history.api";
|
|
104
125
|
__exportStar(require("./interface/project_user_mapping.create.dto.interface"), exports);
|
|
@@ -195,3 +216,8 @@ __exportStar(require("./interface/bank.filter.dto.interface"), exports);
|
|
|
195
216
|
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
196
217
|
__exportStar(require("./interface/intermediary_bank.filter.dto.interface"), exports);
|
|
197
218
|
__exportStar(require("./interface/intermediary_bank.update.dto.interface"), exports);
|
|
219
|
+
// Versioned contracts (checklist 12.4). Namespace re-exports only - never `export *` flat from
|
|
220
|
+
// v1 or v2: flat-exporting both is a duplicate-export error, and flat-exporting one reintroduces
|
|
221
|
+
// the ambiguity the fork exists to remove.
|
|
222
|
+
exports.v1 = __importStar(require("./v1"));
|
|
223
|
+
exports.v2 = __importStar(require("./v2"));
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api/v1 - FROZEN legacy contracts.
|
|
3
|
+
*
|
|
4
|
+
* Interfaces here serve routes that outlive the flow migration. They are hand-written and the
|
|
5
|
+
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
6
|
+
* api/interface/ or in v1 + v2 - never both.
|
|
7
|
+
*/
|
|
8
|
+
export * from "./interface/to_do_list.create.dto.interface";
|
|
9
|
+
export * from "./interface/to_do_list.update.dto.interface";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
/**
|
|
18
|
+
* api/v1 - FROZEN legacy contracts.
|
|
19
|
+
*
|
|
20
|
+
* Interfaces here serve routes that outlive the flow migration. They are hand-written and the
|
|
21
|
+
* generator never writes to this directory (checklist 12.4). An entity appears either in
|
|
22
|
+
* api/interface/ or in v1 + v2 - never both.
|
|
23
|
+
*/
|
|
24
|
+
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
25
|
+
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityCreateDto, IToDoListEntity } from "
|
|
1
|
+
import { IEntityCreateDto, IToDoListEntity } from "../../../entities";
|
|
2
2
|
/** status is set by the entity flow, never by the client */
|
|
3
3
|
export type IToDoListCreateExclude = "status";
|
|
4
4
|
export interface IToDoListCreateDto extends Omit<IEntityCreateDto<IToDoListEntity>, IToDoListCreateExclude> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IEntityUpdateDto, IToDoListEntity } from "
|
|
1
|
+
import { IEntityUpdateDto, IToDoListEntity } from "../../../entities";
|
|
2
2
|
import { IToDoListCreateExclude } from "./to_do_list.create.dto.interface";
|
|
3
3
|
export interface IToDoListUpdateDto extends Omit<IEntityUpdateDto<IToDoListEntity>, IToDoListCreateExclude> {
|
|
4
4
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* api/v2 - the new flow contracts.
|
|
3
|
+
*
|
|
4
|
+
* Intentionally empty: to_do_list's v2 create/update DTO interfaces are generated, not hand-written,
|
|
5
|
+
* and have not been generated yet. The generator writes them to api/v2/interface/ (checklist 12.4,
|
|
6
|
+
* and 9.1 rows 4 and 7).
|
|
7
|
+
*
|
|
8
|
+
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
9
|
+
*/
|
|
10
|
+
export * from "./interface/to_do_list.create.dto.interface";
|
|
11
|
+
export * from "./interface/to_do_list.update.dto.interface";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* api/v2 - the new flow contracts.
|
|
4
|
+
*
|
|
5
|
+
* Intentionally empty: to_do_list's v2 create/update DTO interfaces are generated, not hand-written,
|
|
6
|
+
* and have not been generated yet. The generator writes them to api/v2/interface/ (checklist 12.4,
|
|
7
|
+
* and 9.1 rows 4 and 7).
|
|
8
|
+
*
|
|
9
|
+
* The empty export keeps this a module so `export * as v2` in api/index.ts resolves.
|
|
10
|
+
*/
|
|
11
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
12
|
+
if (k2 === undefined) k2 = k;
|
|
13
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
14
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
15
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
16
|
+
}
|
|
17
|
+
Object.defineProperty(o, k2, desc);
|
|
18
|
+
}) : (function(o, m, k, k2) {
|
|
19
|
+
if (k2 === undefined) k2 = k;
|
|
20
|
+
o[k2] = m[k];
|
|
21
|
+
}));
|
|
22
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
23
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
// export {
|
|
27
|
+
// };
|
|
28
|
+
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
29
|
+
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IEntityCreateDto } from "../../../entities";
|
|
2
|
+
import { IToDoListEntity } from "../../../entities/interface/to_do_list.entity.interface";
|
|
3
|
+
export type IToDoListCreateExclude = "status";
|
|
4
|
+
export interface IToDoListCreateDto extends Omit<IEntityCreateDto<IToDoListEntity>, IToDoListCreateExclude> {
|
|
5
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DeepPartialButRequired } from "../../interface/api.utils.interface";
|
|
2
|
+
import { ToDoListActionEnum } from "../../../entities";
|
|
3
|
+
import { IToDoListCreateDto } from "./to_do_list.create.dto.interface";
|
|
4
|
+
export type IToDoListUpdateDto = DeepPartialButRequired<IToDoListCreateDto, never> & {
|
|
5
|
+
actionData: IToDoListActionDataDto;
|
|
6
|
+
} & {
|
|
7
|
+
id?: number;
|
|
8
|
+
};
|
|
9
|
+
export interface IToDoListActionDataDto {
|
|
10
|
+
action: ToDoListActionEnum;
|
|
11
|
+
remark?: string;
|
|
12
|
+
}
|
package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.d.ts
CHANGED
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { IEntityAuditColumn } from "../entity-audit-columns.interface";
|
|
2
2
|
import { IToDoListEntity } from "../to_do_list.entity.interface";
|
|
3
3
|
import { IFieldMinMaxConstraint } from "./utils";
|
|
4
|
-
/**
|
|
5
|
-
* excluded, and why:
|
|
6
|
-
* - "id", keyof IEntityAuditColumn generated columns
|
|
7
|
-
*
|
|
8
|
-
* ToDoListUpdateDto extends PartialType(OmitType(ToDoListCreateDto, ...)), so it inherits every
|
|
9
|
-
* create bound — create and update cannot disagree for this entity
|
|
10
|
-
*/
|
|
11
4
|
export type IToDoListFieldLengthConstraintsExclude = "status" | "id" | keyof IEntityAuditColumn;
|
|
12
5
|
/**
|
|
13
6
|
* since some fields are optional, but we still need their
|
package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.js
CHANGED
|
@@ -2,30 +2,24 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.toDoListFieldMinMaxConstraints = void 0;
|
|
4
4
|
exports.toDoListFieldMinMaxConstraints = {
|
|
5
|
-
/**
|
|
6
|
-
* the DTO carries @MinLength(1) and no upper bound, so only the min is wired — the max here
|
|
7
|
-
* bounds the text column
|
|
8
|
-
*/
|
|
9
5
|
description: {
|
|
10
6
|
min: 1,
|
|
11
|
-
max:
|
|
7
|
+
max: 512,
|
|
12
8
|
},
|
|
13
|
-
/**
|
|
14
|
-
* a YYMMDD datecode held as varchar(32) rather than an int — the format is enforced by
|
|
15
|
-
* DateCodeValidator, not by a length bound, so this max bounds the column only; the column type
|
|
16
|
-
* is step-4 material
|
|
17
|
-
*/
|
|
18
|
-
dateCode: {
|
|
19
|
-
max: 32,
|
|
20
|
-
},
|
|
21
|
-
/** minutes, and the DTO bounds this with @IsPositive() plus a multiple-of check, not @Min/@Max */
|
|
22
9
|
estimatedDuration: {
|
|
10
|
+
min: 1,
|
|
11
|
+
max: 1440,
|
|
12
|
+
},
|
|
13
|
+
userId: {
|
|
14
|
+
min: 1,
|
|
23
15
|
max: 9999999,
|
|
24
16
|
},
|
|
25
17
|
projectId: {
|
|
18
|
+
min: 0,
|
|
26
19
|
max: 9999999,
|
|
27
20
|
},
|
|
28
|
-
|
|
29
|
-
|
|
21
|
+
date: {
|
|
22
|
+
min: 20250407,
|
|
23
|
+
max: 99999999,
|
|
30
24
|
},
|
|
31
25
|
};
|
|
@@ -3,9 +3,9 @@ import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
|
3
3
|
export interface IToDoListEntity extends IEntityAuditColumn {
|
|
4
4
|
id: number;
|
|
5
5
|
description: string;
|
|
6
|
-
dateCode: string;
|
|
7
6
|
estimatedDuration: number;
|
|
8
|
-
projectId: number;
|
|
9
7
|
userId: number;
|
|
8
|
+
projectId: number;
|
|
10
9
|
status: ToDoListStatusEnum;
|
|
10
|
+
date: number;
|
|
11
11
|
}
|
|
@@ -1,21 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
3
3
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
4
5
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
6
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
7
|
+
import { ToDoListActionEnum } from "../../entities";
|
|
5
8
|
import { ToDoListStatusEnum } from "../enums/to_do_list_status_enum";
|
|
6
|
-
import {
|
|
7
|
-
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
9
|
+
import { IToDoListFlowConfigContextData } from "../flow-configs/to_do_list_flow.config";
|
|
8
10
|
import { IToDoListEntity } from "../interface/to_do_list.entity.interface";
|
|
9
|
-
import {
|
|
11
|
+
import { BankEntityModel } from "./bank.entity.model";
|
|
12
|
+
import { BillingEntityModel } from "./billing.entity.model";
|
|
13
|
+
import { ClientEntityModel } from "./client.entity.model";
|
|
14
|
+
import { ClientAffiliateEntityModel } from "./client_affiliate.entity.model";
|
|
15
|
+
import { ClientDebitNoteEntityModel } from "./client_debit_note.entity.model";
|
|
16
|
+
import { ClientDebitNoteParticularsEntityModel } from "./client_debit_note_particulars.entity.model";
|
|
17
|
+
import { CountryEntityModel } from "./country.entity.model";
|
|
18
|
+
import { ExpenseHeadEntityModel } from "./expense_head.entity.model";
|
|
19
|
+
import { GstRateEntityModel } from "./gst_rate.entity.model";
|
|
20
|
+
import { IntermediaryBankEntityModel } from "./intermediary_bank.entity.model";
|
|
21
|
+
import { LeaveEntityModel } from "./leave.entity.model";
|
|
22
|
+
import { LeaveApprovalEntityModel } from "./leave_approval.entity.model";
|
|
23
|
+
import { OfficeLocationEntityModel } from "./office_location.entity.model";
|
|
24
|
+
import { OrganizationEntityModel } from "./organization.entity.model";
|
|
25
|
+
import { OrganizationTypeEntityModel } from "./organization_type.entity.model";
|
|
10
26
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
11
|
-
import {
|
|
27
|
+
import { StateEntityModel } from "./state.entity.model";
|
|
28
|
+
import { TdsRateEntityModel } from "./tds_rate.entity.model";
|
|
29
|
+
import { VendorEntityModel } from "./vendor.entity.model";
|
|
30
|
+
import { VendorAdvanceEntityModel } from "./vendor_advance.entity.model";
|
|
31
|
+
import { VendorInvoiceEntityModel } from "./vendor_invoice.entity.model";
|
|
32
|
+
import { VendorInvoiceAdvanceEntityModel } from "./vendor_invoice_advance.entity.model";
|
|
33
|
+
import { VendorInvoiceItemEntityModel } from "./vendor_invoice_item.entity.model";
|
|
34
|
+
import { VendorInvoicePaymentEntityModel } from "./vendor_invoice_payment.entity.model";
|
|
35
|
+
import { VendorTdsChallanEntityModel } from "./vendor_tds_challan.entity.model";
|
|
36
|
+
import { VendorTdsLiabilityEntityModel } from "./vendor_tds_liability.entity.model";
|
|
37
|
+
import { VoucherTypeEntityModel } from "./voucher_type.entity.model";
|
|
38
|
+
import { WorkFromHomeEntityModel } from "./work_from_home.entity.model";
|
|
12
39
|
export declare class ToDoListEntityModel extends BaseEntityModel<EntityEnum.TO_DO_LIST> implements IToDoListEntity {
|
|
13
40
|
id: number;
|
|
14
41
|
description: string;
|
|
15
|
-
dateCode: string;
|
|
16
42
|
estimatedDuration: number;
|
|
17
|
-
projectId: number;
|
|
18
43
|
userId: number;
|
|
44
|
+
projectId: number;
|
|
45
|
+
date: number;
|
|
19
46
|
status: ToDoListStatusEnum;
|
|
20
47
|
createdOn: number;
|
|
21
48
|
updatedOn: number;
|
|
@@ -25,7 +52,34 @@ export declare class ToDoListEntityModel extends BaseEntityModel<EntityEnum.TO_D
|
|
|
25
52
|
user?: UserEntityModel;
|
|
26
53
|
static relationConfigs: RelationConfigs<[EntityEnum.PROJECT, EntityEnum.USER], EntityEnum.TO_DO_LIST>;
|
|
27
54
|
static fromEntity(entity: IToDoListEntity): ToDoListEntityModel;
|
|
28
|
-
getRelationConfigs(): [
|
|
55
|
+
getRelationConfigs(): any[];
|
|
56
|
+
get leaveApprovals(): LeaveApprovalEntityModel[] | undefined;
|
|
57
|
+
get leaves(): LeaveEntityModel[] | undefined;
|
|
58
|
+
get clients(): ClientEntityModel[] | undefined;
|
|
59
|
+
get clientDebitNotes(): ClientDebitNoteEntityModel[] | undefined;
|
|
60
|
+
get banks(): BankEntityModel[] | undefined;
|
|
61
|
+
get vendorTdsChallans(): VendorTdsChallanEntityModel[] | undefined;
|
|
62
|
+
get tdsRates(): TdsRateEntityModel[] | undefined;
|
|
63
|
+
get organizationTypes(): OrganizationTypeEntityModel[] | undefined;
|
|
64
|
+
get vendors(): VendorEntityModel[] | undefined;
|
|
65
|
+
get states(): StateEntityModel[] | undefined;
|
|
66
|
+
get countrys(): CountryEntityModel[] | undefined;
|
|
67
|
+
get vendorInvoices(): VendorInvoiceEntityModel[] | undefined;
|
|
68
|
+
get officeLocations(): OfficeLocationEntityModel[] | undefined;
|
|
69
|
+
get organizations(): OrganizationEntityModel[] | undefined;
|
|
70
|
+
get vendorInvoiceItems(): VendorInvoiceItemEntityModel[] | undefined;
|
|
71
|
+
get voucherTypes(): VoucherTypeEntityModel[] | undefined;
|
|
72
|
+
get expenseHeads(): ExpenseHeadEntityModel[] | undefined;
|
|
73
|
+
get gstRates(): GstRateEntityModel[] | undefined;
|
|
74
|
+
get vendorAdvances(): VendorAdvanceEntityModel[] | undefined;
|
|
75
|
+
get vendorInvoiceAdvances(): VendorInvoiceAdvanceEntityModel[] | undefined;
|
|
76
|
+
get vendorInvoicePayments(): VendorInvoicePaymentEntityModel[] | undefined;
|
|
77
|
+
get vendorTdsLiabilitys(): VendorTdsLiabilityEntityModel[] | undefined;
|
|
78
|
+
get intermediaryBanks(): IntermediaryBankEntityModel[] | undefined;
|
|
79
|
+
get billings(): BillingEntityModel[] | undefined;
|
|
80
|
+
get clientAffiliates(): ClientAffiliateEntityModel[] | undefined;
|
|
81
|
+
get clientDebitNoteParticularss(): ClientDebitNoteParticularsEntityModel[] | undefined;
|
|
82
|
+
get workFromHomes(): WorkFromHomeEntityModel[] | undefined;
|
|
29
83
|
getNextStatus(currentUser: IUserEntity, action: ToDoListActionEnum, toDoListFlowConfigContextData: IToDoListFlowConfigContextData): ToDoListStatusEnum;
|
|
30
84
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
31
85
|
combinedActions?: Record<string, {
|
|
@@ -4,20 +4,20 @@ exports.ToDoListEntityModel = void 0;
|
|
|
4
4
|
const error_key_enum_1 = require("../../enums/error.key.enum");
|
|
5
5
|
const exceptions_1 = require("../../exceptions");
|
|
6
6
|
const utils_1 = require("../../utils");
|
|
7
|
-
const to_do_list_flow_config_1 = require("../flow-configs/to_do_list_flow.config");
|
|
8
|
-
const to_do_list_status_enum_1 = require("../enums/to_do_list_status_enum");
|
|
9
|
-
const relation_type_enum_1 = require("../enums/relation_type_enum");
|
|
10
7
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
11
8
|
const base_entity_model_1 = require("./base.entity.model");
|
|
9
|
+
const entities_1 = require("../../entities");
|
|
10
|
+
const to_do_list_status_enum_1 = require("../enums/to_do_list_status_enum");
|
|
11
|
+
const to_do_list_flow_config_1 = require("../flow-configs/to_do_list_flow.config");
|
|
12
12
|
class ToDoListEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
13
13
|
constructor() {
|
|
14
14
|
super(...arguments);
|
|
15
15
|
this.id = 0;
|
|
16
16
|
this.description = "";
|
|
17
|
-
this.dateCode = "";
|
|
18
17
|
this.estimatedDuration = 0;
|
|
19
|
-
this.projectId = 0;
|
|
20
18
|
this.userId = 0;
|
|
19
|
+
this.projectId = 0;
|
|
20
|
+
this.date = 0;
|
|
21
21
|
this.status = to_do_list_status_enum_1.ToDoListStatusEnum.APPROVED;
|
|
22
22
|
this.createdOn = 0;
|
|
23
23
|
this.updatedOn = 0;
|
|
@@ -30,7 +30,357 @@ class ToDoListEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
30
30
|
return result;
|
|
31
31
|
}
|
|
32
32
|
getRelationConfigs() {
|
|
33
|
-
return
|
|
33
|
+
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
34
|
+
}
|
|
35
|
+
get leaveApprovals() {
|
|
36
|
+
// many_to_many -> many_to_many verified
|
|
37
|
+
// {'to_do_list->user': 'many_to_one', 'user->leave_approval': 'one_to_many'}
|
|
38
|
+
// ['to_do_list', 'user'] -> many_to_one
|
|
39
|
+
// ['user', 'leave_approval'] -> one_to_many
|
|
40
|
+
return undefined;
|
|
41
|
+
}
|
|
42
|
+
get leaves() {
|
|
43
|
+
// many_to_many -> many_to_many verified
|
|
44
|
+
// {'to_do_list->user': 'many_to_one', 'user->leave_approval': 'one_to_many', 'leave_approval->leave': 'many_to_one'}
|
|
45
|
+
// ['user', 'leave_approval'] -> one_to_many
|
|
46
|
+
// ['leave_approval', 'leave'] -> many_to_one
|
|
47
|
+
var _a;
|
|
48
|
+
return (_a = this.leaveApprovals) === null || _a === void 0 ? void 0 : _a.flatMap((leaveApproval) => leaveApproval.leave).filter((leave) => !!leave).reduce((accumulator, current) => {
|
|
49
|
+
if (!accumulator.some((leave) => leave.id === current.id)) {
|
|
50
|
+
accumulator.push(current);
|
|
51
|
+
}
|
|
52
|
+
return accumulator;
|
|
53
|
+
}, []);
|
|
54
|
+
}
|
|
55
|
+
get clients() {
|
|
56
|
+
// many_to_many -> many_to_many verified
|
|
57
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many'}
|
|
58
|
+
// ['to_do_list', 'user'] -> many_to_one
|
|
59
|
+
// ['user', 'client'] -> many_to_many
|
|
60
|
+
// return this.user?.clients;
|
|
61
|
+
return undefined;
|
|
62
|
+
}
|
|
63
|
+
get clientDebitNotes() {
|
|
64
|
+
// many_to_many -> many_to_many verified
|
|
65
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many'}
|
|
66
|
+
// ['user', 'client'] -> many_to_many
|
|
67
|
+
// ['client', 'client_debit_note'] -> one_to_many
|
|
68
|
+
// return this.clients
|
|
69
|
+
// ?.flatMap((client) => client.clientDebitNotes)
|
|
70
|
+
// .filter((clientDebitNote): clientDebitNote is ClientDebitNoteEntityModel => !!clientDebitNote)
|
|
71
|
+
// .reduce((accumulator: ClientDebitNoteEntityModel[], current) => {
|
|
72
|
+
// if (!accumulator.some((clientDebitNote) => clientDebitNote.id === current.id)) {
|
|
73
|
+
// accumulator.push(current);
|
|
74
|
+
// }
|
|
75
|
+
// return accumulator;
|
|
76
|
+
// }, []);
|
|
77
|
+
return undefined;
|
|
78
|
+
}
|
|
79
|
+
get banks() {
|
|
80
|
+
// many_to_many -> many_to_many verified
|
|
81
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one'}
|
|
82
|
+
// ['client', 'client_debit_note'] -> one_to_many
|
|
83
|
+
// ['client_debit_note', 'bank'] -> many_to_one
|
|
84
|
+
var _a;
|
|
85
|
+
return (_a = this.clientDebitNotes) === null || _a === void 0 ? void 0 : _a.flatMap((clientDebitNote) => clientDebitNote.bank).filter((bank) => !!bank).reduce((accumulator, current) => {
|
|
86
|
+
if (!accumulator.some((bank) => bank.id === current.id)) {
|
|
87
|
+
accumulator.push(current);
|
|
88
|
+
}
|
|
89
|
+
return accumulator;
|
|
90
|
+
}, []);
|
|
91
|
+
}
|
|
92
|
+
get vendorTdsChallans() {
|
|
93
|
+
// many_to_many -> many_to_many verified
|
|
94
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many'}
|
|
95
|
+
// ['client_debit_note', 'bank'] -> many_to_one
|
|
96
|
+
// ['bank', 'vendor_tds_challan'] -> one_to_many
|
|
97
|
+
// return this.banks
|
|
98
|
+
// ?.flatMap((bank) => bank.vendorTdsChallans)
|
|
99
|
+
// .filter((vendorTdsChallan): vendorTdsChallan is VendorTdsChallanEntityModel => !!vendorTdsChallan)
|
|
100
|
+
// .reduce((accumulator: VendorTdsChallanEntityModel[], current) => {
|
|
101
|
+
// if (!accumulator.some((vendorTdsChallan) => vendorTdsChallan.id === current.id)) {
|
|
102
|
+
// accumulator.push(current);
|
|
103
|
+
// }
|
|
104
|
+
// return accumulator;
|
|
105
|
+
// }, []);
|
|
106
|
+
return undefined;
|
|
107
|
+
}
|
|
108
|
+
get tdsRates() {
|
|
109
|
+
// many_to_many -> many_to_many verified
|
|
110
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one'}
|
|
111
|
+
// ['bank', 'vendor_tds_challan'] -> one_to_many
|
|
112
|
+
// ['vendor_tds_challan', 'tds_rate'] -> many_to_one
|
|
113
|
+
var _a;
|
|
114
|
+
return (_a = this.vendorTdsChallans) === null || _a === void 0 ? void 0 : _a.flatMap((vendorTdsChallan) => vendorTdsChallan.tdsRate).filter((tdsRate) => !!tdsRate).reduce((accumulator, current) => {
|
|
115
|
+
if (!accumulator.some((tdsRate) => tdsRate.id === current.id)) {
|
|
116
|
+
accumulator.push(current);
|
|
117
|
+
}
|
|
118
|
+
return accumulator;
|
|
119
|
+
}, []);
|
|
120
|
+
}
|
|
121
|
+
get organizationTypes() {
|
|
122
|
+
// many_to_many -> many_to_many verified
|
|
123
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many'}
|
|
124
|
+
// ['vendor_tds_challan', 'tds_rate'] -> many_to_one
|
|
125
|
+
// ['tds_rate', 'organization_type'] -> many_to_many
|
|
126
|
+
var _a;
|
|
127
|
+
return (_a = this.tdsRates) === null || _a === void 0 ? void 0 : _a.flatMap((tdsRate) => tdsRate.organizationTypes).filter((organizationType) => !!organizationType).reduce((accumulator, current) => {
|
|
128
|
+
if (!accumulator.some((organizationType) => organizationType.id === current.id)) {
|
|
129
|
+
accumulator.push(current);
|
|
130
|
+
}
|
|
131
|
+
return accumulator;
|
|
132
|
+
}, []);
|
|
133
|
+
}
|
|
134
|
+
get vendors() {
|
|
135
|
+
// many_to_many -> many_to_many verified
|
|
136
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many'}
|
|
137
|
+
// ['tds_rate', 'organization_type'] -> many_to_many
|
|
138
|
+
// ['organization_type', 'vendor'] -> one_to_many
|
|
139
|
+
var _a;
|
|
140
|
+
return (_a = this.organizationTypes) === null || _a === void 0 ? void 0 : _a.flatMap((organizationType) => organizationType.vendors).filter((vendor) => !!vendor).reduce((accumulator, current) => {
|
|
141
|
+
if (!accumulator.some((vendor) => vendor.id === current.id)) {
|
|
142
|
+
accumulator.push(current);
|
|
143
|
+
}
|
|
144
|
+
return accumulator;
|
|
145
|
+
}, []);
|
|
146
|
+
}
|
|
147
|
+
get states() {
|
|
148
|
+
// many_to_many -> many_to_many verified
|
|
149
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->state': 'many_to_one'}
|
|
150
|
+
// ['organization_type', 'vendor'] -> one_to_many
|
|
151
|
+
// ['vendor', 'state'] -> many_to_one
|
|
152
|
+
var _a;
|
|
153
|
+
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.stateModel).filter((state) => !!state).reduce((accumulator, current) => {
|
|
154
|
+
if (!accumulator.some((state) => state.id === current.id)) {
|
|
155
|
+
accumulator.push(current);
|
|
156
|
+
}
|
|
157
|
+
return accumulator;
|
|
158
|
+
}, []);
|
|
159
|
+
}
|
|
160
|
+
get countrys() {
|
|
161
|
+
// many_to_many -> many_to_many verified
|
|
162
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->country': 'many_to_one'}
|
|
163
|
+
// ['organization_type', 'vendor'] -> one_to_many
|
|
164
|
+
// ['vendor', 'country'] -> many_to_one
|
|
165
|
+
var _a;
|
|
166
|
+
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.countryModel).filter((country) => !!country).reduce((accumulator, current) => {
|
|
167
|
+
if (!accumulator.some((country) => country.id === current.id)) {
|
|
168
|
+
accumulator.push(current);
|
|
169
|
+
}
|
|
170
|
+
return accumulator;
|
|
171
|
+
}, []);
|
|
172
|
+
}
|
|
173
|
+
get vendorInvoices() {
|
|
174
|
+
// one_to_many -> many_to_many mismatch
|
|
175
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many'}
|
|
176
|
+
// ['organization_type', 'vendor'] -> one_to_many
|
|
177
|
+
// ['vendor', 'vendor_invoice'] -> one_to_many
|
|
178
|
+
var _a;
|
|
179
|
+
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.vendorInvoices).filter((vendorInvoice) => !!vendorInvoice).reduce((accumulator, current) => {
|
|
180
|
+
if (!accumulator.some((vendorInvoice) => vendorInvoice.id === current.id)) {
|
|
181
|
+
accumulator.push(current);
|
|
182
|
+
}
|
|
183
|
+
return accumulator;
|
|
184
|
+
}, []);
|
|
185
|
+
}
|
|
186
|
+
get officeLocations() {
|
|
187
|
+
// many_to_many -> many_to_many verified
|
|
188
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', '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
|
+
var _a;
|
|
192
|
+
return (_a = this.vendorInvoices) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoice) => vendorInvoice.officeLocation).filter((officeLocation) => !!officeLocation).reduce((accumulator, current) => {
|
|
193
|
+
if (!accumulator.some((officeLocation) => officeLocation.id === current.id)) {
|
|
194
|
+
accumulator.push(current);
|
|
195
|
+
}
|
|
196
|
+
return accumulator;
|
|
197
|
+
}, []);
|
|
198
|
+
}
|
|
199
|
+
get organizations() {
|
|
200
|
+
// many_to_one -> many_to_many mismatch
|
|
201
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', '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', 'office_location->organization': 'many_to_one'}
|
|
202
|
+
// ['vendor_invoice', 'office_location'] -> many_to_one
|
|
203
|
+
// ['office_location', 'organization'] -> many_to_one
|
|
204
|
+
// return this.officeLocations
|
|
205
|
+
// ?.flatMap((officeLocation) => officeLocation.organizations)
|
|
206
|
+
// .filter((organization): organization is OrganizationEntityModel => !!organization)
|
|
207
|
+
// .reduce((accumulator: OrganizationEntityModel[], current) => {
|
|
208
|
+
// if (!accumulator.some((organization) => organization.id === current.id)) {
|
|
209
|
+
// accumulator.push(current);
|
|
210
|
+
// }
|
|
211
|
+
// return accumulator;
|
|
212
|
+
// }, []);
|
|
213
|
+
return undefined;
|
|
214
|
+
}
|
|
215
|
+
get vendorInvoiceItems() {
|
|
216
|
+
// one_to_many -> many_to_many mismatch
|
|
217
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_item': 'one_to_many'}
|
|
218
|
+
// ['vendor', 'vendor_invoice'] -> one_to_many
|
|
219
|
+
// ['vendor_invoice', 'vendor_invoice_item'] -> one_to_many
|
|
220
|
+
var _a;
|
|
221
|
+
return (_a = this.vendorInvoices) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoice) => vendorInvoice.vendorInvoiceItems).filter((vendorInvoiceItem) => !!vendorInvoiceItem).reduce((accumulator, current) => {
|
|
222
|
+
if (!accumulator.some((vendorInvoiceItem) => vendorInvoiceItem.id === current.id)) {
|
|
223
|
+
accumulator.push(current);
|
|
224
|
+
}
|
|
225
|
+
return accumulator;
|
|
226
|
+
}, []);
|
|
227
|
+
}
|
|
228
|
+
get voucherTypes() {
|
|
229
|
+
// many_to_many -> many_to_many verified
|
|
230
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many'}
|
|
231
|
+
// ['vendor_tds_challan', 'tds_rate'] -> many_to_one
|
|
232
|
+
// ['tds_rate', 'voucher_type'] -> many_to_many
|
|
233
|
+
var _a;
|
|
234
|
+
return (_a = this.tdsRates) === null || _a === void 0 ? void 0 : _a.flatMap((tdsRate) => tdsRate.voucherTypes).filter((voucherType) => !!voucherType).reduce((accumulator, current) => {
|
|
235
|
+
if (!accumulator.some((voucherType) => voucherType.id === current.id)) {
|
|
236
|
+
accumulator.push(current);
|
|
237
|
+
}
|
|
238
|
+
return accumulator;
|
|
239
|
+
}, []);
|
|
240
|
+
}
|
|
241
|
+
get expenseHeads() {
|
|
242
|
+
// many_to_many -> many_to_many verified
|
|
243
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->voucher_type': 'many_to_many', 'voucher_type->expense_head': 'one_to_many'}
|
|
244
|
+
// ['tds_rate', 'voucher_type'] -> many_to_many
|
|
245
|
+
// ['voucher_type', 'expense_head'] -> one_to_many
|
|
246
|
+
var _a;
|
|
247
|
+
return (_a = this.voucherTypes) === null || _a === void 0 ? void 0 : _a.flatMap((voucherType) => voucherType.expenseHeads).filter((expenseHead) => !!expenseHead).reduce((accumulator, current) => {
|
|
248
|
+
if (!accumulator.some((expenseHead) => expenseHead.id === current.id)) {
|
|
249
|
+
accumulator.push(current);
|
|
250
|
+
}
|
|
251
|
+
return accumulator;
|
|
252
|
+
}, []);
|
|
253
|
+
}
|
|
254
|
+
get gstRates() {
|
|
255
|
+
// many_to_many -> many_to_many verified
|
|
256
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_invoice': 'one_to_many', 'vendor_invoice->vendor_invoice_item': 'one_to_many', 'vendor_invoice_item->gst_rate': 'many_to_one'}
|
|
257
|
+
// ['vendor_invoice', 'vendor_invoice_item'] -> one_to_many
|
|
258
|
+
// ['vendor_invoice_item', 'gst_rate'] -> many_to_one
|
|
259
|
+
var _a;
|
|
260
|
+
return (_a = this.vendorInvoiceItems) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoiceItem) => vendorInvoiceItem.gstRate).filter((gstRate) => !!gstRate).reduce((accumulator, current) => {
|
|
261
|
+
if (!accumulator.some((gstRate) => gstRate.id === current.id)) {
|
|
262
|
+
accumulator.push(current);
|
|
263
|
+
}
|
|
264
|
+
return accumulator;
|
|
265
|
+
}, []);
|
|
266
|
+
}
|
|
267
|
+
get vendorAdvances() {
|
|
268
|
+
// one_to_many -> many_to_many mismatch
|
|
269
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_advance': 'one_to_many'}
|
|
270
|
+
// ['organization_type', 'vendor'] -> one_to_many
|
|
271
|
+
// ['vendor', 'vendor_advance'] -> one_to_many
|
|
272
|
+
var _a;
|
|
273
|
+
return (_a = this.vendors) === null || _a === void 0 ? void 0 : _a.flatMap((vendor) => vendor.vendorAdvances).filter((vendorAdvance) => !!vendorAdvance).reduce((accumulator, current) => {
|
|
274
|
+
if (!accumulator.some((vendorAdvance) => vendorAdvance.id === current.id)) {
|
|
275
|
+
accumulator.push(current);
|
|
276
|
+
}
|
|
277
|
+
return accumulator;
|
|
278
|
+
}, []);
|
|
279
|
+
}
|
|
280
|
+
get vendorInvoiceAdvances() {
|
|
281
|
+
// one_to_many -> many_to_many mismatch
|
|
282
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->organization_type': 'many_to_many', 'organization_type->vendor': 'one_to_many', 'vendor->vendor_advance': 'one_to_many', 'vendor_advance->vendor_invoice_advance': 'one_to_many'}
|
|
283
|
+
// ['vendor', 'vendor_advance'] -> one_to_many
|
|
284
|
+
// ['vendor_advance', 'vendor_invoice_advance'] -> one_to_many
|
|
285
|
+
// return this.vendorAdvances
|
|
286
|
+
// ?.flatMap((vendorAdvance) => vendorAdvance.vendorInvoiceAdvances)
|
|
287
|
+
// .filter((vendorInvoiceAdvance): vendorInvoiceAdvance is VendorInvoiceAdvanceEntityModel => !!vendorInvoiceAdvance)
|
|
288
|
+
// .reduce((accumulator: VendorInvoiceAdvanceEntityModel[], current) => {
|
|
289
|
+
// if (!accumulator.some((vendorInvoiceAdvance) => vendorInvoiceAdvance.id === current.id)) {
|
|
290
|
+
// accumulator.push(current);
|
|
291
|
+
// }
|
|
292
|
+
// return accumulator;
|
|
293
|
+
// }, []);
|
|
294
|
+
return undefined;
|
|
295
|
+
}
|
|
296
|
+
get vendorInvoicePayments() {
|
|
297
|
+
// one_to_many -> many_to_many mismatch
|
|
298
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', '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'}
|
|
299
|
+
// ['vendor', 'vendor_invoice'] -> one_to_many
|
|
300
|
+
// ['vendor_invoice', 'vendor_invoice_payment'] -> one_to_many
|
|
301
|
+
var _a;
|
|
302
|
+
return (_a = this.vendorInvoices) === null || _a === void 0 ? void 0 : _a.flatMap((vendorInvoice) => vendorInvoice.vendorInvoicePayments).filter((vendorInvoicePayment) => !!vendorInvoicePayment).reduce((accumulator, current) => {
|
|
303
|
+
if (!accumulator.some((vendorInvoicePayment) => vendorInvoicePayment.id === current.id)) {
|
|
304
|
+
accumulator.push(current);
|
|
305
|
+
}
|
|
306
|
+
return accumulator;
|
|
307
|
+
}, []);
|
|
308
|
+
}
|
|
309
|
+
get vendorTdsLiabilitys() {
|
|
310
|
+
// many_to_many -> many_to_many verified
|
|
311
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->vendor_tds_challan': 'one_to_many', 'vendor_tds_challan->tds_rate': 'many_to_one', 'tds_rate->vendor_tds_liability': 'one_to_many'}
|
|
312
|
+
// ['vendor_tds_challan', 'tds_rate'] -> many_to_one
|
|
313
|
+
// ['tds_rate', 'vendor_tds_liability'] -> one_to_many
|
|
314
|
+
var _a;
|
|
315
|
+
return (_a = this.tdsRates) === null || _a === void 0 ? void 0 : _a.flatMap((tdsRate) => tdsRate.vendorTdsLiabilitys).filter((vendorTdsLiability) => !!vendorTdsLiability).reduce((accumulator, current) => {
|
|
316
|
+
if (!accumulator.some((vendorTdsLiability) => vendorTdsLiability.id === current.id)) {
|
|
317
|
+
accumulator.push(current);
|
|
318
|
+
}
|
|
319
|
+
return accumulator;
|
|
320
|
+
}, []);
|
|
321
|
+
}
|
|
322
|
+
get intermediaryBanks() {
|
|
323
|
+
// many_to_many -> many_to_many verified
|
|
324
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->intermediary_bank': 'one_to_many'}
|
|
325
|
+
// ['client_debit_note', 'bank'] -> many_to_one
|
|
326
|
+
// ['bank', 'intermediary_bank'] -> one_to_many
|
|
327
|
+
var _a;
|
|
328
|
+
return (_a = this.banks) === null || _a === void 0 ? void 0 : _a.flatMap((bank) => bank.intermediaryBanks).filter((intermediaryBank) => !!intermediaryBank).reduce((accumulator, current) => {
|
|
329
|
+
if (!accumulator.some((intermediaryBank) => intermediaryBank.id === current.id)) {
|
|
330
|
+
accumulator.push(current);
|
|
331
|
+
}
|
|
332
|
+
return accumulator;
|
|
333
|
+
}, []);
|
|
334
|
+
}
|
|
335
|
+
get billings() {
|
|
336
|
+
// many_to_many -> many_to_many verified
|
|
337
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->bank': 'many_to_one', 'bank->billing': 'one_to_many'}
|
|
338
|
+
// ['client_debit_note', 'bank'] -> many_to_one
|
|
339
|
+
// ['bank', 'billing'] -> one_to_many
|
|
340
|
+
// return this.banks
|
|
341
|
+
// ?.flatMap((bank) => bank.billings)
|
|
342
|
+
// .filter((billing): billing is BillingEntityModel => !!billing)
|
|
343
|
+
// .reduce((accumulator: BillingEntityModel[], current) => {
|
|
344
|
+
// if (!accumulator.some((billing) => billing.id === current.id)) {
|
|
345
|
+
// accumulator.push(current);
|
|
346
|
+
// }
|
|
347
|
+
// return accumulator;
|
|
348
|
+
// }, []);
|
|
349
|
+
return undefined;
|
|
350
|
+
}
|
|
351
|
+
get clientAffiliates() {
|
|
352
|
+
// many_to_many -> many_to_many verified
|
|
353
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->client_affiliate': 'many_to_one'}
|
|
354
|
+
// ['client', 'client_debit_note'] -> one_to_many
|
|
355
|
+
// ['client_debit_note', 'client_affiliate'] -> many_to_one
|
|
356
|
+
var _a;
|
|
357
|
+
return (_a = this.clientDebitNotes) === null || _a === void 0 ? void 0 : _a.flatMap((clientDebitNote) => clientDebitNote.clientAffiliate).filter((clientAffiliate) => !!clientAffiliate).reduce((accumulator, current) => {
|
|
358
|
+
if (!accumulator.some((clientAffiliate) => clientAffiliate.id === current.id)) {
|
|
359
|
+
accumulator.push(current);
|
|
360
|
+
}
|
|
361
|
+
return accumulator;
|
|
362
|
+
}, []);
|
|
363
|
+
}
|
|
364
|
+
get clientDebitNoteParticularss() {
|
|
365
|
+
// one_to_many -> many_to_many mismatch
|
|
366
|
+
// {'to_do_list->user': 'many_to_one', 'user->client': 'many_to_many', 'client->client_debit_note': 'one_to_many', 'client_debit_note->client_debit_note_particulars': 'one_to_many'}
|
|
367
|
+
// ['client', 'client_debit_note'] -> one_to_many
|
|
368
|
+
// ['client_debit_note', 'client_debit_note_particulars'] -> one_to_many
|
|
369
|
+
var _a;
|
|
370
|
+
return (_a = this.clientDebitNotes) === null || _a === void 0 ? void 0 : _a.flatMap((clientDebitNote) => clientDebitNote.clientDebitNoteParticularss).filter((clientDebitNoteParticulars) => !!clientDebitNoteParticulars).reduce((accumulator, current) => {
|
|
371
|
+
if (!accumulator.some((clientDebitNoteParticulars) => clientDebitNoteParticulars.id === current.id)) {
|
|
372
|
+
accumulator.push(current);
|
|
373
|
+
}
|
|
374
|
+
return accumulator;
|
|
375
|
+
}, []);
|
|
376
|
+
}
|
|
377
|
+
get workFromHomes() {
|
|
378
|
+
// many_to_many -> many_to_many verified
|
|
379
|
+
// {'to_do_list->user': 'many_to_one', 'user->work_from_home': 'one_to_many'}
|
|
380
|
+
// ['to_do_list', 'user'] -> many_to_one
|
|
381
|
+
// ['user', 'work_from_home'] -> one_to_many
|
|
382
|
+
// return this.user?.workFromHomes;
|
|
383
|
+
return undefined;
|
|
34
384
|
}
|
|
35
385
|
getNextStatus(currentUser, action, toDoListFlowConfigContextData) {
|
|
36
386
|
if (!this.status) {
|
|
@@ -69,7 +419,7 @@ class ToDoListEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
69
419
|
if (!hasPermission) {
|
|
70
420
|
throw new exceptions_1.AppBadRequestException({
|
|
71
421
|
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
72
|
-
message: [`Current user does not have permission to ${action}
|
|
422
|
+
message: [`Current user does not have permission to ${action} toDoList`],
|
|
73
423
|
});
|
|
74
424
|
}
|
|
75
425
|
const nextStatus = matchingPermissionConfig.next(toDoListFlowConfigContextData);
|
|
@@ -95,14 +445,20 @@ exports.ToDoListEntityModel = ToDoListEntityModel;
|
|
|
95
445
|
ToDoListEntityModel.relationConfigs = [
|
|
96
446
|
{
|
|
97
447
|
name: entity_utils_interface_1.EntityEnum.PROJECT,
|
|
98
|
-
relation:
|
|
448
|
+
relation: entities_1.RelationType.ONE,
|
|
99
449
|
key: "project",
|
|
100
|
-
mapKeyConfig: {
|
|
450
|
+
mapKeyConfig: {
|
|
451
|
+
relationKey: "id",
|
|
452
|
+
key: "projectId",
|
|
453
|
+
},
|
|
101
454
|
},
|
|
102
455
|
{
|
|
103
456
|
name: entity_utils_interface_1.EntityEnum.USER,
|
|
104
|
-
relation:
|
|
457
|
+
relation: entities_1.RelationType.ONE,
|
|
105
458
|
key: "user",
|
|
106
|
-
mapKeyConfig: {
|
|
459
|
+
mapKeyConfig: {
|
|
460
|
+
relationKey: "id",
|
|
461
|
+
key: "userId",
|
|
462
|
+
},
|
|
107
463
|
},
|
|
108
464
|
];
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|