import { PrismaService } from "../../../core/database/prisma/prisma.service";
import { Prisma } from '@prisma/client';
import { ActivateSnDto, CreateRobotUnitDto, QueryRobotUnitDto, UpdateRobotUnitDto } from '../dto/robot-unit.dto';
import { RobotSystemConfigService } from './robot-system-config.service';
import { SnapshotProjectorService } from './snapshot-projector.service';
export declare class RobotUnitService {
    private readonly prisma;
    private readonly configService;
    private readonly projector;
    private readonly logger;
    constructor(prisma: PrismaService, configService: RobotSystemConfigService, projector: SnapshotProjectorService);
    private formatDatePart;
    private generateFfsn;
    private validateForeignKeys;
    create(dto: CreateRobotUnitDto, userId: string, organizationId: string): Promise<{
        purchaseOrder: {
            id: string;
            supplierId: string;
            poNo: string;
        } | null;
        purchaseOrderLine: {
            id: string;
            lineNo: number;
            unitPrice: Prisma.Decimal;
        } | null;
        snapshot: {
            version: number;
            lastEventId: string | null;
            robotUnitId: string;
            currentStage: import("@prisma/client").$Enums.RobotLifecycleStage;
            isHeld: boolean;
            holdReason: string | null;
            currentLocationId: string | null;
            currentCustomerId: string | null;
            currentSalesOrderId: string | null;
            currentDeliveryRequestId: string | null;
            currentSpecialistId: string | null;
            physicalProductStatus: import("@prisma/client").$Enums.RobotPhysicalStatus | null;
            daysReadyForDelivery: number | null;
            warrantyStatus: import("@prisma/client").$Enums.RobotWarrantyStatus | null;
            lastEventAt: Date | null;
            derivedAt: Date;
        } | null;
        events: {
            id: string;
            createdAt: Date;
            deletedAt: Date | null;
            organizationId: string;
            createdById: string;
            eventType: import("@prisma/client").$Enums.RobotLifecycleEventType;
            notes: string | null;
            payload: Prisma.JsonValue;
            partnerId: string | null;
            robotUnitId: string;
            customerId: string | null;
            toStage: import("@prisma/client").$Enums.RobotLifecycleStage | null;
            toLocationId: string | null;
            occurredAt: Date;
            fromStage: import("@prisma/client").$Enums.RobotLifecycleStage | null;
            fromLocationId: string | null;
            actorUserId: string | null;
            relatedType: import("@prisma/client").$Enums.RobotEventRelatedType | null;
            relatedId: string | null;
        }[];
        model: {
            code: string;
            id: string;
            createdAt: Date;
            name: string;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            description: string | null;
            organizationId: string;
            createdById: string;
            enabled: boolean;
            imageUrl: string | null;
            brand: string | null;
        };
        sku: {
            model: {
                code: string;
                id: string;
                name: string;
            };
        } & {
            code: string;
            id: string;
            createdAt: Date;
            name: string;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            description: string | null;
            organizationId: string;
            createdById: string;
            enabled: boolean;
            currencyCode: string | null;
            modelId: string;
            variant: string | null;
            defaultPrice: Prisma.Decimal | null;
            defaultCost: Prisma.Decimal | null;
        };
    } & {
        id: string;
        createdAt: Date;
        metadata: Prisma.JsonValue;
        updatedAt: Date;
        deletedAt: Date | null;
        organizationId: string;
        createdById: string;
        version: number;
        modelId: string;
        ffsn: string;
        ffsnDisplay: string | null;
        placeholderSnOrig: string | null;
        supplierSn: string | null;
        skuId: string;
        usageType: import("@prisma/client").$Enums.RobotUsageType;
        purchaseOrderId: string | null;
        purchaseOrderLineId: string | null;
        originalSupplierId: string | null;
        manufactureDate: Date | null;
        retiredAt: Date | null;
        disposalType: import("@prisma/client").$Enums.RobotDisposalType | null;
        disposalNotes: string | null;
        sapMaterialNo: string | null;
    }>;
    private isPlaceholderSn;
    activateSn(unitId: string, dto: ActivateSnDto, userId: string, organizationId: string): Promise<({
        snapshot: {
            version: number;
            lastEventId: string | null;
            robotUnitId: string;
            currentStage: import("@prisma/client").$Enums.RobotLifecycleStage;
            isHeld: boolean;
            holdReason: string | null;
            currentLocationId: string | null;
            currentCustomerId: string | null;
            currentSalesOrderId: string | null;
            currentDeliveryRequestId: string | null;
            currentSpecialistId: string | null;
            physicalProductStatus: import("@prisma/client").$Enums.RobotPhysicalStatus | null;
            daysReadyForDelivery: number | null;
            warrantyStatus: import("@prisma/client").$Enums.RobotWarrantyStatus | null;
            lastEventAt: Date | null;
            derivedAt: Date;
        } | null;
    } & {
        id: string;
        createdAt: Date;
        metadata: Prisma.JsonValue;
        updatedAt: Date;
        deletedAt: Date | null;
        organizationId: string;
        createdById: string;
        version: number;
        modelId: string;
        ffsn: string;
        ffsnDisplay: string | null;
        placeholderSnOrig: string | null;
        supplierSn: string | null;
        skuId: string;
        usageType: import("@prisma/client").$Enums.RobotUsageType;
        purchaseOrderId: string | null;
        purchaseOrderLineId: string | null;
        originalSupplierId: string | null;
        manufactureDate: Date | null;
        retiredAt: Date | null;
        disposalType: import("@prisma/client").$Enums.RobotDisposalType | null;
        disposalNotes: string | null;
        sapMaterialNo: string | null;
    }) | null>;
    findAll(query: QueryRobotUnitDto): Promise<{
        items: ({
            purchaseOrder: {
                id: string;
                supplierId: string;
                poNo: string;
                orderedAt: Date;
            } | null;
            purchaseOrderLine: {
                id: string;
                currencyCode: string;
                lineNo: number;
                unitPrice: Prisma.Decimal;
            } | null;
            snapshot: {
                version: number;
                lastEventId: string | null;
                robotUnitId: string;
                currentStage: import("@prisma/client").$Enums.RobotLifecycleStage;
                isHeld: boolean;
                holdReason: string | null;
                currentLocationId: string | null;
                currentCustomerId: string | null;
                currentSalesOrderId: string | null;
                currentDeliveryRequestId: string | null;
                currentSpecialistId: string | null;
                physicalProductStatus: import("@prisma/client").$Enums.RobotPhysicalStatus | null;
                daysReadyForDelivery: number | null;
                warrantyStatus: import("@prisma/client").$Enums.RobotWarrantyStatus | null;
                lastEventAt: Date | null;
                derivedAt: Date;
            } | null;
            model: {
                code: string;
                id: string;
                name: string;
            };
            sku: {
                code: string;
                id: string;
                name: string;
                variant: string | null;
            };
        } & {
            id: string;
            createdAt: Date;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            organizationId: string;
            createdById: string;
            version: number;
            modelId: string;
            ffsn: string;
            ffsnDisplay: string | null;
            placeholderSnOrig: string | null;
            supplierSn: string | null;
            skuId: string;
            usageType: import("@prisma/client").$Enums.RobotUsageType;
            purchaseOrderId: string | null;
            purchaseOrderLineId: string | null;
            originalSupplierId: string | null;
            manufactureDate: Date | null;
            retiredAt: Date | null;
            disposalType: import("@prisma/client").$Enums.RobotDisposalType | null;
            disposalNotes: string | null;
            sapMaterialNo: string | null;
        })[];
        total: number;
        page: number;
        limit: number;
        totalPages: number;
        hasNext: boolean;
        hasPrev: boolean;
    }>;
    findByFfsn(ffsn: string): Promise<{
        id: string;
        ffsn: string;
    }>;
    findOne(id: string): Promise<{
        purchaseOrder: {
            id: string;
            supplierId: string;
            poNo: string;
        } | null;
        purchaseOrderLine: {
            id: string;
            lineNo: number;
            unitPrice: Prisma.Decimal;
        } | null;
        snapshot: {
            version: number;
            lastEventId: string | null;
            robotUnitId: string;
            currentStage: import("@prisma/client").$Enums.RobotLifecycleStage;
            isHeld: boolean;
            holdReason: string | null;
            currentLocationId: string | null;
            currentCustomerId: string | null;
            currentSalesOrderId: string | null;
            currentDeliveryRequestId: string | null;
            currentSpecialistId: string | null;
            physicalProductStatus: import("@prisma/client").$Enums.RobotPhysicalStatus | null;
            daysReadyForDelivery: number | null;
            warrantyStatus: import("@prisma/client").$Enums.RobotWarrantyStatus | null;
            lastEventAt: Date | null;
            derivedAt: Date;
        } | null;
        events: {
            id: string;
            createdAt: Date;
            deletedAt: Date | null;
            organizationId: string;
            createdById: string;
            eventType: import("@prisma/client").$Enums.RobotLifecycleEventType;
            notes: string | null;
            payload: Prisma.JsonValue;
            partnerId: string | null;
            robotUnitId: string;
            customerId: string | null;
            toStage: import("@prisma/client").$Enums.RobotLifecycleStage | null;
            toLocationId: string | null;
            occurredAt: Date;
            fromStage: import("@prisma/client").$Enums.RobotLifecycleStage | null;
            fromLocationId: string | null;
            actorUserId: string | null;
            relatedType: import("@prisma/client").$Enums.RobotEventRelatedType | null;
            relatedId: string | null;
        }[];
        model: {
            code: string;
            id: string;
            createdAt: Date;
            name: string;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            description: string | null;
            organizationId: string;
            createdById: string;
            enabled: boolean;
            imageUrl: string | null;
            brand: string | null;
        };
        sku: {
            model: {
                code: string;
                id: string;
                name: string;
            };
        } & {
            code: string;
            id: string;
            createdAt: Date;
            name: string;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            description: string | null;
            organizationId: string;
            createdById: string;
            enabled: boolean;
            currencyCode: string | null;
            modelId: string;
            variant: string | null;
            defaultPrice: Prisma.Decimal | null;
            defaultCost: Prisma.Decimal | null;
        };
    } & {
        id: string;
        createdAt: Date;
        metadata: Prisma.JsonValue;
        updatedAt: Date;
        deletedAt: Date | null;
        organizationId: string;
        createdById: string;
        version: number;
        modelId: string;
        ffsn: string;
        ffsnDisplay: string | null;
        placeholderSnOrig: string | null;
        supplierSn: string | null;
        skuId: string;
        usageType: import("@prisma/client").$Enums.RobotUsageType;
        purchaseOrderId: string | null;
        purchaseOrderLineId: string | null;
        originalSupplierId: string | null;
        manufactureDate: Date | null;
        retiredAt: Date | null;
        disposalType: import("@prisma/client").$Enums.RobotDisposalType | null;
        disposalNotes: string | null;
        sapMaterialNo: string | null;
    }>;
    update(id: string, dto: UpdateRobotUnitDto, userId: string): Promise<{
        purchaseOrder: {
            id: string;
            supplierId: string;
            poNo: string;
        } | null;
        purchaseOrderLine: {
            id: string;
            lineNo: number;
            unitPrice: Prisma.Decimal;
        } | null;
        snapshot: {
            version: number;
            lastEventId: string | null;
            robotUnitId: string;
            currentStage: import("@prisma/client").$Enums.RobotLifecycleStage;
            isHeld: boolean;
            holdReason: string | null;
            currentLocationId: string | null;
            currentCustomerId: string | null;
            currentSalesOrderId: string | null;
            currentDeliveryRequestId: string | null;
            currentSpecialistId: string | null;
            physicalProductStatus: import("@prisma/client").$Enums.RobotPhysicalStatus | null;
            daysReadyForDelivery: number | null;
            warrantyStatus: import("@prisma/client").$Enums.RobotWarrantyStatus | null;
            lastEventAt: Date | null;
            derivedAt: Date;
        } | null;
        events: {
            id: string;
            createdAt: Date;
            deletedAt: Date | null;
            organizationId: string;
            createdById: string;
            eventType: import("@prisma/client").$Enums.RobotLifecycleEventType;
            notes: string | null;
            payload: Prisma.JsonValue;
            partnerId: string | null;
            robotUnitId: string;
            customerId: string | null;
            toStage: import("@prisma/client").$Enums.RobotLifecycleStage | null;
            toLocationId: string | null;
            occurredAt: Date;
            fromStage: import("@prisma/client").$Enums.RobotLifecycleStage | null;
            fromLocationId: string | null;
            actorUserId: string | null;
            relatedType: import("@prisma/client").$Enums.RobotEventRelatedType | null;
            relatedId: string | null;
        }[];
        model: {
            code: string;
            id: string;
            createdAt: Date;
            name: string;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            description: string | null;
            organizationId: string;
            createdById: string;
            enabled: boolean;
            imageUrl: string | null;
            brand: string | null;
        };
        sku: {
            model: {
                code: string;
                id: string;
                name: string;
            };
        } & {
            code: string;
            id: string;
            createdAt: Date;
            name: string;
            metadata: Prisma.JsonValue;
            updatedAt: Date;
            deletedAt: Date | null;
            description: string | null;
            organizationId: string;
            createdById: string;
            enabled: boolean;
            currencyCode: string | null;
            modelId: string;
            variant: string | null;
            defaultPrice: Prisma.Decimal | null;
            defaultCost: Prisma.Decimal | null;
        };
    } & {
        id: string;
        createdAt: Date;
        metadata: Prisma.JsonValue;
        updatedAt: Date;
        deletedAt: Date | null;
        organizationId: string;
        createdById: string;
        version: number;
        modelId: string;
        ffsn: string;
        ffsnDisplay: string | null;
        placeholderSnOrig: string | null;
        supplierSn: string | null;
        skuId: string;
        usageType: import("@prisma/client").$Enums.RobotUsageType;
        purchaseOrderId: string | null;
        purchaseOrderLineId: string | null;
        originalSupplierId: string | null;
        manufactureDate: Date | null;
        retiredAt: Date | null;
        disposalType: import("@prisma/client").$Enums.RobotDisposalType | null;
        disposalNotes: string | null;
        sapMaterialNo: string | null;
    }>;
    softDelete(id: string, userId: string): Promise<{
        message: string;
    }>;
}
