law-common 10.18.1-beta.4 → 10.18.1-beta.6
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/entities/enums/relation-type.enum.d.ts +4 -0
- package/dist/src/entities/enums/relation-type.enum.js +8 -0
- package/dist/src/entities/interface/entity.utils.interface.d.ts +17 -0
- package/dist/src/entities/interface/relation-config.interface.d.ts +16 -0
- package/dist/src/entities/interface/relation-config.interface.js +2 -0
- package/dist/src/entities/model/base.entity.model.d.ts +1 -6
- package/dist/src/entities/model/base.entity.model.js +4 -8
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.d.ts +2 -2
- package/dist/src/entities/model/billing-reimbursement-expense.entity.model.js +5 -5
- package/dist/src/entities/model/billing.entity.model.d.ts +11 -10
- package/dist/src/entities/model/billing.entity.model.js +6 -5
- package/dist/src/entities/model/client.entity.model.d.ts +8 -21
- package/dist/src/entities/model/client.entity.model.js +7 -6
- package/dist/src/entities/model/entity.model.interface.d.ts +1 -18
- package/dist/src/entities/model/entity.model.interface.js +7 -7
- package/dist/src/entities/model/project-user-mapping.entity.model.d.ts +8 -8
- package/dist/src/entities/model/project-user-mapping.entity.model.js +9 -8
- package/dist/src/entities/model/project.entity.model.d.ts +11 -10
- package/dist/src/entities/model/project.entity.model.js +9 -8
- package/dist/src/entities/model/reimbursement-expense.entity.model.d.ts +7 -7
- package/dist/src/entities/model/reimbursement-expense.entity.model.js +8 -7
- package/dist/src/entities/model/reimbursement.entity.model.d.ts +2 -2
- package/dist/src/entities/model/reimbursement.entity.model.js +5 -5
- package/dist/src/entities/model/task.entity.model.d.ts +2 -2
- package/dist/src/entities/model/task.entity.model.js +4 -4
- package/dist/src/entities/model/timesheet.entity.model.d.ts +2 -2
- package/dist/src/entities/model/timesheet.entity.model.js +4 -4
- package/dist/src/entities/model/user.entity.model.d.ts +2 -2
- package/dist/src/entities/model/user.entity.model.js +4 -4
- package/package.json +1 -1
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelationType = void 0;
|
|
4
|
+
var RelationType;
|
|
5
|
+
(function (RelationType) {
|
|
6
|
+
RelationType["ONE"] = "one";
|
|
7
|
+
RelationType["MANY"] = "many";
|
|
8
|
+
})(RelationType || (exports.RelationType = RelationType = {}));
|
|
@@ -3,6 +3,14 @@ import { ConvertToArray } from "../../misc";
|
|
|
3
3
|
import { Modify } from "../../misc/interface/modify.interface";
|
|
4
4
|
import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
|
|
5
5
|
import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
6
|
+
import { BillingReimbursementExpneseEntityModel } from "../model/billing-reimbursement-expense.entity.model";
|
|
7
|
+
import { BillingEntityModel } from "../model/billing.entity.model";
|
|
8
|
+
import { ClientEntityModel } from "../model/client.entity.model";
|
|
9
|
+
import { ProjectUserMappingEntityModel } from "../model/project-user-mapping.entity.model";
|
|
10
|
+
import { ProjectEntityModel } from "../model/project.entity.model";
|
|
11
|
+
import { ReimbursementExpenseEntityModel } from "../model/reimbursement-expense.entity.model";
|
|
12
|
+
import { ReimbursementEntityModel } from "../model/reimbursement.entity.model";
|
|
13
|
+
import { UserEntityModel } from "../model/user.entity.model";
|
|
6
14
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
7
15
|
import { IBankEntity } from "./bank.entity.interface";
|
|
8
16
|
import { IBankHistoryEntity } from "./bank_history.entity.interface";
|
|
@@ -267,3 +275,12 @@ export declare enum VirtualEntityEnum {
|
|
|
267
275
|
}
|
|
268
276
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
269
277
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
278
|
+
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntityModel : T extends EntityEnum.PROJECT ? ProjectEntityModel : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntityModel : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntityModel : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntityModel : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntityModel : UserEntityModel;
|
|
279
|
+
export type EntityMap = {
|
|
280
|
+
[key in EntityEnum]: EnumToModel<key>[];
|
|
281
|
+
};
|
|
282
|
+
export type EntityIndexMap = {
|
|
283
|
+
[key in EntityEnum]: {
|
|
284
|
+
[id: number]: EnumToModel<key>;
|
|
285
|
+
};
|
|
286
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RelationType } from "../enums/relation-type.enum";
|
|
2
|
+
import { EntityEnum, EnumEntityType, VirtualEntityEnum } from "./entity.utils.interface";
|
|
3
|
+
type SourcePath<TSource> = (keyof TSource & string) | `${string}.${string}`;
|
|
4
|
+
export type IRelationConfig<TSource extends EntityEnum | VirtualEntityEnum, K extends EnumEntityType<EntityEnum | VirtualEntityEnum>> = {
|
|
5
|
+
name: TSource;
|
|
6
|
+
relation: RelationType;
|
|
7
|
+
key: string;
|
|
8
|
+
mapKeyConfig: {
|
|
9
|
+
relationKey: SourcePath<EnumEntityType<TSource>>;
|
|
10
|
+
key: keyof K;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
export type RelationConfigs<T extends readonly (EntityEnum | VirtualEntityEnum)[], E extends EnumEntityType<EntityEnum>> = {
|
|
14
|
+
[K in keyof T]: T[K] extends EntityEnum | VirtualEntityEnum ? IRelationConfig<T[K], E> : never;
|
|
15
|
+
};
|
|
16
|
+
export {};
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
2
|
-
import { EntityIndexMap } from "./entity.model.interface";
|
|
3
|
-
export declare enum RelationType {
|
|
4
|
-
ONE = "one",
|
|
5
|
-
MANY = "many"
|
|
6
|
-
}
|
|
1
|
+
import { EntityEnum, EntityIndexMap } from "../interface/entity.utils.interface";
|
|
7
2
|
export declare abstract class BaseEntityModel<T extends EntityEnum> {
|
|
8
3
|
protected entityName: T;
|
|
9
4
|
constructor(entityName: T);
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BaseEntityModel =
|
|
4
|
-
|
|
5
|
-
(function (RelationType) {
|
|
6
|
-
RelationType["ONE"] = "one";
|
|
7
|
-
RelationType["MANY"] = "many";
|
|
8
|
-
})(RelationType || (exports.RelationType = RelationType = {}));
|
|
3
|
+
exports.BaseEntityModel = void 0;
|
|
4
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
9
5
|
class BaseEntityModel {
|
|
10
6
|
constructor(entityName) {
|
|
11
7
|
this.entityName = entityName;
|
|
12
8
|
}
|
|
13
9
|
populateRelationsByIndex(entityIndexMap) {
|
|
14
10
|
for (const relationConfig of this.getRelationConfigs() || []) {
|
|
15
|
-
if (relationConfig.relation === RelationType.ONE) {
|
|
11
|
+
if (relationConfig.relation === relation_type_enum_1.RelationType.ONE) {
|
|
16
12
|
// @ts-ignore
|
|
17
13
|
const relatedEntities = entityIndexMap[relationConfig.name] || {};
|
|
18
14
|
// @ts-ignore
|
|
@@ -44,7 +40,7 @@ class BaseEntityModel {
|
|
|
44
40
|
// @ts-ignore
|
|
45
41
|
this[relationConfig.key] = foundRelatedEntities[0];
|
|
46
42
|
}
|
|
47
|
-
else if (relationConfig.relation === RelationType.MANY) {
|
|
43
|
+
else if (relationConfig.relation === relation_type_enum_1.RelationType.MANY) {
|
|
48
44
|
// @ts-ignore
|
|
49
45
|
this[relationConfig.key] = [];
|
|
50
46
|
// @ts-ignore
|
|
@@ -3,7 +3,7 @@ import { BillingReimbursementExpenseImpactEnum } from "../enums/billing-reimbure
|
|
|
3
3
|
import { BillingReimbursementExpenseChangedStatusEnum } from "../enums/billing-reimbursement-expense-change-status.enum";
|
|
4
4
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
5
5
|
import { BaseEntityModel } from "./base.entity.model";
|
|
6
|
-
export declare class
|
|
6
|
+
export declare class BillingReimbursementExpneseEntityModel extends BaseEntityModel<EntityEnum.BILLING_REIMBURSEMENT_EXPENSE> implements IBillingReimbursementExpenseApiEntity {
|
|
7
7
|
id: number;
|
|
8
8
|
billingId: number;
|
|
9
9
|
userId: number;
|
|
@@ -21,5 +21,5 @@ export declare class BillingReimbursementExpneseEntity extends BaseEntityModel<E
|
|
|
21
21
|
updatedOn: string;
|
|
22
22
|
static relationConfigs: never[];
|
|
23
23
|
getRelationConfigs(): any[];
|
|
24
|
-
static fromApiEntity(apiEntity: IBillingReimbursementExpenseApiEntity):
|
|
24
|
+
static fromApiEntity(apiEntity: IBillingReimbursementExpenseApiEntity): BillingReimbursementExpneseEntityModel;
|
|
25
25
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.BillingReimbursementExpneseEntityModel = void 0;
|
|
4
4
|
const billing_reimbursement_expense_change_status_enum_1 = require("../enums/billing-reimbursement-expense-change-status.enum");
|
|
5
5
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
-
class
|
|
7
|
+
class BillingReimbursementExpneseEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.id = 0;
|
|
@@ -26,10 +26,10 @@ class BillingReimbursementExpneseEntity extends base_entity_model_1.BaseEntityMo
|
|
|
26
26
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
27
27
|
}
|
|
28
28
|
static fromApiEntity(apiEntity) {
|
|
29
|
-
const entity = new
|
|
29
|
+
const entity = new BillingReimbursementExpneseEntityModel(entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE);
|
|
30
30
|
Object.assign(entity, apiEntity);
|
|
31
31
|
return entity;
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
exports.
|
|
35
|
-
|
|
34
|
+
exports.BillingReimbursementExpneseEntityModel = BillingReimbursementExpneseEntityModel;
|
|
35
|
+
BillingReimbursementExpneseEntityModel.relationConfigs = [];
|
|
@@ -6,12 +6,13 @@ import { BillingStatusEnum } from "../enums/billing.status.enum";
|
|
|
6
6
|
import { BillingInvoiceTypeEnum } from "../enums/billing_invoice_type.enum";
|
|
7
7
|
import { PaymentStatusEnum } from "../enums/payment_status.enum";
|
|
8
8
|
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
9
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
9
10
|
import { BaseEntityModel } from "./base.entity.model";
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
11
|
+
import { BillingReimbursementExpneseEntityModel } from "./billing-reimbursement-expense.entity.model";
|
|
12
|
+
import { ClientEntityModel } from "./client.entity.model";
|
|
13
|
+
import { ProjectEntityModel } from "./project.entity.model";
|
|
14
|
+
import { ReimbursementExpenseEntityModel } from "./reimbursement-expense.entity.model";
|
|
15
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
15
16
|
export interface BillingActions {
|
|
16
17
|
label: string;
|
|
17
18
|
value: BillingActionsEnum;
|
|
@@ -48,12 +49,12 @@ export declare class BillingEntityModel extends BaseEntityModel<EntityEnum.BILLI
|
|
|
48
49
|
createdOn: string;
|
|
49
50
|
updatedOn: string;
|
|
50
51
|
type: BillingTypeEnum;
|
|
51
|
-
project?:
|
|
52
|
-
client?:
|
|
53
|
-
updatedByUser?:
|
|
52
|
+
project?: ProjectEntityModel;
|
|
53
|
+
client?: ClientEntityModel;
|
|
54
|
+
updatedByUser?: UserEntityModel;
|
|
54
55
|
billOverdue?: boolean;
|
|
55
|
-
billingIdReimbursementExpense?:
|
|
56
|
-
reimbursementExpense?:
|
|
56
|
+
billingIdReimbursementExpense?: BillingReimbursementExpneseEntityModel[];
|
|
57
|
+
reimbursementExpense?: ReimbursementExpenseEntityModel[];
|
|
57
58
|
static relationConfigs: RelationConfigs<[
|
|
58
59
|
EntityEnum.PROJECT,
|
|
59
60
|
EntityEnum.CLIENT,
|
|
@@ -6,6 +6,7 @@ const billing_type_enum_1 = require("../enums/billing-type.enum");
|
|
|
6
6
|
const billing_status_enum_1 = require("../enums/billing.status.enum");
|
|
7
7
|
const billing_invoice_type_enum_1 = require("../enums/billing_invoice_type.enum");
|
|
8
8
|
const payment_status_enum_1 = require("../enums/payment_status.enum");
|
|
9
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
9
10
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
10
11
|
const base_entity_model_1 = require("./base.entity.model");
|
|
11
12
|
var BillingStatusCategoryEnumForUI;
|
|
@@ -184,7 +185,7 @@ exports.BillingEntityModel = BillingEntityModel;
|
|
|
184
185
|
BillingEntityModel.relationConfigs = [
|
|
185
186
|
{
|
|
186
187
|
name: entity_utils_interface_1.EntityEnum.PROJECT,
|
|
187
|
-
relation:
|
|
188
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
188
189
|
key: "project",
|
|
189
190
|
mapKeyConfig: {
|
|
190
191
|
relationKey: "id",
|
|
@@ -193,7 +194,7 @@ BillingEntityModel.relationConfigs = [
|
|
|
193
194
|
},
|
|
194
195
|
{
|
|
195
196
|
name: entity_utils_interface_1.EntityEnum.CLIENT,
|
|
196
|
-
relation:
|
|
197
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
197
198
|
key: "client",
|
|
198
199
|
mapKeyConfig: {
|
|
199
200
|
relationKey: "id",
|
|
@@ -202,7 +203,7 @@ BillingEntityModel.relationConfigs = [
|
|
|
202
203
|
},
|
|
203
204
|
{
|
|
204
205
|
name: entity_utils_interface_1.EntityEnum.USER,
|
|
205
|
-
relation:
|
|
206
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
206
207
|
key: "updatedByUser",
|
|
207
208
|
mapKeyConfig: {
|
|
208
209
|
relationKey: "id",
|
|
@@ -211,13 +212,13 @@ BillingEntityModel.relationConfigs = [
|
|
|
211
212
|
},
|
|
212
213
|
{
|
|
213
214
|
name: entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE,
|
|
214
|
-
relation:
|
|
215
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
215
216
|
key: "reimbursementExpense",
|
|
216
217
|
mapKeyConfig: { relationKey: "projectId", key: "projectId" },
|
|
217
218
|
},
|
|
218
219
|
{
|
|
219
220
|
name: entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE,
|
|
220
|
-
relation:
|
|
221
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
221
222
|
key: "billingIdReimbursementExpense",
|
|
222
223
|
mapKeyConfig: {
|
|
223
224
|
relationKey: "billingId",
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import { ProjectEntity } from "./project.entity.model";
|
|
2
|
-
import { EntityEnum, EnumEntityType, VirtualEntityEnum } from "../interface/entity.utils.interface";
|
|
3
|
-
import { BaseEntityModel, RelationType } from "./base.entity.model";
|
|
4
1
|
import { IClientApiEntity } from "../../api";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
mapKeyConfig: {
|
|
11
|
-
relationKey: SourcePath<EnumEntityType<TSource>>;
|
|
12
|
-
key: keyof K;
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
export type RelationConfigs<T extends readonly (EntityEnum | VirtualEntityEnum)[], E extends EnumEntityType<EntityEnum>> = {
|
|
16
|
-
[K in keyof T]: T[K] extends EntityEnum | VirtualEntityEnum ? IRelationConfig<T[K], E> : never;
|
|
17
|
-
};
|
|
18
|
-
export declare class ClientEntity extends BaseEntityModel<EntityEnum.CLIENT> implements IClientApiEntity {
|
|
2
|
+
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
3
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
|
+
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
+
import { ProjectEntityModel } from "./project.entity.model";
|
|
6
|
+
export declare class ClientEntityModel extends BaseEntityModel<EntityEnum.CLIENT> implements IClientApiEntity {
|
|
19
7
|
createdOn: string;
|
|
20
8
|
updatedOn: string;
|
|
21
9
|
id: number;
|
|
@@ -37,12 +25,11 @@ export declare class ClientEntity extends BaseEntityModel<EntityEnum.CLIENT> imp
|
|
|
37
25
|
updatedBy: number;
|
|
38
26
|
projectIds?: number[];
|
|
39
27
|
billingOverdueDays: number;
|
|
40
|
-
projects:
|
|
28
|
+
projects: ProjectEntityModel[];
|
|
41
29
|
getRelationConfigs(): any;
|
|
42
30
|
static relationConfigs: RelationConfigs<[
|
|
43
31
|
EntityEnum.PROJECT
|
|
44
32
|
], EnumEntityType<EntityEnum.CLIENT>>;
|
|
45
|
-
static fromApiEntity(apiEntity: IClientApiEntity):
|
|
46
|
-
populateProjectIds(projects:
|
|
33
|
+
static fromApiEntity(apiEntity: IClientApiEntity): ClientEntityModel;
|
|
34
|
+
populateProjectIds(projects: ProjectEntityModel[]): ClientEntityModel;
|
|
47
35
|
}
|
|
48
|
-
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ClientEntityModel = void 0;
|
|
4
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
4
5
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
-
class
|
|
7
|
+
class ClientEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
7
8
|
constructor() {
|
|
8
9
|
super(...arguments);
|
|
9
10
|
this.createdOn = `${new Date()}`;
|
|
@@ -24,7 +25,7 @@ class ClientEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
24
25
|
return this.constructor.prototype.constructor.relationConfigs;
|
|
25
26
|
}
|
|
26
27
|
static fromApiEntity(apiEntity) {
|
|
27
|
-
const entity = new
|
|
28
|
+
const entity = new ClientEntityModel(entity_utils_interface_1.EntityEnum.CLIENT);
|
|
28
29
|
Object.assign(entity, apiEntity);
|
|
29
30
|
return entity;
|
|
30
31
|
}
|
|
@@ -35,11 +36,11 @@ class ClientEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
35
36
|
return this;
|
|
36
37
|
}
|
|
37
38
|
}
|
|
38
|
-
exports.
|
|
39
|
-
|
|
39
|
+
exports.ClientEntityModel = ClientEntityModel;
|
|
40
|
+
ClientEntityModel.relationConfigs = [
|
|
40
41
|
{
|
|
41
42
|
name: entity_utils_interface_1.EntityEnum.PROJECT,
|
|
42
|
-
relation:
|
|
43
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
43
44
|
key: "projects",
|
|
44
45
|
mapKeyConfig: {
|
|
45
46
|
relationKey: "clientId",
|
|
@@ -1,21 +1,4 @@
|
|
|
1
|
-
import { EntityEnum, EnumEntityType, IBaseEntityApiResponse
|
|
2
|
-
import { BillingReimbursementExpneseEntity } from "./billing-reimbursement-expense.entity.model";
|
|
3
|
-
import { BillingEntityModel } from "./billing.entity.model";
|
|
4
|
-
import { ClientEntity } from "./client.entity.model";
|
|
5
|
-
import { ProjectUserMappingEntity } from "./project-user-mapping.entity.model";
|
|
6
|
-
import { ProjectEntity } from "./project.entity.model";
|
|
7
|
-
import { ReimbursementExpenseEntity } from "./reimbursement-expense.entity.model";
|
|
8
|
-
import { ReimbursementEntity } from "./reimbursement.entity.model";
|
|
9
|
-
import { UserEntity } from "./user.entity.model";
|
|
10
|
-
export type EnumToModel<T extends EntityEnum | VirtualEntityEnum> = T extends EntityEnum.BILLING ? BillingEntityModel : T extends EntityEnum.CLIENT ? ClientEntity : T extends EntityEnum.PROJECT ? ProjectEntity : T extends EntityEnum.PROJECT_USER_MAPPING ? ProjectUserMappingEntity : T extends EntityEnum.REIMBURSEMENT ? ReimbursementEntity : T extends EntityEnum.REIMBURSEMENT_EXPENSE ? ReimbursementExpenseEntity : T extends EntityEnum.BILLING_REIMBURSEMENT_EXPENSE ? BillingReimbursementExpneseEntity : UserEntity;
|
|
11
|
-
export type EntityMap = {
|
|
12
|
-
[key in EntityEnum]: EnumToModel<key>[];
|
|
13
|
-
};
|
|
14
|
-
export type EntityIndexMap = {
|
|
15
|
-
[key in EntityEnum]: {
|
|
16
|
-
[id: number]: EnumToModel<key>;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
1
|
+
import { EntityEnum, EntityIndexMap, EntityMap, EnumEntityType, IBaseEntityApiResponse } from "../interface/entity.utils.interface";
|
|
19
2
|
export declare function mapToIndex(entityMap: EntityMap): EntityIndexMap;
|
|
20
3
|
export declare function getEntityIndexMap<T extends EntityEnum>(data: IBaseEntityApiResponse<EnumEntityType<T>>, baseEntity: T, reusedConfig?: {
|
|
21
4
|
existingEntityIndexMap: EntityIndexMap;
|
|
@@ -44,14 +44,14 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
|
44
44
|
function parseEntities(json, baseEntity, entityMap) {
|
|
45
45
|
var _a;
|
|
46
46
|
const entityFromJsonMappings = {
|
|
47
|
-
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.
|
|
48
|
-
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.
|
|
47
|
+
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromApiEntity,
|
|
48
|
+
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromApiEntity,
|
|
49
49
|
[entity_utils_interface_1.EntityEnum.BILLING]: billing_entity_model_1.BillingEntityModel.fromApiEntity,
|
|
50
|
-
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.
|
|
51
|
-
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.
|
|
52
|
-
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.
|
|
53
|
-
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.
|
|
54
|
-
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.
|
|
50
|
+
[entity_utils_interface_1.EntityEnum.USER]: user_entity_model_1.UserEntityModel.fromApiEntity,
|
|
51
|
+
[entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING]: project_user_mapping_entity_model_1.ProjectUserMappingEntityModel.fromApiEntity,
|
|
52
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT]: reimbursement_entity_model_1.ReimbursementEntityModel.fromApiEntity,
|
|
53
|
+
[entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE]: reimbursement_expense_entity_model_1.ReimbursementExpenseEntityModel.fromApiEntity,
|
|
54
|
+
[entity_utils_interface_1.EntityEnum.BILLING_REIMBURSEMENT_EXPENSE]: billing_reimbursement_expense_entity_model_1.BillingReimbursementExpneseEntityModel.fromApiEntity,
|
|
55
55
|
};
|
|
56
56
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
57
57
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { ProjectUserStatusEnum } from "../enums/project_user_status.enum";
|
|
2
2
|
import { EntityEnum, EnumEntityType, IEntityApiResponse } from "../interface/entity.utils.interface";
|
|
3
3
|
import { IProjectUserMappingEntity } from "../interface/project.entity.interface";
|
|
4
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
5
|
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
export declare class ProjectUserMappingEntity extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements IEntityApiResponse<IProjectUserMappingEntity> {
|
|
6
|
+
import { ProjectEntityModel } from "./project.entity.model";
|
|
7
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
8
|
+
export declare class ProjectUserMappingEntityModel extends BaseEntityModel<EntityEnum.PROJECT_USER_MAPPING> implements IEntityApiResponse<IProjectUserMappingEntity> {
|
|
9
9
|
id: number;
|
|
10
10
|
projectId: number;
|
|
11
11
|
userId: number;
|
|
@@ -14,12 +14,12 @@ export declare class ProjectUserMappingEntity extends BaseEntityModel<EntityEnum
|
|
|
14
14
|
updatedOn: string;
|
|
15
15
|
createdBy: number;
|
|
16
16
|
updatedBy: number;
|
|
17
|
-
user?:
|
|
18
|
-
project?:
|
|
19
|
-
static fromApiEntity(apiEntity: IEntityApiResponse<IProjectUserMappingEntity>):
|
|
17
|
+
user?: UserEntityModel;
|
|
18
|
+
project?: ProjectEntityModel;
|
|
19
|
+
static fromApiEntity(apiEntity: IEntityApiResponse<IProjectUserMappingEntity>): ProjectUserMappingEntityModel;
|
|
20
20
|
static relationConfigs: RelationConfigs<[
|
|
21
21
|
EntityEnum.USER,
|
|
22
22
|
EntityEnum.PROJECT
|
|
23
23
|
], EnumEntityType<EntityEnum.PROJECT_USER_MAPPING>>;
|
|
24
|
-
getRelationConfigs(): [import("
|
|
24
|
+
getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.USER, EnumEntityType<EntityEnum.PROJECT_USER_MAPPING>>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT, EnumEntityType<EntityEnum.PROJECT_USER_MAPPING>>];
|
|
25
25
|
}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProjectUserMappingEntityModel = void 0;
|
|
4
4
|
const project_user_status_enum_1 = require("../enums/project_user_status.enum");
|
|
5
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
5
6
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
7
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
-
class
|
|
8
|
+
class ProjectUserMappingEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
10
11
|
this.id = 0;
|
|
@@ -17,19 +18,19 @@ class ProjectUserMappingEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
17
18
|
this.updatedBy = 0;
|
|
18
19
|
}
|
|
19
20
|
static fromApiEntity(apiEntity) {
|
|
20
|
-
const entity = new
|
|
21
|
+
const entity = new ProjectUserMappingEntityModel(entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING);
|
|
21
22
|
Object.assign(entity, apiEntity);
|
|
22
23
|
return entity;
|
|
23
24
|
}
|
|
24
25
|
getRelationConfigs() {
|
|
25
|
-
return
|
|
26
|
+
return ProjectUserMappingEntityModel.relationConfigs;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
exports.
|
|
29
|
-
|
|
29
|
+
exports.ProjectUserMappingEntityModel = ProjectUserMappingEntityModel;
|
|
30
|
+
ProjectUserMappingEntityModel.relationConfigs = [
|
|
30
31
|
{
|
|
31
32
|
name: entity_utils_interface_1.EntityEnum.USER,
|
|
32
|
-
relation:
|
|
33
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
33
34
|
key: "user",
|
|
34
35
|
mapKeyConfig: {
|
|
35
36
|
relationKey: "id",
|
|
@@ -38,7 +39,7 @@ ProjectUserMappingEntity.relationConfigs = [
|
|
|
38
39
|
},
|
|
39
40
|
{
|
|
40
41
|
name: entity_utils_interface_1.EntityEnum.PROJECT,
|
|
41
|
-
relation:
|
|
42
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
42
43
|
key: "project",
|
|
43
44
|
mapKeyConfig: {
|
|
44
45
|
relationKey: "id",
|
|
@@ -3,11 +3,12 @@ import { CurrencyEnum } from "../../enums";
|
|
|
3
3
|
import { ProjectBillingTypeEnum, ProjectStatusEnum } from "../enums/project.entity.enum";
|
|
4
4
|
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
5
5
|
import { IProjectUserDto } from "../interface/project.entity.interface";
|
|
6
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
6
7
|
import { BaseEntityModel } from "./base.entity.model";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
export declare class
|
|
8
|
+
import { ClientEntityModel } from "./client.entity.model";
|
|
9
|
+
import { ProjectUserMappingEntityModel } from "./project-user-mapping.entity.model";
|
|
10
|
+
import { UserEntityModel } from "./user.entity.model";
|
|
11
|
+
export declare class ProjectEntityModel extends BaseEntityModel<EntityEnum.PROJECT> implements IProjectApiEntity {
|
|
11
12
|
id: number;
|
|
12
13
|
name: string;
|
|
13
14
|
clientId: number;
|
|
@@ -26,14 +27,14 @@ export declare class ProjectEntity extends BaseEntityModel<EntityEnum.PROJECT> i
|
|
|
26
27
|
updatedOn: string;
|
|
27
28
|
users?: IProjectUserDto[];
|
|
28
29
|
billingOverdueDays?: number;
|
|
29
|
-
userMappings?: (
|
|
30
|
-
projectUserMappings?:
|
|
31
|
-
client:
|
|
32
|
-
static fromApiEntity(apiEntity: IProjectApiEntity):
|
|
30
|
+
userMappings?: (UserEntityModel & ProjectUserMappingEntityModel)[];
|
|
31
|
+
projectUserMappings?: ProjectUserMappingEntityModel[];
|
|
32
|
+
client: ClientEntityModel;
|
|
33
|
+
static fromApiEntity(apiEntity: IProjectApiEntity): ProjectEntityModel;
|
|
33
34
|
static relationConfigs: RelationConfigs<[
|
|
34
35
|
EntityEnum.PROJECT_USER_MAPPING,
|
|
35
36
|
EntityEnum.CLIENT
|
|
36
37
|
], EnumEntityType<EntityEnum.PROJECT>>;
|
|
37
|
-
populateUsers(users:
|
|
38
|
-
getRelationConfigs(): [import("
|
|
38
|
+
populateUsers(users: UserEntityModel[], projectUserMapping: ProjectUserMappingEntityModel[]): void;
|
|
39
|
+
getRelationConfigs(): [import("../interface/relation-config.interface").IRelationConfig<EntityEnum.PROJECT_USER_MAPPING, EnumEntityType<EntityEnum.PROJECT>>, import("../interface/relation-config.interface").IRelationConfig<EntityEnum.CLIENT, EnumEntityType<EntityEnum.PROJECT>>];
|
|
39
40
|
}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ProjectEntityModel = void 0;
|
|
4
4
|
const enums_1 = require("../../enums");
|
|
5
5
|
const project_entity_enum_1 = require("../enums/project.entity.enum");
|
|
6
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
6
7
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
7
8
|
const base_entity_model_1 = require("./base.entity.model");
|
|
8
|
-
class
|
|
9
|
+
class ProjectEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
9
10
|
constructor() {
|
|
10
11
|
super(...arguments);
|
|
11
12
|
this.id = 0;
|
|
@@ -25,7 +26,7 @@ class ProjectEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
25
26
|
this.client = {};
|
|
26
27
|
}
|
|
27
28
|
static fromApiEntity(apiEntity) {
|
|
28
|
-
const entity = new
|
|
29
|
+
const entity = new ProjectEntityModel(entity_utils_interface_1.EntityEnum.PROJECT);
|
|
29
30
|
entity.id = apiEntity.id;
|
|
30
31
|
entity.name = apiEntity.name;
|
|
31
32
|
entity.clientId = apiEntity.clientId;
|
|
@@ -78,14 +79,14 @@ class ProjectEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
78
79
|
this.users = projectUserDto;
|
|
79
80
|
}
|
|
80
81
|
getRelationConfigs() {
|
|
81
|
-
return
|
|
82
|
+
return ProjectEntityModel.relationConfigs;
|
|
82
83
|
}
|
|
83
84
|
}
|
|
84
|
-
exports.
|
|
85
|
-
|
|
85
|
+
exports.ProjectEntityModel = ProjectEntityModel;
|
|
86
|
+
ProjectEntityModel.relationConfigs = [
|
|
86
87
|
{
|
|
87
88
|
name: entity_utils_interface_1.EntityEnum.PROJECT_USER_MAPPING,
|
|
88
|
-
relation:
|
|
89
|
+
relation: relation_type_enum_1.RelationType.MANY,
|
|
89
90
|
key: "projectUserMappings",
|
|
90
91
|
mapKeyConfig: {
|
|
91
92
|
relationKey: "projectId",
|
|
@@ -94,7 +95,7 @@ ProjectEntity.relationConfigs = [
|
|
|
94
95
|
},
|
|
95
96
|
{
|
|
96
97
|
name: entity_utils_interface_1.EntityEnum.CLIENT,
|
|
97
|
-
relation:
|
|
98
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
98
99
|
key: "client",
|
|
99
100
|
mapKeyConfig: {
|
|
100
101
|
relationKey: "id",
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { IReimbursementExpenseApiEntity } from "../../api";
|
|
2
|
+
import { ReimbursementExpenseState } from "../enums/reimbursement.entity.enum";
|
|
3
3
|
import { EntityEnum, EnumEntityType } from "../interface/entity.utils.interface";
|
|
4
|
+
import { RelationConfigs } from "../interface/relation-config.interface";
|
|
4
5
|
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
export declare class ReimbursementExpenseEntity extends BaseEntityModel<EntityEnum.REIMBURSEMENT_EXPENSE> implements IReimbursementExpenseApiEntity {
|
|
6
|
+
import { ReimbursementEntityModel } from "./reimbursement.entity.model";
|
|
7
|
+
export declare class ReimbursementExpenseEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT_EXPENSE> implements IReimbursementExpenseApiEntity {
|
|
8
8
|
id: number;
|
|
9
9
|
reimbursementId: number;
|
|
10
10
|
userId: number;
|
|
@@ -18,8 +18,8 @@ export declare class ReimbursementExpenseEntity extends BaseEntityModel<EntityEn
|
|
|
18
18
|
updatedBy: number;
|
|
19
19
|
createdOn: string;
|
|
20
20
|
updatedOn: string;
|
|
21
|
-
reimbursement?:
|
|
22
|
-
static fromApiEntity(apiEntity: IReimbursementExpenseApiEntity):
|
|
21
|
+
reimbursement?: ReimbursementEntityModel;
|
|
22
|
+
static fromApiEntity(apiEntity: IReimbursementExpenseApiEntity): ReimbursementExpenseEntityModel;
|
|
23
23
|
static relationConfigs: RelationConfigs<[
|
|
24
24
|
EntityEnum.REIMBURSEMENT
|
|
25
25
|
], EnumEntityType<EntityEnum.REIMBURSEMENT_EXPENSE>>;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ReimbursementExpenseEntityModel = void 0;
|
|
4
|
+
const reimbursement_entity_enum_1 = require("../enums/reimbursement.entity.enum");
|
|
5
|
+
const relation_type_enum_1 = require("../enums/relation-type.enum");
|
|
4
6
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
5
7
|
const base_entity_model_1 = require("./base.entity.model");
|
|
6
|
-
|
|
7
|
-
class ReimbursementExpenseEntity extends base_entity_model_1.BaseEntityModel {
|
|
8
|
+
class ReimbursementExpenseEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
9
|
constructor() {
|
|
9
10
|
super(...arguments);
|
|
10
11
|
this.id = 0;
|
|
@@ -20,7 +21,7 @@ class ReimbursementExpenseEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
20
21
|
this.updatedOn = "";
|
|
21
22
|
}
|
|
22
23
|
static fromApiEntity(apiEntity) {
|
|
23
|
-
const entity = new
|
|
24
|
+
const entity = new ReimbursementExpenseEntityModel(entity_utils_interface_1.EntityEnum.REIMBURSEMENT_EXPENSE);
|
|
24
25
|
Object.assign(entity, apiEntity);
|
|
25
26
|
return entity;
|
|
26
27
|
}
|
|
@@ -28,12 +29,12 @@ class ReimbursementExpenseEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
28
29
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
29
30
|
}
|
|
30
31
|
}
|
|
31
|
-
exports.
|
|
32
|
-
|
|
32
|
+
exports.ReimbursementExpenseEntityModel = ReimbursementExpenseEntityModel;
|
|
33
|
+
ReimbursementExpenseEntityModel.relationConfigs = [
|
|
33
34
|
{
|
|
34
35
|
name: entity_utils_interface_1.EntityEnum.REIMBURSEMENT,
|
|
35
36
|
key: "reimbursement",
|
|
36
|
-
relation:
|
|
37
|
+
relation: relation_type_enum_1.RelationType.ONE,
|
|
37
38
|
mapKeyConfig: {
|
|
38
39
|
relationKey: "id",
|
|
39
40
|
key: "reimbursementId",
|
|
@@ -2,7 +2,7 @@ import { IReimbursementApiEntity } from "../../api";
|
|
|
2
2
|
import { ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum } from "../enums/reimbursement.entity.enum";
|
|
3
3
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
4
4
|
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
-
export declare class
|
|
5
|
+
export declare class ReimbursementEntityModel extends BaseEntityModel<EntityEnum.REIMBURSEMENT> implements IReimbursementApiEntity {
|
|
6
6
|
id: number;
|
|
7
7
|
billingType: ReimbursementBillingTypeEnum;
|
|
8
8
|
billDate: string;
|
|
@@ -28,5 +28,5 @@ export declare class ReimbursementEntity extends BaseEntityModel<EntityEnum.REIM
|
|
|
28
28
|
updatedOn: string;
|
|
29
29
|
static relationConfigs: never[];
|
|
30
30
|
getRelationConfigs(): any[];
|
|
31
|
-
static fromApiEntity(apiEntity: IReimbursementApiEntity):
|
|
31
|
+
static fromApiEntity(apiEntity: IReimbursementApiEntity): ReimbursementEntityModel;
|
|
32
32
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ReimbursementEntityModel = void 0;
|
|
4
4
|
const reimbursement_entity_enum_1 = require("../enums/reimbursement.entity.enum");
|
|
5
5
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
6
6
|
const base_entity_model_1 = require("./base.entity.model");
|
|
7
|
-
class
|
|
7
|
+
class ReimbursementEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
8
8
|
constructor() {
|
|
9
9
|
super(...arguments);
|
|
10
10
|
this.id = 0;
|
|
@@ -25,10 +25,10 @@ class ReimbursementEntity extends base_entity_model_1.BaseEntityModel {
|
|
|
25
25
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
26
26
|
}
|
|
27
27
|
static fromApiEntity(apiEntity) {
|
|
28
|
-
const entity = new
|
|
28
|
+
const entity = new ReimbursementEntityModel(entity_utils_interface_1.EntityEnum.REIMBURSEMENT);
|
|
29
29
|
Object.assign(entity, apiEntity);
|
|
30
30
|
return entity;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
-
exports.
|
|
34
|
-
|
|
33
|
+
exports.ReimbursementEntityModel = ReimbursementEntityModel;
|
|
34
|
+
ReimbursementEntityModel.relationConfigs = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITaskApiEntity } from "../../api";
|
|
2
2
|
import { TaskStatusEnum, TaskTypeEnum } from "../enums/task.entity.enum";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class TaskEntityModel implements ITaskApiEntity {
|
|
4
4
|
id: number;
|
|
5
5
|
name: string;
|
|
6
6
|
description: string;
|
|
@@ -10,5 +10,5 @@ export declare class TaskEntity implements ITaskApiEntity {
|
|
|
10
10
|
updatedBy: number;
|
|
11
11
|
createdOn: string;
|
|
12
12
|
updatedOn: string;
|
|
13
|
-
static fromApiEntity(apiEntity: ITaskApiEntity):
|
|
13
|
+
static fromApiEntity(apiEntity: ITaskApiEntity): TaskEntityModel;
|
|
14
14
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TaskEntityModel = void 0;
|
|
4
4
|
const task_entity_enum_1 = require("../enums/task.entity.enum");
|
|
5
|
-
class
|
|
5
|
+
class TaskEntityModel {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.id = 0;
|
|
8
8
|
this.name = "";
|
|
@@ -15,9 +15,9 @@ class TaskEntity {
|
|
|
15
15
|
this.updatedOn = "";
|
|
16
16
|
}
|
|
17
17
|
static fromApiEntity(apiEntity) {
|
|
18
|
-
const entity = new
|
|
18
|
+
const entity = new TaskEntityModel();
|
|
19
19
|
Object.assign(entity, apiEntity);
|
|
20
20
|
return entity;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
exports.
|
|
23
|
+
exports.TaskEntityModel = TaskEntityModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ITimesheetApiEntity } from "../../api";
|
|
2
2
|
import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class TimesheetEntityModel implements ITimesheetApiEntity {
|
|
4
4
|
id: number;
|
|
5
5
|
userId: number;
|
|
6
6
|
projectId: number;
|
|
@@ -14,5 +14,5 @@ export declare class TimesheetEntity implements ITimesheetApiEntity {
|
|
|
14
14
|
updatedBy: number;
|
|
15
15
|
createdOn: string;
|
|
16
16
|
updatedOn: string;
|
|
17
|
-
static fromApiEntity(apiEntity: ITimesheetApiEntity):
|
|
17
|
+
static fromApiEntity(apiEntity: ITimesheetApiEntity): TimesheetEntityModel;
|
|
18
18
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TimesheetEntityModel = void 0;
|
|
4
4
|
const timesheet_status_enum_1 = require("../enums/timesheet.status.enum");
|
|
5
|
-
class
|
|
5
|
+
class TimesheetEntityModel {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.id = 0;
|
|
8
8
|
this.userId = 0;
|
|
@@ -17,9 +17,9 @@ class TimesheetEntity {
|
|
|
17
17
|
this.updatedOn = "";
|
|
18
18
|
}
|
|
19
19
|
static fromApiEntity(apiEntity) {
|
|
20
|
-
const entity = new
|
|
20
|
+
const entity = new TimesheetEntityModel();
|
|
21
21
|
Object.assign(entity, apiEntity);
|
|
22
22
|
return entity;
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
|
-
exports.
|
|
25
|
+
exports.TimesheetEntityModel = TimesheetEntityModel;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IUserApiEntity } from "../../api";
|
|
2
2
|
import { UserRoleEnum, UserStatusEnum } from "../enums/user.entity.enum";
|
|
3
|
-
export declare class
|
|
3
|
+
export declare class UserEntityModel implements IUserApiEntity {
|
|
4
4
|
id: number;
|
|
5
5
|
name: string;
|
|
6
6
|
email: string;
|
|
@@ -39,5 +39,5 @@ export declare class UserEntity implements IUserApiEntity {
|
|
|
39
39
|
updatedBy: number;
|
|
40
40
|
createdOn: string;
|
|
41
41
|
updatedOn: string;
|
|
42
|
-
static fromApiEntity(apiEntity: IUserApiEntity):
|
|
42
|
+
static fromApiEntity(apiEntity: IUserApiEntity): UserEntityModel;
|
|
43
43
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UserEntityModel = void 0;
|
|
4
4
|
const user_entity_enum_1 = require("../enums/user.entity.enum");
|
|
5
|
-
class
|
|
5
|
+
class UserEntityModel {
|
|
6
6
|
constructor() {
|
|
7
7
|
this.id = 0;
|
|
8
8
|
this.name = "";
|
|
@@ -22,9 +22,9 @@ class UserEntity {
|
|
|
22
22
|
this.updatedOn = "";
|
|
23
23
|
}
|
|
24
24
|
static fromApiEntity(apiEntity) {
|
|
25
|
-
const entity = new
|
|
25
|
+
const entity = new UserEntityModel();
|
|
26
26
|
Object.assign(entity, apiEntity);
|
|
27
27
|
return entity;
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
|
-
exports.
|
|
30
|
+
exports.UserEntityModel = UserEntityModel;
|