This commit is contained in:
seb
2026-09-22 07:25:16 +02:00
parent 4ed6260e91
commit cca131d83a
148 changed files with 5343 additions and 3466 deletions

View File

@@ -138,55 +138,52 @@ export default class LibDashStore {
}
this.provider = provider;
// Transitional: store modules still use the raw mssql pool.
// They are converted to provider.query() area by area (see TODO.md).
const pool = provider.pool;
this.pool = pool;
this.pool = provider.pool;
this.companyuser = {
getByEmail: companyuserGetByEmail(pool),
add: companyuserAdd(pool),
delete: companyuserDelete(pool),
getByEmail: companyuserGetByEmail(provider),
add: companyuserAdd(provider),
delete: companyuserDelete(provider),
};
this.company = {
create: companyCreate(pool),
update: companyUpdate(pool),
delete: companyDelete(pool),
list: companyList(pool),
create: companyCreate(provider),
update: companyUpdate(provider),
delete: companyDelete(provider),
list: companyList(provider),
};
this.category = {
getTreeForCompany: categoryGetTreeForCompany(pool),
getCategoryArticles: categoryGetCategoryArticles(pool),
createUnderParent: categoryCreateUnderParent(pool),
ensureByPath: categoryEnsureByPath(pool),
rename: categoryRename(pool),
move: categoryMove(pool),
order: categoryOrder(pool),
delete: categoryDelete(pool),
addImage: categoryAddImage(pool),
deleteImage: categoryDeleteImage(pool),
getTreeForCompany: categoryGetTreeForCompany(provider),
getCategoryArticles: categoryGetCategoryArticles(provider),
createUnderParent: categoryCreateUnderParent(provider),
ensureByPath: categoryEnsureByPath(provider),
rename: categoryRename(provider),
move: categoryMove(provider),
order: categoryOrder(provider),
delete: categoryDelete(provider),
addImage: categoryAddImage(provider),
deleteImage: categoryDeleteImage(provider),
};
this.article = {
createUnderParent: articleCreateUnderParent(pool),
getBySku: articleGetBySku(pool),
getHistoryBySku: articleGetHistoryBySku(pool),
listSearchIndex: articleListSearchIndex(pool),
listExport: articleListExport(pool),
updateBySku: articleUpdateBySku(pool),
setPricesBySku: articleSetPricesBySku(pool),
setEansBySku: articleSetEansBySku(pool),
setBrandIdBySku: articleSetBrandIdBySku(pool),
setWeightBySku: articleSetWeightBySku(pool),
setCategoryIdsBySku: articleSetCategoryIdsBySku(pool),
setFatherBySku: articleSetFatherBySku(pool),
importRows: articleImportRows(pool),
addImage: articleAddImage(pool),
deleteImage: articleDeleteImage(pool),
orderImages: articleOrderImages(pool),
delete: articleDelete(pool),
createUnderParent: articleCreateUnderParent(provider),
getBySku: articleGetBySku(provider),
getHistoryBySku: articleGetHistoryBySku(provider),
listSearchIndex: articleListSearchIndex(provider),
listExport: articleListExport(provider),
updateBySku: articleUpdateBySku(provider),
setPricesBySku: articleSetPricesBySku(provider),
setEansBySku: articleSetEansBySku(provider),
setBrandIdBySku: articleSetBrandIdBySku(provider),
setWeightBySku: articleSetWeightBySku(provider),
setCategoryIdsBySku: articleSetCategoryIdsBySku(provider),
setFatherBySku: articleSetFatherBySku(provider),
importRows: articleImportRows(provider),
addImage: articleAddImage(provider),
deleteImage: articleDeleteImage(provider),
orderImages: articleOrderImages(provider),
delete: articleDelete(provider),
};
this.lang = {
@@ -205,105 +202,105 @@ export default class LibDashStore {
};
this.unit = {
list: unitList(pool),
upsert: unitUpsert(pool),
delete: unitDelete(pool),
list: unitList(provider),
upsert: unitUpsert(provider),
delete: unitDelete(provider),
};
this.companysetting = {
list: companysettingList(pool),
get: companysettingGet(pool),
set: companysettingSet(pool),
list: companysettingList(provider),
get: companysettingGet(provider),
set: companysettingSet(provider),
};
this.brand = {
list: brandList(pool),
upsert: brandUpsert(pool),
delete: brandDelete(pool),
list: brandList(provider),
upsert: brandUpsert(provider),
delete: brandDelete(provider),
};
this.customergroup = {
list: customergroupList(pool),
create: customergroupCreate(pool),
update: customergroupUpdate(pool),
order: customergroupOrder(pool),
delete: customergroupDelete(pool),
list: customergroupList(provider),
create: customergroupCreate(provider),
update: customergroupUpdate(provider),
order: customergroupOrder(provider),
delete: customergroupDelete(provider),
};
this.entity = {
list: entityList(pool),
getById: entityGetById(pool),
create: entityCreate(pool),
update: entityUpdate(pool),
delete: entityDelete(pool),
peekNextNumber: entityPeekNextNumber(pool),
isNumberFree: entityIsNumberFree(pool),
list: entityList(provider),
getById: entityGetById(provider),
create: entityCreate(provider),
update: entityUpdate(provider),
delete: entityDelete(provider),
peekNextNumber: entityPeekNextNumber(provider),
isNumberFree: entityIsNumberFree(provider),
};
this.entityaddress = {
list: entityaddressList(pool),
create: entityaddressCreate(pool),
update: entityaddressUpdate(pool),
delete: entityaddressDelete(pool),
list: entityaddressList(provider),
create: entityaddressCreate(provider),
update: entityaddressUpdate(provider),
delete: entityaddressDelete(provider),
};
this.entitycontact = {
list: entitycontactList(pool),
create: entitycontactCreate(pool),
update: entitycontactUpdate(pool),
delete: entitycontactDelete(pool),
list: entitycontactList(provider),
create: entitycontactCreate(provider),
update: entitycontactUpdate(provider),
delete: entitycontactDelete(provider),
};
this.supplier = {
list: supplierList(pool),
create: supplierCreate(pool),
update: supplierUpdate(pool),
delete: supplierDelete(pool),
list: supplierList(provider),
create: supplierCreate(provider),
update: supplierUpdate(provider),
delete: supplierDelete(provider),
};
this.articlesupplier = {
listByArticleSku: articlesupplierListByArticleSku(pool),
listByEntityAndSkus: articlesupplierListByEntityAndSkus(pool),
listBySupplierAndSkus: articlesupplierListByEntityAndSkus(pool),
create: articlesupplierCreate(pool),
update: articlesupplierUpdate(pool),
order: articlesupplierOrder(pool),
delete: articlesupplierDelete(pool),
listByArticleSku: articlesupplierListByArticleSku(provider),
listByEntityAndSkus: articlesupplierListByEntityAndSkus(provider),
listBySupplierAndSkus: articlesupplierListByEntityAndSkus(provider),
create: articlesupplierCreate(provider),
update: articlesupplierUpdate(provider),
order: articlesupplierOrder(provider),
delete: articlesupplierDelete(provider),
};
this.delivery = {
list: deliveryList(pool),
getById: deliveryGetById(pool),
create: deliveryCreate(pool),
update: deliveryUpdate(pool),
delete: deliveryDelete(pool),
list: deliveryList(provider),
getById: deliveryGetById(provider),
create: deliveryCreate(provider),
update: deliveryUpdate(provider),
delete: deliveryDelete(provider),
};
this.quote = {
list: quoteList(pool),
getById: quoteGetById(pool),
create: quoteCreate(pool),
update: quoteUpdate(pool),
delete: quoteDelete(pool),
list: quoteList(provider),
getById: quoteGetById(provider),
create: quoteCreate(provider),
update: quoteUpdate(provider),
delete: quoteDelete(provider),
};
this.order = {
list: orderList(pool),
getById: orderGetById(pool),
create: orderCreate(pool),
update: orderUpdate(pool),
delete: orderDelete(pool),
list: orderList(provider),
getById: orderGetById(provider),
create: orderCreate(provider),
update: orderUpdate(provider),
delete: orderDelete(provider),
};
this.posterminal = {
list: posterminalList(pool),
upsert: posterminalUpsert(pool),
delete: posterminalDelete(pool),
setOn: posterminalSetOn(pool),
setOff: posterminalSetOff(pool),
setOnAll: posterminalSetOnAll(pool),
setOffAll: posterminalSetOffAll(pool),
getCategoryPosterminalIds: posterminalGetCategoryPosterminalIds(pool),
list: posterminalList(provider),
upsert: posterminalUpsert(provider),
delete: posterminalDelete(provider),
setOn: posterminalSetOn(provider),
setOff: posterminalSetOff(provider),
setOnAll: posterminalSetOnAll(provider),
setOffAll: posterminalSetOffAll(provider),
getCategoryPosterminalIds: posterminalGetCategoryPosterminalIds(provider),
};
this.google_auth = {
@@ -317,21 +314,21 @@ export default class LibDashStore {
};
this.pic = {
getImageByHash: picGetImageByHash(pool),
getThumbByHash: picGetThumbByHash(pool),
getImageByHash: picGetImageByHash(provider),
getThumbByHash: picGetThumbByHash(provider),
};
this.numbers = {
list: numbersList(pool),
update: numbersUpdate(pool),
list: numbersList(provider),
update: numbersUpdate(provider),
};
this.manifestattachment = {
add: manifestattachmentAdd(pool),
remove: manifestattachmentRemove(pool),
listByManifestId: manifestattachmentListByManifestId(pool),
getById: manifestattachmentGetById(pool),
order: manifestattachmentOrder(pool),
add: manifestattachmentAdd(provider),
remove: manifestattachmentRemove(provider),
listByManifestId: manifestattachmentListByManifestId(provider),
getById: manifestattachmentGetById(provider),
order: manifestattachmentOrder(provider),
};
this.purge = storePurge(provider);
@@ -347,3 +344,6 @@ export default class LibDashStore {
}
export { SCHEMA_SCRIPTS } from './providers/mssql/schema.js';
export { BetterSqlite3Provider } from './providers/sqlite3/index.js';
export { MssqlProvider } from './providers/mssql/index.js';