feat: add maintenance ticketing and parts inventory prototype - #963
Draft
jmarrxyz wants to merge 12 commits into
Draft
feat: add maintenance ticketing and parts inventory prototype#963jmarrxyz wants to merge 12 commits into
jmarrxyz wants to merge 12 commits into
Conversation
…pporting surfaces Full-stack implementation migrated from the fleet-vision prototype: - Maintenance screen with Queue (list + kanban board), History tabs - Repair ticket detail modal with status banners, linked miner/rack cards, activity timeline, prev/next navigation - Create ticket modal with miner autocomplete, category/component selection - Bulk close with resolution cards - Infrastructure devices tab under Fleet with miner-style table (sticky name column, configurable columns, manage columns modal) - Infrastructure device detail, add device (scan network + manual), fan behavior settings - Fan behavior integrated into curtailment response profile "Apply to" section - Proto definitions, database migrations, sqlc queries, Go handlers/services for maintenance, inventory, and infradevice domains - Permission constants and authz catalog entries - Mock data seeded from fleet-vision prototype Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Ticket detail modal: sticky footer, collapsing header, staggered card group - Completion form: inline in status card, Select-based fields - Active curtailment module: staggered miner + infra progress bars - Fan behavior modal: simplified to sequence/offset/mode/target, disabled states - Infrastructure "Apply to" row in curtailment response profiles - Responsive toolbar and table column hiding on compact viewports - Overdue tickets banner with View/Dismiss actions - Component icons in list, board, and detail views - Various layout and spacing fixes Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…l refinements - Replace bespoke buttons/inputs/dividers with shared components (Chip→Button, bare buttons→Row, StatusCircle, Divider) - Infrastructure table: sorting, filtering, pagination, column exemptions, select all/none matching miners - Device detail modal: StatusModalLayout pattern, DialogIcon, Row list, toast for test connection - Ticket queue: remove search, overdue banner with dismiss, responsive columns Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ra-devices-revival * origin/main: fix(ha): shorten HA certificate lifetime (#961)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reviewable diff: +7740/-1 across 52 files (excludes generated, test, and story files).
Summary
This draft adds a maintenance workspace for triaging repair tickets, reviewing repair history, and tracking spare-parts inventory. It also defines the protobuf, persistence schema, domain services, and Connect handlers needed to turn the current UI prototype into an operator-backed workflow. The stale branch has been brought onto current
main; its superseded infrastructure-device implementation was removed in favor of the production infrastructure stack already onmain.This remains a draft because the maintenance page currently uses local mock data and the client API adapters, SQL store implementations, and
fleetdhandler registration still need to be wired before the workflow is production-ready.How it works
Users with
maintenance:readsee a new lazy-loaded Maintenance destination. The page exposes list and Kanban queue views, history, and inventory, plus ticket create/detail, comments, status, RMA, completion, bulk-close, and stock-adjustment UI flows; today those views are backed by feature-local mock data. Review feedback is reflected in a standard bulk-close modal, a constrained scrolling ticket detail with shared dropdown icons, and a streamlined create form with a Miner-defaulted category dropdown, current-site selection, and a single description field.The server-side contract is defined in parallel: maintenance and inventory protobuf services generate Connect clients and handlers, handlers enforce
maintenance:readormaintenance:manage, domain services validate mutations and coordinate transactional work, and sqlc queries target the new repair-ticket, comment, part-usage, and inventory tables. Cursor requests are validated before narrowing enum values or passing IDs to the domain layer.flowchart LR U["Fleet operator"] --> N["Maintenance navigation"] N --> P["Maintenance page"] P --> Q["Ticket queue and detail"] P --> H["Repair history"] P --> I["Parts inventory"] Q --> M["Feature-local mock data (current draft)"] H --> M I --> M P --> A["Generated client adapters (to wire)"] A --> C["Connect handlers"] C --> D["Maintenance and inventory domain services"] D --> S["SQL stores (to implement)"] S --> T["Repair and inventory tables"]sequenceDiagram participant Operator participant UI as Maintenance UI participant API as Client adapter participant Handler as Connect handler participant Domain as Domain service participant DB as Postgres Operator->>UI: Create or update repair work UI-->>Operator: Prototype interaction from local state Note over UI,DB: Production request path is defined but not fully wired in this draft UI->>API: Maintenance or inventory request API->>Handler: Validated protobuf message Handler->>Domain: Organization-scoped command Domain->>DB: Transactional sqlc operation DB-->>Domain: Ticket or inventory state Domain-->>UI: Generated responseAreas of the code involved
client/src/protoFleet/features/maintenance/client/src/protoFleet/features/maintenance/**/*.stories.tsxclient/src/protoFleet/api/client/src/protoFleet/config/navItems.ts,routePrefetch.ts,router.tsxproto/maintenance/v1/,proto/inventory/v1/server/internal/handlers/server/internal/domain/maintenance/,inventory/server/internal/domain/stores/interfaces/server/migrations/000144–000148server/sqlc/queries/mainimplementation and discarded the branch's obsolete parallel stackKey technical decisions & trade-offs
main's production infrastructure-device stack instead of reconciling the stale branch's duplicateinfradeviceimplementation.000144–000147instead of editing or colliding with migrations added since the branch diverged.maintenance:readandmaintenance:manageinstead of reusing site permissions, because repair workflows are organization-wide and include inventory operations.Testing & validation
just lint— protobuf, client, server, and plugin lint all pass.server/just build— all server packages build.go test ./... -run '^$'— every server package compiles, including generated maintenance/inventory services.go test ./server/internal/ha/deployment— passes after the final sync withmain.--noEmit, and ProtoFleet production build pass.npm run build-storybookpasses for 16 maintenance scenarios across eight story files.Server Checks / Testpasses the full database-backed suite, including migrations through000148and built-in-role seeding.