law-common 10.18.1-beta.17 → 10.18.1-beta.19
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.
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { BillingActionsEnum, IBillingEntity, IBillingTimesheetUpdateDto, IEntityUpdateDto } from "../../entities";
|
|
1
|
+
import { BillingActionsEnum, IBillingEntity, IBillingReimbursementExpenseUpdateDto, IBillingTimesheetUpdateDto, IEntityUpdateDto } from "../../entities";
|
|
2
2
|
import { IBillingEntityCreateDtoValidationData } from "./billing.create.dto.interface";
|
|
3
3
|
export interface IBillingUpdateDto extends IEntityUpdateDto<IBillingEntity> {
|
|
4
4
|
}
|
|
5
5
|
export interface IUpdateBillingDto extends IBillingUpdateDto {
|
|
6
6
|
action?: BillingActionsEnum;
|
|
7
7
|
timesheets?: IBillingTimesheetUpdateDto[];
|
|
8
|
+
reimbursementExpenses?: IBillingReimbursementExpenseUpdateDto[];
|
|
8
9
|
}
|
|
9
10
|
export interface IBillingUpdateDtoValidationData extends IBillingEntityCreateDtoValidationData {
|
|
10
11
|
billingEntity: IBillingEntity;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { IBaseResponse } from "../../api";
|
|
2
2
|
import { ConvertToArray } from "../../misc";
|
|
3
3
|
import { Modify } from "../../misc/interface/modify.interface";
|
|
4
|
+
import { TimesheetEntityModel } from "../../model/entities/timesheet.model";
|
|
4
5
|
import { EntitySearchConstraintTypeEnum } from "../enums/entity_search_constraint_type.enum";
|
|
5
6
|
import { HistoryOperationEnum } from "../enums/history_operation.enum";
|
|
6
7
|
import { BankEntityModel } from "../model/bank.entity.model";
|
|
@@ -280,7 +281,7 @@ export declare enum VirtualEntityEnum {
|
|
|
280
281
|
}
|
|
281
282
|
export type IHistoryConstraintSearchResponse<T> = IBaseResponse<IHistoryEntitySearchByConstraintResponse<T>[]>;
|
|
282
283
|
export type IHistoryConstraintSearchServiceResponse<T> = IHistoryEntitySearchByConstraintResponse<T>[];
|
|
283
|
-
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 : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : UserEntityModel;
|
|
284
|
+
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 : T extends EntityEnum.CLIENT_AFFILIATE ? ClientAffiliateEntityModel : T extends EntityEnum.BANK ? BankEntityModel : T extends EntityEnum.CONFIGURATION ? ConfigurationEntityModel : T extends EntityEnum.TASK ? TaskEntityModel : T extends EntityEnum.BILLING_TIMESHEET ? BillingTimesheetEntityModel : T extends EntityEnum.TIMESHEET ? TimesheetEntityModel : UserEntityModel;
|
|
284
285
|
export type EntityMap = {
|
|
285
286
|
[key in EntityEnum]: EnumToModel<key>[];
|
|
286
287
|
};
|
|
@@ -24,6 +24,7 @@ class ConfigurationEntityModel {
|
|
|
24
24
|
return configurationEntities.find((configurationEntity) => configurationEntity.key === key);
|
|
25
25
|
}
|
|
26
26
|
static fromApiEntity(apiEntity) {
|
|
27
|
+
console.log("apiEntity", apiEntity);
|
|
27
28
|
const entity = new ConfigurationEntityModel(apiEntity);
|
|
28
29
|
Object.assign(entity, apiEntity);
|
|
29
30
|
return entity;
|
|
@@ -4,6 +4,7 @@ exports.mapToIndex = mapToIndex;
|
|
|
4
4
|
exports.getEntityIndexMap = getEntityIndexMap;
|
|
5
5
|
exports.populateRelationsFor = populateRelationsFor;
|
|
6
6
|
exports.parseEntities = parseEntities;
|
|
7
|
+
const timesheet_model_1 = require("../../model/entities/timesheet.model");
|
|
7
8
|
const entity_utils_interface_1 = require("../interface/entity.utils.interface");
|
|
8
9
|
const bank_entity_model_1 = require("./bank.entity.model");
|
|
9
10
|
const base_entity_model_1 = require("./base.entity.model");
|
|
@@ -48,6 +49,7 @@ function populateRelationsFor(entityIndexMap, enumEntities) {
|
|
|
48
49
|
}
|
|
49
50
|
function parseEntities(json, baseEntity, entityMap) {
|
|
50
51
|
var _a;
|
|
52
|
+
console.log("baseEntity", baseEntity);
|
|
51
53
|
const entityFromJsonMappings = {
|
|
52
54
|
[entity_utils_interface_1.EntityEnum.PROJECT]: project_entity_model_1.ProjectEntityModel.fromApiEntity,
|
|
53
55
|
[entity_utils_interface_1.EntityEnum.CLIENT]: client_entity_model_1.ClientEntityModel.fromApiEntity,
|
|
@@ -62,11 +64,14 @@ function parseEntities(json, baseEntity, entityMap) {
|
|
|
62
64
|
[entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromApiEntity,
|
|
63
65
|
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromApiEntity,
|
|
64
66
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
|
|
67
|
+
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_model_1.TimesheetEntityModel.fromApiEntity,
|
|
65
68
|
};
|
|
66
69
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
70
|
+
console.log("entityFromJsonMappings", entityFromJsonMappings);
|
|
67
71
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
68
72
|
}
|
|
69
73
|
entityMap[baseEntity] = ((_a = json["baseEntities"]) !== null && _a !== void 0 ? _a : []).map((e) => entityFromJsonMappings[baseEntity](e));
|
|
74
|
+
console.log("entityMap", entityMap[entity_utils_interface_1.EntityEnum.CONFIGURATION]);
|
|
70
75
|
if (json["relatedEntities"]) {
|
|
71
76
|
const relatedEntities = json["relatedEntities"];
|
|
72
77
|
for (const entityName in relatedEntities) {
|