Sync only V3 product compositions
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m46s
All checks were successful
Build and Deploy / build-and-push (push) Successful in 1m46s
This commit is contained in:
@@ -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: []
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user