Add unit API and article unitamount/unitSi patch.

Units use the selected company; article PATCH accepts name/unitamount/unitSi.
This commit is contained in:
seb
2026-08-01 06:15:30 +02:00
parent aba9779161
commit bfb1d8762a
13 changed files with 744 additions and 29 deletions

View File

@@ -13,6 +13,7 @@ const STORE_NAMESPACES = [
'category',
'article',
'pic',
'unit',
'lang',
'tax',
'google_auth',

16
src/db/unit.js Normal file
View File

@@ -0,0 +1,16 @@
import { getStore } from './store.js';
export async function list(googleAuthId, companyId) {
const store = await getStore();
return store.unit.list(googleAuthId, companyId);
}
export async function upsert(googleAuthId, companyId, data) {
const store = await getStore();
return store.unit.upsert(googleAuthId, companyId, data);
}
export async function remove(googleAuthId, companyId, si) {
const store = await getStore();
return store.unit.delete(googleAuthId, companyId, si);
}