Circle V2 API Docs
    Preparing search index...

    Variable rpaRunsRepoConst

    rpaRunsRepo: DbRepo<
        {
            countForSuperadmin: (params: ListRpaRunsParams) => Promise<number>;
            countPatientGroupsForSuperadmin: (
                params: ListRpaRunsParams,
            ) => Promise<number>;
            create: (
                params: CreateRpaRunParams,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                },
            >;
            getActiveForPatient: (
                patientId: PatientId,
                activeSince: DbDate,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }
                | undefined,
            >;
            getByExternalRunId: (
                externalRunId: string,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }
                | undefined,
            >;
            getById: (
                id: RpaRunId,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                },
            >;
            getLatestForPatient: (
                patientId: PatientId,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }
                | undefined,
            >;
            listDistinctSyncTypesForSuperadmin: () => Promise<string[]>;
            listForSuperadmin: (
                params: ListRpaRunsParams,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_first_name: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    patient_last_name: string | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }[],
            >;
            listGroupedByPatientForSuperadmin: (
                params: ListRpaRunsParams,
            ) => Promise<
                {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_first_name: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    patient_last_name: string | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }[],
            >;
            setDocumentCountByExternalRunId: (
                externalRunId: string,
                documentCount: number,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }
                | undefined,
            >;
            updateByExternalRunId: (
                externalRunId: string,
                patch: UpdateRpaRunFromWebhookParams,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }
                | undefined,
            >;
            updateProgressByExternalRunId: (
                externalRunId: string,
                patch: UpdateRpaRunProgressParams,
            ) => Promise<
                | {
                    completed_at: string & { __brand: "DbDate" }
                    | null;
                    created_at: DbDate;
                    current_step: string | null;
                    document_count: number | null;
                    dry_run: boolean;
                    entity_id: number & { __brand: "EntityId" } | null;
                    external_run_id: string | null;
                    facility_id: string & { __brand: "FacilityId" } | null;
                    failure_reason: string | null;
                    id: RpaRunId;
                    integration_id: string & { __brand: "IntegrationId" } | null;
                    last_step_at: string & { __brand: "DbDate" } | null;
                    live_view_url: string | null;
                    patient_id: string & { __brand: "PatientId" } | null;
                    raw_payload: Record<string, unknown> | null;
                    started_at: string & { __brand: "DbDate" } | null;
                    status: "success" | "failed" | "pending" | "running" | "stopped";
                    step_history: { at: string; step: string }[] | null;
                    sync_type: string | null;
                    treatment_episode_id: string & { __brand: "TreatmentEpisodeId" } | null;
                    triggered_by: string & { __brand: "UserId" } | null;
                }
                | undefined,
            >;
        },
    > = ...