invoice-system-common 1.0.25-beta.2 → 1.0.27

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.
@@ -3,4 +3,5 @@ export declare class DateUtils {
3
3
  formatDateYYYYMMDD(dateString: string): string;
4
4
  getDaysInMonthFromYYYYMMDD(dateString: string): number;
5
5
  getDaysBetween(start: string, end: string): number;
6
+ formatDateDDMMYYYY(dateString: string): string;
6
7
  }
@@ -20,7 +20,16 @@ class DateUtils {
20
20
  const s = new Date(Number(start.slice(0, 4)), Number(start.slice(4, 6)) - 1, Number(start.slice(6, 8)));
21
21
  const e = new Date(Number(end.slice(0, 4)), Number(end.slice(4, 6)) - 1, Number(end.slice(6, 8)));
22
22
  const diff = (e.getTime() - s.getTime()) / (1000 * 60 * 60 * 24);
23
- return diff;
23
+ return diff + 1;
24
+ }
25
+ formatDateDDMMYYYY(dateString) {
26
+ if (!/^\d{8}$/.test(dateString)) {
27
+ throw new Error("Invalid date format. Expected YYYYMMDD.");
28
+ }
29
+ const year = dateString.slice(0, 4);
30
+ const month = dateString.slice(4, 6);
31
+ const day = dateString.slice(6, 8);
32
+ return `${day}-${month}-${year}`;
24
33
  }
25
34
  }
26
35
  exports.DateUtils = DateUtils;
@@ -2,6 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getDecimalNoUptoNPlaces = getDecimalNoUptoNPlaces;
4
4
  function getDecimalNoUptoNPlaces(decimalNumber, n = 2) {
5
- console.log("decimalNumber", typeof decimalNumber);
6
5
  return parseFloat(Number(decimalNumber).toFixed(n));
7
6
  }
@@ -1,10 +1,11 @@
1
- import { IOrganizationEntity } from './organization.entity.interface';
2
- import { OrganizationActionEnum } from '../enums/organization.action.enum';
3
- import { IEntityFilterData } from '../helpers/generics';
4
- export interface IOrganizationCreateDto extends Partial<IOrganizationEntity> {
1
+ import { EntityList } from "../enums/entity-list.enum";
2
+ import { OrganizationActionEnum } from "../enums/organization.action.enum";
3
+ import { EntityType, IEntityCreateDto, IEntityFilterData, IEntityUpdateDto } from "../helpers/generics";
4
+ export type IOrganizationCreateDtoExclude = "status";
5
+ export interface IOrganizationCreateDto extends IEntityCreateDto<Omit<EntityType<EntityList.ORGANIZATION>, IOrganizationCreateDtoExclude>> {
5
6
  }
6
- export interface IOrganizationUpdateDto extends Partial<IOrganizationEntity> {
7
+ export interface IOrganizationUpdateDto extends IEntityUpdateDto<EntityType<EntityList.ORGANIZATION>> {
7
8
  action: OrganizationActionEnum;
8
9
  }
9
- export interface IOrganizationEntityFilterDto extends IEntityFilterData<IOrganizationEntity> {
10
+ export interface IOrganizationEntityFilterDto extends IEntityFilterData<EntityType<EntityList.ORGANIZATION>> {
10
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "invoice-system-common",
3
- "version": "1.0.25-beta.2",
3
+ "version": "1.0.27",
4
4
  "description": "",
5
5
  "homepage": "https://github.com/Kashyap2210/invoice-system-common#readme",
6
6
  "bugs": {