Skip to content

Extract Customer Service module and rename to Customer Support - #514

Merged
ddon merged 5 commits into
BeamLabEU:devfrom
timujinne:dev
May 4, 2026
Merged

Extract Customer Service module and rename to Customer Support#514
ddon merged 5 commits into
BeamLabEU:devfrom
timujinne:dev

Conversation

@timujinne

@timujinnetimujinne commented May 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Changes

Module extraction (commits 57cb97f, 6360da5, 4816194)

  • Remove lib/modules/customer_service/ (~6000 LOC) — now in the standalone package
  • module_registry.ex — drop PhoenixKit.Modules.CustomerService from internal_modules/0, add entry to known_external_packages/0
  • integration.ex — replace inline /dashboard/customer-service/tickets routes with Code.ensure_loaded? guards on the external module
  • auth.ex — repoint anonymize_user_tickets/1 at the external PhoenixKitCustomerSupport.Ticket

Rename to "Customer Support" (commit 2fa4075)

  • Module: PhoenixKitCustomerServicePhoenixKitCustomerSupport
  • Atom: :phoenix_kit_customer_service:phoenix_kit_customer_support
  • Settings keys: customer_service_*customer_support_* (7 keys)
  • URL paths: /customer-service/*/customer-support/*
  • Permission key: customer_servicecustomer_support
  • Hex package: phoenix_kit_customer_servicephoenix_kit_customer_support
  • 4 test files updated for the new identifiers

V109 migration

  • New lib/phoenix_kit/migrations/postgres/v109.ex mirroring V77's pattern
  • Renames 7 settings keys + auto_granted_perm:* + phoenix_kit_role_permissions.module_key in-place; idempotent; reversible down/1
  • DB tables (phoenix_kit_tickets, phoenix_kit_ticket_*) are not renamed — they're domain-named, not module-named
  • @current_version 108 → 109; ⚡ LATEST tag moved from V107 to V109

Verified

  • mix precommit (compile + credo + dialyzer + format check) — PASS
  • Companion package compiles + format-checks clean
  • Live router check on parent app: 0 orphan routes under /customer-service

Notes for maintainer

Test Plan

  • mix precommit clean on core
  • Package quality + smoke test clean
  • Live router check on parent app — no orphan routes
  • V109 up/down rollback tested on a parent app
  • Maintainer review

…kage
- Remove lib/modules/customer_service/ tree (22 files: context, 4 schemas,
events, 9 LiveViews, 8 templates) and lib/phoenix_kit_web/routes/customer_service.ex
- Drop PhoenixKit.Modules.CustomerService from internal_modules/0 in
module_registry.ex and add corresponding entry to known_external_packages/0
- Surgical edits in integration.ex: remove CustomerServiceRoutes alias,
collapse {tickets_admin, referrals_admin} destructure to single
referrals_admin binding, drop unquote(tickets_admin), replace inline
/dashboard/customer-service/tickets routes (and locale variant) with
Code.ensure_loaded?(PhoenixKitCustomerService.Web.UserList) guards,
remove customer_service_routes safe_route_call wiring
- Fix stale Module.concat([PhoenixKit, Modules, Tickets, Ticket]) in
auth.ex anonymize_user_tickets/1 — pre-existing no-op since the
Tickets→CustomerService rename; now points at PhoenixKitCustomerService.Ticket
- Update outdated example in module_registry.ex feature_enabled_checks/0 doc
- Bump @Version 1.7.103 → 1.7.104
Migrations (V35/V51/V53/V58/V72/V74/V75/V77) and the SupportAgent system
role stay in core. Settings keys (customer_service_*) and permission key
unchanged. Gettext strings remain in core's PhoenixKitWeb.Gettext backend.
Plan: dev_docs/plans/2026-05-03-customer-service-extraction.md
Upstream maintainer owns version + CHANGELOG; agent should not
bump @Version unilaterally. The customer_service extraction commit
(57cb97f) prematurely bumped to 1.7.104 — revert until upstream
decides the next version.
Line-wrap reflow only — no behavior change. Picked up by mix format
during the customer_service extraction work; lifted into its own
commit to keep the extraction commit clean.
Customer Service ticketing has been renamed to Customer Support to
match the new standalone package at BeamLabEU/phoenix_kit_customer_support.
Changes:
- Module reference: PhoenixKitCustomerService -> PhoenixKitCustomerSupport
- Atom: :phoenix_kit_customer_service -> :phoenix_kit_customer_support
- Settings keys: customer_service_* -> customer_support_*
- URL paths: /customer-service/* -> /customer-support/*
- Permission key: customer_service -> customer_support
- Hex package: phoenix_kit_customer_service -> phoenix_kit_customer_support
Add V109 migration that renames 7 settings keys and the
phoenix_kit_role_permissions.module_key in-place. The DB tables
(phoenix_kit_tickets, phoenix_kit_ticket_*) are domain-named and
keep their existing names.
@timujinnetimujinne changed the title Extract Customer Service module into phoenix_kit_customer_serviceExtract Customer Service module and rename to Customer SupportMay 4, 2026
The tests asserted PhoenixKitCustomerSupport / "customer_support" registry
state, but the package is now external (not a test dep), so those keys
don't exist at test runtime. Replace assertions with still-internal
modules / drop ones that were testing the removed internal module.
@ddon
ddon merged commit 54b976f into BeamLabEU:devMay 4, 2026
ddon pushed a commit that referenced this pull request May 4, 2026
PR #514 extracted Customer Service to phoenix_kit_customer_support
and renamed the module surface; reviewed and closed two minor findings.
Changes (review close-outs):
- Backfill V108 docstring section in lib/phoenix_kit/migrations/postgres.ex
(was missing — pre-existing gap from PR #512 that this PR was the
natural place to close)
- Drop unused _prefix arg from rename_role_permission/4 in v109.ex
(table name is already prefix-qualified at the call site)
Skipped on purpose: rewriting V109's DO \$\$ blocks as parameterized
queries. V109 is unpublished but the values are migration-time
constants, the existing implementation is tested and idempotent, and
minimizing surface area before publish beats stylistic polish.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for freeto 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.

2 participants

@timujinne@ddon