law-common 14.0.8-beta.2 → 14.0.9
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 +2 -28
- package/dist/src/api/{v1/interface → interface}/to_do_list.create.dto.interface.d.ts +1 -1
- package/dist/src/api/{v1/interface → interface}/to_do_list.update.dto.interface.d.ts +1 -1
- package/dist/src/entities/flow-configs/to_do_list_flow.config.js +5 -5
- package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.d.ts +7 -0
- package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.js +16 -10
- 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 +9 -63
- package/dist/src/entities/model/to_do_list.entity.model.js +11 -367
- package/dist/src/entities/model/user.entity.model.d.ts +0 -4
- package/dist/src/entities/model/user.entity.model.js +0 -17
- package/package.json +1 -1
- package/dist/src/api/v1/index.d.ts +0 -9
- package/dist/src/api/v1/index.js +0 -25
- package/dist/src/api/v2/index.d.ts +0 -11
- package/dist/src/api/v2/index.js +0 -29
- package/dist/src/api/v2/interface/to_do_list.create.dto.interface.d.ts +0 -5
- package/dist/src/api/v2/interface/to_do_list.create.dto.interface.js +0 -2
- package/dist/src/api/v2/interface/to_do_list.update.dto.interface.d.ts +0 -12
- package/dist/src/api/v2/interface/to_do_list.update.dto.interface.js +0 -2
- /package/dist/src/api/{v1/interface → interface}/to_do_list.create.dto.interface.js +0 -0
- /package/dist/src/api/{v1/interface → interface}/to_do_list.update.dto.interface.js +0 -0
package/dist/src/api/index.d.ts
CHANGED
|
@@ -80,7 +80,9 @@ 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";
|
|
83
84
|
export * from "./interface/to_do_list.filter.dto.interface";
|
|
85
|
+
export * from "./interface/to_do_list.update.dto.interface";
|
|
84
86
|
export * from "./interface/project_user_mapping.create.dto.interface";
|
|
85
87
|
export * from "./interface/project_user_mapping.filter.dto.interface";
|
|
86
88
|
export * from "./interface/project_user_mapping.update.dto.interface";
|
|
@@ -175,5 +177,3 @@ export * from "./interface/bank.filter.dto.interface";
|
|
|
175
177
|
export * from "./interface/intermediary_bank.create.dto.interface";
|
|
176
178
|
export * from "./interface/intermediary_bank.filter.dto.interface";
|
|
177
179
|
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,33 +10,10 @@ 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
|
-
});
|
|
18
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
19
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
20
15
|
};
|
|
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
|
-
})();
|
|
38
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.v2 = exports.v1 = void 0;
|
|
40
17
|
__exportStar(require("./interface/base.response.interface"), exports);
|
|
41
18
|
__exportStar(require("./interface/jwt.payload.interface"), exports);
|
|
42
19
|
__exportStar(require("./interface/login.response.interface"), exports);
|
|
@@ -119,7 +96,9 @@ __exportStar(require("./interface/leave.create.dto.interface"), exports);
|
|
|
119
96
|
__exportStar(require("./interface/leave.update.dto.interface"), exports);
|
|
120
97
|
__exportStar(require("./interface/cron_jobs.entity.response"), exports);
|
|
121
98
|
__exportStar(require("./interface/cron_jobs_manual_trigger.dto.interface"), exports);
|
|
99
|
+
__exportStar(require("./interface/to_do_list.create.dto.interface"), exports);
|
|
122
100
|
__exportStar(require("./interface/to_do_list.filter.dto.interface"), exports);
|
|
101
|
+
__exportStar(require("./interface/to_do_list.update.dto.interface"), exports);
|
|
123
102
|
// export * from "./interface/billing-reimbursement-expense.api";
|
|
124
103
|
// export * from "./interface/billing-reimbursement-expense-history.api";
|
|
125
104
|
__exportStar(require("./interface/project_user_mapping.create.dto.interface"), exports);
|
|
@@ -216,8 +195,3 @@ __exportStar(require("./interface/bank.filter.dto.interface"), exports);
|
|
|
216
195
|
__exportStar(require("./interface/intermediary_bank.create.dto.interface"), exports);
|
|
217
196
|
__exportStar(require("./interface/intermediary_bank.filter.dto.interface"), exports);
|
|
218
197
|
__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"));
|
|
@@ -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
|
}
|
|
@@ -11,11 +11,11 @@ const to_do_list_status_enum_1 = require("../enums/to_do_list_status_enum");
|
|
|
11
11
|
*
|
|
12
12
|
* @Post() TO_DO_LIST_CREATE_ORG, _CREATE_PROJECT, _CREATE_SELF
|
|
13
13
|
* @Patch(":id") TO_DO_LIST_UPDATE_ORG, _UPDATE_PROJECT, _UPDATE_SELF
|
|
14
|
-
* @Delete(":id") TO_DO_LIST_DELETE_ORG, _DELETE_PROJECT
|
|
14
|
+
* @Delete(":id") TO_DO_LIST_DELETE_ORG, _DELETE_PROJECT
|
|
15
15
|
*
|
|
16
|
-
* DELETE
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* DELETE carries only two: TO_DO_LIST_DELETE_SELF has never been seeded, so a user whose only
|
|
17
|
+
* to-do-list authority is over their own rows cannot delete. That matches today's behaviour and is
|
|
18
|
+
* preserved rather than fixed here.
|
|
19
19
|
*
|
|
20
20
|
* DEACTIVATE / ACTIVATE / RESTORE are unscoped - LW-826 seeded them flat - so those keep single-name
|
|
21
21
|
* arrays. Mixing the two shapes in one config is deliberate: each action names the rows that exist.
|
|
@@ -28,7 +28,7 @@ const to_do_list_status_enum_1 = require("../enums/to_do_list_status_enum");
|
|
|
28
28
|
*/
|
|
29
29
|
const TO_DO_LIST_CREATE_PERMISSION = ["TO_DO_LIST_CREATE_ORG", "TO_DO_LIST_CREATE_PROJECT", "TO_DO_LIST_CREATE_SELF"];
|
|
30
30
|
const TO_DO_LIST_UPDATE_PERMISSION = ["TO_DO_LIST_UPDATE_ORG", "TO_DO_LIST_UPDATE_PROJECT", "TO_DO_LIST_UPDATE_SELF"];
|
|
31
|
-
const TO_DO_LIST_DELETE_PERMISSION = ["TO_DO_LIST_DELETE_ORG", "TO_DO_LIST_DELETE_PROJECT"
|
|
31
|
+
const TO_DO_LIST_DELETE_PERMISSION = ["TO_DO_LIST_DELETE_ORG", "TO_DO_LIST_DELETE_PROJECT"];
|
|
32
32
|
const TO_DO_LIST_DEACTIVATE_PERMISSION = ["TO_DO_LIST_DEACTIVATE"];
|
|
33
33
|
const TO_DO_LIST_ACTIVATE_PERMISSION = ["TO_DO_LIST_ACTIVATE"];
|
|
34
34
|
const TO_DO_LIST_RESTORE_PERMISSION = ["TO_DO_LIST_RESTORE"];
|
package/dist/src/entities/interface/field-constraint/to_do_list_field_constraints.interface.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
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
|
+
*/
|
|
4
11
|
export type IToDoListFieldLengthConstraintsExclude = "status" | "id" | keyof IEntityAuditColumn;
|
|
5
12
|
/**
|
|
6
13
|
* 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,24 +2,30 @@
|
|
|
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
|
+
*/
|
|
5
9
|
description: {
|
|
6
10
|
min: 1,
|
|
7
|
-
max:
|
|
11
|
+
max: 65535,
|
|
8
12
|
},
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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,
|
|
12
20
|
},
|
|
13
|
-
|
|
14
|
-
|
|
21
|
+
/** minutes, and the DTO bounds this with @IsPositive() plus a multiple-of check, not @Min/@Max */
|
|
22
|
+
estimatedDuration: {
|
|
15
23
|
max: 9999999,
|
|
16
24
|
},
|
|
17
25
|
projectId: {
|
|
18
|
-
min: 0,
|
|
19
26
|
max: 9999999,
|
|
20
27
|
},
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
max: 99999999,
|
|
28
|
+
userId: {
|
|
29
|
+
max: 9999999,
|
|
24
30
|
},
|
|
25
31
|
};
|
|
@@ -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;
|
|
6
7
|
estimatedDuration: number;
|
|
7
|
-
userId: number;
|
|
8
8
|
projectId: number;
|
|
9
|
+
userId: number;
|
|
9
10
|
status: ToDoListStatusEnum;
|
|
10
|
-
date: number;
|
|
11
11
|
}
|
|
@@ -1,48 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { ToDoListActionEnum } from "../enums/to_do_list_action_enum";
|
|
2
|
+
import { IToDoListFlowConfigContextData } from "../flow-configs/to_do_list_flow.config";
|
|
3
3
|
import { IUserEntity } from "../interface/user.entity.interface";
|
|
4
|
-
import { BaseEntityModel } from "./base.entity.model";
|
|
5
4
|
import { IRowActions } from "./interface/row-actions.interface";
|
|
6
|
-
import { UserEntityModel } from "./user.entity.model";
|
|
7
|
-
import { ToDoListActionEnum } from "../../entities";
|
|
8
5
|
import { ToDoListStatusEnum } from "../enums/to_do_list_status_enum";
|
|
9
|
-
import {
|
|
6
|
+
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
7
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
10
8
|
import { IToDoListEntity } from "../interface/to_do_list.entity.interface";
|
|
11
|
-
import {
|
|
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";
|
|
9
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
26
10
|
import { ProjectEntityModel } from "./project.entity.model";
|
|
27
|
-
import {
|
|
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";
|
|
11
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
39
12
|
export declare class ToDoListEntityModel extends BaseEntityModel<EntityEnum.TO_DO_LIST> implements IToDoListEntity {
|
|
40
13
|
id: number;
|
|
41
14
|
description: string;
|
|
15
|
+
dateCode: string;
|
|
42
16
|
estimatedDuration: number;
|
|
43
|
-
userId: number;
|
|
44
17
|
projectId: number;
|
|
45
|
-
|
|
18
|
+
userId: number;
|
|
46
19
|
status: ToDoListStatusEnum;
|
|
47
20
|
createdOn: number;
|
|
48
21
|
updatedOn: number;
|
|
@@ -52,34 +25,7 @@ export declare class ToDoListEntityModel extends BaseEntityModel<EntityEnum.TO_D
|
|
|
52
25
|
user?: UserEntityModel;
|
|
53
26
|
static relationConfigs: RelationConfigs<[EntityEnum.PROJECT, EntityEnum.USER], EntityEnum.TO_DO_LIST>;
|
|
54
27
|
static fromEntity(entity: IToDoListEntity): ToDoListEntityModel;
|
|
55
|
-
getRelationConfigs():
|
|
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;
|
|
28
|
+
getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT, EntityEnum.TO_DO_LIST>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.USER, EntityEnum.TO_DO_LIST>];
|
|
83
29
|
getNextStatus(currentUser: IUserEntity, action: ToDoListActionEnum, toDoListFlowConfigContextData: IToDoListFlowConfigContextData): ToDoListStatusEnum;
|
|
84
30
|
getAvailableActions(currentUser: UserEntityModel, config?: {
|
|
85
31
|
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");
|
|
7
10
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
8
11
|
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 = "";
|
|
17
18
|
this.estimatedDuration = 0;
|
|
18
|
-
this.userId = 0;
|
|
19
19
|
this.projectId = 0;
|
|
20
|
-
this.
|
|
20
|
+
this.userId = 0;
|
|
21
21
|
this.status = to_do_list_status_enum_1.ToDoListStatusEnum.APPROVED;
|
|
22
22
|
this.createdOn = 0;
|
|
23
23
|
this.updatedOn = 0;
|
|
@@ -30,357 +30,7 @@ class ToDoListEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
30
30
|
return result;
|
|
31
31
|
}
|
|
32
32
|
getRelationConfigs() {
|
|
33
|
-
return
|
|
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;
|
|
33
|
+
return ToDoListEntityModel.relationConfigs;
|
|
384
34
|
}
|
|
385
35
|
getNextStatus(currentUser, action, toDoListFlowConfigContextData) {
|
|
386
36
|
if (!this.status) {
|
|
@@ -419,7 +69,7 @@ class ToDoListEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
419
69
|
if (!hasPermission) {
|
|
420
70
|
throw new exceptions_1.AppBadRequestException({
|
|
421
71
|
key: error_key_enum_1.ErrorKeyEnum.PERMISSION,
|
|
422
|
-
message: [`Current user does not have permission to ${action}
|
|
72
|
+
message: [`Current user does not have permission to ${action} to do list`],
|
|
423
73
|
});
|
|
424
74
|
}
|
|
425
75
|
const nextStatus = matchingPermissionConfig.next(toDoListFlowConfigContextData);
|
|
@@ -445,20 +95,14 @@ exports.ToDoListEntityModel = ToDoListEntityModel;
|
|
|
445
95
|
ToDoListEntityModel.relationConfigs = [
|
|
446
96
|
{
|
|
447
97
|
name: entity_utils_interface_1.EntityEnum.PROJECT,
|
|
448
|
-
relation:
|
|
98
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
449
99
|
key: "project",
|
|
450
|
-
mapKeyConfig: {
|
|
451
|
-
relationKey: "id",
|
|
452
|
-
key: "projectId",
|
|
453
|
-
},
|
|
100
|
+
mapKeyConfig: { relationKey: "id", key: "projectId" },
|
|
454
101
|
},
|
|
455
102
|
{
|
|
456
103
|
name: entity_utils_interface_1.EntityEnum.USER,
|
|
457
|
-
relation:
|
|
104
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
458
105
|
key: "user",
|
|
459
|
-
mapKeyConfig: {
|
|
460
|
-
relationKey: "id",
|
|
461
|
-
key: "userId",
|
|
462
|
-
},
|
|
106
|
+
mapKeyConfig: { relationKey: "id", key: "userId" },
|
|
463
107
|
},
|
|
464
108
|
];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
|
|
2
1
|
import { UserRoleEnum } from "../enums/user_role_enum";
|
|
3
2
|
import { UserStatusEnum } from "../enums/user_status_enum";
|
|
4
3
|
import { EntityEnum, Nullable } from "../interface/entity.utils.interface";
|
|
@@ -58,8 +57,5 @@ export declare class UserEntityModel extends BaseEntityModel<EntityEnum.USER> im
|
|
|
58
57
|
get roleEntityModel(): RoleEntityModel;
|
|
59
58
|
hasPermission(permissionName: string): boolean;
|
|
60
59
|
get projects(): ProjectEntityModel[];
|
|
61
|
-
get activeProjects(): ProjectEntityModel[];
|
|
62
|
-
get inactiveProjects(): ProjectEntityModel[];
|
|
63
|
-
getProjectUserStatus(projectId: number): ProjectUserStatusEnum | null;
|
|
64
60
|
get isOwnerPartnerRoleUser(): boolean;
|
|
65
61
|
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UserEntityModel = void 0;
|
|
4
|
-
const project_user_status_enum_1 = require("../enums/project_user_status.enum");
|
|
5
4
|
const relation_type_enum_1 = require("../enums/relation_type_enum");
|
|
6
5
|
const user_role_enum_1 = require("../enums/user_role_enum");
|
|
7
6
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
@@ -52,22 +51,6 @@ class UserEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
52
51
|
get projects() {
|
|
53
52
|
return this.projecUserMappings.map((mapping) => mapping.project).filter((project) => !!project);
|
|
54
53
|
}
|
|
55
|
-
get activeProjects() {
|
|
56
|
-
return this.projecUserMappings
|
|
57
|
-
.filter((mapping) => mapping.status === project_user_status_enum_1.ProjectUserStatusEnum.ACTIVE)
|
|
58
|
-
.map((mapping) => mapping.project)
|
|
59
|
-
.filter((project) => !!project);
|
|
60
|
-
}
|
|
61
|
-
get inactiveProjects() {
|
|
62
|
-
return this.projecUserMappings
|
|
63
|
-
.filter((mapping) => mapping.status === project_user_status_enum_1.ProjectUserStatusEnum.INACTIVE)
|
|
64
|
-
.map((mapping) => mapping.project)
|
|
65
|
-
.filter((project) => !!project);
|
|
66
|
-
}
|
|
67
|
-
getProjectUserStatus(projectId) {
|
|
68
|
-
var _a, _b;
|
|
69
|
-
return (_b = (_a = this.projecUserMappings.find((mapping) => mapping.projectId === projectId)) === null || _a === void 0 ? void 0 : _a.status) !== null && _b !== void 0 ? _b : null;
|
|
70
|
-
}
|
|
71
54
|
get isOwnerPartnerRoleUser() {
|
|
72
55
|
return [user_role_enum_1.UserRoleEnum.OWNER, user_role_enum_1.UserRoleEnum.PARTNER].includes(this.role);
|
|
73
56
|
}
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
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";
|
package/dist/src/api/v1/index.js
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
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,11 +0,0 @@
|
|
|
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";
|
package/dist/src/api/v2/index.js
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
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);
|
|
@@ -1,5 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,12 +0,0 @@
|
|
|
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
|
-
}
|
|
File without changes
|
|
File without changes
|