A price can be stored with an amount no page is prepared to show #94

Open
opened 2026-09-21 07:18:28 +00:00 by cgalo5758 · 0 comments
Owner

What a contributor runs into

core.prices.unit_amount is a plain integer column with no range constraint. The only bound on what lands there is in the handler that writes it, found during an earlier review of the operator forms.

Why it costs

A migration, a script or a second writer can store an amount outside the range the rest of the console assumes, and nothing rejects it until a page renders it or an arithmetic step overflows.

Where

internal/db/migrations/00001_init.sql, the prices table; the price form handler in internal/server.

Done when

The column carries a check constraint for the range the console supports, and the handler refuses the same range with the same bound.

Migrated from status/issues.md at b7a0e15

## What a contributor runs into `core.prices.unit_amount` is a plain integer column with no range constraint. The only bound on what lands there is in the handler that writes it, found during an earlier review of the operator forms. ## Why it costs A migration, a script or a second writer can store an amount outside the range the rest of the console assumes, and nothing rejects it until a page renders it or an arithmetic step overflows. ## Where [`internal/db/migrations/00001_init.sql`](https://git.coopcloud.tech/wiki-cafe/member-console/src/commit/b7a0e15/internal/db/migrations/00001_init.sql), the prices table; the price form handler in [`internal/server`](https://git.coopcloud.tech/wiki-cafe/member-console/src/commit/b7a0e15/internal/server). ## Done when The column carries a check constraint for the range the console supports, and the handler refuses the same range with the same bound. Migrated from status/issues.md at b7a0e15
cgalo5758 added the
kind
debt
area/catalogarea/billing
labels 2026-09-21 07:18:28 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: wiki-cafe/member-console#94