This commit is contained in:
seb
2026-10-22 14:39:46 +02:00
parent a27f507138
commit 36a135011f
3 changed files with 9 additions and 9 deletions

View File

@@ -10,7 +10,7 @@ Returns deleted entities after lastChangedDeletedEntity cursor for the authentic
| Param | Required | Type | Description | | Param | Required | Type | Description |
|-------|----------|------|-------------| |-------|----------|------|-------------|
| `lastChangedDeletedEntity` | no | string | Sequential ID cursor of last processed tombstone | | `lastChangedDeletedEntity` | no | string | Sequential ID cursor of last processed obituary |
| `limit` | no | integer | Maximum number of deleted entities to return | | `limit` | no | integer | Maximum number of deleted entities to return |
## Response `200` ## Response `200`

View File

@@ -115,9 +115,9 @@ export async function getProductList(params) {
return store.posterminal.getProductList(params); return store.posterminal.getProductList(params);
} }
export async function setMaxKnownTombstoneId(id, maxknowntombstoneid) { export async function setMaxKnownObituaryId(id, maxknownobituaryid) {
const store = await getStore(); const store = await getStore();
return store.posterminal.setMaxKnownTombstoneId(id, maxknowntombstoneid); return store.posterminal.setMaxKnownObituaryId(id, maxknownobituaryid);
} }
/** /**

View File

@@ -22,7 +22,7 @@ const TYPE_MAP = {
* name: lastChangedDeletedEntity * name: lastChangedDeletedEntity
* schema: * schema:
* type: string * type: string
* description: Sequential ID cursor of last processed tombstone * description: Sequential ID cursor of last processed obituary
* - in: query * - in: query
* name: limit * name: limit
* schema: * schema:
@@ -57,17 +57,17 @@ export async function handleDeletedEntity(req, res, next) {
const cursor = Number(req.query.lastChangedDeletedEntity) || 0; const cursor = Number(req.query.lastChangedDeletedEntity) || 0;
const limit = Number(req.query.limit) || 200; const limit = Number(req.query.limit) || 200;
const tombstones = await getDeletedEntityList({ const obituaries = await getDeletedEntityList({
posterminalId: posterminal.id, posterminalId: posterminal.id,
cursor, cursor,
limit, limit,
}); });
res.json( res.json(
tombstones.map((t) => ({ obituaries.map((o) => ({
entityId: String(t.entityId), entityId: String(o.entityId),
entityType: TYPE_MAP[t.entityType?.toLowerCase()] ?? 0, entityType: TYPE_MAP[o.entityType?.toLowerCase()] ?? 0,
lastChanged: t.id, lastChanged: o.id,
})) }))
); );
} catch (err) { } catch (err) {