Ignore job: dismiss open jobs from the market (ISS-047 part B, v0.29.0) #59

Merged
kamilkrzywda merged 2 commits from feat/ignore-job into master 2026-09-20 20:15:42 +02:00
Owner

What changed (ISS-047 part B — "Add availability for ignoring job")

New terminal package status 'ignored' — added to the packages status enum in lib/db/schema.ts, the PackageState.status union in lib/game/state.ts, and the OpenAPI PackageState schema. No DB migration needed (status column is plain TEXT, no CHECK constraint). Ignored jobs leave the board permanently; the existing top-up logic refills open jobs to 10 with new random ones.

New endpoint — POST /api/packages/{packageId}/ignore (no body, mirrors the abandon route): 404 unknown id, 409 unless status is 'open', otherwise flips it to 'ignored'. Becomes the 13th public endpoint; OpenAPI spec + both endpoint-count assertions updated (lib/openapi.test.ts, e2e/api.spec.ts).

UI — small "Ignore" button beside Load on each open-package row in the Jobs tab (testid ignore-{pkg.id}, disabled while busy). No reputation cost, no side effects.

Tests

  • Unit: +7 tests (ignorePackage happy path + 409 for every non-open status + 404; 'ignored' added to the "terminal statuses never expire" engine test) → vitest 325 passed (was 318).
  • E2E (CI-only): new right-pane test — hook-created package renders, click Ignore, poll until status is 'ignored', row gone from the list, second ignore attempt returns 409. playwright --list: 47 tests in 13 files.

Completes ISS-047 (part A shipped as v0.28.0).

## What changed (ISS-047 part B — "Add availability for ignoring job") **New terminal package status `'ignored'`** — added to the packages status enum in `lib/db/schema.ts`, the `PackageState.status` union in `lib/game/state.ts`, and the OpenAPI PackageState schema. No DB migration needed (status column is plain TEXT, no CHECK constraint). Ignored jobs leave the board permanently; the existing top-up logic refills open jobs to 10 with new random ones. **New endpoint** — `POST /api/packages/{packageId}/ignore` (no body, mirrors the abandon route): 404 unknown id, 409 unless status is 'open', otherwise flips it to 'ignored'. Becomes the 13th public endpoint; OpenAPI spec + both endpoint-count assertions updated (`lib/openapi.test.ts`, `e2e/api.spec.ts`). **UI** — small "Ignore" button beside Load on each open-package row in the Jobs tab (testid `ignore-{pkg.id}`, disabled while busy). No reputation cost, no side effects. ## Tests - Unit: +7 tests (ignorePackage happy path + 409 for every non-open status + 404; 'ignored' added to the "terminal statuses never expire" engine test) → vitest **325 passed** (was 318). - E2E (CI-only): new right-pane test — hook-created package renders, click Ignore, poll until status is 'ignored', row gone from the list, second ignore attempt returns 409. `playwright --list`: 47 tests in 13 files. Completes ISS-047 (part A shipped as v0.28.0).
kamilkrzywda added 1 commit 2026-09-20 16:34:11 +02:00
New terminal status 'ignored' + ignorePackage action + POST /api/packages/{packageId}/ignore
(no body, no penalty; top-up logic refills the market). Ignore button per open-package row in
the Jobs tab. OpenAPI gains the 13th endpoint; unit tests for the action (happy/409x5/404),
engine terminal-status coverage, and a new e2e spec test.
kamilkrzywda scheduled this pull request to auto merge when all checks succeed 2026-09-20 16:34:22 +02:00
kamilkrzywda added 1 commit 2026-09-20 20:07:21 +02:00
kamilkrzywda merged commit 86d486fb69 into master 2026-09-20 20:15:42 +02:00
kamilkrzywda deleted branch feat/ignore-job 2026-09-20 20:15:42 +02:00
Sign in to join this conversation.