Sync only V3 product compositions
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m46s

This commit is contained in:
Cauê Faleiros
2026-07-29 14:46:25 -03:00
parent b1067325b9
commit 06b59d8d37

View File

@@ -37,13 +37,7 @@ type StructurePayload = {
totalQuantity: string;
unit: string;
}>;
steps: Array<{
stepNumber: number;
name: string;
startDate: null;
endDate: null;
status: string;
}>;
steps: never[];
};
type SyncState = {
status?: 'running' | 'stopped' | 'completed';
@@ -270,13 +264,7 @@ async function buildPayload(productId: string): Promise<StructurePayload | null>
notes: `Composição sincronizada da API pública Olist V3 para produto ${product.id}.`
},
components: components.filter(component => component.componentSku || component.componentName),
steps: (manufactured?.etapas || []).map((name, index) => ({
stepNumber: index + 1,
name: text(name),
startDate: null,
endDate: null,
status: 'pendente'
})).filter(step => step.name)
steps: []
};
}