Update README and SQL files to include 'fullHash', 'fullW', 'fullH', and 'fullSize' for articles and photos

This commit is contained in:
seb
2026-08-01 04:33:00 +02:00
parent 3b0d3266a5
commit ee895fab5f
3 changed files with 6 additions and 2 deletions

View File

@@ -124,7 +124,7 @@ Backend mapping:
| `createUnderParent` | `({ googleAuthId, parentId, name })` | `{ id, parentId, sort, name }` | | `createUnderParent` | `({ googleAuthId, parentId, name })` | `{ id, parentId, sort, name }` |
| `delete` | `({ googleAuthId, id })` | `void` — blocked by FK if `categoryarticle` or child categories remain | | `delete` | `({ googleAuthId, id })` | `void` — blocked by FK if `categoryarticle` or child categories remain |
| `getTreeForCompany` | `(googleAuthId, companyId)` | `{ languageId, tree, articles }` | | `getTreeForCompany` | `(googleAuthId, companyId)` | `{ languageId, tree, articles }` |
| `getCategoryArticles` | `(googleAuthId, categoryId)` | `{ id, sku, name, slug, net, taxRate, optionsCount, articleListCount, childCount, fatherArticleId, fatherSku, thumbW, thumbH, thumbHash }[]` | | `getCategoryArticles` | `(googleAuthId, categoryId)` | `{ id, sku, name, slug, net, taxRate, optionsCount, articleListCount, childCount, fatherArticleId, fatherSku, fullHash, thumbW, thumbH, thumbHash }[]` |
### `createUnderParent` (transaction) ### `createUnderParent` (transaction)
@@ -181,7 +181,7 @@ Backend mapping:
} }
``` ```
`getCategoryArticles` / `getTreeForCompany().articles[]` keep the flat list shape (`net`, `taxRate`, single `thumbW`/`thumbH`/`thumbHash`). `getCategoryArticles` / `getTreeForCompany().articles[]` keep the flat list shape (`net`, `taxRate`, single `fullHash`/`thumbW`/`thumbH`/`thumbHash`).
`parentId` is the category id. Creates `article` + `articletext` (company default language) + `categoryarticle` in one transaction. Allocates `sku` via `getnextnumberwithprefixandpadding` (`type` `sku`; creates `numbers` row with empty prefix if missing). Default unit `pc` is ensured if missing (`unitamount` 1, `weight` 0). Auth via `resolveCategoryAccess(googleAuthId, parentId)` — `Parent not found` / `Not authorized`. `parentId` is the category id. Creates `article` + `articletext` (company default language) + `categoryarticle` in one transaction. Allocates `sku` via `getnextnumberwithprefixandpadding` (`type` `sku`; creates `numbers` row with empty prefix if missing). Default unit `pc` is ensured if missing (`unitamount` 1, `weight` 0). Auth via `resolveCategoryAccess(googleAuthId, parentId)` — `Parent not found` / `Not authorized`.

View File

@@ -46,6 +46,7 @@ export const ARTICLE_LIST_COLUMNS = `
) AS childCount, ) AS childCount,
a.fatherarticle_id AS fatherArticleId, a.fatherarticle_id AS fatherArticleId,
father.sku AS fatherSku, father.sku AS fatherSku,
pic.hash AS fullHash,
pic.thumbw AS thumbW, pic.thumbw AS thumbW,
pic.thumbh AS thumbH, pic.thumbh AS thumbH,
pic.thumbhash AS thumbHash pic.thumbhash AS thumbHash

View File

@@ -65,6 +65,9 @@ export const GET_PHOTOS_BY_ARTICLE_ID = `
SELECT SELECT
ap.sort, ap.sort,
p.hash AS fullHash, p.hash AS fullHash,
p.w AS fullW,
p.h AS fullH,
p.size AS fullSize,
p.thumbw AS thumbW, p.thumbw AS thumbW,
p.thumbh AS thumbH, p.thumbh AS thumbH,
p.thumbhash AS thumbHash p.thumbhash AS thumbHash