8000 Add supplements fields to approved submission editor · Issue #158 · jra3/mulm · GitHub
[go: up one dir, main page]

Skip to content

Add supplements fields to approved submission editor #158

Closed

Description

@jra3

Current implementation plan — 2026-10-15

Part of #558. This section supersedes the obsolete inline-column and approvedEditSchema implementation notes below.

A committee member correcting an Approved HAP/CAP Submission must be able to edit the supplement types and regimens originally supplied by the Member. Propagation, lighting and CO₂ already exist in the details editor; this gap is normalized supplements.

  • Load and render the existing normalized supplement rows, with the same applicability and validation rules as the Member form.
  • Support adding, changing and removing supplement rows, including clearing all. Define omitted input versus explicit empty input so unrelated details edits cannot erase supplements.
  • Extend the approved-details lifecycle operation rather than bypassing it in the route. A supplement-only change is a valid edit.
  • Require the existing committee authorization and reason; retain the prohibition on editing one's own Submission.
  • Commit details, supplement replacement and the single reason-bearing admin audit entry together. A failure anywhere leaves all three unchanged; successful retry creates one committed edit.
  • Keep Species, points, Witness and approval state unchanged; details edits send no notification and trigger no standings recomputation (ADR-0003).
  • Verify add/edit/clear, omitted input, supplement-only edits, unauthorized requests, forbidden points/Species fields and failure/rollback/retry with focused tests. Confirm saved values by reopening the editor; the completed report in Complete Program-aware Submission reports for HAP and CAP #559 will also display them.

Blocked by: None. Coordinate with the Member-save transaction work already in progress, without assuming that uncommitted work is on the default branch.

Original issue (historical context)

Description

The post-approval editor (/admin/submissions/:id/edit-approved) is missing the supplements fields that are present in the main submission form.

Missing Fields

Supplement Type (multi-select):

  • Dosing Pump
  • Manual Addition
  • Root Tabs
  • Liquid Fertilizer
  • Dry Fertilizer

Supplement Regimen (text input):

  • Description of supplement dosing schedule

Context

These fields are:

  • Already in the database (supplement_type, supplement_regimen columns)
  • Already displayed in the main BAP form for Plant/Coral submissions
  • Already parsed and displayed in the edit form rendering code (lines 1022-1023 in src/routes/admin.ts)
  • Only relevant for Plant/Coral species (hasSupplements() helper)

Implementation Notes

  1. Add to Details tab in src/views/admin/editApprovedSubmission.pug
  2. Wrap in if hasSupplements conditional (already passed to template)
  3. Convert comma-separated string back to multi-select format for display
  4. Include in the approvedEditSchema validation (already accepts these as optional strings)

Related Files

  • src/views/admin/editApprovedSubmission.pug - Template to update
  • src/routes/admin.ts:1022-1023 - Already parses these fields
  • src/forms/approvedEdit.ts:25-26 - Schema already includes these fields
  • src/views/bapForm/form.pug:152-170 - Reference implementation in main form

Testing

  1. Edit an approved Plant or Coral submission
  2. Verify supplement fields appear in Details tab
  3. Verify fields can be edited and saved
  4. Verify changes are recorded in edit log

Metadata

Metadata

Assignees

No one assigned

    Labels

    admin-toolsAdmin interface and management toolsenhancementNew feature or requestformsForm handling, validation, and user inputpriority:highHigh priority - should be addressed soonready-for-agentFully specified, ready for an AFK agent

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0