This commit is contained in:
seb
2026-10-22 12:30:06 +02:00
parent bb880e3c84
commit 9495ad51cc
27 changed files with 539 additions and 238 deletions

View File

@@ -127,6 +127,11 @@ async function run() {
name: 'POS Register 1',
pairingpin: '1234',
});
await store.posterminal.pair(posTerminal.id, {
token: 'pos-token-1',
clientserial: 'SN1',
pairedAt: new Date().toISOString(),
});
await store.posterminal.setOn(googleAuthId, posTerminal.id, subCat2.id);
await store.posterminal.setOn(googleAuthId, posTerminal.id, outsideCat.id);
@@ -170,7 +175,7 @@ async function run() {
/Article not found/
);
// tombstone for artOnlySub exists
const t1 = provider.db.prepare('SELECT * FROM articletombstone WHERE sku = ?').all(artOnlySub.sku);
const t1 = provider.db.prepare("SELECT * FROM posterminaltombstone WHERE posterminal_id = ? AND entity_type = 'article' AND entity_id = ?").all(posTerminal.id, artOnlySub.id);
assert.equal(t1.length, 1);
// artParent and its child artChild: both deleted
@@ -182,8 +187,8 @@ async function run() {
() => store.article.getBySku(googleAuthId, artChild.article.sku),
/Article not found/
);
const tParent = provider.db.prepare('SELECT * FROM articletombstone WHERE sku = ?').all(artParent.sku);
const tChild = provider.db.prepare('SELECT * FROM articletombstone WHERE sku = ?').all(artChild.article.sku);
const tParent = provider.db.prepare("SELECT * FROM posterminaltombstone WHERE posterminal_id = ? AND entity_type = 'article' AND entity_id = ?").all(posTerminal.id, artParent.id);
const tChild = provider.db.prepare("SELECT * FROM posterminaltombstone WHERE posterminal_id = ? AND entity_type = 'article' AND entity_id = ?").all(posTerminal.id, artChild.article.id);
assert.equal(tParent.length, 1);
assert.equal(tChild.length, 1);