feat(sync): harden the Hiboutik sync, share rate limits across instances, update dependencies (#4)
This commit is contained in:
@@ -1,10 +1,13 @@
|
||||
import { z } from 'zod';
|
||||
import { hiboutikId, hiboutikNumber, hiboutikRef } from './hiboutik.schema';
|
||||
|
||||
/** Available stock of one product size, as returned by Hiboutik `GET /stock_available/all_wh` (all warehouses). */
|
||||
export interface StockHiboutikDto {
|
||||
product_id: number;
|
||||
export const stockHiboutikSchema = z.object({
|
||||
product_id: hiboutikId,
|
||||
/** Size id, 0 for a product without sizes. */
|
||||
product_size: number;
|
||||
/** Decimal as a string, e.g. "3". Stays at 0 while stock management is disabled in Hiboutik. */
|
||||
stock_available: string;
|
||||
product_barcode: string;
|
||||
product_supplier_reference: string;
|
||||
}
|
||||
product_size: hiboutikRef,
|
||||
/** Sent as a decimal string, e.g. "3". Stays at 0 while stock management is disabled in Hiboutik. */
|
||||
stock_available: hiboutikNumber,
|
||||
});
|
||||
|
||||
export type StockHiboutikDto = z.output<typeof stockHiboutikSchema>;
|
||||
|
||||
Reference in New Issue
Block a user