feat(cleaner): add preload API for cleaner operation history

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Misaka_Company
2026-04-13 11:52:14 +08:00
parent 73656dada8
commit 74096fbfa0
3 changed files with 162 additions and 1 deletions

View File

@@ -11,6 +11,12 @@ import type {
ExportResultItem,
ExportResultResponse
} from './cleaner.types'
import type {
CleanerBatchStats,
CleanerExecutionRecord,
CleanerOrderRecord,
CleanerMaterialRecord
} from './cleaner-history.types'
import type { IpcResult } from './ipc.types'
/**
@@ -113,6 +119,45 @@ export interface CleanerAPI {
* @returns Unsubscribe function
*/
onProgress: (callback: (data: CleanerProgress) => void) => () => void
/**
* Get cleaner operation history batches
* @param options - Query options (limit, offset, usernames)
*/
getHistoryBatches: (options?: {
limit?: number
offset?: number
usernames?: string[]
}) => Promise<IpcResult<CleanerBatchStats[]>>
/**
* Get detailed execution and order records for a specific batch
* @param batchId - Batch ID
*/
getHistoryBatchDetails: (batchId: string) => Promise<
IpcResult<{
executions: CleanerExecutionRecord[]
orders: CleanerOrderRecord[]
}>
>
/**
* Get material-level details for a specific order in a batch attempt
* @param batchId - Batch ID
* @param attemptNumber - Attempt number
* @param orderNumber - Order number
*/
getHistoryMaterialDetails: (
batchId: string,
attemptNumber: number,
orderNumber: string
) => Promise<IpcResult<CleanerMaterialRecord[]>>
/**
* Delete a cleaner history batch
* @param batchId - Batch ID
*/
deleteHistoryBatch: (batchId: string) => Promise<IpcResult<{ deleted: boolean }>>
}
/**