import { Prisma, PurchaseUnit } from "../generated/prisma/client.js";
export declare class RetailStockService {
    allocateStock(data: {
        purchaseId: bigint;
        allocatedUnit: PurchaseUnit;
        allocatedQty: Prisma.Decimal | number | string;
        allocatedKg?: Prisma.Decimal | number | string;
        allocationDate: Date;
        remarks?: string | undefined;
        createdBy: bigint;
    }): Promise<{
        id: bigint;
        createdAt: Date;
        updatedAt: Date;
        createdBy: bigint | null;
        deletedAt: Date | null;
        remarks: string | null;
        lotNo: string;
        bags: Prisma.Decimal | null;
        quantity: Prisma.Decimal;
        costPerUnit: Prisma.Decimal;
        remainingQuantity: Prisma.Decimal;
        remainingBags: Prisma.Decimal | null;
        purchaseId: bigint;
        allocatedUnit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
        allocatedQty: Prisma.Decimal;
        allocationDate: Date;
    }>;
    getAvailableLots(vegetableId?: bigint): Promise<{
        unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
        id: bigint;
        vegetable: {
            name: string;
            id: bigint;
        };
        supplier: {
            name: string;
        } | null;
        purchaseDate: Date;
        cashSupplierName: string | null;
        lotNo: string;
        rateType: import("../generated/prisma/index.js").$Enums.RateType;
        weightPerBag: Prisma.Decimal | null;
        costPerUnit: Prisma.Decimal;
        arrivalDate: Date | null;
        remainingQuantity: Prisma.Decimal;
        remainingBags: Prisma.Decimal;
    }[]>;
    getAllocations(page?: number, limit?: number, search?: string): Promise<{
        data: {
            id: string;
            purchaseId: string;
            createdBy: string | undefined;
            purchase: {
                id: string;
                supplierId: string | null;
                vegetableId: string;
                createdBy: string | undefined;
                supplier: {
                    id: string;
                    stateId: string;
                    districtId: string;
                    createdBy: string | undefined;
                    name: string;
                    address: string | null;
                    status: boolean;
                    createdAt: Date;
                    updatedAt: Date;
                    mobileNo: string;
                    tamilName: string | null;
                    openingBalance: Prisma.Decimal;
                    outstandingBalance: Prisma.Decimal;
                    deletedAt: Date | null;
                } | null;
                vegetable: {
                    id: string;
                    createdBy: string | undefined;
                    name: string;
                    status: boolean;
                    createdAt: Date;
                    updatedAt: Date;
                    tamilName: string | null;
                    hindiName: string | null;
                    kannadaName: string | null;
                    malayalamName: string | null;
                    teluguName: string | null;
                    hsnCode: string | null;
                    isFlexible: boolean;
                } | null;
                unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
                status: import("../generated/prisma/index.js").$Enums.PurchaseStatus;
                createdAt: Date;
                updatedAt: Date;
                deletedAt: Date | null;
                remarks: string | null;
                purchaseDate: Date;
                billNo: string | null;
                cashSupplierName: string | null;
                lotNo: string;
                purchaseType: import("../generated/prisma/index.js").$Enums.PurchaseType;
                rateType: import("../generated/prisma/index.js").$Enums.RateType;
                bags: Prisma.Decimal;
                weightPerBag: Prisma.Decimal | null;
                quantity: Prisma.Decimal;
                ratePerUnit: Prisma.Decimal;
                freight: Prisma.Decimal;
                extraFreight: Prisma.Decimal;
                associationFee: Prisma.Decimal;
                unloadingFee: Prisma.Decimal;
                miscellaneousFee: Prisma.Decimal;
                totalFreight: Prisma.Decimal;
                transportFee: Prisma.Decimal;
                loadingUnloadingFee: Prisma.Decimal;
                otherCharges: Prisma.Decimal;
                thaiyalCharges: Prisma.Decimal;
                extraCharges: Prisma.Decimal;
                goodsTotal: Prisma.Decimal;
                surchargeTotal: Prisma.Decimal;
                costPerUnit: Prisma.Decimal;
                grandTotal: Prisma.Decimal;
                dateOfDespatch: Date | null;
                arrivalDate: Date | null;
                placeOfDespatch: string | null;
                placeOfArrival: string | null;
                truckNo: string | null;
                agentName: string | null;
                advanceAmount: Prisma.Decimal;
                balanceAmount: Prisma.Decimal;
                remainingQuantity: Prisma.Decimal;
                remainingBags: Prisma.Decimal;
                closedAt: Date | null;
            } | null;
            createdByUser: {
                name: string;
            } | null;
            createdAt: Date;
            updatedAt: Date;
            deletedAt: Date | null;
            remarks: string | null;
            lotNo: string;
            bags: Prisma.Decimal | null;
            quantity: Prisma.Decimal;
            costPerUnit: Prisma.Decimal;
            remainingQuantity: Prisma.Decimal;
            remainingBags: Prisma.Decimal | null;
            allocatedUnit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
            allocatedQty: Prisma.Decimal;
            allocationDate: Date;
        }[];
        meta: {
            total: number;
            page: number;
            limit: number;
            totalPages: number;
        };
    }>;
    /**
     * Returns current retail stock levels, grouped by lotNo.
     * Each row is the SUM of all RetailStock allocations for that lotNo.
     * Used for the "Current Stock" tab on the Retail Stock page.
     */
    getRetailStockSummary(): Promise<{
        lotNo: string;
        purchaseId: string;
        purchaseLotNo: string | null;
        vegetable: {
            name: string;
            id: bigint;
            isFlexible: boolean;
        } | null;
        isFlexible: boolean;
        supplier: {
            name: string;
        } | null;
        cashSupplierName: string | null;
        unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit | null;
        weightPerBag: Prisma.Decimal | null;
        totalAllocatedQty: Prisma.Decimal | null;
        totalAllocatedKg: Prisma.Decimal | null;
        totalAllocatedBags: Prisma.Decimal | null;
        remainingQuantity: Prisma.Decimal | null;
        remainingBags: Prisma.Decimal | null;
        movementCount: number;
    }[]>;
    /**
     * Manually closes a flexible retail lot or allocation by depleting remaining quantity and bags to 0.
     */
    closeRetailLot(params: {
        lotNo?: string | undefined;
        id?: bigint | undefined;
        purchaseId?: bigint | undefined;
    }): Promise<{
        success: boolean;
        message: string;
    }>;
    /**
     * Returns paginated wholesale → retail stock movement history.
     * Each row is a single RetailStock allocation event.
     * Filterable by lotNo for drill-down from Current Stock tab.
     */
    getStockMovements(page?: number, limit?: number, lotNo?: string): Promise<{
        data: {
            id: string;
            purchaseId: string;
            lotNo: string;
            allocatedUnit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
            allocatedQty: Prisma.Decimal;
            quantity: Prisma.Decimal;
            bags: Prisma.Decimal | null;
            remainingQuantity: Prisma.Decimal;
            remainingBags: Prisma.Decimal | null;
            costPerUnit: Prisma.Decimal;
            allocationDate: Date;
            remarks: string | null;
            createdAt: Date;
            createdByUser: {
                name: string;
            } | null;
            purchase: {
                id: string;
                vegetable: {
                    id: string;
                    name: string;
                } | null;
                unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
                supplier: {
                    name: string;
                } | null;
                lotNo: string;
                weightPerBag: Prisma.Decimal | null;
            } | null;
        }[];
        meta: {
            total: number;
            page: number;
            limit: number;
            totalPages: number;
        };
    }>;
    /**
     * Returns retail stock lots that still have remaining quantity > 0.
     * Used to populate the "Select Retail Lot" dropdown in the retail sale modal.
     */
    getAvailableRetailLots(vegetableId?: bigint): Promise<{
        lotNo: string;
        purchaseId: string;
        vegetable: {
            name: string;
            id: bigint;
            isFlexible: boolean;
        };
        unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
        rateType: import("../generated/prisma/index.js").$Enums.RateType;
        weightPerBag: Prisma.Decimal | null;
        costPerUnit: Prisma.Decimal;
        isFlexible: boolean;
        remainingQuantity: Prisma.Decimal | null;
        remainingBags: Prisma.Decimal | null;
    }[]>;
    recordSpoilage(data: {
        retailAllocationId?: bigint;
        lotNo?: string;
        quantity: number;
        spoilageDate: Date;
        reason?: string;
        remarks?: string;
        createdBy: bigint;
    }): Promise<{
        id: string;
        retailStockId: string;
        quantity: Prisma.Decimal;
        spoilageDate: Date;
    }[]>;
    returnStock(data: {
        retailAllocationId?: bigint;
        purchaseId?: bigint;
        quantity: number;
        returnDate: Date;
        reason?: string;
        remarks?: string;
        returnUnit?: string;
        returnedBags?: number;
        createdBy: bigint;
    }): Promise<{
        retailStockId: string;
        purchaseId: any;
        returnedQuantity: Prisma.Decimal;
        returnedBags: any;
        returnDate: Date;
    }[]>;
    getRetailStockSpoilages(page?: number, limit?: number, vegetableId?: bigint, dateFrom?: Date, dateTo?: Date): Promise<{
        data: {
            id: string;
            retailStockId: string;
            retailStock: {
                id: string;
                purchaseId: string;
                purchase: {
                    id: string;
                    vegetable: {
                        id: string;
                        name: string;
                        status: boolean;
                        createdAt: Date;
                        updatedAt: Date;
                        tamilName: string | null;
                        createdBy: bigint | null;
                        hindiName: string | null;
                        kannadaName: string | null;
                        malayalamName: string | null;
                        teluguName: string | null;
                        hsnCode: string | null;
                        isFlexible: boolean;
                    } | null;
                    unit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
                    status: import("../generated/prisma/index.js").$Enums.PurchaseStatus;
                    createdAt: Date;
                    updatedAt: Date;
                    createdBy: bigint | null;
                    deletedAt: Date | null;
                    supplierId: bigint | null;
                    remarks: string | null;
                    purchaseDate: Date;
                    billNo: string | null;
                    cashSupplierName: string | null;
                    vegetableId: bigint;
                    lotNo: string;
                    purchaseType: import("../generated/prisma/index.js").$Enums.PurchaseType;
                    rateType: import("../generated/prisma/index.js").$Enums.RateType;
                    bags: Prisma.Decimal;
                    weightPerBag: Prisma.Decimal | null;
                    quantity: Prisma.Decimal;
                    ratePerUnit: Prisma.Decimal;
                    freight: Prisma.Decimal;
                    extraFreight: Prisma.Decimal;
                    associationFee: Prisma.Decimal;
                    unloadingFee: Prisma.Decimal;
                    miscellaneousFee: Prisma.Decimal;
                    totalFreight: Prisma.Decimal;
                    transportFee: Prisma.Decimal;
                    loadingUnloadingFee: Prisma.Decimal;
                    otherCharges: Prisma.Decimal;
                    thaiyalCharges: Prisma.Decimal;
                    extraCharges: Prisma.Decimal;
                    goodsTotal: Prisma.Decimal;
                    surchargeTotal: Prisma.Decimal;
                    costPerUnit: Prisma.Decimal;
                    grandTotal: Prisma.Decimal;
                    dateOfDespatch: Date | null;
                    arrivalDate: Date | null;
                    placeOfDespatch: string | null;
                    placeOfArrival: string | null;
                    truckNo: string | null;
                    agentName: string | null;
                    advanceAmount: Prisma.Decimal;
                    balanceAmount: Prisma.Decimal;
                    remainingQuantity: Prisma.Decimal;
                    remainingBags: Prisma.Decimal;
                    closedAt: Date | null;
                } | null;
                createdAt: Date;
                updatedAt: Date;
                createdBy: bigint | null;
                deletedAt: Date | null;
                remarks: string | null;
                lotNo: string;
                bags: Prisma.Decimal | null;
                quantity: Prisma.Decimal;
                costPerUnit: Prisma.Decimal;
                remainingQuantity: Prisma.Decimal;
                remainingBags: Prisma.Decimal | null;
                allocatedUnit: import("../generated/prisma/index.js").$Enums.PurchaseUnit;
                allocatedQty: Prisma.Decimal;
                allocationDate: Date;
            } | null;
            reason: string | null;
            createdAt: Date;
            updatedAt: Date;
            createdBy: bigint | null;
            remarks: string | null;
            quantity: Prisma.Decimal;
            spoilageDate: Date;
        }[];
        meta: {
            total: number;
            page: number;
            limit: number;
            totalPages: number;
        };
    }>;
}
//# sourceMappingURL=RetailStockService.d.ts.map