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;
|
totalQuantity: string;
|
||||||
unit: string;
|
unit: string;
|
||||||
}>;
|
}>;
|
||||||
steps: Array<{
|
steps: never[];
|
||||||
stepNumber: number;
|
|
||||||
name: string;
|
|
||||||
startDate: null;
|
|
||||||
endDate: null;
|
|
||||||
status: string;
|
|
||||||
}>;
|
|
||||||
};
|
};
|
||||||
type SyncState = {
|
type SyncState = {
|
||||||
status?: 'running' | 'stopped' | 'completed';
|
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}.`
|
notes: `Composição sincronizada da API pública Olist V3 para produto ${product.id}.`
|
||||||
},
|
},
|
||||||
components: components.filter(component => component.componentSku || component.componentName),
|
components: components.filter(component => component.componentSku || component.componentName),
|
||||||
steps: (manufactured?.etapas || []).map((name, index) => ({
|
steps: []
|
||||||
stepNumber: index + 1,
|
|
||||||
name: text(name),
|
|
||||||
startDate: null,
|
|
||||||
endDate: null,
|
|
||||||
status: 'pendente'
|
|
||||||
})).filter(step => step.name)
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user