feat: define core TypeScript interfaces

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Misaka
2026-03-01 11:53:59 +08:00
parent 4364c71bf9
commit 3222e03cea
3 changed files with 54 additions and 0 deletions

View File

@@ -0,0 +1,21 @@
export interface CleanerInput {
orderNumbers: string[];
materialCodes: string[];
dryRun: boolean;
onProgress?: (message: string, progress: number) => void;
}
export interface CleanerResult {
ordersProcessed: number;
materialsDeleted: number;
materialsSkipped: number;
errors: string[];
details: OrderCleanDetail[];
}
export interface OrderCleanDetail {
orderNumber: string;
materialsDeleted: number;
materialsSkipped: number;
errors: string[];
}

View File

@@ -0,0 +1,16 @@
export interface ErpConfig {
url: string;
username: string;
password: string;
}
export interface ErpSession {
browser: import('playwright').Browser;
context: import('playwright').BrowserContext;
page: import('playwright').Page;
isLoggedIn: boolean;
}
export interface ProgressCallback {
(message: string, progress?: number): void;
}

View File

@@ -0,0 +1,17 @@
export interface ExtractorInput {
orderNumbers: string[];
batchSize?: number;
onProgress?: (message: string, progress: number) => void;
}
export interface ExtractorResult {
downloadedFiles: string[];
mergedFile: string | null;
recordCount: number;
errors: string[];
}
export interface OrderInfo {
orderNumber: string;
productionId: string;
}