feat: add Warehouses + Integrations modules, /admin/configuracion page
- Schema v0.3: Warehouse + Integration models (db push applied) - WarehousesModule: CRUD, set-default, multi-warehouse support - IntegrationsModule: 26 keys across 7 groups (payment, notifications, customs, courier, marketplace, compliance, warehouse) - AuthService: suite address pulled from default Warehouse in DB (env fallback) - AuthModule: imports WarehousesModule - Seed: creates default warehouse from WAREHOUSE_ADDRESS_* env vars - Web: /admin/configuracion page (3 tabs: Bodegas, Integraciones, Estado APIs) - Web: admin layout adds Configuracion nav link - api.ts: warehouses + integrations client methods
This commit is contained in:
@@ -139,4 +139,19 @@ export const api = {
|
||||
products: {
|
||||
scan: (url: string) => request<any>("/products/scan", { method: "POST", body: JSON.stringify({ url }) }),
|
||||
},
|
||||
warehouses: {
|
||||
list: () => request<any[]>("/warehouses"),
|
||||
getDefault: () => request<any>("/warehouses/default"),
|
||||
get: (id: string) => request<any>(`/warehouses/${id}`),
|
||||
create: (body: any) => request<any>("/warehouses", { method: "POST", body: JSON.stringify(body) }),
|
||||
update: (id: string, body: any) => request<any>(`/warehouses/${id}`, { method: "PATCH", body: JSON.stringify(body) }),
|
||||
setDefault: (id: string) => request<any>(`/warehouses/${id}/set-default`, { method: "PATCH" }),
|
||||
remove: (id: string) => request<any>(`/warehouses/${id}`, { method: "DELETE" }),
|
||||
},
|
||||
integrations: {
|
||||
list: () => request<any[]>("/integrations"),
|
||||
status: () => request<any>("/integrations/status"),
|
||||
batchUpsert: (items: Array<{ key: string; value: string | null; isActive: boolean }>) =>
|
||||
request<any>("/integrations/batch", { method: "PUT", body: JSON.stringify({ items }) }),
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user