From e161aaab833e0c2eb7547ed9ea8de0e8a73042c0 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Fri, 6 Mar 2026 13:02:55 -0600 Subject: [PATCH] docs: update changelogs for billing overrides and interface stats fix --- CHANGELOG.txt | 27 +++++++++++++++++++++++++++ priv/static/changelog.txt | 6 ++++++ 2 files changed, 33 insertions(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 2cf0bb46..a95096f8 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,3 +1,30 @@ +2026-03-06 +feat: per-organization billing override admin UI + - Add custom_free_device_limit and custom_price_per_device nullable fields to organizations + - Add billing_override_changeset/2 with validation (separate from main changeset) + - Add effective_device_limit/1 to SubscriptionLimits respecting custom overrides + - Add effective_free_device_count/1 and effective_price_per_device/1 to Billing + - Update billable_device_count and estimated_monthly_cost to use effective values + - Add Admin.update_billing_overrides/4 with audit logging + - Add override editing UI to /admin/organizations with edit panel + - Update org settings page to display effective limits/pricing instead of hardcoded values +Files: priv/repo/migrations/20260306184112_add_billing_overrides_to_organizations.exs, + lib/towerops/organizations/organization.ex, + lib/towerops/organizations/subscription_limits.ex, + lib/towerops/billing.ex, + lib/towerops/admin.ex, + lib/towerops/admin/audit_log.ex, + lib/towerops_web/live/admin/org_live/index.ex, + lib/towerops_web/live/admin/org_live/index.html.heex, + lib/towerops_web/live/org/settings_live.html.heex + +fix: access interface stats through latest_stat association + - Template accessed if_in_octets/if_out_octets directly on Interface struct + - These fields live on InterfaceStat (interface.latest_stat) + - Added nil guard to prevent KeyError when association not loaded + - Fixes production 500 error on device detail page +Files: lib/towerops_web/live/device_live/show.html.heex + 2026-03-05 feat: add rate limiting to admin endpoints (100 req/min) - Add :admin type to RateLimit plug with 100 requests per minute per IP diff --git a/priv/static/changelog.txt b/priv/static/changelog.txt index ad133f78..f27ba5ad 100644 --- a/priv/static/changelog.txt +++ b/priv/static/changelog.txt @@ -1,3 +1,9 @@ +2026-03-06 — Per-Organization Billing Overrides +* Superadmins can now customize free device limits and per-device pricing for individual organizations +* Override management available in the admin organizations panel +* Organization settings page now reflects custom billing terms when set +* Fixed a crash on the device detail page when interface statistics were unavailable + 2026-03-05 — Security Enhancements * Enhanced security for API endpoints and file uploads * Improved validation for mobile device registration