Skip to content

feat(connector): add health.incidents - #110

Open
Gabrielpanga wants to merge 1 commit into
masterfrom
feat/connector-health-incidents
Open

feat(connector): add health.incidents#110
Gabrielpanga wants to merge 1 commit into
masterfrom
feat/connector-health-incidents

Conversation

@Gabrielpanga

Copy link
Copy Markdown
Member

Mirrors the field now returned by the API: the incidents affecting a connector right now.

@Data
@Builder
public class Health {
  ConnectorStatus status;
  String stage;
  List<ConnectorIncident> incidents;   // new
}

Each incident carries a customer-facing title, a type, the affected product, severity, state, startedAt and a url permalink to the status page.

incidents is null when the connector has no active incident, so its presence is the signal. It describes the institution, not the caller's own connections — status says whether you can connect at all, this says what is wrong, and a bank can be perfectly reachable while failing to return instalments.

Two modelling choices

type is an enum, following the ConnectorStatus pattern in this package — @SerializedName per value, Lombok @Getter on the backing string. A value added server-side after this release deserializes as null under Gson, which is honest. Note OTHER is a real value meaning Pluggy has not classified the incident, not that nothing is wrong.

product stays a String. Its values include pis-agendado, and an unrecognised one would deserialize to null — worse than just handing back the raw string.

Verification

mvn -o compile from a cleared target/classes: 114 source files, BUILD SUCCESS.

Context: the API side shipped in v0.695.0. Same change in pluggyai/pluggy-node#179 and pluggyai/pluggy-net#43.

Mirrors the field now returned by the API: the incidents affecting a connector
right now, each with a customer-facing title, a type, the affected product,
severity, state and a permalink to the status page.

Null when the connector has no active incident, so its presence is the signal.
It describes the institution, not the caller's own connections. `status` says
whether you can connect at all; this says what is wrong, and a bank can be
perfectly reachable while failing to return instalments.

`type` is an enum following the ConnectorStatus pattern — @SerializedName per
value, Lombok @Getter on the backing string. A value added server-side after
this release deserializes as null under Gson, which is honest; OTHER is a real
value meaning Pluggy has not classified the incident, not that nothing is
wrong.

`product` stays a String: its values (pis-agendado) do not map cleanly, and an
unrecognised one would deserialize to null, which is worse than the raw string.
Sign up for free to 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.

1 participant