본문으로 건너뛰기

Domain Ownership

Status

Active

Date

2026-04-28

Owners

  • Platform Backend

Last Verified Commit

56362a7a

Ownership Rules

This repo currently uses a shared database, but service ownership is logical and must still be respected.

Core rules:

  • each domain has one primary runtime owner
  • wallet_service is the only money writer
  • edge services do not become hidden domain owners
  • orchestration is allowed, but direct cross-domain mutation is not

Domain Map

DomainPrimary OwnerEdge SurfaceNotes
player auth/profile/common dataplayer_servicegatewayincludes registration helpers, profile, messages, captcha/common data
player balances, deposits, withdrawalswallet_servicegateway and admin_servicemoney writes stay here even when initiated elsewhere
rolling lifecyclerolling_servicewallet_service, admin_service, gatewayconsumes wallet events and emits rolling events
coupons, rebate, cashback, lossbackpromotion_servicegateway and admin_servicesettlement and coupon saga logic lives here
provider callbacks and game integrationgame_servicedirect provider traffic and gateway proxyingprovider-specific auth and callback semantics stay here
agent portal flowsagent_servicedirect agent frontend trafficincludes legacy agent compatibility aliases
back-office operational APIsadmin_servicedirect bo/admin trafficalso owns top-info websocket aggregation
SMS automation and reconciliationrecon_serviceadmin_service compatibility adaptersextracted from middle_server; no direct money mutation
player HTTP routing and legacy response translationgatewayplayer-facing external trafficedge only; owns no business data

Non-Negotiable Ownership Constraints

  • recon_service may persist review or match state, but final approval must still flow through wallet_service.
  • admin_service may orchestrate approvals and queries, but it must not become a second money writer.
  • gateway may normalize or proxy payloads, but it must not persist domain state.
  • worker loops must run under the owner service or owner worker runtime.

Multi-Brand Ownership

Per ADR-009, two new domain ownerships are added and one existing aggregate becomes brand-global:

DomainPrimary OwnerEdge SurfaceNotes
brand catalog and per-brand configurationadmin_servicedirect bo/admin trafficowns brand and brand_config; brand defaults override documented globals
agent-to-brand allow listadmin_service writes; agent_service readsadmin_service exposes agent_brand CRUD; agent_service enforces it on every agent-facing routecontrols which brands an agent can serve
agent aggregateagent_servicedirect agent frontend trafficstays brand-global; per-brand variation lives in agent_setting(agent_id, brand_id) and agent_domain(agent_id, brand_id)

Brand isolation rules:

  • every other domain owner above scopes its writes by brand_id
  • wallet_service rejects any command whose target row brand differs from request brand; ADR-005 still binds wallet_service as the only money writer
  • gateway resolves brand from the request domain and forwards X-Brand-Id
  • game_service resolves brand from the outbound account namespace on callback
  • back-office staff ownership is removed by this change and is not replaced

Migration Gap

The unresolved ownership area is the residual middle_server back-office scope outside recon:

  • role and menu management
  • config and i18n editing
  • web rules, FAQ, and content
  • BI push tooling
  • coin passthrough behavior
  • generic catch-all forwarding

Those capabilities need an explicit owner before full legacy retirement.