import { RawMaterial, RawMaterialCategory, RawMaterialVendor, UnitOfMeasure } from '../generated/prisma/index';
import { PrismaService } from '../prisma/prisma.service';
import { ImportCommitDto, ImportPreviewDto, PurchaseOrderEmailDto, PurchaseOrderWriteDto, RawMaterialCategoryWriteDto, RawMaterialQuery, RawMaterialSettingsWriteDto, RawMaterialVendorWriteDto, RawMaterialWriteDto, UnitOfMeasureWriteDto } from './raw-material.dto';
export declare class RawMaterialService {
    private readonly prisma;
    constructor(prisma: PrismaService);
    listMaterials(query: RawMaterialQuery): Promise<{
        items: {
            categoryName: string;
            categoryCode: string;
            uomName: string;
            uomCode: string;
            vendorName: string;
            vendorCode: string;
            reorderWarning: boolean;
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            description: string | null;
            costPerUnit: number;
            materialCode: string;
            materialName: string;
            categoryId: string | null;
            subType: string | null;
            uomId: string | null;
            hsnCode: string | null;
            taxCategory: string | null;
            gstPercent: number;
            vendorId: string | null;
            currency: string;
            batchNumber: string | null;
            qualityGrade: string | null;
            specificationStandard: string | null;
            storageConditions: string | null;
            currentStock: number;
            reorderLevel: number;
            reorderQuantity: number;
            stockType: string;
            lossWastePercent: number;
            accountLevelLink: string | null;
            imagePath: string | null;
            category?: RawMaterialCategory | null;
            uom?: UnitOfMeasure | null;
            vendor?: RawMaterialVendor | null;
        }[];
        meta: {
            total: number;
            page: number;
            pageSize: number;
            totalPages: number;
        };
        filterOptions: {
            categories: {
                id: string;
                status: string;
                createdAt: Date;
                updatedAt: Date;
                description: string | null;
                categoryCode: string | null;
                categoryName: string;
            }[];
            uoms: {
                id: string;
                status: string;
                createdAt: Date;
                updatedAt: Date;
                uomName: string;
                uomCode: string;
                measureType: string;
                conversionFactor: number;
            }[];
            vendors: {
                mapEmbedUrl: string;
                id: string;
                status: string;
                createdAt: Date;
                updatedAt: Date;
                vendorCode: string;
                vendorName: string;
                address: string | null;
                phoneNumber: string | null;
                whatsappNumber: string | null;
                email: string | null;
                gstNumber: string | null;
                mapLocationUrl: string | null;
                locationPlace: string | null;
                locationPincode: string | null;
                latitude: number | null;
                longitude: number | null;
            }[];
            statuses: string[];
            stockTypes: string[];
            measureTypes: string[];
            currencies: string[];
            purchaseStatuses: string[];
            settings: {
                createdAt: Date;
                updatedAt: Date;
                key: string;
                smtpHost: string | null;
                smtpPort: number;
                smtpSecure: boolean;
                smtpUsername: string | null;
                smtpPassword: string | null;
                defaultSenderEmail: string | null;
                defaultSenderName: string | null;
                defaultCc: string | null;
                billHeader: string | null;
                billFooter: string | null;
                logoPath: string | null;
                processCodeAutoGenerate: boolean;
                processCodePrefix: string;
            };
        };
    }>;
    suggestMaterials(search?: string): Promise<{
        categoryName: string;
        categoryCode: string;
        uomName: string;
        uomCode: string;
        vendorName: string;
        vendorCode: string;
        reorderWarning: boolean;
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        description: string | null;
        costPerUnit: number;
        materialCode: string;
        materialName: string;
        categoryId: string | null;
        subType: string | null;
        uomId: string | null;
        hsnCode: string | null;
        taxCategory: string | null;
        gstPercent: number;
        vendorId: string | null;
        currency: string;
        batchNumber: string | null;
        qualityGrade: string | null;
        specificationStandard: string | null;
        storageConditions: string | null;
        currentStock: number;
        reorderLevel: number;
        reorderQuantity: number;
        stockType: string;
        lossWastePercent: number;
        accountLevelLink: string | null;
        imagePath: string | null;
        category?: RawMaterialCategory | null;
        uom?: UnitOfMeasure | null;
        vendor?: RawMaterialVendor | null;
    }[]>;
    getMaterial(id: string): Promise<{
        priceHistory: {
            id: string;
            rawMaterialId: string;
            materialCode: string;
            materialName: string;
            vendorId: string | null;
            vendorName: string;
            oldPrice: number;
            newPrice: number;
            currency: string;
            effectiveDate: Date;
            updatedBy: string;
            remarks: string;
            movement: string;
        }[];
        categoryName: string;
        categoryCode: string;
        uomName: string;
        uomCode: string;
        vendorName: string;
        vendorCode: string;
        reorderWarning: boolean;
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        description: string | null;
        costPerUnit: number;
        materialCode: string;
        materialName: string;
        categoryId: string | null;
        subType: string | null;
        uomId: string | null;
        hsnCode: string | null;
        taxCategory: string | null;
        gstPercent: number;
        vendorId: string | null;
        currency: string;
        batchNumber: string | null;
        qualityGrade: string | null;
        specificationStandard: string | null;
        storageConditions: string | null;
        currentStock: number;
        reorderLevel: number;
        reorderQuantity: number;
        stockType: string;
        lossWastePercent: number;
        accountLevelLink: string | null;
        imagePath: string | null;
        category?: RawMaterialCategory | null;
        uom?: UnitOfMeasure | null;
        vendor?: RawMaterialVendor | null;
    }>;
    createMaterial(dto: RawMaterialWriteDto): Promise<{
        categoryName: string;
        categoryCode: string;
        uomName: string;
        uomCode: string;
        vendorName: string;
        vendorCode: string;
        reorderWarning: boolean;
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        description: string | null;
        costPerUnit: number;
        materialCode: string;
        materialName: string;
        categoryId: string | null;
        subType: string | null;
        uomId: string | null;
        hsnCode: string | null;
        taxCategory: string | null;
        gstPercent: number;
        vendorId: string | null;
        currency: string;
        batchNumber: string | null;
        qualityGrade: string | null;
        specificationStandard: string | null;
        storageConditions: string | null;
        currentStock: number;
        reorderLevel: number;
        reorderQuantity: number;
        stockType: string;
        lossWastePercent: number;
        accountLevelLink: string | null;
        imagePath: string | null;
        category?: RawMaterialCategory | null;
        uom?: UnitOfMeasure | null;
        vendor?: RawMaterialVendor | null;
    }>;
    updateMaterial(id: string, dto: RawMaterialWriteDto): Promise<{
        categoryName: string;
        categoryCode: string;
        uomName: string;
        uomCode: string;
        vendorName: string;
        vendorCode: string;
        reorderWarning: boolean;
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        description: string | null;
        costPerUnit: number;
        materialCode: string;
        materialName: string;
        categoryId: string | null;
        subType: string | null;
        uomId: string | null;
        hsnCode: string | null;
        taxCategory: string | null;
        gstPercent: number;
        vendorId: string | null;
        currency: string;
        batchNumber: string | null;
        qualityGrade: string | null;
        specificationStandard: string | null;
        storageConditions: string | null;
        currentStock: number;
        reorderLevel: number;
        reorderQuantity: number;
        stockType: string;
        lossWastePercent: number;
        accountLevelLink: string | null;
        imagePath: string | null;
        category?: RawMaterialCategory | null;
        uom?: UnitOfMeasure | null;
        vendor?: RawMaterialVendor | null;
    }>;
    deleteMaterial(id: string): Promise<{
        deleted: boolean;
    }>;
    listCategories(query: RawMaterialQuery): Promise<{
        items: unknown[];
        meta: {
            total: number;
            page: number;
            pageSize: number;
            totalPages: number;
        };
    }>;
    createCategory(dto: RawMaterialCategoryWriteDto): Promise<{
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        description: string | null;
        categoryCode: string | null;
        categoryName: string;
    }>;
    updateCategory(id: string, dto: RawMaterialCategoryWriteDto): Promise<{
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        description: string | null;
        categoryCode: string | null;
        categoryName: string;
    }>;
    deleteCategory(id: string): Promise<{
        deleted: boolean;
    }>;
    listUoms(query: RawMaterialQuery): Promise<{
        items: unknown[];
        meta: {
            total: number;
            page: number;
            pageSize: number;
            totalPages: number;
        };
    }>;
    createUom(dto: UnitOfMeasureWriteDto): Promise<{
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        uomName: string;
        uomCode: string;
        measureType: string;
        conversionFactor: number;
    }>;
    updateUom(id: string, dto: UnitOfMeasureWriteDto): Promise<{
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        uomName: string;
        uomCode: string;
        measureType: string;
        conversionFactor: number;
    }>;
    deleteUom(id: string): Promise<{
        deleted: boolean;
    }>;
    listVendors(query: RawMaterialQuery): Promise<{
        items: unknown[];
        meta: {
            total: number;
            page: number;
            pageSize: number;
            totalPages: number;
        };
    }>;
    createVendor(dto: RawMaterialVendorWriteDto): Promise<{
        mapEmbedUrl: string;
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorCode: string;
        vendorName: string;
        address: string | null;
        phoneNumber: string | null;
        whatsappNumber: string | null;
        email: string | null;
        gstNumber: string | null;
        mapLocationUrl: string | null;
        locationPlace: string | null;
        locationPincode: string | null;
        latitude: number | null;
        longitude: number | null;
    }>;
    updateVendor(id: string, dto: RawMaterialVendorWriteDto): Promise<{
        mapEmbedUrl: string;
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorCode: string;
        vendorName: string;
        address: string | null;
        phoneNumber: string | null;
        whatsappNumber: string | null;
        email: string | null;
        gstNumber: string | null;
        mapLocationUrl: string | null;
        locationPlace: string | null;
        locationPincode: string | null;
        latitude: number | null;
        longitude: number | null;
    }>;
    deleteVendor(id: string): Promise<{
        deleted: boolean;
    }>;
    listPriceHistory(query: RawMaterialQuery & {
        rawMaterialId?: string;
    }): Promise<{
        items: unknown[];
        meta: {
            total: number;
            page: number;
            pageSize: number;
            totalPages: number;
        };
    }>;
    listPurchaseOrders(query: RawMaterialQuery): Promise<{
        items: unknown[];
        meta: {
            total: number;
            page: number;
            pageSize: number;
            totalPages: number;
        };
    }>;
    getPurchaseOrder(id: string): Promise<{
        settings: {
            createdAt: Date;
            updatedAt: Date;
            key: string;
            smtpHost: string | null;
            smtpPort: number;
            smtpSecure: boolean;
            smtpUsername: string | null;
            smtpPassword: string | null;
            defaultSenderEmail: string | null;
            defaultSenderName: string | null;
            defaultCc: string | null;
            billHeader: string | null;
            billFooter: string | null;
            logoPath: string | null;
            processCodeAutoGenerate: boolean;
            processCodePrefix: string;
        };
        vendorName: string;
        vendorEmail: string;
        vendor: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            vendorCode: string;
            vendorName: string;
            address: string | null;
            phoneNumber: string | null;
            whatsappNumber: string | null;
            email: string | null;
            gstNumber: string | null;
            mapLocationUrl: string | null;
            locationPlace: string | null;
            locationPincode: string | null;
            latitude: number | null;
            longitude: number | null;
        } | null;
        currencyLabel: string;
        items: {
            materialCode: string;
            materialName: string;
            uomCode: string;
            id: string;
            createdAt: Date;
            rate: number;
            description: string | null;
            rawMaterialId: string | null;
            quantity: number;
            uomId: string | null;
            gstPercent: number;
            lineSubtotal: number;
            lineGst: number;
            lineTotal: number;
            purchaseOrderId: string;
            rawMaterial?: RawMaterial | null;
            uom?: UnitOfMeasure | null;
        }[];
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorId: string | null;
        poNumber: string;
        orderDate: Date;
        expectedDate: Date | null;
        subtotal: number;
        gstTotal: number;
        transportationCost: number;
        totalAmount: number;
        transportDetails: string | null;
        epassRequired: boolean;
        epassFilePath: string | null;
        notes: string | null;
        generatedAt: Date | null;
        emailSubject: string | null;
        emailTo: string | null;
        emailCc: string | null;
        emailMessage: string | null;
        emailSentAt: Date | null;
        stockConvertedAt: Date | null;
        stockConvertedBy: string | null;
        createdBy: string | null;
    }>;
    createPurchaseOrder(dto: PurchaseOrderWriteDto): Promise<{
        vendorName: string;
        vendorEmail: string;
        vendor: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            vendorCode: string;
            vendorName: string;
            address: string | null;
            phoneNumber: string | null;
            whatsappNumber: string | null;
            email: string | null;
            gstNumber: string | null;
            mapLocationUrl: string | null;
            locationPlace: string | null;
            locationPincode: string | null;
            latitude: number | null;
            longitude: number | null;
        } | null;
        currencyLabel: string;
        items: {
            materialCode: string;
            materialName: string;
            uomCode: string;
            id: string;
            createdAt: Date;
            rate: number;
            description: string | null;
            rawMaterialId: string | null;
            quantity: number;
            uomId: string | null;
            gstPercent: number;
            lineSubtotal: number;
            lineGst: number;
            lineTotal: number;
            purchaseOrderId: string;
            rawMaterial?: RawMaterial | null;
            uom?: UnitOfMeasure | null;
        }[];
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorId: string | null;
        poNumber: string;
        orderDate: Date;
        expectedDate: Date | null;
        subtotal: number;
        gstTotal: number;
        transportationCost: number;
        totalAmount: number;
        transportDetails: string | null;
        epassRequired: boolean;
        epassFilePath: string | null;
        notes: string | null;
        generatedAt: Date | null;
        emailSubject: string | null;
        emailTo: string | null;
        emailCc: string | null;
        emailMessage: string | null;
        emailSentAt: Date | null;
        stockConvertedAt: Date | null;
        stockConvertedBy: string | null;
        createdBy: string | null;
    }>;
    updatePurchaseOrder(id: string, dto: PurchaseOrderWriteDto): Promise<{
        vendorName: string;
        vendorEmail: string;
        vendor: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            vendorCode: string;
            vendorName: string;
            address: string | null;
            phoneNumber: string | null;
            whatsappNumber: string | null;
            email: string | null;
            gstNumber: string | null;
            mapLocationUrl: string | null;
            locationPlace: string | null;
            locationPincode: string | null;
            latitude: number | null;
            longitude: number | null;
        } | null;
        currencyLabel: string;
        items: {
            materialCode: string;
            materialName: string;
            uomCode: string;
            id: string;
            createdAt: Date;
            rate: number;
            description: string | null;
            rawMaterialId: string | null;
            quantity: number;
            uomId: string | null;
            gstPercent: number;
            lineSubtotal: number;
            lineGst: number;
            lineTotal: number;
            purchaseOrderId: string;
            rawMaterial?: RawMaterial | null;
            uom?: UnitOfMeasure | null;
        }[];
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorId: string | null;
        poNumber: string;
        orderDate: Date;
        expectedDate: Date | null;
        subtotal: number;
        gstTotal: number;
        transportationCost: number;
        totalAmount: number;
        transportDetails: string | null;
        epassRequired: boolean;
        epassFilePath: string | null;
        notes: string | null;
        generatedAt: Date | null;
        emailSubject: string | null;
        emailTo: string | null;
        emailCc: string | null;
        emailMessage: string | null;
        emailSentAt: Date | null;
        stockConvertedAt: Date | null;
        stockConvertedBy: string | null;
        createdBy: string | null;
    }>;
    deletePurchaseOrder(id: string): Promise<{
        deleted: boolean;
    }>;
    generatePurchaseOrder(id: string): Promise<{
        vendorName: string;
        vendorEmail: string;
        vendor: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            vendorCode: string;
            vendorName: string;
            address: string | null;
            phoneNumber: string | null;
            whatsappNumber: string | null;
            email: string | null;
            gstNumber: string | null;
            mapLocationUrl: string | null;
            locationPlace: string | null;
            locationPincode: string | null;
            latitude: number | null;
            longitude: number | null;
        } | null;
        currencyLabel: string;
        items: {
            materialCode: string;
            materialName: string;
            uomCode: string;
            id: string;
            createdAt: Date;
            rate: number;
            description: string | null;
            rawMaterialId: string | null;
            quantity: number;
            uomId: string | null;
            gstPercent: number;
            lineSubtotal: number;
            lineGst: number;
            lineTotal: number;
            purchaseOrderId: string;
            rawMaterial?: RawMaterial | null;
            uom?: UnitOfMeasure | null;
        }[];
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorId: string | null;
        poNumber: string;
        orderDate: Date;
        expectedDate: Date | null;
        subtotal: number;
        gstTotal: number;
        transportationCost: number;
        totalAmount: number;
        transportDetails: string | null;
        epassRequired: boolean;
        epassFilePath: string | null;
        notes: string | null;
        generatedAt: Date | null;
        emailSubject: string | null;
        emailTo: string | null;
        emailCc: string | null;
        emailMessage: string | null;
        emailSentAt: Date | null;
        stockConvertedAt: Date | null;
        stockConvertedBy: string | null;
        createdBy: string | null;
    }>;
    convertPurchaseOrderToStock(id: string, dto: {
        convertedBy?: string;
    }): Promise<{
        vendorName: string;
        vendorEmail: string;
        vendor: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            vendorCode: string;
            vendorName: string;
            address: string | null;
            phoneNumber: string | null;
            whatsappNumber: string | null;
            email: string | null;
            gstNumber: string | null;
            mapLocationUrl: string | null;
            locationPlace: string | null;
            locationPincode: string | null;
            latitude: number | null;
            longitude: number | null;
        } | null;
        currencyLabel: string;
        items: {
            materialCode: string;
            materialName: string;
            uomCode: string;
            id: string;
            createdAt: Date;
            rate: number;
            description: string | null;
            rawMaterialId: string | null;
            quantity: number;
            uomId: string | null;
            gstPercent: number;
            lineSubtotal: number;
            lineGst: number;
            lineTotal: number;
            purchaseOrderId: string;
            rawMaterial?: RawMaterial | null;
            uom?: UnitOfMeasure | null;
        }[];
        id: string;
        status: string;
        createdAt: Date;
        updatedAt: Date;
        vendorId: string | null;
        poNumber: string;
        orderDate: Date;
        expectedDate: Date | null;
        subtotal: number;
        gstTotal: number;
        transportationCost: number;
        totalAmount: number;
        transportDetails: string | null;
        epassRequired: boolean;
        epassFilePath: string | null;
        notes: string | null;
        generatedAt: Date | null;
        emailSubject: string | null;
        emailTo: string | null;
        emailCc: string | null;
        emailMessage: string | null;
        emailSentAt: Date | null;
        stockConvertedAt: Date | null;
        stockConvertedBy: string | null;
        createdBy: string | null;
    }>;
    sendPurchaseOrderEmail(id: string, dto: PurchaseOrderEmailDto): Promise<{
        sent: boolean;
    }>;
    getSettings(): Promise<{
        createdAt: Date;
        updatedAt: Date;
        key: string;
        smtpHost: string | null;
        smtpPort: number;
        smtpSecure: boolean;
        smtpUsername: string | null;
        smtpPassword: string | null;
        defaultSenderEmail: string | null;
        defaultSenderName: string | null;
        defaultCc: string | null;
        billHeader: string | null;
        billFooter: string | null;
        logoPath: string | null;
        processCodeAutoGenerate: boolean;
        processCodePrefix: string;
    }>;
    updateSettings(dto: RawMaterialSettingsWriteDto): Promise<{
        createdAt: Date;
        updatedAt: Date;
        key: string;
        smtpHost: string | null;
        smtpPort: number;
        smtpSecure: boolean;
        smtpUsername: string | null;
        smtpPassword: string | null;
        defaultSenderEmail: string | null;
        defaultSenderName: string | null;
        defaultCc: string | null;
        billHeader: string | null;
        billFooter: string | null;
        logoPath: string | null;
        processCodeAutoGenerate: boolean;
        processCodePrefix: string;
    }>;
    getOptions(): Promise<{
        categories: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            description: string | null;
            categoryCode: string | null;
            categoryName: string;
        }[];
        uoms: {
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            uomName: string;
            uomCode: string;
            measureType: string;
            conversionFactor: number;
        }[];
        vendors: {
            mapEmbedUrl: string;
            id: string;
            status: string;
            createdAt: Date;
            updatedAt: Date;
            vendorCode: string;
            vendorName: string;
            address: string | null;
            phoneNumber: string | null;
            whatsappNumber: string | null;
            email: string | null;
            gstNumber: string | null;
            mapLocationUrl: string | null;
            locationPlace: string | null;
            locationPincode: string | null;
            latitude: number | null;
            longitude: number | null;
        }[];
        statuses: string[];
        stockTypes: string[];
        measureTypes: string[];
        currencies: string[];
        purchaseStatuses: string[];
        settings: {
            createdAt: Date;
            updatedAt: Date;
            key: string;
            smtpHost: string | null;
            smtpPort: number;
            smtpSecure: boolean;
            smtpUsername: string | null;
            smtpPassword: string | null;
            defaultSenderEmail: string | null;
            defaultSenderName: string | null;
            defaultCc: string | null;
            billHeader: string | null;
            billFooter: string | null;
            logoPath: string | null;
            processCodeAutoGenerate: boolean;
            processCodePrefix: string;
        };
    }>;
    exportModule(moduleName: string, query: RawMaterialQuery & {
        format?: string;
    }): Promise<{
        fileName: string;
        mime: string;
        base64: string;
    }>;
    previewImport(moduleName: string, dto: ImportPreviewDto): Promise<{
        fileName: string;
        rows: {
            rowNumber: number;
            data: Record<string, string>;
            valid: boolean;
            errors: string[];
        }[];
        total: number;
        valid: number;
        invalid: number;
    }>;
    commitImport(moduleName: string, dto: ImportCommitDto): Promise<{
        created: number;
        failed: number;
        errors: string[];
    }>;
    private getFilterOptions;
    private buildMaterialWhere;
    private buildPurchaseOrderWhere;
    private validateMaterial;
    private validateCategory;
    private validateUom;
    private validateVendor;
    private validatePurchaseOrder;
    private preparePurchaseItems;
    private nextPurchaseOrderNumber;
    private refreshMaterialStocks;
    private createPriceHistory;
    private getExportRows;
    private validateImportRow;
    private createFromImport;
    private findOrCreateImportCategory;
    private findOrCreateImportUom;
    private findVendorForImport;
    private resolveUploadPath;
    private materialIncludes;
    private ensureMaterial;
    private ensureCategory;
    private ensureUom;
    private ensureVendor;
    private ensureImportModule;
    private listResponse;
    private meta;
    private toPositiveNumber;
}
