import * as z from "zod/v3"; import { ClosedEnum } from "../../types/enums.js"; import { Result as SafeParseResult } from "../../types/fp.js"; import { SDKValidationError } from "../errors/sdkvalidationerror.js"; /** * The lifecycle status of the batch request itself. Terminal values are `completed` (processing finished — inspect `results` and `exclusions` for per-payroll outcomes) and `failed` (the batch crashed at the system level; can be retried). This is distinct from the per-payroll `status` returned inside `results[]`. A `completed` batch does not imply every payroll was cancelled. */ export declare const PayrollBatchResultsStatus: { readonly Pending: "pending"; readonly Processing: "processing"; readonly Completed: "completed"; readonly Failed: "failed"; }; /** * The lifecycle status of the batch request itself. Terminal values are `completed` (processing finished — inspect `results` and `exclusions` for per-payroll outcomes) and `failed` (the batch crashed at the system level; can be retried). This is distinct from the per-payroll `status` returned inside `results[]`. A `completed` batch does not imply every payroll was cancelled. */ export type PayrollBatchResultsStatus = ClosedEnum; /** * The outcome of cancelling this payroll. A cancel is atomic — there is no per-payroll `partial_success`. * * @remarks * - `success`: the payroll was cancelled, or required no action (already cancelled / never run) * - `failed`: the payroll could not be cancelled; see `errors` */ export declare const PayrollBatchResultsResultsStatus: { readonly Success: "success"; readonly Failed: "failed"; }; /** * The outcome of cancelling this payroll. A cancel is atomic — there is no per-payroll `partial_success`. * * @remarks * - `success`: the payroll was cancelled, or required no action (already cancelled / never run) * - `failed`: the payroll could not be cancelled; see `errors` */ export type PayrollBatchResultsResultsStatus = ClosedEnum; /** * Machine-readable reason the cancellation failed. * * @remarks * - `not_cancellable`: the payroll is past the point where it can be cancelled * - `internal_error`: an unexpected error occurred; the request can be retried */ export declare const PayrollBatchResultsResultsCategory: { readonly NotCancellable: "not_cancellable"; readonly InternalError: "internal_error"; }; /** * Machine-readable reason the cancellation failed. * * @remarks * - `not_cancellable`: the payroll is past the point where it can be cancelled * - `internal_error`: an unexpected error occurred; the request can be retried */ export type PayrollBatchResultsResultsCategory = ClosedEnum; export type PayrollBatchResultsErrors = { /** * The key identifying the error source. */ errorKey?: string | undefined; /** * Machine-readable reason the cancellation failed. * * @remarks * - `not_cancellable`: the payroll is past the point where it can be cancelled * - `internal_error`: an unexpected error occurred; the request can be retried */ category?: PayrollBatchResultsResultsCategory | undefined; /** * Human-readable explanation of the failure. */ message?: string | undefined; }; export type Results = { /** * The index of this payroll in the original POST batch array. */ idx?: number | undefined; /** * The UUID of the payroll. */ uuid?: string | undefined; /** * The outcome of cancelling this payroll. A cancel is atomic — there is no per-payroll `partial_success`. * * @remarks * - `success`: the payroll was cancelled, or required no action (already cancelled / never run) * - `failed`: the payroll could not be cancelled; see `errors` */ status?: PayrollBatchResultsResultsStatus | undefined; /** * Present only when `status` is `failed`. A cancel is a single atomic operation, so this is a flat array with exactly one error. */ errors?: Array | undefined; }; /** * The type of entity this exclusion represents. */ export declare const PayrollBatchResultsEntityType: { readonly Payroll: "payroll"; }; /** * The type of entity this exclusion represents. */ export type PayrollBatchResultsEntityType = ClosedEnum; /** * Always `failed` for an excluded payroll. */ export declare const PayrollBatchResultsExclusionsStatus: { readonly Failed: "failed"; }; /** * Always `failed` for an excluded payroll. */ export type PayrollBatchResultsExclusionsStatus = ClosedEnum; /** * Machine-readable category for why the payroll was excluded. * * @remarks * - `not_found`: the payroll does not exist, or is not associated with a company the partner is mapped to * - `duplicate_operation`: the same payroll UUID appeared more than once in the request; only the first occurrence is processed */ export declare const PayrollBatchResultsCategory: { readonly NotFound: "not_found"; readonly DuplicateOperation: "duplicate_operation"; }; /** * Machine-readable category for why the payroll was excluded. * * @remarks * - `not_found`: the payroll does not exist, or is not associated with a company the partner is mapped to * - `duplicate_operation`: the same payroll UUID appeared more than once in the request; only the first occurrence is processed */ export type PayrollBatchResultsCategory = ClosedEnum; export type Exclusions = { /** * The index of this payroll in the original POST batch array. */ idx?: number | undefined; /** * The type of entity this exclusion represents. */ entityType?: PayrollBatchResultsEntityType | undefined; /** * The UUID of the excluded payroll. */ uuid?: string | undefined; /** * The UUID of the company asserted to own the payroll. */ companyUuid?: string | undefined; /** * Always `failed` for an excluded payroll. */ status?: PayrollBatchResultsExclusionsStatus | undefined; /** * Machine-readable category for why the payroll was excluded. * * @remarks * - `not_found`: the payroll does not exist, or is not associated with a company the partner is mapped to * - `duplicate_operation`: the same payroll UUID appeared more than once in the request; only the first occurrence is processed */ category?: PayrollBatchResultsCategory | undefined; /** * Human-readable explanation for the exclusion. */ message?: string | undefined; }; /** * A payroll cancellation batch with per-payroll results. */ export type PayrollBatchResults = { /** * The unique identifier of the payroll cancellation batch. */ uuid: string; /** * The idempotency key provided when creating the batch. */ idempotencyKey: string; /** * The lifecycle status of the batch request itself. Terminal values are `completed` (processing finished — inspect `results` and `exclusions` for per-payroll outcomes) and `failed` (the batch crashed at the system level; can be retried). This is distinct from the per-payroll `status` returned inside `results[]`. A `completed` batch does not imply every payroll was cancelled. */ status: PayrollBatchResultsStatus; /** * The timestamp when the batch was submitted. */ submittedAt: Date; /** * The timestamp when the batch processing completed. */ completedAt?: Date | null | undefined; /** * The number of payrolls submitted in the batch. */ submittedItems?: number | null | undefined; /** * The number of payrolls processed (cancelled or attempted). Only present once the batch reaches a terminal status. */ processedItems?: number | undefined; /** * The number of payrolls excluded from processing. Only present once the batch reaches a terminal status. */ excludedItems?: number | undefined; /** * Per-payroll cancellation results. Only present once the batch reaches a terminal status. One entry per authorized payroll. */ results?: Array | undefined; /** * Payrolls that could not be processed, determined at submission time. Only present once the batch reaches a terminal status. Every UUID submitted in the POST batch appears in exactly one of `results` or `exclusions`. */ exclusions?: Array | undefined; }; /** @internal */ export declare const PayrollBatchResultsStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const PayrollBatchResultsResultsStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const PayrollBatchResultsResultsCategory$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const PayrollBatchResultsErrors$inboundSchema: z.ZodType; export declare function payrollBatchResultsErrorsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const Results$inboundSchema: z.ZodType; export declare function resultsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const PayrollBatchResultsEntityType$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const PayrollBatchResultsExclusionsStatus$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const PayrollBatchResultsCategory$inboundSchema: z.ZodNativeEnum; /** @internal */ export declare const Exclusions$inboundSchema: z.ZodType; export declare function exclusionsFromJSON(jsonString: string): SafeParseResult; /** @internal */ export declare const PayrollBatchResults$inboundSchema: z.ZodType; export declare function payrollBatchResultsFromJSON(jsonString: string): SafeParseResult; //# sourceMappingURL=payrollbatchresults.d.ts.map