av6-core 1.7.16 → 1.7.18
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 +203 -1
- package/dist/index.d.ts +203 -1
- package/dist/index.js +232 -0
- package/dist/index.mjs +278 -16
- package/package.json +1 -1
- package/prisma-client.d.ts +16 -0
package/dist/index.d.mts
CHANGED
|
@@ -528,6 +528,14 @@ declare enum ApprovalStatus {
|
|
|
528
528
|
REJECTED = 3,
|
|
529
529
|
CANCELLED = 4
|
|
530
530
|
}
|
|
531
|
+
declare enum FlowType {
|
|
532
|
+
STATUS = 0,
|
|
533
|
+
CO_PAY = 1,
|
|
534
|
+
INDIVIDUAL_DISCOUNT = 2,
|
|
535
|
+
OVERALL_DISCOUNT = 3,
|
|
536
|
+
SPECIAL_DISCOUNT = 4,
|
|
537
|
+
REFUND = 5
|
|
538
|
+
}
|
|
531
539
|
type StepType = "MIN_MAX" | "NORMAL";
|
|
532
540
|
type ApprovalStep = {
|
|
533
541
|
id?: number;
|
|
@@ -544,6 +552,18 @@ type ApprovalStep = {
|
|
|
544
552
|
createdAt?: Date | string;
|
|
545
553
|
updatedAt?: Date | string;
|
|
546
554
|
};
|
|
555
|
+
type ApproverMapping = {
|
|
556
|
+
id?: number;
|
|
557
|
+
staffId?: number | null;
|
|
558
|
+
stepId: number;
|
|
559
|
+
ccId: number;
|
|
560
|
+
roleId?: number | null;
|
|
561
|
+
isActive?: boolean;
|
|
562
|
+
createdBy?: number | null;
|
|
563
|
+
updatedBy?: number | null;
|
|
564
|
+
createdAt?: Date | string;
|
|
565
|
+
updatedAt?: Date | string;
|
|
566
|
+
};
|
|
547
567
|
type ApprovalInstance = {
|
|
548
568
|
id?: number;
|
|
549
569
|
flowId: number;
|
|
@@ -561,6 +581,28 @@ type ApprovalInstance = {
|
|
|
561
581
|
createdAt?: Date | string;
|
|
562
582
|
updatedAt?: Date | string;
|
|
563
583
|
};
|
|
584
|
+
type ApprovalFlow = {
|
|
585
|
+
name: string;
|
|
586
|
+
id: number;
|
|
587
|
+
subjectType: string;
|
|
588
|
+
service: string;
|
|
589
|
+
isActive: boolean;
|
|
590
|
+
createdBy: number | null;
|
|
591
|
+
updatedBy: number | null;
|
|
592
|
+
createdAt: Date;
|
|
593
|
+
updatedAt: Date;
|
|
594
|
+
flowType: FlowType;
|
|
595
|
+
};
|
|
596
|
+
type ApprovalAction = {
|
|
597
|
+
id: number;
|
|
598
|
+
isActive: boolean;
|
|
599
|
+
level: number;
|
|
600
|
+
instanceId: number;
|
|
601
|
+
actedBy: number;
|
|
602
|
+
statusAfter: ApprovalStatus;
|
|
603
|
+
comment: string | null;
|
|
604
|
+
actedAt: Date;
|
|
605
|
+
};
|
|
564
606
|
type LevelReadyEvt = {
|
|
565
607
|
instanceId: number;
|
|
566
608
|
subjectType: string;
|
|
@@ -583,6 +625,24 @@ declare global {
|
|
|
583
625
|
"approval:REJECTED": (i: ApprovalInstance) => void;
|
|
584
626
|
}
|
|
585
627
|
}
|
|
628
|
+
interface CreateApprovalFlow {
|
|
629
|
+
subjectType: string;
|
|
630
|
+
name: string;
|
|
631
|
+
}
|
|
632
|
+
interface UpdateApprovalFlow extends CreateApprovalFlow {
|
|
633
|
+
id: number;
|
|
634
|
+
}
|
|
635
|
+
interface IApprovalStep {
|
|
636
|
+
id?: number;
|
|
637
|
+
flowId: number;
|
|
638
|
+
subjectType: string;
|
|
639
|
+
}
|
|
640
|
+
type FlowWithStepsResponse = ApprovalFlow & {
|
|
641
|
+
steps: ApprovalStep[];
|
|
642
|
+
};
|
|
643
|
+
interface FlowWithSelectedStepResponse extends ApprovalFlow {
|
|
644
|
+
step: ApprovalStep | null;
|
|
645
|
+
}
|
|
586
646
|
interface ActInput {
|
|
587
647
|
instanceId: number;
|
|
588
648
|
approverId: number;
|
|
@@ -590,6 +650,16 @@ interface ActInput {
|
|
|
590
650
|
ccId: number;
|
|
591
651
|
comment?: string;
|
|
592
652
|
}
|
|
653
|
+
interface RawFlowWithSelectedStepResponse {
|
|
654
|
+
flowId: number;
|
|
655
|
+
stepId: number;
|
|
656
|
+
level: number;
|
|
657
|
+
minAmount: number;
|
|
658
|
+
maxAmount: number;
|
|
659
|
+
stepType: string;
|
|
660
|
+
ccId: number;
|
|
661
|
+
service: string;
|
|
662
|
+
}
|
|
593
663
|
interface StartFlowReq {
|
|
594
664
|
service: string;
|
|
595
665
|
subjectType: string;
|
|
@@ -600,6 +670,126 @@ interface StartFlowReq {
|
|
|
600
670
|
level?: number;
|
|
601
671
|
extra?: Record<string, string | number | boolean | null>;
|
|
602
672
|
}
|
|
673
|
+
interface NotificationEvent {
|
|
674
|
+
instanceId: number;
|
|
675
|
+
subjectType: string;
|
|
676
|
+
service: string;
|
|
677
|
+
subjectId: number;
|
|
678
|
+
level: number;
|
|
679
|
+
ccId: number;
|
|
680
|
+
approvers: ApproverMapping[];
|
|
681
|
+
}
|
|
682
|
+
interface CommonApproveReq {
|
|
683
|
+
service: string;
|
|
684
|
+
subjectType: string;
|
|
685
|
+
id: number;
|
|
686
|
+
comment?: string;
|
|
687
|
+
ccId: number;
|
|
688
|
+
approverId: number;
|
|
689
|
+
approveType: "APPROVE" | "REJECT";
|
|
690
|
+
}
|
|
691
|
+
interface CommonGetApprovalActionReq {
|
|
692
|
+
service: string;
|
|
693
|
+
subjectType: string;
|
|
694
|
+
id: number;
|
|
695
|
+
}
|
|
696
|
+
interface GetPendingApprovalReq {
|
|
697
|
+
service: string;
|
|
698
|
+
ccId: number;
|
|
699
|
+
staffId: number;
|
|
700
|
+
}
|
|
701
|
+
interface IParentConfigJSON {
|
|
702
|
+
tableName: string;
|
|
703
|
+
approvedAt?: string;
|
|
704
|
+
approvedBy?: string;
|
|
705
|
+
approvalNote?: string;
|
|
706
|
+
status?: string;
|
|
707
|
+
refundAmount?: string;
|
|
708
|
+
discountType?: string;
|
|
709
|
+
discountValue?: string;
|
|
710
|
+
discountAmount?: string;
|
|
711
|
+
totalCopaymentAmount?: string;
|
|
712
|
+
isApproved?: string;
|
|
713
|
+
paymentStatus?: string;
|
|
714
|
+
}
|
|
715
|
+
interface IParentConfigData {
|
|
716
|
+
approvedAt?: string | null;
|
|
717
|
+
approvedBy?: string | null;
|
|
718
|
+
approvalNote?: string | null;
|
|
719
|
+
status?: string | null;
|
|
720
|
+
refundAmount?: number | null;
|
|
721
|
+
discountType?: string | null;
|
|
722
|
+
discountValue?: number | null;
|
|
723
|
+
discountAmount?: number | null;
|
|
724
|
+
totalCopaymentAmount?: number | null;
|
|
725
|
+
isApproved?: string | null;
|
|
726
|
+
paymentStatus?: string | null;
|
|
727
|
+
}
|
|
728
|
+
interface IChildConfigJSON {
|
|
729
|
+
tableName: string;
|
|
730
|
+
discountType?: string;
|
|
731
|
+
discountValue?: string;
|
|
732
|
+
discountAmount?: string;
|
|
733
|
+
copayValue?: string;
|
|
734
|
+
copayType?: string;
|
|
735
|
+
copayAmount?: string;
|
|
736
|
+
coPayModificationStatus?: string;
|
|
737
|
+
}
|
|
738
|
+
interface IChildConfigData {
|
|
739
|
+
discountType?: string | null;
|
|
740
|
+
discountValue?: number | null;
|
|
741
|
+
discountAmount?: number | null;
|
|
742
|
+
copayValue?: number | null;
|
|
743
|
+
copayType?: string | null;
|
|
744
|
+
copayAmount?: number | null;
|
|
745
|
+
coPayModificationStatus?: string | null;
|
|
746
|
+
}
|
|
747
|
+
interface ICommonApprovalUpdate {
|
|
748
|
+
id: number;
|
|
749
|
+
flowType: FlowType;
|
|
750
|
+
status?: string | null;
|
|
751
|
+
approvedAt?: string | null;
|
|
752
|
+
approvedBy?: string | null;
|
|
753
|
+
approvalNote?: string | null;
|
|
754
|
+
refundAmount?: number | null;
|
|
755
|
+
}
|
|
756
|
+
interface EventInstance {
|
|
757
|
+
subjectType: string;
|
|
758
|
+
service: string;
|
|
759
|
+
instanceId: number;
|
|
760
|
+
flowType: FlowType;
|
|
761
|
+
subjectId: number;
|
|
762
|
+
approverId: number;
|
|
763
|
+
step: ApprovalStep;
|
|
764
|
+
comment?: string;
|
|
765
|
+
}
|
|
766
|
+
interface ApprovalInstanceByUser {
|
|
767
|
+
id: number;
|
|
768
|
+
flowId: number;
|
|
769
|
+
subjectType: string;
|
|
770
|
+
service: string;
|
|
771
|
+
subjectId: number;
|
|
772
|
+
refNo: number;
|
|
773
|
+
currentStepId: number;
|
|
774
|
+
netTotal: number;
|
|
775
|
+
status: ApprovalStatus;
|
|
776
|
+
createdBy: string;
|
|
777
|
+
createdAt: Date;
|
|
778
|
+
level: number;
|
|
779
|
+
flowType: FlowType;
|
|
780
|
+
flowName: string;
|
|
781
|
+
extra?: string | null;
|
|
782
|
+
}
|
|
783
|
+
interface ApprovalActionDto extends Omit<ApprovalAction, "actedBy"> {
|
|
784
|
+
actedByDetails: EmployeeCache | null;
|
|
785
|
+
}
|
|
786
|
+
interface GetMyApprovalFlow extends Omit<CommonFilterWithDate, "sortBy"> {
|
|
787
|
+
staffId: number;
|
|
788
|
+
ccId: number;
|
|
789
|
+
service: string;
|
|
790
|
+
status?: ApprovalStatus[];
|
|
791
|
+
flowType?: FlowType;
|
|
792
|
+
}
|
|
603
793
|
interface ApprovalDeps {
|
|
604
794
|
helpers: Helpers;
|
|
605
795
|
logger: winston.Logger;
|
|
@@ -619,8 +809,20 @@ declare class ApprovalService {
|
|
|
619
809
|
act({ instanceId, approverId, action, ccId, comment }: ActInput): Promise<any>;
|
|
620
810
|
private emitEvents;
|
|
621
811
|
private assertPermission;
|
|
812
|
+
getAllApprovalFlow(input: GetMyApprovalFlow): Promise<PaginatedResponse<ApprovalInstanceByUser>>;
|
|
813
|
+
getApprovalActDetailsBySubjectId(subjectId: number, subjectType: string, service: string): Promise<ApprovalAction[]>;
|
|
622
814
|
}
|
|
623
815
|
|
|
816
|
+
declare const approvalRepository: (helpers: Helpers) => {
|
|
817
|
+
findMatchingFlow(tx: PrismaClient | Prisma.TransactionClient, type: string, service: string, ccId: number, netTotal: number, level?: number): Promise<RawFlowWithSelectedStepResponse | null>;
|
|
818
|
+
getAllApprovalFlow(tx: PrismaClient | Prisma.TransactionClient, { staffId, ccId, pageNo, pageSize, service, sortDir, startDate, endDate, searchText, status, flowType, }: GetMyApprovalFlow): Promise<PaginatedResponse<ApprovalInstanceByUser>>;
|
|
819
|
+
getApprovalActDetailsBySubjectId(tx: PrismaClient | Prisma.TransactionClient, { subjectId, subjectType, service }: {
|
|
820
|
+
subjectId: number;
|
|
821
|
+
subjectType: string;
|
|
822
|
+
service: string;
|
|
823
|
+
}): Promise<any>;
|
|
824
|
+
};
|
|
825
|
+
|
|
624
826
|
declare function customOmit<T extends object, K extends keyof T>(obj: T, keys: K[]): {
|
|
625
827
|
rest: Omit<T, K>;
|
|
626
828
|
omitted: Pick<T, K>;
|
|
@@ -814,4 +1016,4 @@ declare class AuditProxy<Module extends string = "OPD" | "PROCEDURE" | "GENERAL_
|
|
|
814
1016
|
createAuditedService<T extends object>(serviceName: string, service: T): T;
|
|
815
1017
|
}
|
|
816
1018
|
|
|
817
|
-
export { ApprovalService, type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type BulkAtomicResult, type BulkConfig, type BulkConflictConfig, type BulkOnConflict, type CacheAdapter, type CalculationRes, type ColValue, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeepMerge, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedMap, type FixedSearchRequest, type FixedSearchRequestService, type Helpers, type ImportExcel, type ImportExcelRequestService, type LockUnlockParams, type LockUnlockRequestRepository, type LogicNode, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type Op, type PaginatedResponse, type PathToSelectWithSelect, type PathValue, type PathsToSelectWithSelect, type Presence, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type SingleValidationMapping, type SourcePath, type Store, type ToggleActive, type TxClient, type UINConfigDTO, type UINPreviewRequest, type UINSegment, type UINSegmentType, type UIN_RESET_POLICY, type UinDeps, type UnionToIntersection, type UniqueConfig, type UpdateConfigByCodeInput, type UpdateStatusRequestRepository, type UpdateUINConfigRequest, type ValidationErrorItem, commonService, convertArrayPatternToEachBlocksGeneric, customOmit, findDifferences, formatDatesDeep, fromTimestampToSqlDatetime, getDynamicValue, getNestedValue, getNestedValueV2, getPattern, interpolate, objectTo2DArray, renderEmailTemplate, renderTemplate, toNumberOrNull, toUINConfigDTO, uinConfigService, type updateStatusParams };
|
|
1019
|
+
export { type ActInput, type ApprovalAction, type ApprovalActionDto, type ApprovalDeps, type ApprovalFlow, type ApprovalInstance, type ApprovalInstanceByUser, ApprovalService, ApprovalStatus, type ApprovalStep, type ApproverMapping, type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type BulkAtomicResult, type BulkConfig, type BulkConflictConfig, type BulkOnConflict, type CacheAdapter, type CalculationRes, type ColValue, type CommonApproveReq, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonGetApprovalActionReq, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateApprovalFlow, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeepMerge, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type EventInstance, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedMap, type FixedSearchRequest, type FixedSearchRequestService, FlowType, type FlowWithSelectedStepResponse, type FlowWithStepsResponse, type GetMyApprovalFlow, type GetPendingApprovalReq, type Helpers, type IApprovalStep, type IChildConfigData, type IChildConfigJSON, type ICommonApprovalUpdate, type IParentConfigData, type IParentConfigJSON, type ImportExcel, type ImportExcelRequestService, type LevelDoneEvt, type LevelReadyEvt, type LockUnlockParams, type LockUnlockRequestRepository, type LogicNode, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type NotificationEvent, type Op, type PaginatedResponse, type PathToSelectWithSelect, type PathValue, type PathsToSelectWithSelect, type Presence, type PrismaTransactionClient, type RawFlowWithSelectedStepResponse, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type SingleValidationMapping, type SourcePath, type StartFlowReq, type StepType, type Store, type ToggleActive, type TxClient, type UINConfigDTO, type UINPreviewRequest, type UINSegment, type UINSegmentType, type UIN_RESET_POLICY, type UinDeps, type UnionToIntersection, type UniqueConfig, type UpdateApprovalFlow, type UpdateConfigByCodeInput, type UpdateStatusRequestRepository, type UpdateUINConfigRequest, type ValidationErrorItem, approvalRepository, commonService, convertArrayPatternToEachBlocksGeneric, customOmit, findDifferences, formatDatesDeep, fromTimestampToSqlDatetime, getDynamicValue, getNestedValue, getNestedValueV2, getPattern, interpolate, objectTo2DArray, renderEmailTemplate, renderTemplate, toNumberOrNull, toUINConfigDTO, uinConfigService, type updateStatusParams };
|
package/dist/index.d.ts
CHANGED
|
@@ -528,6 +528,14 @@ declare enum ApprovalStatus {
|
|
|
528
528
|
REJECTED = 3,
|
|
529
529
|
CANCELLED = 4
|
|
530
530
|
}
|
|
531
|
+
declare enum FlowType {
|
|
532
|
+
STATUS = 0,
|
|
533
|
+
CO_PAY = 1,
|
|
534
|
+
INDIVIDUAL_DISCOUNT = 2,
|
|
535
|
+
OVERALL_DISCOUNT = 3,
|
|
536
|
+
SPECIAL_DISCOUNT = 4,
|
|
537
|
+
REFUND = 5
|
|
538
|
+
}
|
|
531
539
|
type StepType = "MIN_MAX" | "NORMAL";
|
|
532
540
|
type ApprovalStep = {
|
|
533
541
|
id?: number;
|
|
@@ -544,6 +552,18 @@ type ApprovalStep = {
|
|
|
544
552
|
createdAt?: Date | string;
|
|
545
553
|
updatedAt?: Date | string;
|
|
546
554
|
};
|
|
555
|
+
type ApproverMapping = {
|
|
556
|
+
id?: number;
|
|
557
|
+
staffId?: number | null;
|
|
558
|
+
stepId: number;
|
|
559
|
+
ccId: number;
|
|
560
|
+
roleId?: number | null;
|
|
561
|
+
isActive?: boolean;
|
|
562
|
+
createdBy?: number | null;
|
|
563
|
+
updatedBy?: number | null;
|
|
564
|
+
createdAt?: Date | string;
|
|
565
|
+
updatedAt?: Date | string;
|
|
566
|
+
};
|
|
547
567
|
type ApprovalInstance = {
|
|
548
568
|
id?: number;
|
|
549
569
|
flowId: number;
|
|
@@ -561,6 +581,28 @@ type ApprovalInstance = {
|
|
|
561
581
|
createdAt?: Date | string;
|
|
562
582
|
updatedAt?: Date | string;
|
|
563
583
|
};
|
|
584
|
+
type ApprovalFlow = {
|
|
585
|
+
name: string;
|
|
586
|
+
id: number;
|
|
587
|
+
subjectType: string;
|
|
588
|
+
service: string;
|
|
589
|
+
isActive: boolean;
|
|
590
|
+
createdBy: number | null;
|
|
591
|
+
updatedBy: number | null;
|
|
592
|
+
createdAt: Date;
|
|
593
|
+
updatedAt: Date;
|
|
594
|
+
flowType: FlowType;
|
|
595
|
+
};
|
|
596
|
+
type ApprovalAction = {
|
|
597
|
+
id: number;
|
|
598
|
+
isActive: boolean;
|
|
599
|
+
level: number;
|
|
600
|
+
instanceId: number;
|
|
601
|
+
actedBy: number;
|
|
602
|
+
statusAfter: ApprovalStatus;
|
|
603
|
+
comment: string | null;
|
|
604
|
+
actedAt: Date;
|
|
605
|
+
};
|
|
564
606
|
type LevelReadyEvt = {
|
|
565
607
|
instanceId: number;
|
|
566
608
|
subjectType: string;
|
|
@@ -583,6 +625,24 @@ declare global {
|
|
|
583
625
|
"approval:REJECTED": (i: ApprovalInstance) => void;
|
|
584
626
|
}
|
|
585
627
|
}
|
|
628
|
+
interface CreateApprovalFlow {
|
|
629
|
+
subjectType: string;
|
|
630
|
+
name: string;
|
|
631
|
+
}
|
|
632
|
+
interface UpdateApprovalFlow extends CreateApprovalFlow {
|
|
633
|
+
id: number;
|
|
634
|
+
}
|
|
635
|
+
interface IApprovalStep {
|
|
636
|
+
id?: number;
|
|
637
|
+
flowId: number;
|
|
638
|
+
subjectType: string;
|
|
639
|
+
}
|
|
640
|
+
type FlowWithStepsResponse = ApprovalFlow & {
|
|
641
|
+
steps: ApprovalStep[];
|
|
642
|
+
};
|
|
643
|
+
interface FlowWithSelectedStepResponse extends ApprovalFlow {
|
|
644
|
+
step: ApprovalStep | null;
|
|
645
|
+
}
|
|
586
646
|
interface ActInput {
|
|
587
647
|
instanceId: number;
|
|
588
648
|
approverId: number;
|
|
@@ -590,6 +650,16 @@ interface ActInput {
|
|
|
590
650
|
ccId: number;
|
|
591
651
|
comment?: string;
|
|
592
652
|
}
|
|
653
|
+
interface RawFlowWithSelectedStepResponse {
|
|
654
|
+
flowId: number;
|
|
655
|
+
stepId: number;
|
|
656
|
+
level: number;
|
|
657
|
+
minAmount: number;
|
|
658
|
+
maxAmount: number;
|
|
659
|
+
stepType: string;
|
|
660
|
+
ccId: number;
|
|
661
|
+
service: string;
|
|
662
|
+
}
|
|
593
663
|
interface StartFlowReq {
|
|
594
664
|
service: string;
|
|
595
665
|
subjectType: string;
|
|
@@ -600,6 +670,126 @@ interface StartFlowReq {
|
|
|
600
670
|
level?: number;
|
|
601
671
|
extra?: Record<string, string | number | boolean | null>;
|
|
602
672
|
}
|
|
673
|
+
interface NotificationEvent {
|
|
674
|
+
instanceId: number;
|
|
675
|
+
subjectType: string;
|
|
676
|
+
service: string;
|
|
677
|
+
subjectId: number;
|
|
678
|
+
level: number;
|
|
679
|
+
ccId: number;
|
|
680
|
+
approvers: ApproverMapping[];
|
|
681
|
+
}
|
|
682
|
+
interface CommonApproveReq {
|
|
683
|
+
service: string;
|
|
684
|
+
subjectType: string;
|
|
685
|
+
id: number;
|
|
686
|
+
comment?: string;
|
|
687
|
+
ccId: number;
|
|
688
|
+
approverId: number;
|
|
689
|
+
approveType: "APPROVE" | "REJECT";
|
|
690
|
+
}
|
|
691
|
+
interface CommonGetApprovalActionReq {
|
|
692
|
+
service: string;
|
|
693
|
+
subjectType: string;
|
|
694
|
+
id: number;
|
|
695
|
+
}
|
|
696
|
+
interface GetPendingApprovalReq {
|
|
697
|
+
service: string;
|
|
698
|
+
ccId: number;
|
|
699
|
+
staffId: number;
|
|
700
|
+
}
|
|
701
|
+
interface IParentConfigJSON {
|
|
702
|
+
tableName: string;
|
|
703
|
+
approvedAt?: string;
|
|
704
|
+
approvedBy?: string;
|
|
705
|
+
approvalNote?: string;
|
|
706
|
+
status?: string;
|
|
707
|
+
refundAmount?: string;
|
|
708
|
+
discountType?: string;
|
|
709
|
+
discountValue?: string;
|
|
710
|
+
discountAmount?: string;
|
|
711
|
+
totalCopaymentAmount?: string;
|
|
712
|
+
isApproved?: string;
|
|
713
|
+
paymentStatus?: string;
|
|
714
|
+
}
|
|
715
|
+
interface IParentConfigData {
|
|
716
|
+
approvedAt?: string | null;
|
|
717
|
+
approvedBy?: string | null;
|
|
718
|
+
approvalNote?: string | null;
|
|
719
|
+
status?: string | null;
|
|
720
|
+
refundAmount?: number | null;
|
|
721
|
+
discountType?: string | null;
|
|
722
|
+
discountValue?: number | null;
|
|
723
|
+
discountAmount?: number | null;
|
|
724
|
+
totalCopaymentAmount?: number | null;
|
|
725
|
+
isApproved?: string | null;
|
|
726
|
+
paymentStatus?: string | null;
|
|
727
|
+
}
|
|
728
|
+
interface IChildConfigJSON {
|
|
729
|
+
tableName: string;
|
|
730
|
+
discountType?: string;
|
|
731
|
+
discountValue?: string;
|
|
732
|
+
discountAmount?: string;
|
|
733
|
+
copayValue?: string;
|
|
734
|
+
copayType?: string;
|
|
735
|
+
copayAmount?: string;
|
|
736
|
+
coPayModificationStatus?: string;
|
|
737
|
+
}
|
|
738
|
+
interface IChildConfigData {
|
|
739
|
+
discountType?: string | null;
|
|
740
|
+
discountValue?: number | null;
|
|
741
|
+
discountAmount?: number | null;
|
|
742
|
+
copayValue?: number | null;
|
|
743
|
+
copayType?: string | null;
|
|
744
|
+
copayAmount?: number | null;
|
|
745
|
+
coPayModificationStatus?: string | null;
|
|
746
|
+
}
|
|
747
|
+
interface ICommonApprovalUpdate {
|
|
748
|
+
id: number;
|
|
749
|
+
flowType: FlowType;
|
|
750
|
+
status?: string | null;
|
|
751
|
+
approvedAt?: string | null;
|
|
752
|
+
approvedBy?: string | null;
|
|
753
|
+
approvalNote?: string | null;
|
|
754
|
+
refundAmount?: number | null;
|
|
755
|
+
}
|
|
756
|
+
interface EventInstance {
|
|
757
|
+
subjectType: string;
|
|
758
|
+
service: string;
|
|
759
|
+
instanceId: number;
|
|
760
|
+
flowType: FlowType;
|
|
761
|
+
subjectId: number;
|
|
762
|
+
approverId: number;
|
|
763
|
+
step: ApprovalStep;
|
|
764
|
+
comment?: string;
|
|
765
|
+
}
|
|
766
|
+
interface ApprovalInstanceByUser {
|
|
767
|
+
id: number;
|
|
768
|
+
flowId: number;
|
|
769
|
+
subjectType: string;
|
|
770
|
+
service: string;
|
|
771
|
+
subjectId: number;
|
|
772
|
+
refNo: number;
|
|
773
|
+
currentStepId: number;
|
|
774
|
+
netTotal: number;
|
|
775
|
+
status: ApprovalStatus;
|
|
776
|
+
createdBy: string;
|
|
777
|
+
createdAt: Date;
|
|
778
|
+
level: number;
|
|
779
|
+
flowType: FlowType;
|
|
780
|
+
flowName: string;
|
|
781
|
+
extra?: string | null;
|
|
782
|
+
}
|
|
783
|
+
interface ApprovalActionDto extends Omit<ApprovalAction, "actedBy"> {
|
|
784
|
+
actedByDetails: EmployeeCache | null;
|
|
785
|
+
}
|
|
786
|
+
interface GetMyApprovalFlow extends Omit<CommonFilterWithDate, "sortBy"> {
|
|
787
|
+
staffId: number;
|
|
788
|
+
ccId: number;
|
|
789
|
+
service: string;
|
|
790
|
+
status?: ApprovalStatus[];
|
|
791
|
+
flowType?: FlowType;
|
|
792
|
+
}
|
|
603
793
|
interface ApprovalDeps {
|
|
604
794
|
helpers: Helpers;
|
|
605
795
|
logger: winston.Logger;
|
|
@@ -619,8 +809,20 @@ declare class ApprovalService {
|
|
|
619
809
|
act({ instanceId, approverId, action, ccId, comment }: ActInput): Promise<any>;
|
|
620
810
|
private emitEvents;
|
|
621
811
|
private assertPermission;
|
|
812
|
+
getAllApprovalFlow(input: GetMyApprovalFlow): Promise<PaginatedResponse<ApprovalInstanceByUser>>;
|
|
813
|
+
getApprovalActDetailsBySubjectId(subjectId: number, subjectType: string, service: string): Promise<ApprovalAction[]>;
|
|
622
814
|
}
|
|
623
815
|
|
|
816
|
+
declare const approvalRepository: (helpers: Helpers) => {
|
|
817
|
+
findMatchingFlow(tx: PrismaClient | Prisma.TransactionClient, type: string, service: string, ccId: number, netTotal: number, level?: number): Promise<RawFlowWithSelectedStepResponse | null>;
|
|
818
|
+
getAllApprovalFlow(tx: PrismaClient | Prisma.TransactionClient, { staffId, ccId, pageNo, pageSize, service, sortDir, startDate, endDate, searchText, status, flowType, }: GetMyApprovalFlow): Promise<PaginatedResponse<ApprovalInstanceByUser>>;
|
|
819
|
+
getApprovalActDetailsBySubjectId(tx: PrismaClient | Prisma.TransactionClient, { subjectId, subjectType, service }: {
|
|
820
|
+
subjectId: number;
|
|
821
|
+
subjectType: string;
|
|
822
|
+
service: string;
|
|
823
|
+
}): Promise<any>;
|
|
824
|
+
};
|
|
825
|
+
|
|
624
826
|
declare function customOmit<T extends object, K extends keyof T>(obj: T, keys: K[]): {
|
|
625
827
|
rest: Omit<T, K>;
|
|
626
828
|
omitted: Pick<T, K>;
|
|
@@ -814,4 +1016,4 @@ declare class AuditProxy<Module extends string = "OPD" | "PROCEDURE" | "GENERAL_
|
|
|
814
1016
|
createAuditedService<T extends object>(serviceName: string, service: T): T;
|
|
815
1017
|
}
|
|
816
1018
|
|
|
817
|
-
export { ApprovalService, type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type BulkAtomicResult, type BulkConfig, type BulkConflictConfig, type BulkOnConflict, type CacheAdapter, type CalculationRes, type ColValue, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeepMerge, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedMap, type FixedSearchRequest, type FixedSearchRequestService, type Helpers, type ImportExcel, type ImportExcelRequestService, type LockUnlockParams, type LockUnlockRequestRepository, type LogicNode, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type Op, type PaginatedResponse, type PathToSelectWithSelect, type PathValue, type PathsToSelectWithSelect, type Presence, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type SingleValidationMapping, type SourcePath, type Store, type ToggleActive, type TxClient, type UINConfigDTO, type UINPreviewRequest, type UINSegment, type UINSegmentType, type UIN_RESET_POLICY, type UinDeps, type UnionToIntersection, type UniqueConfig, type UpdateConfigByCodeInput, type UpdateStatusRequestRepository, type UpdateUINConfigRequest, type ValidationErrorItem, commonService, convertArrayPatternToEachBlocksGeneric, customOmit, findDifferences, formatDatesDeep, fromTimestampToSqlDatetime, getDynamicValue, getNestedValue, getNestedValueV2, getPattern, interpolate, objectTo2DArray, renderEmailTemplate, renderTemplate, toNumberOrNull, toUINConfigDTO, uinConfigService, type updateStatusParams };
|
|
1019
|
+
export { type ActInput, type ApprovalAction, type ApprovalActionDto, type ApprovalDeps, type ApprovalFlow, type ApprovalInstance, type ApprovalInstanceByUser, ApprovalService, ApprovalStatus, type ApprovalStep, type ApproverMapping, type AuditContext, type AuditContextProvider, AuditCore, type AuditLogPayload, AuditLogger, AuditProxy, type BulkAtomicResult, type BulkConfig, type BulkConflictConfig, type BulkOnConflict, type CacheAdapter, type CalculationRes, type ColValue, type CommonApproveReq, type CommonCreateRequestRepository, type CommonExcelRequest, type CommonFilterRequest, type CommonFilterWithDate, type CommonGetApprovalActionReq, type CommonServiceResponse, type CommonUpdateRequestRepository, type Config, type Context, type CreateApprovalFlow, type CreateUINConfigRequest, type CrudContext, type CrudDelegate, type DataType, type DeepMerge, type DeleteParams, type DeleteRequestRepository, type Deps, type DropdownRequest, type DropdownRequestService, type DtoFromMapping, type DtoNullOnMissing, type DynamicCreateInput, type DynamicCrudConfig, type DynamicShortCode, type DynamicUpdateInput, type EmitPayload, type EmployeeCache, type EventInstance, type ExcelConfig, type ExportExcel, type ExportExcelRequestService, type FetchRequest, type FetchRequestRepository, type FieldConfig, type FieldRules, type FieldType, type FixedMap, type FixedSearchRequest, type FixedSearchRequestService, FlowType, type FlowWithSelectedStepResponse, type FlowWithStepsResponse, type GetMyApprovalFlow, type GetPendingApprovalReq, type Helpers, type IApprovalStep, type IChildConfigData, type IChildConfigJSON, type ICommonApprovalUpdate, type IParentConfigData, type IParentConfigJSON, type ImportExcel, type ImportExcelRequestService, type LevelDoneEvt, type LevelReadyEvt, type LockUnlockParams, type LockUnlockRequestRepository, type LogicNode, type Mapper, type MergeAll, type NewFixedSearchRequest, type NewFixedSearchRequestService, type NewSearchRequest, NotificationEmitter, type NotificationEvent, type Op, type PaginatedResponse, type PathToSelectWithSelect, type PathValue, type PathsToSelectWithSelect, type Presence, type PrismaTransactionClient, type RawFlowWithSelectedStepResponse, type Recipient, type RelationConfig, type RelationStrategy, type RelationWriteConfig, type SearchRequest, type SearchRequestService, type ServiceCacheAdapter, type SingleValidationMapping, type SourcePath, type StartFlowReq, type StepType, type Store, type ToggleActive, type TxClient, type UINConfigDTO, type UINPreviewRequest, type UINSegment, type UINSegmentType, type UIN_RESET_POLICY, type UinDeps, type UnionToIntersection, type UniqueConfig, type UpdateApprovalFlow, type UpdateConfigByCodeInput, type UpdateStatusRequestRepository, type UpdateUINConfigRequest, type ValidationErrorItem, approvalRepository, commonService, convertArrayPatternToEachBlocksGeneric, customOmit, findDifferences, formatDatesDeep, fromTimestampToSqlDatetime, getDynamicValue, getNestedValue, getNestedValueV2, getPattern, interpolate, objectTo2DArray, renderEmailTemplate, renderTemplate, toNumberOrNull, toUINConfigDTO, uinConfigService, type updateStatusParams };
|