feat: a Tiny order can be the client's own SKUs per length, 1 metro plus the rest
All checks were successful
Build and deploy / Validate source (push) Successful in 5s
Build and deploy / Integration suite on a real stack (push) Successful in 2m31s
Build and deploy / Secret scan and release gate (push) Successful in 5s
Build and deploy / Publish images (push) Successful in 59s

Dropstar's catalogue sells film as SKUs per length, and an order is a sum of
them: 1,30 m is one "1 metro" (DTFIMP.TX.100CM) and one "30 cm"
(DTFIMP.TX.0030CM). The adapter sent one product with the metres as the
quantity. TINY_SKU_<MODE> names a mode's SKU prefix; the order then carries
N times the metre SKU and one 10 cm SKU for the rest, at the price the
customer paid, the last line taking what is left of the item so the order
adds up to the cent. Each code is looked up once by its exact SKU among the
active products. "Testar conexão" and tiny_probe conferir check all ten, and
tiny_probe pedido takes --metros to show a split test order.

Modes without the setting keep their product id: UV and artes avulsas stay
that way until their SKUs are confirmed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Cauê Faleiros
2026-10-05 10:46:07 -03:00
parent a5c1ca53c0
commit e81b2b1681
7 changed files with 197 additions and 14 deletions

View File

@@ -309,6 +309,11 @@ TINY_PRODUCT_TEXTIL_FOLHA=... # Tiny product id for each Site product
TINY_PRODUCT_TEXTIL_AVULSA=...
TINY_PRODUCT_UV_FOLHA=...
TINY_PRODUCT_UV_AVULSA=...
TINY_SKU_TEXTIL_FOLHA=DTFIMP.TX # optional, instead of the product id: sell by the client's
# SKUs (<prefix>.100CM per metre + <prefix>.0010CM … .0090CM)
TINY_SKU_TEXTIL_AVULSA= # same, for the other modes, once their SKUs are confirmed
TINY_SKU_UV_FOLHA=
TINY_SKU_UV_AVULSA=
```
With the client ID and secret set, the Kanban header shows **Conectar Tiny**.

View File

@@ -352,6 +352,19 @@ From the report already sent. These are dated promises, not backlog.
the two Têxtil modes; UV needs a product either way. The item note already
carries the Site mode and grade. No product ids are set in production yet;
both questions go to the client with the Mercado Pago credentials request.
**SKUs (2026-10-05):** the client answered that the products already exist
and an order is a sum of SKUs (1,30 m = `DTFIMP.TX.100CM` + `DTFIMP.TX.0030CM`);
the contact permission is no longer an issue (the user, 2026-09-28).
`TINY_SKU_<MODE>` (e.g. `TINY_SKU_TEXTIL_FOLHA=DTFIMP.TX`) sells a mode as
N × `<prefix>.100CM` plus one `<prefix>.00X0CM`, at the price the customer
paid (the client agreed), the last line taking what is left of the item's
total so the order adds up to the cent. Codes are looked up by `codigo`
(exact match on `sku`, active only) and remembered; "Testar conexão" and
`tiny_probe conferir` check all ten. Assumed, to confirm with the client:
above 1 m it is always N × "1 metro", not the 2–10 m SKUs. UV (only
`DTFIMP.UV.010CM` seen) and artes avulsas stay on a product id per metre
until their SKUs are confirmed. Fake transport only; whether v3's `/produtos`
filters by `codigo` is checked by `conferir` on the account.
**Customer notices through Tiny (2026-09-25, Week 3 head start):** the client
already sends WhatsApp notices from Tiny's order situação (Tiny webhook ->
the `api-tiny-n8n` middleware, which reads the order through API v2 -> n8n