[Issue]: Add a PO line items units entry for months and year #44

Closed
opened 2026-06-20 18:58:54 +00:00 by shad0w · 3 comments
Owner

Raised by

Hardik Singh(admin) (admin@pelagiamarine.com, ADMIN) — via portal Report Issue button

Description

Currently the units dropdown only has days, need months and year(s) also as an option

Priority

P0 — Critical (broken / blocking)

Context

  • Page: /dashboard
  • Reported at: 2026-06-20T18:58:54.951Z
### Raised by Hardik Singh(admin) (admin@pelagiamarine.com, ADMIN) — via portal Report Issue button ### Description Currently the units dropdown only has days, need months and year(s) also as an option ### Priority P0 — Critical (broken / blocking) ### Context - Page: `/dashboard` - Reported at: 2026-06-20T18:58:54.951Z
shad0w added the
portal
label 2026-06-20 18:58:54 +00:00
shad0w added the
feature
claude-queue
triaged
labels 2026-06-20 19:01:09 +00:00
Author
Owner

Claude triage

Triage — Issue #44: Add PO line-item unit options for months and year(s)

Interpretation

The PO line-items editor exposes a fixed Unit of Measure (UoM) dropdown. The reporter
(admin) wants time-based duration units beyond the existing day — specifically month(s)
and year(s) — to be selectable. (The issue says "only has days", but the dropdown actually
carries many units, e.g. pc/kg/L/hr/day; the real ask is simply that the time/duration units
are incomplete — hr and day exist, but week/month/year do not.) This is an enhancement
to an existing list, not a broken behaviour.

Action items

  1. In App/components/po/po-line-items-editor.tsx, append new entries to the UOM_OPTIONS
    array (around lines 10–27), e.g.:
    • { value: "month", label: "month — Month" }
    • { value: "year", label: "year — Year" }
      (Optionally add week for completeness, but stick to the requested month/year unless
      product confirms otherwise.)
  2. No other code change is strictly required: the array is the single source of truth, rendered
    directly into the <select> at lines 396–398.

Files / areas involved

  • App/components/po/po-line-items-editor.tsx — the only definition and only consumer of
    UOM_OPTIONS (confirmed via repo-wide grep; no duplicate list elsewhere).

Why this is safe / verifiable

  • The unit field is validated as a free-form string only — lib/validations/po.ts:7
    (unit: z.string().min(1, "Unit is required")). There is no Zod enum, no Prisma enum, and
    no DB migration
    tied to UoM values, so new options are accepted by validation and persistence
    with no schema work.
  • Stored as a plain string on POLineItem; display (po-detail.tsx shows item.unit verbatim)
    and exports are unaffected.
  • Change is a one-array-literal edit; verifiable by pnpm type-check and pnpm lint. A unit test
    asserting the new options appear in the dropdown could be added (tests/unit/po-line-items-editor.test.tsx
    exists per CLAUDE.md command examples).
  • No touch to auth/permissions, payments/money, DB migrations, external systems, or GST logic.

Open questions (non-blocking)

  • Exact value/label convention: use singular month/year (consistent with existing singular
    day, hr) — assumed. Reporter wrote "year(s)"/"months"; recommend keeping values singular.
  • Whether to also add week. Default: add only what was requested (month, year).
  • Whether to backfill these onto seeded product UoMs — out of scope; user picks per line item.

Routing rationale: Single-file append to a free-string UoM list with no enum/migration/permission/money impact and type-check + lint verifiability — safe for an unattended claude-queue run.

Routing: claude-queue | Type: feature

## Claude triage # Triage — Issue #44: Add PO line-item unit options for months and year(s) ## Interpretation The PO line-items editor exposes a fixed **Unit of Measure (UoM)** dropdown. The reporter (admin) wants time-based duration units beyond the existing `day` — specifically **month(s)** and **year(s)** — to be selectable. (The issue says "only has days", but the dropdown actually carries many units, e.g. pc/kg/L/hr/day; the real ask is simply that the *time/duration* units are incomplete — `hr` and `day` exist, but `week`/`month`/`year` do not.) This is an enhancement to an existing list, not a broken behaviour. ## Action items 1. In `App/components/po/po-line-items-editor.tsx`, append new entries to the `UOM_OPTIONS` array (around lines 10–27), e.g.: - `{ value: "month", label: "month — Month" }` - `{ value: "year", label: "year — Year" }` (Optionally add `week` for completeness, but stick to the requested `month`/`year` unless product confirms otherwise.) 2. No other code change is strictly required: the array is the single source of truth, rendered directly into the `<select>` at lines 396–398. ## Files / areas involved - `App/components/po/po-line-items-editor.tsx` — the only definition and only consumer of `UOM_OPTIONS` (confirmed via repo-wide grep; no duplicate list elsewhere). ## Why this is safe / verifiable - The `unit` field is validated as a free-form string only — `lib/validations/po.ts:7` (`unit: z.string().min(1, "Unit is required")`). There is **no Zod enum, no Prisma enum, and no DB migration** tied to UoM values, so new options are accepted by validation and persistence with no schema work. - Stored as a plain string on `POLineItem`; display (`po-detail.tsx` shows `item.unit` verbatim) and exports are unaffected. - Change is a one-array-literal edit; verifiable by `pnpm type-check` and `pnpm lint`. A unit test asserting the new options appear in the dropdown could be added (`tests/unit/po-line-items-editor.test.tsx` exists per CLAUDE.md command examples). - No touch to auth/permissions, payments/money, DB migrations, external systems, or GST logic. ## Open questions (non-blocking) - Exact value/label convention: use singular `month`/`year` (consistent with existing singular `day`, `hr`) — assumed. Reporter wrote "year(s)"/"months"; recommend keeping values singular. - Whether to also add `week`. Default: add only what was requested (`month`, `year`). - Whether to backfill these onto seeded product UoMs — out of scope; user picks per line item. Routing rationale: Single-file append to a free-string UoM list with no enum/migration/permission/money impact and type-check + lint verifiability — safe for an unattended claude-queue run. **Routing:** `claude-queue` | **Type:** `feature`
shad0w added
claude-working
and removed
claude-queue
labels 2026-06-20 19:01:09 +00:00
Author
Owner

[Claude] Started working on this issue on branch claude/issue-44.

<!-- ppms-bot --> [Claude] Started working on this issue on branch `claude/issue-44`.
shad0w added
claude-pr
and removed
claude-working
labels 2026-06-20 19:02:55 +00:00
Author
Owner

[Claude] Opened PR #45 with a proposed fix. Review and merge it, then create a release tag to deploy.

<!-- ppms-bot --> [Claude] Opened PR [#45](https://git.pelagiamarine.com/shad0w/pelagia-portal/pulls/45) with a proposed fix. Review and merge it, then create a release tag to deploy.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: shad0w/pelagia-portal#44
No description provided.