import { PrismaService } from "../../../core/database/prisma/prisma.service";
import { Prisma, RobotLifecycleStage, RobotEventRelatedType } from '@prisma/client';
import { LifecycleGuardsService } from './lifecycle-guards.service';
import { SnapshotProjectorService } from './snapshot-projector.service';
export interface ChangeStageInput {
    robotUnitId: string;
    toStage: RobotLifecycleStage;
    actorUserId: string;
    reason?: string;
    metadata?: Record<string, any>;
    expectedVersion?: number;
    relatedType?: RobotEventRelatedType;
    relatedId?: string;
}
export declare class RobotLifecycleService {
    private readonly prisma;
    private readonly guards;
    private readonly projector;
    private readonly logger;
    constructor(prisma: PrismaService, guards: LifecycleGuardsService, projector: SnapshotProjectorService);
    changeStage(input: ChangeStageInput): Promise<{
        snapshot: {
            currentStage: import("@prisma/client").$Enums.RobotLifecycleStage;
            lastEventId: string;
            lastEventAt: Date;
            version: number;
            robotUnitId: string;
            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;
            derivedAt: Date;
        };
        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;
    }>;
    bulkChangeStage(robotUnitIds: string[], toStage: RobotLifecycleStage, actorUserId: string, reason?: string): Promise<{
        success: string[];
        failed: {
            id: string;
            reason: string;
            reasons?: string[];
        }[];
    }>;
    hold(robotUnitId: string, holdReason: string, actorUserId: string): Promise<{
        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;
    }>;
    unhold(robotUnitId: string, actorUserId: string): Promise<{
        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;
    }>;
    moveLocation(robotUnitId: string, toLocationId: string, actorUserId: string, reason?: string): Promise<{
        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;
    }>;
    listEvents(robotUnitId: string, limit?: number): Promise<{
        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;
    }[]>;
    getAllowedNextStages(currentStage: RobotLifecycleStage): RobotLifecycleStage[];
}
