law-common 1.1.19 → 1.1.21

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,4 +1,5 @@
1
1
  import { CurrencyEnum, TimeUnitEnum } from "../../enums";
2
+ import { PartialBy } from "../../misc";
2
3
  import { IAuditColumnEntity } from "./audit-column.entity.interface";
3
4
  import { IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "./entity.utils.interface";
4
5
  export interface IRateEntity extends IAuditColumnEntity {
@@ -12,4 +13,6 @@ export interface IRateEntityCreateDto extends IEntityCreateDto<IRateEntity> {
12
13
  }
13
14
  export interface IRateEntityUpdateDto extends IEntityUpdateDto<IRateEntity> {
14
15
  }
16
+ export interface IRateEntityUpdateByDesignationCurrencyDto extends PartialBy<Omit<IRateEntity, 'id' | keyof IAuditColumnEntity>, 'unit'> {
17
+ }
15
18
  export type IRateEntityFilterData = IEntityFilterData<IRateEntity>;
@@ -23,7 +23,7 @@ var CurrencyEnum;
23
23
  return CurrencyEnum.GBP;
24
24
  default:
25
25
  throw new exceptions_1.AppBadRequestException({
26
- message: [`Invalid currency: '${value}'`],
26
+ message: [`Invalid currency: '${value}'. Valid values are: ${CurrencyEnum.getNames().join(", ")}`],
27
27
  key: error_key_enum_1.ErrorKeyEnum.CURRENCY,
28
28
  });
29
29
  }
@@ -55,7 +55,7 @@ var TimeUnitEnum;
55
55
  return TimeUnitEnum.YEAR;
56
56
  default:
57
57
  throw new exceptions_1.AppBadRequestException({
58
- message: [`Invalid time unit: ${value}`],
58
+ message: [`Invalid time unit: ${value}. Valid values are: ${TimeUnitEnum.getNames().join(", ")}`],
59
59
  key: error_key_enum_1.ErrorKeyEnum.TIME_UNIT,
60
60
  });
61
61
  }
@@ -1,4 +1,6 @@
1
+ import { ErrorKeyEnum } from "../../enums/error.key.enum";
1
2
  import { IAppBadRequestException } from "../type/app-bad-request.exception";
2
3
  export declare class AppBadRequestException extends Error {
4
+ key: ErrorKeyEnum;
3
5
  constructor(appBadRequestException: IAppBadRequestException);
4
6
  }
@@ -4,6 +4,8 @@ exports.AppBadRequestException = void 0;
4
4
  class AppBadRequestException extends Error {
5
5
  constructor(appBadRequestException) {
6
6
  super();
7
+ this.name = "AppBadRequestException";
8
+ this.key = appBadRequestException.key;
7
9
  this.message = appBadRequestException.message.join(",");
8
10
  }
9
11
  }
@@ -1 +1,2 @@
1
1
  export type Modify<T, R> = Omit<T, keyof R> & R;
2
+ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "law-common",
3
- "version": "1.1.19",
3
+ "version": "1.1.21",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "files": [