law-common 8.1.0 → 8.3.0

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,12 +1,13 @@
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;
7
8
  billDate: string;
8
9
  amount: number;
9
- billNo?: string;
10
+ billNo?: string | null;
10
11
  expenseIncurredBy: ReimbursementIncurredByEnum;
11
12
  billPresent: ReimbursementBillingPresentEnum;
12
13
  description: string;
@@ -32,10 +33,19 @@ export interface IReimbursementCreateDtoExtra {
32
33
  expenseDetails: IReimbursementExpenseAllocation[];
33
34
  attachmentDocumentUrls?: string[];
34
35
  }
36
+ export interface IReimbursementEntityCreateDtoValidationData {
37
+ projectUserMappingEntities: IProjectUserMappingEntity[];
38
+ }
39
+ export interface IReimbursementEntityUpdateDtoValidationData {
40
+ projectUserMappingEntities: IProjectUserMappingEntity[];
41
+ }
35
42
  export type IReimbursementExclude = "billingType" | "attachmentUrlsCsv" | "amountReimbursed" | "processedBy" | "processedDate";
36
43
  export interface IReimbursementEntityCreateDto extends Omit<IEntityCreateDto<IReimbursementEntity>, IReimbursementExclude>, IReimbursementCreateDtoExtra {
37
44
  }
38
- export interface IReimbursementUpdateDto extends IEntityUpdateDto<IReimbursementEntity> {
45
+ export interface IReimbursementAttatchementDocsDetails {
46
+ attatchmentDocumentDetails?: string[];
47
+ }
48
+ export interface IReimbursementUpdateDto extends IEntityUpdateDto<IReimbursementEntity>, IReimbursementAttatchementDocsDetails {
39
49
  }
40
50
  export interface IReimbursementEntityFilterDto extends IEntityFilterData<IReimbursementEntity> {
41
51
  createdBy?: number[];
@@ -1,6 +1,7 @@
1
1
  import { ReimbursementExpenseActionEnum, ReimbursementExpenseState } 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 IReimbursementExpenseEntity extends IAuditColumnEntity {
5
6
  id: number;
6
7
  reimbursementId: number;
@@ -23,3 +24,9 @@ export interface IReimbursementExpenseEntityUpdateDto extends IEntityUpdateDto<I
23
24
  }
24
25
  export interface IReimbursementExpenseEntityFilterDto extends IEntityFilterData<IReimbursementExpenseEntity> {
25
26
  }
27
+ export interface IReimbursementExpenseEntityCreateDtoValidationData {
28
+ projectUserMappingEntities: IProjectUserMappingEntity[];
29
+ }
30
+ export interface IReimbursementExpenseEntityUpdateDtoValidationData {
31
+ projectUserMappingEntities: IProjectUserMappingEntity[];
32
+ }
@@ -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;
@@ -17,6 +18,9 @@ export type ITimesheetEntityExclude = "status";
17
18
  export interface ITimesheetEntityCreateDto extends Omit<IEntityCreateDto<ITimesheetEntity>, ITimesheetEntityExclude> {
18
19
  status?: TimesheetStatusEnum;
19
20
  }
21
+ export interface ITimesheetEntityCreateDtoValidationData {
22
+ projectUserMappingEntities: IProjectUserMappingEntity[];
23
+ }
20
24
  export interface IActionDataDto {
21
25
  action: TimesheetActionEnum;
22
26
  remark?: string;
@@ -9,8 +9,8 @@ export interface IUserEntity extends IAuditColumnEntity {
9
9
  secondaryContactNo?: string;
10
10
  password?: string;
11
11
  userCode?: string;
12
- joiningDate?: Date;
13
- endDate?: Date;
12
+ joiningDate?: string;
13
+ endDate?: string;
14
14
  address?: string;
15
15
  zipCode?: number;
16
16
  country?: string;
@@ -1,3 +1,4 @@
1
1
  export * from "./interface/modify.interface";
2
2
  export * from "./interface/upload-multer-file.interface";
3
3
  export * from "./type/arrayed.type";
4
+ export * from "./models/dto-validation-type";
@@ -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);
@@ -6,11 +6,10 @@ const userDTO = {
6
6
  secondaryContactNo: "",
7
7
  password: "",
8
8
  userCode: "",
9
- joiningDate: new Date(),
10
- endDate: new Date(),
9
+ joiningDate: "",
10
+ endDate: "",
11
11
  address: "",
12
12
  zipCode: 0,
13
- // country: CountryEnum.India,
14
13
  country: "India",
15
14
  designation: "",
16
15
  role: entities_1.UserRoleEnum.employee,
@@ -29,7 +28,6 @@ const userDTO = {
29
28
  officeAllocation: 0,
30
29
  tempAddress: "",
31
30
  tempZipCode: 0,
32
- // tempCountry: CountryEnum.India,
33
31
  tempCountry: "India",
34
32
  tempAddressSameAsPrimary: true,
35
33
  emergencyContactName: "",
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "8.1.0",
3
+ "version": "8.3.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [