Skip to content

feat: add product deletion UI and wire up Products.delete_product/1 #8

Description

@z3ugma

Summary

Products can be created and renamed (via the context layer), but there is no way to delete a product from the UI or API. The Acai.Products.delete_product/1 function exists in the context module but is not wired to any LiveView, controller, or API endpoint.

Current state

  • Acai.Products.delete_product/1 at lib/acai/products/products.ex:63 performs Repo.delete(product) and has a unit test
  • The function is called nowhere — no LiveView event handler, no API controller, no button in any template
  • product_live.ex only renders the feature-completion matrix; there is no settings/danger zone UI for products
  • team_settings_live.ex handles team deletion (which cascade-deletes products), but there's no per-product delete flow
  • No feature spec exists for product settings or product deletion

What needs to be built

  1. Feature spec — Create features/site/product-settings.feature.yaml defining the product deletion workflow (confirm-by-typing-name modal, cascade warning, redirect behavior)

  2. UI — Either:

    • A settings page at /t/:team_name/p/:product_name/settings, OR
    • A delete button + modal within the existing product view

    The modal should:

    • Warn that deletion is permanent and cascade-deletes all associated implementations, specs, requirements, and feature states
    • Require the user to type the product name to confirm
    • Disable the confirm button until the typed name matches exactly
    • On confirmation, call Products.delete_product/1 and redirect to /t/:team_name
  3. API endpoint (optional) — A DELETE /api/v1/products/:product_name endpoint for programmatic deletion, if desired

  4. Authorisation — Product deletion should respect the team's permission model (only users with appropriate role/scope can delete)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions