Add delivery and supplier HTTP APIs with expanded response docs.

Wire store-backed CRUD for goods receipts and suppliers, and teach the API doc generator to expand $ref/allOf/array samples so route markdown shows full JSON shapes.
This commit is contained in:
seb
2026-08-06 05:32:48 +02:00
parent a748bd5f5c
commit 1860f38640
52 changed files with 2515 additions and 66 deletions

26
src/db/delivery.js Normal file
View File

@@ -0,0 +1,26 @@
import { getStore } from './store.js';
export async function list(googleAuthId, companyId) {
const store = await getStore();
return store.delivery.list(googleAuthId, companyId);
}
export async function getById(googleAuthId, companyId, id) {
const store = await getStore();
return store.delivery.getById(googleAuthId, companyId, id);
}
export async function create(googleAuthId, companyId, data) {
const store = await getStore();
return store.delivery.create(googleAuthId, companyId, data);
}
export async function update(googleAuthId, companyId, id, data) {
const store = await getStore();
return store.delivery.update(googleAuthId, companyId, id, data);
}
export async function remove(googleAuthId, companyId, id) {
const store = await getStore();
return store.delivery.delete(googleAuthId, companyId, id);
}

View File

@@ -19,6 +19,8 @@ const STORE_NAMESPACES = [
'tax',
'google_auth',
'posterminal',
'supplier',
'delivery',
];
/**

21
src/db/supplier.js Normal file
View File

@@ -0,0 +1,21 @@
import { getStore } from './store.js';
export async function list(googleAuthId, companyId) {
const store = await getStore();
return store.supplier.list(googleAuthId, companyId);
}
export async function create(googleAuthId, companyId, data) {
const store = await getStore();
return store.supplier.create(googleAuthId, companyId, data);
}
export async function update(googleAuthId, companyId, id, data) {
const store = await getStore();
return store.supplier.update(googleAuthId, companyId, id, data);
}
export async function remove(googleAuthId, companyId, id) {
const store = await getStore();
return store.supplier.delete(googleAuthId, companyId, id);
}