49 lines
1.7 KiB
Markdown
49 lines
1.7 KiB
Markdown
# Legacy v1 process smoke
|
|||
|
|
|
||
|
|
Sequential create/process + poll against the legacy public surface:
|
||
|
|
|
||
|
|
1. `POST /api/v1/products/process` with `items[{ean,…}]`
|
||
|
|
2. `GET /api/v1/products/process/{process_id}` until `COMPLETED` / `FAILED` / `CANCELLED`
|
||
|
|
|
||
|
|
Not a load test (that is `scripts/api-load-smoke`). One job, low poll rate.
|
||
|
|
|
||
|
|
## Auth (no secrets in this folder)
|
||
|
|
|
||
|
|
Set **`API_KEY`** (or `-key`). For local Platform Demo, use the seeded key documented in [`docs/demo-user.md`](../../docs/demo-user.md) (prefix `dk_demo_lo…`). Do not commit other keys.
|
||
|
|
|
||
|
|
## Smoke (local)
|
||
|
|
|
||
|
|
API on `:28471` and a **worker** must be running (`npm run dev` or `scripts/run-api.ps1` + worker).
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
$env:API_BASE = "http://127.0.0.1:28471"
|
||
|
|
$env:API_KEY = "<paste from docs/demo-user.md>"
|
||
|
|
cd f:\laragon\www\_MY\descrybe-v2\scripts\v1-process-smoke
|
||
|
|
go run .
|
||
|
|
```
|
||
|
|
|
||
|
|
Defaults: one synthetic EAN (`8700999000001`), `processing_type=full`, poll every 2s, wait up to 3m.
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
go run . -eans 8806088803005,8700000000002 -processing-type full -wait 5m
|
||
|
|
```
|
||
|
|
|
||
|
|
Exit `0` on `COMPLETED`, `1` on failure/timeout, `2` on bad flags / missing key.
|
||
|
|
|
||
|
|
## Cleanup leftover Demo smoke EANs
|
||
|
|
|
||
|
|
There is **no** product soft-delete HTTP API (`GET`/`PATCH` only). After a smoke run, leftover `8700999...` rows stay on **Platform Demo** only (never A1).
|
||
|
|
|
||
|
|
Safe paths (Demo only; both refuse A1):
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
# SQL (preview SELECT is in the script header comments)
|
||
|
|
psql $env:DATABASE_URL -v ON_ERROR_STOP=1 -f scripts/cleanup-process-smoke-eans.sql
|
||
|
|
|
||
|
|
# Or via seed-demo
|
||
|
|
cd apps/api
|
||
|
|
go run ./cmd/seed-demo -purge-smoke-eans
|
||
|
|
```
|
||
|
|
|
||
|
|
Related: [`docs/live-public-api-e2e.md`](../../docs/live-public-api-e2e.md), [`docs/demo-user.md`](../../docs/demo-user.md).
|