law-common 4.0.0 → 4.0.1
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/interface/reimbursement.entity.interface.d.ts +4 -0
- package/dist/src/entities/interface/timesheet.entity.interface.d.ts +4 -0
- package/dist/src/misc/index.d.ts +1 -0
- package/dist/src/misc/index.js +1 -0
- package/dist/src/misc/models/dto-validation-type.d.ts +13 -0
- package/dist/src/misc/models/dto-validation-type.js +38 -0
- package/package.json +1 -1
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ReimbursementActionEnum, ReimbursementBillingPresentEnum, ReimbursementBillingTypeEnum, ReimbursementExpenseActionEnum, ReimbursementExpenseState, ReimbursementIncurredByEnum, ReimbursementPaymentStatusEnum, ReimbursementStatusEnum } from "../enums/reimbursement.entity.enum";
|
|
2
2
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
3
3
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
4
|
+
import { IProjectUserMappingEntity } from "./project.entity.interface";
|
|
4
5
|
export interface IReimbursementEntity extends IAuditColumnEntity {
|
|
5
6
|
id: number;
|
|
6
7
|
billingType: ReimbursementBillingTypeEnum;
|
|
@@ -32,6 +33,9 @@ export interface IReimbursementCreateDtoExtra {
|
|
|
32
33
|
expenseDetails: IReimbursementExpenseAllocation[];
|
|
33
34
|
attachmentDocumentUrls?: string[];
|
|
34
35
|
}
|
|
36
|
+
export interface IReimbursementEntityCreateDtoValidationData {
|
|
37
|
+
projectUserMappingEntities: IProjectUserMappingEntity[];
|
|
38
|
+
}
|
|
35
39
|
export type IReimbursementExclude = "billingType" | "attachmentUrlsCsv" | "amountReimbursed" | "processedBy" | "processedDate";
|
|
36
40
|
export interface IReimbursementEntityCreateDto extends Omit<IEntityCreateDto<IReimbursementEntity>, IReimbursementExclude>, IReimbursementCreateDtoExtra {
|
|
37
41
|
}
|
|
@@ -2,6 +2,7 @@ import { TimesheetActionEnum } from "../enums/timesheet.action.enum";
|
|
|
2
2
|
import { TimesheetStatusEnum } from "../enums/timesheet.status.enum";
|
|
3
3
|
import { IAuditColumnEntity } from "./audit-column.entity.interface";
|
|
4
4
|
import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
|
|
5
|
+
import { IProjectUserMappingEntity } from "./project.entity.interface";
|
|
5
6
|
export interface ITimesheetEntity extends IAuditColumnEntity {
|
|
6
7
|
id: number;
|
|
7
8
|
userId: number;
|
|
@@ -16,6 +17,9 @@ export interface ITimesheetEntity extends IAuditColumnEntity {
|
|
|
16
17
|
export interface ITimesheetEntityCreateDto extends IEntityCreateDto<ITimesheetEntity> {
|
|
17
18
|
status?: TimesheetStatusEnum;
|
|
18
19
|
}
|
|
20
|
+
export interface ITimesheetEntityCreateDtoValidationData {
|
|
21
|
+
projectUserMappingEntities: IProjectUserMappingEntity[];
|
|
22
|
+
}
|
|
19
23
|
export interface IActionDataDto {
|
|
20
24
|
action: TimesheetActionEnum;
|
|
21
25
|
remark?: string;
|
package/dist/src/misc/index.d.ts
CHANGED
package/dist/src/misc/index.js
CHANGED
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./interface/modify.interface"), exports);
|
|
18
18
|
__exportStar(require("./interface/upload-multer-file.interface"), exports);
|
|
19
19
|
__exportStar(require("./type/arrayed.type"), exports);
|
|
20
|
+
__exportStar(require("./models/dto-validation-type"), exports);
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export declare class Result<T, E> {
|
|
2
|
+
private readonly isOk;
|
|
3
|
+
private readonly _value?;
|
|
4
|
+
private readonly _error?;
|
|
5
|
+
private constructor();
|
|
6
|
+
static ok<T, E = never>(value: T): Result<T, E>;
|
|
7
|
+
static err<T = never, E = unknown>(error: E): Result<T, E>;
|
|
8
|
+
static void<E = never>(): Result<void, E>;
|
|
9
|
+
unwrap(): T;
|
|
10
|
+
unwrapErr(): E;
|
|
11
|
+
is_ok(): boolean;
|
|
12
|
+
is_err(): boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Result = void 0;
|
|
4
|
+
class Result {
|
|
5
|
+
constructor(isOk, _value, _error) {
|
|
6
|
+
this.isOk = isOk;
|
|
7
|
+
this._value = _value;
|
|
8
|
+
this._error = _error;
|
|
9
|
+
}
|
|
10
|
+
static ok(value) {
|
|
11
|
+
return new Result(true, value);
|
|
12
|
+
}
|
|
13
|
+
static err(error) {
|
|
14
|
+
return new Result(false, undefined, error);
|
|
15
|
+
}
|
|
16
|
+
static void() {
|
|
17
|
+
return new Result(true, undefined);
|
|
18
|
+
}
|
|
19
|
+
unwrap() {
|
|
20
|
+
if (!this.isOk) {
|
|
21
|
+
throw new Error(`Tried to unwrap an Err result: ${JSON.stringify(this._error)}`);
|
|
22
|
+
}
|
|
23
|
+
return this._value;
|
|
24
|
+
}
|
|
25
|
+
unwrapErr() {
|
|
26
|
+
if (this.isOk) {
|
|
27
|
+
throw new Error(`Tried to unwrapErr an Ok result: ${JSON.stringify(this._value)}`);
|
|
28
|
+
}
|
|
29
|
+
return this._error;
|
|
30
|
+
}
|
|
31
|
+
is_ok() {
|
|
32
|
+
return this.isOk;
|
|
33
|
+
}
|
|
34
|
+
is_err() {
|
|
35
|
+
return !this.isOk;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
exports.Result = Result;
|