import { HttpService } from '@nestjs/axios';
import { TransactionStatus, User } from 'generated/prisma/client';
import { RequestUser } from 'src/auth/types/request-user.type';
import { BootstrapTableRequestDto } from 'src/commons/dto/bootstrap-table-request.dto';
import { BootstrapTableResponseDto } from 'src/commons/dto/bootstrap-table-response.dto';
import { RunumService } from 'src/commons/services/runum.service';
import { ExportQueryDto } from 'src/export/export.types';
import { NotesService } from 'src/note/notes.service';
import { PrismaService } from 'src/prisma/prisma.service';
import { StorageService } from 'src/storage/storage.service';
import { CancelTransactionDto } from './dto/cancel-transaction.dto';
import { CreatePaymentDto } from './dto/create-payment.dto';
import { CreateTransactionDto } from './dto/create-transaction.dto';
import { TransactionChartQueryDto } from './dto/transaction-chart-query.dto';
import { TransactionPerformanceQueryDto } from './dto/transaction-performance-query.dto';
import { TransactionSummaryQueryDto } from './dto/transaction-summary-query.dto';
import { UpdateTransactionDto } from './dto/update-transaction.dto';
import { ConfigService } from '@nestjs/config';
export declare class TransactionsService {
    private prisma;
    private storage;
    private runum;
    private notesService;
    private httpService;
    private configService;
    exportService: any;
    constructor(prisma: PrismaService, storage: StorageService, runum: RunumService, notesService: NotesService, httpService: HttpService, configService: ConfigService);
    private readonly logger;
    private readonly MAX_EXPORT_MONTHS;
    private readonly includeAll;
    private checkBranchAccess;
    private generateTrxCode;
    private normalizeValue;
    private aggregateTransactions;
    private buildAuditLogs;
    private computeChange;
    findAll(query: BootstrapTableRequestDto, user: any): Promise<BootstrapTableResponseDto<{
        branch: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            address: string;
            name: string;
            beginEffective: Date;
            endEffective: Date | null;
        };
        bank: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            name: string;
            status: import("generated/prisma/client").SettingStatus;
        } | null;
        customer: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            fullName: string;
            phoneNumber: string;
            ktpNumber: string | null;
            ktpPhotoUrl: string | null;
            address: string;
        };
        docs: {
            url: string;
            id: string;
            createdAt: Date;
            filename: string;
            mimetype: string;
            size: number;
            transactionId: string;
            order: number;
            type: import("generated/prisma/client").TransactionDocType;
        }[];
        createdByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        items: ({
            docs: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                type: string;
                transactionItemId: string;
            }[];
            images: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                itemId: string;
            }[];
        } & {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            itemCode: string | null;
            grossWeight: import("@prisma/client/runtime/client").Decimal;
            netWeight: import("@prisma/client/runtime/client").Decimal;
            caratId: string;
            pricePerGram: import("@prisma/client/runtime/client").Decimal;
            pricePerGramAt: Date;
            purityPercent: import("@prisma/client/runtime/client").Decimal;
            totalPrice: import("@prisma/client/runtime/client").Decimal;
            isAdjusted: boolean;
            itemTypeId: string;
            transactionId: string;
        })[];
        payments: ({
            transferUser: {
                email: string;
                id: string;
                firstName: string | null;
                lastName: string | null;
            };
        } & {
            id: string;
            createdAt: Date;
            transferDate: Date;
            proofUrl: string;
            filename: string;
            mimetype: string;
            size: number;
            transactionId: string;
            transferBy: string;
        })[];
        completedByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        headStoreUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
    } & {
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }>>;
    findOne(id: string): Promise<{
        notes: {
            id: string;
            createdAt: Date;
            createdBy: string;
            entityId: string;
            type: import("generated/prisma/client").NoteType;
            content: string;
            entityType: import("generated/prisma/client").NoteEntityType;
        }[];
        branch: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            address: string;
            name: string;
            beginEffective: Date;
            endEffective: Date | null;
        };
        bank: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            name: string;
            status: import("generated/prisma/client").SettingStatus;
        } | null;
        customer: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            fullName: string;
            phoneNumber: string;
            ktpNumber: string | null;
            ktpPhotoUrl: string | null;
            address: string;
        };
        docs: {
            url: string;
            id: string;
            createdAt: Date;
            filename: string;
            mimetype: string;
            size: number;
            transactionId: string;
            order: number;
            type: import("generated/prisma/client").TransactionDocType;
        }[];
        createdByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        items: ({
            docs: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                type: string;
                transactionItemId: string;
            }[];
            images: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                itemId: string;
            }[];
        } & {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            itemCode: string | null;
            grossWeight: import("@prisma/client/runtime/client").Decimal;
            netWeight: import("@prisma/client/runtime/client").Decimal;
            caratId: string;
            pricePerGram: import("@prisma/client/runtime/client").Decimal;
            pricePerGramAt: Date;
            purityPercent: import("@prisma/client/runtime/client").Decimal;
            totalPrice: import("@prisma/client/runtime/client").Decimal;
            isAdjusted: boolean;
            itemTypeId: string;
            transactionId: string;
        })[];
        payments: ({
            transferUser: {
                email: string;
                id: string;
                firstName: string | null;
                lastName: string | null;
            };
        } & {
            id: string;
            createdAt: Date;
            transferDate: Date;
            proofUrl: string;
            filename: string;
            mimetype: string;
            size: number;
            transactionId: string;
            transferBy: string;
        })[];
        completedByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        headStoreUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }>;
    getAuditLogsForTransaction(id: string, query: BootstrapTableRequestDto): Promise<BootstrapTableResponseDto<{
        changedByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        };
    } & {
        id: string;
        entityId: string;
        entityType: string;
        changedAt: Date;
        fieldName: string;
        oldValue: string | null;
        newValue: string | null;
        headerEntityType: string | null;
        headerEntityId: string | null;
        changedBy: string;
    }>>;
    update(id: string, dto: UpdateTransactionDto, user: User): Promise<({
        items: ({
            images: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                itemId: string;
            }[];
        } & {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            itemCode: string | null;
            grossWeight: import("@prisma/client/runtime/client").Decimal;
            netWeight: import("@prisma/client/runtime/client").Decimal;
            caratId: string;
            pricePerGram: import("@prisma/client/runtime/client").Decimal;
            pricePerGramAt: Date;
            purityPercent: import("@prisma/client/runtime/client").Decimal;
            totalPrice: import("@prisma/client/runtime/client").Decimal;
            isAdjusted: boolean;
            itemTypeId: string;
            transactionId: string;
        })[];
    } & {
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }) | null>;
    remove(id: string): Promise<{
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }>;
    cancel(id: string, dto: CancelTransactionDto, user: User): Promise<{
        items: ({
            images: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                itemId: string;
            }[];
        } & {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            itemCode: string | null;
            grossWeight: import("@prisma/client/runtime/client").Decimal;
            netWeight: import("@prisma/client/runtime/client").Decimal;
            caratId: string;
            pricePerGram: import("@prisma/client/runtime/client").Decimal;
            pricePerGramAt: Date;
            purityPercent: import("@prisma/client/runtime/client").Decimal;
            totalPrice: import("@prisma/client/runtime/client").Decimal;
            isAdjusted: boolean;
            itemTypeId: string;
            transactionId: string;
        })[];
    } & {
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }>;
    getSummary(filter?: {
        branchId?: string;
    }): Promise<Record<string, number>>;
    create(dto: CreateTransactionDto, user: User): Promise<({
        branch: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            address: string;
            name: string;
            beginEffective: Date;
            endEffective: Date | null;
        };
        bank: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            name: string;
            status: import("generated/prisma/client").SettingStatus;
        } | null;
        customer: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            fullName: string;
            phoneNumber: string;
            ktpNumber: string | null;
            ktpPhotoUrl: string | null;
            address: string;
        };
        docs: {
            url: string;
            id: string;
            createdAt: Date;
            filename: string;
            mimetype: string;
            size: number;
            transactionId: string;
            order: number;
            type: import("generated/prisma/client").TransactionDocType;
        }[];
        createdByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        items: ({
            docs: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                type: string;
                transactionItemId: string;
            }[];
            images: {
                url: string;
                id: string;
                createdAt: Date;
                filename: string;
                mimetype: string;
                size: number;
                order: number;
                itemId: string;
            }[];
        } & {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            itemCode: string | null;
            grossWeight: import("@prisma/client/runtime/client").Decimal;
            netWeight: import("@prisma/client/runtime/client").Decimal;
            caratId: string;
            pricePerGram: import("@prisma/client/runtime/client").Decimal;
            pricePerGramAt: Date;
            purityPercent: import("@prisma/client/runtime/client").Decimal;
            totalPrice: import("@prisma/client/runtime/client").Decimal;
            isAdjusted: boolean;
            itemTypeId: string;
            transactionId: string;
        })[];
        payments: ({
            transferUser: {
                email: string;
                id: string;
                firstName: string | null;
                lastName: string | null;
            };
        } & {
            id: string;
            createdAt: Date;
            transferDate: Date;
            proofUrl: string;
            filename: string;
            mimetype: string;
            size: number;
            transactionId: string;
            transferBy: string;
        })[];
        completedByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        headStoreUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
    } & {
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }) | null>;
    addPayment(id: string, dto: CreatePaymentDto, user: User): Promise<{
        id: string;
        createdAt: Date;
        transferDate: Date;
        proofUrl: string;
        filename: string;
        mimetype: string;
        size: number;
        transactionId: string;
        transferBy: string;
    }>;
    complete(id: string, note: string, user: User): Promise<{
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    }>;
    getTransactionsForExport(query: ExportQueryDto, user: any): Promise<({
        branch: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            address: string;
            name: string;
            beginEffective: Date;
            endEffective: Date | null;
        };
        bank: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            name: string;
            status: import("generated/prisma/client").SettingStatus;
        } | null;
        customer: {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            code: string;
            fullName: string;
            phoneNumber: string;
            ktpNumber: string | null;
            ktpPhotoUrl: string | null;
            address: string;
        };
        createdByUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
        items: ({
            itemType: {
                id: string;
                createdAt: Date;
                modifiedAt: Date;
                code: string;
                name: string;
                desc: string | null;
                status: import("generated/prisma/client").SettingStatus;
            };
        } & {
            id: string;
            createdAt: Date;
            modifiedAt: Date;
            itemCode: string | null;
            grossWeight: import("@prisma/client/runtime/client").Decimal;
            netWeight: import("@prisma/client/runtime/client").Decimal;
            caratId: string;
            pricePerGram: import("@prisma/client/runtime/client").Decimal;
            pricePerGramAt: Date;
            purityPercent: import("@prisma/client/runtime/client").Decimal;
            totalPrice: import("@prisma/client/runtime/client").Decimal;
            isAdjusted: boolean;
            itemTypeId: string;
            transactionId: string;
        })[];
        headStoreUser: {
            email: string;
            id: string;
            firstName: string | null;
            lastName: string | null;
        } | null;
    } & {
        id: string;
        createdAt: Date;
        modifiedAt: Date | null;
        status: TransactionStatus;
        branchId: string;
        trxCode: string;
        totalGrossWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalNetWeight: import("@prisma/client/runtime/client").Decimal | null;
        totalAmount: import("@prisma/client/runtime/client").Decimal | null;
        bankAccountNo: string | null;
        bankAccountName: string | null;
        referralSource: string | null;
        knowsFounder: boolean | null;
        cancellationReason: string | null;
        cancelledBy: string | null;
        cancelledAt: Date | null;
        completedAt: Date | null;
        customerId: string;
        bankId: string | null;
        createdBy: string | null;
        modifiedBy: string | null;
        completedBy: string | null;
        headStoreId: string | null;
    })[]>;
    generateItemId(): Promise<string>;
    getAnalyticsChart(query: TransactionChartQueryDto, user: RequestUser): Promise<{
        labels: string[];
        series: {
            transactionCount: {
                success: number[];
                bounce: number[];
            };
            totalAmount: {
                success: number[];
                bounce: number[];
            };
            totalNetWeight: {
                success: number[];
                bounce: number[];
            };
        };
    }>;
    getAnalyticsSummary(query: TransactionSummaryQueryDto, user: RequestUser): Promise<{
        transactionCount: {
            currentPeriod: {
                start: Date;
                end: Date;
                success: number;
                bounce: number;
            };
            previousPeriod: {
                start: Date;
                end: Date;
                success: number;
                bounce: number;
            };
            changes: {
                success: {
                    value: number;
                    percent: number | null;
                    trend: "flat" | "up" | "down";
                };
                bounce: {
                    value: number;
                    percent: number | null;
                    trend: "flat" | "up" | "down";
                };
            };
        };
        totalAmount: {
            currentPeriod: {
                start: Date;
                end: Date;
                success: number;
                bounce: number;
            };
            previousPeriod: {
                start: Date;
                end: Date;
                success: number;
                bounce: number;
            };
            changes: {
                success: {
                    value: number;
                    percent: number | null;
                    trend: "flat" | "up" | "down";
                };
                bounce: {
                    value: number;
                    percent: number | null;
                    trend: "flat" | "up" | "down";
                };
            };
        };
        totalNetWeight: {
            currentPeriod: {
                start: Date;
                end: Date;
                success: number;
                bounce: number;
            };
            previousPeriod: {
                start: Date;
                end: Date;
                success: number;
                bounce: number;
            };
            changes: {
                success: {
                    value: number;
                    percent: number | null;
                    trend: "flat" | "up" | "down";
                };
                bounce: {
                    value: number;
                    percent: number | null;
                    trend: "flat" | "up" | "down";
                };
            };
        };
    }>;
    getPerformanceSummary(query: TransactionPerformanceQueryDto, user: RequestUser): Promise<{
        transactionCount: {
            created: number;
            completed: number;
            canceled: number;
            rejected: number;
        };
        totalGrossWeight: {
            created: number;
            completed: number;
            canceled: number;
            rejected: number;
        };
        totalAmount: {
            created: number;
            completed: number;
            canceled: number;
            rejected: number;
        };
    }>;
    getCancellationReasons(query: TransactionPerformanceQueryDto, user: RequestUser): Promise<{
        reason: string;
        count: number;
    }[]>;
    getPerformanceChart(query: TransactionChartQueryDto, user: RequestUser): Promise<{
        labels: number[];
        series: {
            transactionCount: {
                created: number[];
                success: number[];
                canceled: number[];
            };
            totalGrossWeight: {
                created: number[];
                success: number[];
                canceled: number[];
            };
            totalAmount: {
                created: number[];
                success: number[];
                canceled: number[];
            };
            sla: {
                open: number[];
                waitingPayment: number[];
                paidWaitingHsReview: number[];
                completed: number[];
            };
        };
    }>;
}
