Skip to content

Add Create Inventory form for properties and tax lots#71

Open
nllong wants to merge 1 commit into
mainfrom
inventory-create-form
Open

Add Create Inventory form for properties and tax lots#71
nllong wants to merge 1 commit into
mainfrom
inventory-create-form

Conversation

@nllong

@nllong nllong commented Jul 16, 2026

Copy link
Copy Markdown
Member

Summary

Ports the legacy AngularJS "Create Inventory" form (create a Property or Tax Lot, optionally linking a related record) into a standalone InventoryCreateComponent at /{properties|taxlots}/create. Frontend-only — it calls the backend form_create endpoints that already exist in SEED-platform/seed.

Changes

  • InventoryService.createInventory()POST /api/v3/${type}/form_create/ with organization_id + optional related_view_id; centralized ErrorService handling. New InventoryFormCreateState/Data + FormCreateResponse types.
  • InventoryCreateComponent (standalone) — access level / level instance / cycle selectors; a column-rows table with Material autocomplete over all columns; All Canonical Fields / All Extra Data Fields / Reset / Add Column; column list profile select; live validation (cycle + ALI required, no duplicate display names, ≥1 matching-criteria value per present table); unknown typed names become extra_data string columns.
  • Save flow — confirm dialog, then POST primary and (if the related record has data) POST the related with related_view_id. Property lot_number is linked to taxlot jurisdiction_tax_lot_id.
  • Route + navcreate route registered before :id; "Create Property" and "Create Tax Lot" navigation entries.
  • i18n — all user-facing strings go through Transloco; new keys added to public/i18n/en_US.json.

Design note

The legacy post-save "success modal that offers to view the record" is replaced with a success snackbar + automatic navigation to /{type}/{view_id} (idiomatic SPA). The pre-save confirm dialog is kept. A null view_id (duplicate/merge) shows an info snackbar and does not navigate.

Backend dependency

Requires the form_create endpoints from SEED-platform/seed#4918 (branch 4846-create-property-form). To test, run a backend on that branch and point the dev proxy at it via SEED_HOST in .env.

Screenshots

Create Property — overview (validation banner clears once a matching-criteria value is present):

Create Property form

Pre-save confirm dialog:

Confirm dialog

Linking a related Tax Lot in the same form (adds a TaxLot-typed row, matching criteria auto-checked):

Create Property with linked Tax Lot row

Success snackbar + automatic navigation to the new record's detail page:

Property detail after successful create

Create Tax Lot — same form shape, populated:

Create Tax Lot form

Verification

pnpm lint (eslint + prettier + stylelint) and pnpm build pass.

Live-tested both forms end-to-end with Playwright against a real backend (branch 4846-create-property-form) with seeded data:

  • Created a Property (canonical + extra fields, "All Canonical Fields"/"All Extra Data Fields" toggles) — 0 console errors.
  • Created a Property linked to a pre-existing Tax Lot via a TaxLot-typed row in the same table — confirmed the backend paired them (TaxLotProperty row created) and matching-criteria checkboxes update live as fields are added.
  • Created a Tax Lot — 0 console errors.
  • Re-submitted an identical Tax Lot — correctly detected as a duplicate (204 with null view_id), stayed on the page instead of navigating, per the documented no-op behavior.
  • No Playwright test failures / unexpected console errors across all of the above.

Port the legacy AngularJS "Create Inventory" form into a standalone
InventoryCreateComponent at /{properties|taxlots}/create.

- Add InventoryService.createInventory() calling POST
  /api/v3/{type}/form_create/ with organization_id + optional
  related_view_id, plus request/response types.
- Standalone form: access level / instance / cycle selectors, a
  column-rows table with Material autocomplete over all columns,
  All Canonical / All Extra Data / Reset / Add Column, profile select,
  live validation, confirm dialog, success snackbar + navigation.
- Link property lot_number to taxlot jurisdiction_tax_lot_id; POST
  primary then related with related_view_id.
- Wire the create route (before :id) and Create Property / Create Tax
  Lot nav entries. All user-facing strings via Transloco.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant