@pksep/zod-shared 0.0.512 → 0.0.513

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.
@@ -340,6 +340,7 @@ export interface IWorkloadByOperationData {
340
340
  operationName: string;
341
341
  typeOperationId: number | string;
342
342
  positionsByDate: IWorkloadPositionByDate[];
343
+ debt?: boolean;
343
344
  }
344
345
  export interface IWorkloadPositionSchema {
345
346
  normHours: number;
@@ -21,6 +21,14 @@ export declare class DateMethods {
21
21
  * @returns
22
22
  */
23
23
  comparison: (one_date?: string, two_date?: string, operation?: string) => boolean;
24
+ /**
25
+ * Выссчитываем дельту двух дат.
26
+ * Результат возвращается в минутах
27
+ * @param calculatedCreateTime
28
+ * @param planReadyTime
29
+ * @returns
30
+ */
31
+ calculateDeltaTime: (calculatedCreateTime: Date, planReadyTime: Date) => number;
24
32
  /**
25
33
  * Функция возвращает текущее время в UTC формате
26
34
  * @param config
@@ -47,6 +47,19 @@ class DateMethods {
47
47
  }
48
48
  return result;
49
49
  };
50
+ /**
51
+ * Выссчитываем дельту двух дат.
52
+ * Результат возвращается в минутах
53
+ * @param calculatedCreateTime
54
+ * @param planReadyTime
55
+ * @returns
56
+ */
57
+ this.calculateDeltaTime = (calculatedCreateTime, planReadyTime) => {
58
+ const calculateDate = new Date(calculatedCreateTime);
59
+ const planReadyDate = new Date(planReadyTime);
60
+ const diffInMs = planReadyDate.getTime() - calculateDate.getTime();
61
+ return Math.round(diffInMs / (1000 * 60));
62
+ };
50
63
  /**
51
64
  * Функция возвращает текущее время в UTC формате
52
65
  * @param config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pksep/zod-shared",
3
- "version": "0.0.512",
3
+ "version": "0.0.513",
4
4
  "description": "Zod package for erp project. Contains dto, interfaces, schems, types, enum",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",