Files
adaptador-planilhas/src/server/spreadsheet-adapter/dto.ts
T
camilafagundesandCursor 6e23f1533b 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>
2026-10-02 23:02:00 -03:00

68 lines
1.4 KiB
TypeScript

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 };