Implementa o MVP do Adaptador de Planilhas no Elo Pro.
O módulo usa a identidade Supabase, isola cada workspace e registra storage, TTL, runner e biblioteca XLSX como decisões ainda abertas. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
commit
6e23f1533b
144 files changed
+19060
No files matched your search
@@ -0,0 +1,67 @@
|
||||
import type { ColumnSchema, JobProgress, JobStatus, MappingInput, SourceStatus } from "@/domain/spreadsheet-adapter/types";
|
||||
|
||||
export type MappingDto = {
|
||||
sourceColumn: string;
|
||||
modelColumn: string;
|
||||
isRequired: boolean;
|
||||
position: number;
|
||||
};
|
||||
|
||||
export type ModelDto = {
|
||||
id: string;
|
||||
name: string;
|
||||
originalFilename: string;
|
||||
format: "xlsx" | "csv";
|
||||
sheetName: string | null;
|
||||
headerRow: number;
|
||||
columns: ColumnSchema[];
|
||||
createdAt: string;
|
||||
createdByName: string;
|
||||
};
|
||||
|
||||
export type SourceDto = {
|
||||
id: string;
|
||||
sourceName: string;
|
||||
status: SourceStatus;
|
||||
selectedSheet: string | null;
|
||||
sheets: string[];
|
||||
headerRow: number;
|
||||
rowCount: number;
|
||||
sizeBytes: number;
|
||||
errorCode: string | null;
|
||||
warnings: string[];
|
||||
columns: ColumnSchema[];
|
||||
mappings: MappingDto[];
|
||||
expiresAt: string;
|
||||
hasOutput: boolean;
|
||||
};
|
||||
|
||||
export type JobDto = {
|
||||
id: string;
|
||||
status: JobStatus;
|
||||
errorCode: string | null;
|
||||
progress: JobProgress | null;
|
||||
currentSource: number;
|
||||
model: { id: string; name: string; columns: ColumnSchema[] };
|
||||
sources: SourceDto[];
|
||||
};
|
||||
|
||||
export type SourceSchemaPayload = {
|
||||
columns: ColumnSchema[];
|
||||
sheets: string[];
|
||||
warnings: string[];
|
||||
};
|
||||
|
||||
export type UploadFile = {
|
||||
filename: string;
|
||||
bytes: Buffer;
|
||||
};
|
||||
|
||||
export type ModelCreateInput = UploadFile & {
|
||||
name: string;
|
||||
sheet?: string | null;
|
||||
headerRow?: number;
|
||||
requiredColumns?: string[];
|
||||
};
|
||||
|
||||
export type { MappingInput };
|
||||
Reference in new issue
Block a user