av6-core 1.7.14 → 1.7.15

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/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { JsonValue } from '@prisma/client/runtime/library';
1
+ import { JsonValue, Decimal, DecimalJsLike, InputJsonValue } from '@prisma/client/runtime/library';
2
2
  import { AsyncLocalStorage } from 'async_hooks';
3
3
  import { AxiosResponse } from 'axios';
4
4
  import ExcelJs from 'exceljs';
@@ -520,6 +520,53 @@ interface CommonServiceResponse {
520
520
 
521
521
  declare const commonService: (serviceDeps: Deps) => CommonServiceResponse;
522
522
 
523
+ declare enum ApprovalStatus {
524
+ PENDING = 0,
525
+ PARTIALLY_APPROVED = 1,
526
+ APPROVED = 2,
527
+ REJECTED = 3,
528
+ CANCELLED = 4
529
+ }
530
+ type ApprovalInstance = {
531
+ id?: number;
532
+ flowId: number;
533
+ subjectType: string;
534
+ service: string;
535
+ subjectId: number;
536
+ refNo?: string | null;
537
+ currentStep: number;
538
+ netTotal?: Decimal | DecimalJsLike | number | string | null;
539
+ status?: ApprovalStatus;
540
+ extra?: JsonValue | InputJsonValue;
541
+ isActive?: boolean;
542
+ createdBy?: number | null;
543
+ updatedBy?: number | null;
544
+ createdAt?: Date | string;
545
+ updatedAt?: Date | string;
546
+ };
547
+ type LevelReadyEvt = {
548
+ instanceId: number;
549
+ subjectType: string;
550
+ subjectId: number;
551
+ level: number;
552
+ approverIds: number[];
553
+ };
554
+ type LevelDoneEvt = {
555
+ instanceId: number;
556
+ level: number;
557
+ actedBy: number;
558
+ action: "APPROVE" | "REJECT";
559
+ comment?: string;
560
+ };
561
+ declare global {
562
+ interface ApprovalEvents {
563
+ "approval:LEVEL_READY": (e: LevelReadyEvt) => void;
564
+ "approval:LEVEL_DONE": (e: LevelDoneEvt) => void;
565
+ "approval:APPROVED": (i: ApprovalInstance) => void;
566
+ "approval:REJECTED": (i: ApprovalInstance) => void;
567
+ }
568
+ }
569
+
523
570
  declare function customOmit<T extends object, K extends keyof T>(obj: T, keys: K[]): {
524
571
  rest: Omit<T, K>;
525
572
  omitted: Pick<T, K>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { JsonValue } from '@prisma/client/runtime/library';
1
+ import { JsonValue, Decimal, DecimalJsLike, InputJsonValue } from '@prisma/client/runtime/library';
2
2
  import { AsyncLocalStorage } from 'async_hooks';
3
3
  import { AxiosResponse } from 'axios';
4
4
  import ExcelJs from 'exceljs';
@@ -520,6 +520,53 @@ interface CommonServiceResponse {
520
520
 
521
521
  declare const commonService: (serviceDeps: Deps) => CommonServiceResponse;
522
522
 
523
+ declare enum ApprovalStatus {
524
+ PENDING = 0,
525
+ PARTIALLY_APPROVED = 1,
526
+ APPROVED = 2,
527
+ REJECTED = 3,
528
+ CANCELLED = 4
529
+ }
530
+ type ApprovalInstance = {
531
+ id?: number;
532
+ flowId: number;
533
+ subjectType: string;
534
+ service: string;
535
+ subjectId: number;
536
+ refNo?: string | null;
537
+ currentStep: number;
538
+ netTotal?: Decimal | DecimalJsLike | number | string | null;
539
+ status?: ApprovalStatus;
540
+ extra?: JsonValue | InputJsonValue;
541
+ isActive?: boolean;
542
+ createdBy?: number | null;
543
+ updatedBy?: number | null;
544
+ createdAt?: Date | string;
545
+ updatedAt?: Date | string;
546
+ };
547
+ type LevelReadyEvt = {
548
+ instanceId: number;
549
+ subjectType: string;
550
+ subjectId: number;
551
+ level: number;
552
+ approverIds: number[];
553
+ };
554
+ type LevelDoneEvt = {
555
+ instanceId: number;
556
+ level: number;
557
+ actedBy: number;
558
+ action: "APPROVE" | "REJECT";
559
+ comment?: string;
560
+ };
561
+ declare global {
562
+ interface ApprovalEvents {
563
+ "approval:LEVEL_READY": (e: LevelReadyEvt) => void;
564
+ "approval:LEVEL_DONE": (e: LevelDoneEvt) => void;
565
+ "approval:APPROVED": (i: ApprovalInstance) => void;
566
+ "approval:REJECTED": (i: ApprovalInstance) => void;
567
+ }
568
+ }
569
+
523
570
  declare function customOmit<T extends object, K extends keyof T>(obj: T, keys: K[]): {
524
571
  rest: Omit<T, K>;
525
572
  omitted: Pick<T, K>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "av6-core",
3
- "version": "1.7.14",
3
+ "version": "1.7.15",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.mjs",
6
6
  "types": "dist/index.d.ts",