Files
arcadia-cloud/lib/arcadia_cloud_web/router.ex
Giuliano Silvestro 34fd811e91 Add operator write endpoints for the pricing catalog
CatalogController gains platform-admin-gated writes: create a plan,
create a draft version (with its plan items, transactionally), publish
a version, create an addon — plus a plan-detail endpoint exposing every
version. Pricing stays versioned: create_version always makes a new
draft, publish retires the prior active version, existing subscriptions
are untouched. The Catalog context functions already existed; this just
exposes them over HTTP.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-21 12:21:29 +10:00

54 lines
1.7 KiB
Elixir

defmodule ArcadiaCloudWeb.Router do
use ArcadiaCloudWeb, :router
pipeline :api do
plug :accepts, ["json"]
end
pipeline :authed do
plug ArcadiaCloudWeb.Plugs.RequireAuth
end
scope "/api", ArcadiaCloudWeb do
pipe_through :api
get "/health", HealthController, :show
end
scope "/api/v1", ArcadiaCloudWeb do
pipe_through [:api, :authed]
get "/inventory", InventoryController, :index
get "/billing/balance", BillingController, :balance
get "/billing/cost-lines", BillingController, :cost_lines
get "/drift", DriftController, :index
post "/drift/:id/accept", DriftController, :accept
get "/catalog/plans", CatalogController, :plans
get "/catalog/plans/:id", CatalogController, :show
post "/catalog/plans", CatalogController, :create_plan
post "/catalog/plans/:plan_id/versions", CatalogController, :create_version
post "/catalog/versions/:id/publish", CatalogController, :publish_version
get "/catalog/addons", CatalogController, :addons
post "/catalog/addons", CatalogController, :create_addon
post "/quote", QuoteController, :create
get "/deployments", DeploymentController, :index
post "/deployments", DeploymentController, :create
get "/deployments/:id", DeploymentController, :show
post "/deployments/:id/transition", DeploymentController, :transition
post "/deployments/:id/subscribe", DeploymentController, :subscribe
get "/invoices", InvoiceController, :index
get "/invoices/:id", InvoiceController, :show
get "/dashboard/margin", DashboardController, :margin
get "/dashboard/accrual", DashboardController, :accrual
post "/integrations/llm-usage", IntegrationsController, :llm_usage
end
end