Skip to content

Till & Frånkoppling

This application contains a large number of conditions and flow variants.

For this reason, the documentation here focuses on system architecture and integration boundaries. Detailed business flow behavior is intentionally not described, as it changes frequently and is managed operationally.

Documentation of exact flows is owned by the business side and is maintained using the flow management tooling available in the portal, which serves as the primary source of truth for flow definitions.

Till- och frånkoppling supports the move-in and move-out process for electricity delivery in premises.

When a customer moves out, they provide a move-out date. If no new customer takes over the facility, electricity is automatically disconnected at day boundary (midnight) to avoid unbilled consumption.

Before moving in, the customer receives an SMS with a link where they can approve terms and self-connect the facility (activate electricity).

The solution is orchestration-heavy and integrates with metering/control systems, customer systems, and communication channels.

  • Orchestrates move-out flows and determines whether a disconnect is required
  • Performs automated disconnect at day boundary when no successor exists
  • Orchestrates move-in flows and enables customer self-connect via SMS + approval
  • Controls meters (connect/disconnect) via Gateware integration
  • Updates service/status information in BFUS
  • Creates cases and history records in Lime CRM
  • Supports scheduled/queued execution via ScheduleAPI
  • Provides an operational portal for managing rules/conditions and flow execution
  • Physical meter infrastructure
  • Gateware, BFUS, Lime operation as systems
  • BankID integration beyond planned/coming functionality

The solution is centered around MeterControlAPI, which orchestrates business flows and coordinates integrations.

Key components:

  • MeterControlAPI (core orchestrator)
  • Integration services for Gateware, Lime, BFUS, (future BankID)
  • NotificationAPI + TellusTalk for SMS delivery
  • CustomerFormulaAPI + frontend for customer approval/self-connect
  • ScheduleAPI for planned execution and day-boundary actions
  • Management portal (Static Web Apps) for operational control and rule management
flowchart LR

subgraph Users["Users"]
  OpsUser["Operations user"]
end

subgraph Cloud["Cloud"]
  Portal["Till-/frånkopplingsportal<br/>(Azure Static Web App)"]
  Edge["Front Door + API Management"]
  KC["Keycloak<br/>(Identity)"]
end

subgraph Core["Core"]
  Meter["MeterControlAPI<br/>(orchestrator)"]
end

subgraph Metering["Metering & control"]
  IGW["IntegrationGatewareAPI"]
  Gateware["Gateware"]
  MeterHW["Meters"]
end

subgraph CustomerSystems["Customer & service systems"]
  IBFUS["IntegrationBFUS"]
  IBiz["IntegrationBusinessAPI"]
  BFUSapi["BFUS<br/>(REST API)"]
  BFUSdb["BFUS<br/>(DB views)"]
end

subgraph CRM["CRM / case management"]
  ILime["IntegrationLimeAPI"]
  Lime["Lime CRM<br/>(REST API)"]
end

subgraph Identity["Identity (planned)"]
  IBankID["IntegrationBankID"]
  BankID["BankID<br/>(REST API)"]
end

subgraph Comms["Customer communication"]
  Notif["NotificationAPI"]
  Tellus["TellusTalk<br/>(SMS)"]
end

subgraph CustomerUX["Customer interaction"]
  FormulaAPI["CustomerFormulaAPI"]
  UX["Frontend<br/>(self-connect link)"]
end

subgraph Orchestration["Orchestration"]
  Sched["ScheduleAPI"]
end

%% Portal flow
OpsUser --> Portal --> Edge --> Meter
Edge <-.-> KC

%% Core links
Meter <--> IGW
IGW <--> Gateware <--> MeterHW

Meter <--> ILime
ILime <--> Lime

Meter <--> IBFUS
IBFUS <--> BFUSapi

Meter <--> IBiz
IBiz <--> BFUSdb

Meter --> Notif --> Tellus

Meter <--> FormulaAPI --> UX

Meter <--> Sched

%% Planned
Meter <--> IBankID
IBankID <--> BankID

Move-out: automatic disconnect (very short)

Section titled “Move-out: automatic disconnect (very short)”
  1. Customer provides a move-out date
  2. MeterControlAPI evaluates whether a successor customer exists for the facility
  3. If no successor exists, a disconnect is scheduled for day boundary via ScheduleAPI
  4. At execution time, MeterControlAPI initiates disconnect via Gateware integration
  5. Status is updated in BFUS and history/case information is recorded in Lime (where applicable)

Move-in: customer self-connect (very short)

Section titled “Move-in: customer self-connect (very short)”
  1. Customer receives an SMS containing a link to the self-connect flow
  2. Customer opens the link and approves terms in the frontend
  3. CustomerFormulaAPI confirms approval back to MeterControlAPI
  4. MeterControlAPI initiates connect via Gateware integration
  5. Status is updated in BFUS and history/case information is recorded in Lime (where applicable)

An operational web portal is provided for managing flows and rules/conditions used in connect/disconnect automation.

The portal allows:

  • Editing conditions and rule configuration for flows
  • Starting flows manually
  • Viewing ongoing flows
  • Deactivating/cancelling flows when needed

The portal is hosted in Azure Static Web Apps and uses the shared platform edge (Front Door + API Management + Keycloak) to access on-prem backend services.

Till- och frånkoppling follows standard platform patterns:

  • Backend services hosted on-prem Kubernetes
  • External access routed through Azure Front Door and API Management
  • Authentication handled via Keycloak (for portal and operational access)
  • Service-owned databases hosted on-prem
  • Saga orchestration used for coordinated multi-step workflows

This solution owns:

  • Flow/rule configuration (conditions, parameters)
  • Execution state for ongoing flows
  • Audit/history records created by the solution (where applicable)

Source systems retain ownership of master data:

  • BFUS for customer/service status and facility information
  • Lime for CRM cases/history
  • Gateware for metering control state
  • Portal frontend deployed via Azure Static Web Apps
  • Backend services deployed on on-prem Kubernetes
  • Container images published through Azure Container Registry
  • Centralized service logging
  • Platform monitoring and alerting
  • Gateware connectivity or command failures (connect/disconnect)
  • Missing or incorrect facility/customer data from BFUS views
  • BFUS REST API disruptions when updating service status
  • SMS delivery issues via TellusTalk
  • ScheduleAPI execution failures around day boundary
  • Customer approval flow failures (CustomerFormulaAPI / frontend)
  • Functional owner: Mät & Data + Olle Jonsson
  • Automatic disconnect depends on accurate successor detection in BFUS data
  • Day-boundary scheduling requires ScheduleAPI availability
  • Customer self-connect requires SMS deliverability and reachable frontend
  • Meter operations depend on Gateware and meter availability