• erio's avatar
    refactor(channels): normalize at cache fill and eliminate frontend as-cast · 4a3652ec
    erio authored
    - channel.go: convert normalizeBillingModelSource into a (*Channel) method for entity cohesion
    - channel_service.go: normalize in populateChannelCache so every cache-backed reader (gateway, billing, future endpoints) sees the default; drop the duplicate fallback inside resolveMapping
    - table: tighten Row with status?: ChannelStatus / billing_model_source?: BillingModelSource, remove the [key: string]: unknown index signature
    - admin view: drop the `as ChannelStatus` / `as BillingModelSource` assertions and add statusStyleOf / billingSourceLabelOf helpers with runtime fallback so unseen values render as "-" instead of crashing
    4a3652ec
channel_service.go 33.9 KB