law-common 10.25.1-beta.1 → 10.25.1-beta.2
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 +0 -1
- package/dist/src/api/index.js +0 -1
- package/dist/src/api/interface/billing.entity.response.d.ts +2 -3
- package/dist/src/api/interface/timesheet.entity.response.interface.d.ts +2 -7
- package/dist/src/entities/interface/billing_timesheet.entity.interface.d.ts +4 -4
- package/dist/src/entities/interface/client.entity.interface.d.ts +2 -3
- package/dist/src/entities/interface/timesheet.entity.interface.d.ts +2 -2
- package/dist/src/entities/model/billing-timesheet.entity.model.d.ts +5 -5
- package/dist/src/entities/model/billing-timesheet.entity.model.js +6 -6
- package/dist/src/entities/model/entity.model.interface.js +1 -1
- package/dist/src/entities/model/timesheet.entity.model.d.ts +5 -5
- package/dist/src/entities/model/timesheet.entity.model.js +6 -6
- package/dist/src/model/entities/timesheet.model.d.ts +3 -4
- package/dist/src/model/entities/timesheet.model.js +6 -6
- package/dist/src/utils/helper.fn.util.d.ts +1 -0
- package/dist/src/utils/helper.fn.util.js +5 -0
- package/package.json +1 -1
- package/dist/src/api/interface/billing.timesheet.entity.api.d.ts +0 -3
- package/dist/src/api/interface/billing.timesheet.entity.api.js +0 -2
package/dist/src/api/index.d.ts
CHANGED
|
@@ -20,7 +20,6 @@ export * from "./interface/billing.entity.response";
|
|
|
20
20
|
export * from "./interface/office.location.create.dto.interface";
|
|
21
21
|
export * from "./interface/office.Location.update.dto.interface";
|
|
22
22
|
export * from "./interface/office.location.entity.response";
|
|
23
|
-
export * from "./interface/billing.timesheet.entity.api";
|
|
24
23
|
export * from "./interface/billing.entity.api";
|
|
25
24
|
export * from "./interface/billing.update.dto.interface";
|
|
26
25
|
export * from "./interface/bank.create.dto.interface";
|
package/dist/src/api/index.js
CHANGED
|
@@ -36,7 +36,6 @@ __exportStar(require("./interface/billing.entity.response"), exports);
|
|
|
36
36
|
__exportStar(require("./interface/office.location.create.dto.interface"), exports);
|
|
37
37
|
__exportStar(require("./interface/office.Location.update.dto.interface"), exports);
|
|
38
38
|
__exportStar(require("./interface/office.location.entity.response"), exports);
|
|
39
|
-
__exportStar(require("./interface/billing.timesheet.entity.api"), exports);
|
|
40
39
|
__exportStar(require("./interface/billing.entity.api"), exports);
|
|
41
40
|
__exportStar(require("./interface/billing.update.dto.interface"), exports);
|
|
42
41
|
__exportStar(require("./interface/bank.create.dto.interface"), exports);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IProjectEntity, IUserEntity } from "../../entities";
|
|
1
|
+
import { BillingActionsEnum, BillingStatusEnum, IBillingEntity, IBillingTimesheetEntity, IProjectEntity, IUserEntity } from "../../entities";
|
|
2
2
|
import { IBillingReimbursementExpenseApiEntity } from "./billing-reimbursement-expense.api";
|
|
3
3
|
import { IBillingApiEntity } from "./billing.entity.api";
|
|
4
|
-
import { IBillingTimesheetApiEntity } from "./billing.timesheet.entity.api";
|
|
5
4
|
import { IUpdateBillingDto } from "./billing.update.dto.interface";
|
|
6
5
|
export type IBillingEntityResponse = {
|
|
7
6
|
billing: IBillingApiEntity;
|
|
8
|
-
billingTimesheets?:
|
|
7
|
+
billingTimesheets?: IBillingTimesheetEntity[];
|
|
9
8
|
billingReimbursementExpenses?: IBillingReimbursementExpenseApiEntity[];
|
|
10
9
|
};
|
|
11
10
|
export interface IUserEntityRelation {
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { IBaseResponse } from "./base.response.interface";
|
|
1
|
+
import { IProjectUserMappingEntity, ITimesheetEntity, ITimesheetEntityUpdateDto, IUserEntity, TimesheetActionEnum, TimesheetStatusEnum } from "../../entities";
|
|
3
2
|
import { IClientApiEntityDependent } from "./client.entity.response";
|
|
4
3
|
import { IProjectApiEntityDependent } from "./project.entity.response";
|
|
5
|
-
export type ITimesheetApiEntity = IApiEntity<ITimesheetEntity>;
|
|
6
|
-
export type ITimesheetApiEntityArray = ITimesheetApiEntity[];
|
|
7
|
-
export type ITimesheetApiEntityResponse = IBaseResponse<ITimesheetApiEntity>;
|
|
8
|
-
export type ITimesheetApiEntityResponseArray = IBaseResponse<ITimesheetApiEntity>;
|
|
9
4
|
export type ITimesheetEntityGet = {
|
|
10
|
-
timesheets:
|
|
5
|
+
timesheets: ITimesheetEntity[];
|
|
11
6
|
clients: {
|
|
12
7
|
[key: string]: IClientApiEntityDependent;
|
|
13
8
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { BillingImpactEnum } from "../enums/billing.impact.enum";
|
|
2
2
|
import { BillingTimesheetStatusEnum } from "../enums/billing.timesheet.change.status.enum";
|
|
3
|
-
import {
|
|
3
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
4
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
5
5
|
import { ITimesheetEntity } from "./timesheet.entity.interface";
|
|
6
|
-
export interface IBillingTimesheetEntity extends
|
|
6
|
+
export interface IBillingTimesheetEntity extends IEntityAuditColumn {
|
|
7
7
|
id: number;
|
|
8
8
|
billingId: number;
|
|
9
9
|
dateCode: string;
|
|
@@ -20,7 +20,7 @@ export interface IBillingTimesheetEntity extends IAuditColumnEntity {
|
|
|
20
20
|
}
|
|
21
21
|
export interface IBillingTimesheetEntityCreateDto extends IEntityCreateDto<IBillingTimesheetEntity> {
|
|
22
22
|
}
|
|
23
|
-
export interface
|
|
23
|
+
export interface IBillingTimesheetDetails extends IEntityAuditColumn {
|
|
24
24
|
timesheetId: number;
|
|
25
25
|
billingId: number;
|
|
26
26
|
totalAmount?: number;
|
|
@@ -34,7 +34,7 @@ export interface IBillingTimesheetDetail extends IAuditColumnEntity {
|
|
|
34
34
|
totalDuration: number;
|
|
35
35
|
dateCode: string;
|
|
36
36
|
}
|
|
37
|
-
export interface IBillingTimesheetDetailsArray extends Array<
|
|
37
|
+
export interface IBillingTimesheetDetailsArray extends Array<IBillingTimesheetDetails> {
|
|
38
38
|
}
|
|
39
39
|
export interface IBillingTimesheetEntityFilterDto extends IEntityFilterData<IBillingTimesheetEntity> {
|
|
40
40
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
2
1
|
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
3
2
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
3
|
export interface IClientEntity extends IEntityAuditColumn {
|
|
@@ -33,14 +32,14 @@ export interface IClientEntityUpdateDto extends Omit<IEntityUpdateDto<IClientEnt
|
|
|
33
32
|
}
|
|
34
33
|
export interface IClientEntityFilterDto extends IEntityFilterData<IClientEntity> {
|
|
35
34
|
}
|
|
36
|
-
export interface IClientUserMappingEntity extends
|
|
35
|
+
export interface IClientUserMappingEntity extends IEntityAuditColumn {
|
|
37
36
|
id: number;
|
|
38
37
|
clientId: number;
|
|
39
38
|
userId: number;
|
|
40
39
|
}
|
|
41
40
|
export interface IClientUserMappingCreateDto extends IEntityCreateDto<IClientUserMappingEntity> {
|
|
42
41
|
}
|
|
43
|
-
export interface IClientIntroducingMappingEntity extends
|
|
42
|
+
export interface IClientIntroducingMappingEntity extends IEntityAuditColumn {
|
|
44
43
|
id: number;
|
|
45
44
|
clientId: number;
|
|
46
45
|
userId: number;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { TimesheetActionEnum } from "../enums/timesheet.action.enum";
|
|
2
2
|
import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
3
|
-
import {
|
|
3
|
+
import { IEntityAuditColumn } from "./entity-audit-columns.interface";
|
|
4
4
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
5
5
|
import { IProjectUserMappingEntity } from "./project.entity.interface";
|
|
6
6
|
import { IUserEntity } from "./user.entity.interface";
|
|
7
|
-
export interface ITimesheetEntity extends
|
|
7
|
+
export interface ITimesheetEntity extends IEntityAuditColumn {
|
|
8
8
|
id: number;
|
|
9
9
|
userId: number;
|
|
10
10
|
projectId: number;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { IBillingTimesheetApiEntity } from "../../api";
|
|
2
1
|
import { BillingImpactEnum } from "../enums/billing.impact.enum";
|
|
3
2
|
import { BillingTimesheetStatusEnum } from "../enums/billing.timesheet.change.status.enum";
|
|
3
|
+
import { IBillingTimesheetEntity } from "../interface/billing_timesheet.entity.interface";
|
|
4
4
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
5
5
|
import { BaseEntityModel } from "./base.entity.model";
|
|
6
|
-
export declare class BillingTimesheetEntityModel extends BaseEntityModel<EntityEnum.BILLING_TIMESHEET> implements
|
|
6
|
+
export declare class BillingTimesheetEntityModel extends BaseEntityModel<EntityEnum.BILLING_TIMESHEET> implements IBillingTimesheetEntity {
|
|
7
7
|
id: number;
|
|
8
8
|
billingId: number;
|
|
9
9
|
dateCode: string;
|
|
@@ -17,10 +17,10 @@ export declare class BillingTimesheetEntityModel extends BaseEntityModel<EntityE
|
|
|
17
17
|
impact: BillingImpactEnum;
|
|
18
18
|
amendmentPurpose?: string;
|
|
19
19
|
changedStatus: BillingTimesheetStatusEnum;
|
|
20
|
-
createdOn:
|
|
21
|
-
updatedOn:
|
|
20
|
+
createdOn: number;
|
|
21
|
+
updatedOn: number;
|
|
22
22
|
createdBy: number;
|
|
23
23
|
updatedBy: number;
|
|
24
24
|
getRelationConfigs(): any;
|
|
25
|
-
static fromApiEntity(
|
|
25
|
+
static fromApiEntity(entity: IBillingTimesheetEntity): BillingTimesheetEntityModel;
|
|
26
26
|
}
|
|
@@ -19,18 +19,18 @@ class BillingTimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
19
19
|
this.totalAmount = 0;
|
|
20
20
|
this.impact = billing_impact_enum_1.BillingImpactEnum.NEUTRAL; // adjust default if needed
|
|
21
21
|
this.changedStatus = billing_timesheet_change_status_enum_1.BillingTimesheetStatusEnum.UNCHANGED;
|
|
22
|
-
this.createdOn =
|
|
23
|
-
this.updatedOn =
|
|
22
|
+
this.createdOn = 0;
|
|
23
|
+
this.updatedOn = 0;
|
|
24
24
|
this.createdBy = 0;
|
|
25
25
|
this.updatedBy = 0;
|
|
26
26
|
}
|
|
27
27
|
getRelationConfigs() {
|
|
28
28
|
return this.constructor.prototype.constructor.relationConfigs;
|
|
29
29
|
}
|
|
30
|
-
static fromApiEntity(
|
|
31
|
-
const
|
|
32
|
-
Object.assign(
|
|
33
|
-
return
|
|
30
|
+
static fromApiEntity(entity) {
|
|
31
|
+
const result = new BillingTimesheetEntityModel(entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET);
|
|
32
|
+
Object.assign(result, entity);
|
|
33
|
+
return result;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
exports.BillingTimesheetEntityModel = BillingTimesheetEntityModel;
|
|
@@ -63,7 +63,7 @@ function parseEntities(json, baseEntity, entityMap) {
|
|
|
63
63
|
[entity_utils_interface_1.EntityEnum.CONFIGURATION]: configuration_model_1.ConfigurationEntityModel.fromEntity,
|
|
64
64
|
[entity_utils_interface_1.EntityEnum.TASK]: task_entity_model_1.TaskEntityModel.fromEntity,
|
|
65
65
|
[entity_utils_interface_1.EntityEnum.BILLING_TIMESHEET]: billing_timesheet_entity_model_1.BillingTimesheetEntityModel.fromApiEntity,
|
|
66
|
-
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.
|
|
66
|
+
[entity_utils_interface_1.EntityEnum.TIMESHEET]: timesheet_entity_model_1.TimesheetEntityModel.fromEntity,
|
|
67
67
|
};
|
|
68
68
|
if (!(baseEntity in entityFromJsonMappings)) {
|
|
69
69
|
throw new Error(`Unknown entity: ${baseEntity}`);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { ITimesheetApiEntity } from "../../api";
|
|
2
1
|
import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
3
2
|
import { EntityEnum } from "../interface/entity.utils.interface";
|
|
3
|
+
import { ITimesheetEntity } from "../interface/timesheet.entity.interface";
|
|
4
4
|
import { BaseEntityModel } from "./base.entity.model";
|
|
5
|
-
export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements
|
|
5
|
+
export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIMESHEET> implements ITimesheetEntity {
|
|
6
6
|
id: number;
|
|
7
7
|
userId: number;
|
|
8
8
|
projectId: number;
|
|
@@ -14,8 +14,8 @@ export declare class TimesheetEntityModel extends BaseEntityModel<EntityEnum.TIM
|
|
|
14
14
|
remark?: string;
|
|
15
15
|
createdBy: number;
|
|
16
16
|
updatedBy: number;
|
|
17
|
-
createdOn:
|
|
18
|
-
updatedOn:
|
|
19
|
-
static
|
|
17
|
+
createdOn: number;
|
|
18
|
+
updatedOn: number;
|
|
19
|
+
static fromEntity(entity: ITimesheetEntity): TimesheetEntityModel;
|
|
20
20
|
getRelationConfigs(): any[];
|
|
21
21
|
}
|
|
@@ -16,13 +16,13 @@ class TimesheetEntityModel extends base_entity_model_1.BaseEntityModel {
|
|
|
16
16
|
this.status = timesheet_status_enum_1.TimesheetStatusEnum.CREATE_APPROVAL;
|
|
17
17
|
this.createdBy = 0;
|
|
18
18
|
this.updatedBy = 0;
|
|
19
|
-
this.createdOn =
|
|
20
|
-
this.updatedOn =
|
|
19
|
+
this.createdOn = 0;
|
|
20
|
+
this.updatedOn = 0;
|
|
21
21
|
}
|
|
22
|
-
static
|
|
23
|
-
const
|
|
24
|
-
Object.assign(
|
|
25
|
-
return
|
|
22
|
+
static fromEntity(entity) {
|
|
23
|
+
const result = new TimesheetEntityModel(entity_utils_interface_1.EntityEnum.TIMESHEET);
|
|
24
|
+
Object.assign(result, entity);
|
|
25
|
+
return result;
|
|
26
26
|
}
|
|
27
27
|
getRelationConfigs() {
|
|
28
28
|
return this.constructor.prototype.constructor.relationConfigs || [];
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ITimesheetApiEntity } from "../../api";
|
|
2
1
|
import { ITimesheetEntity, TimesheetStatusEnum } from "../../entities";
|
|
3
2
|
import { ITimesheetEntityModel } from "./interface/timesheet.model.interface";
|
|
4
3
|
export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
@@ -10,9 +9,9 @@ export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
|
10
9
|
dateCode: string;
|
|
11
10
|
totalDuration: number;
|
|
12
11
|
createdBy: number;
|
|
13
|
-
createdOn:
|
|
12
|
+
createdOn: number;
|
|
14
13
|
updatedBy: number;
|
|
15
|
-
updatedOn:
|
|
14
|
+
updatedOn: number;
|
|
16
15
|
status: TimesheetStatusEnum;
|
|
17
16
|
billingId?: number;
|
|
18
17
|
/**
|
|
@@ -25,5 +24,5 @@ export declare class TimesheetEntityModel implements ITimesheetEntityModel {
|
|
|
25
24
|
* @returns
|
|
26
25
|
*/
|
|
27
26
|
static getTotalDuration(timesheets: ITimesheetEntityModel[]): number;
|
|
28
|
-
static
|
|
27
|
+
static fromEntity(entity: ITimesheetEntity): TimesheetEntityModel;
|
|
29
28
|
}
|
|
@@ -12,9 +12,9 @@ class TimesheetEntityModel {
|
|
|
12
12
|
this.dateCode = "";
|
|
13
13
|
this.totalDuration = 0;
|
|
14
14
|
this.createdBy = 0;
|
|
15
|
-
this.createdOn =
|
|
15
|
+
this.createdOn = 0;
|
|
16
16
|
this.updatedBy = 1;
|
|
17
|
-
this.updatedOn =
|
|
17
|
+
this.updatedOn = 0;
|
|
18
18
|
this.status = entities_1.TimesheetStatusEnum.CREATE_APPROVAL;
|
|
19
19
|
this.billingId = 0;
|
|
20
20
|
}
|
|
@@ -34,10 +34,10 @@ class TimesheetEntityModel {
|
|
|
34
34
|
const totalDurationOfEachTimesheet = timesheets.map((timesheet) => timesheet.totalDuration);
|
|
35
35
|
return totalDurationOfEachTimesheet.reduce((sum, duration) => sum + duration, 0);
|
|
36
36
|
}
|
|
37
|
-
static
|
|
38
|
-
const
|
|
39
|
-
Object.assign(
|
|
40
|
-
return
|
|
37
|
+
static fromEntity(entity) {
|
|
38
|
+
const result = new TimesheetEntityModel();
|
|
39
|
+
Object.assign(result, entity);
|
|
40
|
+
return result;
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
exports.TimesheetEntityModel = TimesheetEntityModel;
|
|
@@ -270,3 +270,4 @@ export declare function hasProperty<T extends object>(obj: T | null | undefined,
|
|
|
270
270
|
*/
|
|
271
271
|
export declare function convertToNumberType<T extends string | number>(value: T): number;
|
|
272
272
|
export declare function epochToDateTime(epoch: number): string;
|
|
273
|
+
export declare function dateTimeToEpoch(dateInput: string | Date): number;
|
|
@@ -40,6 +40,7 @@ exports.getDecimalNumberFromString = getDecimalNumberFromString;
|
|
|
40
40
|
exports.hasProperty = hasProperty;
|
|
41
41
|
exports.convertToNumberType = convertToNumberType;
|
|
42
42
|
exports.epochToDateTime = epochToDateTime;
|
|
43
|
+
exports.dateTimeToEpoch = dateTimeToEpoch;
|
|
43
44
|
const date_fns_1 = require("date-fns");
|
|
44
45
|
const util_constants_1 = require("../constants/util.constants");
|
|
45
46
|
const error_key_enum_1 = require("../enums/error.key.enum");
|
|
@@ -570,3 +571,7 @@ function epochToDateTime(epoch) {
|
|
|
570
571
|
const date = new Date(epoch * 1000); // JS Date expects milliseconds
|
|
571
572
|
return (0, date_fns_1.format)(date, "yyyy-MM-dd HH:mm:ss");
|
|
572
573
|
}
|
|
574
|
+
function dateTimeToEpoch(dateInput) {
|
|
575
|
+
const date = typeof dateInput === "string" ? new Date(dateInput) : dateInput;
|
|
576
|
+
return Math.floor(date.getTime() / 1000);
|
|
577
|
+
}
|
package/package.json
CHANGED