import { SaleRepository } from "../repositories/SaleRepository.js";
import { PurchaseRepository } from "../repositories/PurchaseRepository.js";
import { Prisma } from "../generated/prisma/client.js";
import type { Response } from "express";
import { ShopRepository } from "../repositories/ShopRepository.js";
import { UpiRepository } from "../repositories/UpiRepository.js";
export declare class SaleService {
    private readonly saleRepository;
    private readonly shopRepository;
    private readonly upiRepository;
    private readonly purchaseRepository;
    constructor(saleRepository?: SaleRepository, shopRepository?: ShopRepository, upiRepository?: UpiRepository, purchaseRepository?: PurchaseRepository);
    private generateInvoiceNoCandidate;
    createSale(data: any): Promise<{
        customer: {
            name: string;
        } | null;
        items: {
            id: bigint;
            total: Prisma.Decimal;
            createdAt: Date;
            updatedAt: Date;
            createdBy: bigint | null;
            bags: Prisma.Decimal | null;
            quantity: Prisma.Decimal;
            costPerUnit: Prisma.Decimal;
            saleId: bigint;
            purchaseId: bigint;
            saleUnit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
            sellingRate: Prisma.Decimal;
        }[];
    } & {
        id: bigint;
        createdAt: Date;
        updatedAt: Date;
        createdBy: bigint | null;
        deletedAt: Date | null;
        remarks: string | null;
        isWhatsappMessageSent: boolean;
        grandTotal: Prisma.Decimal;
        balanceAmount: Prisma.Decimal;
        invoiceNo: string;
        customerId: bigint | null;
        walkInName: string | null;
        walkInMobile: string | null;
        invoiceDate: Date;
        subTotal: Prisma.Decimal;
        discount: Prisma.Decimal;
        freightCharge: Prisma.Decimal;
        receivedAmount: Prisma.Decimal;
        cashAmount: Prisma.Decimal;
        upiAmount: Prisma.Decimal;
        bankAmount: Prisma.Decimal;
        paymentStatus: import("../generated/prisma/index.js").$Enums.SalePaymentStatus;
        images: Prisma.JsonValue | null;
        invoiceDownloadToken: string;
    }>;
    updateSale(id: bigint, data: any): Promise<{
        customer: {
            name: string;
        } | null;
        items: {
            id: bigint;
            total: Prisma.Decimal;
            createdAt: Date;
            updatedAt: Date;
            createdBy: bigint | null;
            bags: Prisma.Decimal | null;
            quantity: Prisma.Decimal;
            costPerUnit: Prisma.Decimal;
            saleId: bigint;
            purchaseId: bigint;
            saleUnit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
            sellingRate: Prisma.Decimal;
        }[];
    } & {
        id: bigint;
        createdAt: Date;
        updatedAt: Date;
        createdBy: bigint | null;
        deletedAt: Date | null;
        remarks: string | null;
        isWhatsappMessageSent: boolean;
        grandTotal: Prisma.Decimal;
        balanceAmount: Prisma.Decimal;
        invoiceNo: string;
        customerId: bigint | null;
        walkInName: string | null;
        walkInMobile: string | null;
        invoiceDate: Date;
        subTotal: Prisma.Decimal;
        discount: Prisma.Decimal;
        freightCharge: Prisma.Decimal;
        receivedAmount: Prisma.Decimal;
        cashAmount: Prisma.Decimal;
        upiAmount: Prisma.Decimal;
        bankAmount: Prisma.Decimal;
        paymentStatus: import("../generated/prisma/index.js").$Enums.SalePaymentStatus;
        images: Prisma.JsonValue | null;
        invoiceDownloadToken: string;
    }>;
    cancelSale(id: bigint): Promise<{
        id: bigint;
        createdAt: Date;
        updatedAt: Date;
        createdBy: bigint | null;
        deletedAt: Date | null;
        remarks: string | null;
        isWhatsappMessageSent: boolean;
        grandTotal: Prisma.Decimal;
        balanceAmount: Prisma.Decimal;
        invoiceNo: string;
        customerId: bigint | null;
        walkInName: string | null;
        walkInMobile: string | null;
        invoiceDate: Date;
        subTotal: Prisma.Decimal;
        discount: Prisma.Decimal;
        freightCharge: Prisma.Decimal;
        receivedAmount: Prisma.Decimal;
        cashAmount: Prisma.Decimal;
        upiAmount: Prisma.Decimal;
        bankAmount: Prisma.Decimal;
        paymentStatus: import("../generated/prisma/index.js").$Enums.SalePaymentStatus;
        images: Prisma.JsonValue | null;
        invoiceDownloadToken: string;
    }>;
    private enrichSaleWithReturns;
    getSales(page?: number, limit?: number, customerId?: bigint, dateFromStr?: string, dateToStr?: string, search?: string, saleType?: string): Promise<{
        data: any[];
        meta: {
            total: number;
            page: number;
            limit: number;
            totalPages: number;
            summary: {
                totalSubTotal: number;
                totalGrandTotal: number;
                totalReceivedAmount: number;
                totalBalanceAmount: number;
                totalCashAmount: number;
                totalUpiAmount: number;
                totalBankAmount: number;
            };
        };
    }>;
    getSaleById(id: bigint): Promise<any>;
    getAvailableLots(vegetableId?: bigint): Promise<{
        id: string;
        lotNo: string;
        batchIndex: number;
        batchLabel: string;
        unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
        weightPerBag: Prisma.Decimal | null;
        costPerUnit: Prisma.Decimal;
        remainingQuantity: Prisma.Decimal;
        remainingBags: Prisma.Decimal;
        arrivalDate: Date | null;
        purchaseDate: Date;
        vegetable: {
            name: string;
            id: bigint;
            isFlexible: boolean;
        };
        supplier: {
            name: string;
        } | null;
    }[]>;
    getSaleMeta(): Promise<{
        customers: {
            name: string;
            id: bigint;
            outstandingBalance: Prisma.Decimal;
        }[];
        vegetables: {
            name: string;
            id: bigint;
        }[];
    }>;
    getSalesForExport(dateFromStr?: string, dateToStr?: string, search?: string, saleType?: string): Promise<any[]>;
    generateInvoice(id: bigint, res: Response, options?: {
        lang: string;
        printSign: boolean;
    }): Promise<void>;
    sendWhatsappInvoice(saleId: bigint): Promise<void>;
}
//# sourceMappingURL=SaleService.d.ts.map