OSS-first docs
These docs teach the open system first: contracts, generated surfaces, runtimes, governance, and incremental adoption. Studio shows up as the operating layer on top, not as the source of truth.
Refresh balances for a bank account via the configured open banking provider.
Goal
Ensure canonical balance records reflect the latest values from Powens.
Context
Triggered by scheduled workflows before generating summaries or forecasting cashflow.
Source Definition
export const OpenBankingRefreshBalances = defineCommand({
meta: {
key: 'openbanking.balances.refresh',
version: '1.0.0',
description:
'Refresh balances for a bank account via the configured open banking provider.',
goal: 'Ensure canonical balance records reflect the latest values from Powens.',
context:
'Triggered by scheduled workflows before generating summaries or forecasting cashflow.',
owners: ['@platform.finance'],
tags: ['open-banking', 'powens', 'balances'],
stability: 'experimental',
},
io: {
input: OpenBankingRefreshBalancesInput,
output: OpenBankingRefreshBalancesOutput,
},
policy: {
auth: 'admin',
},
telemetry: {
success: {
event: { key: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshed },
properties: ({ input, output }) => {
const payload = input as {
tenantId?: string;
accountId?: string;
};
const result = output as {
balances?: unknown[];
refreshedAt?: string;
} | null;
return {
tenantId: payload?.tenantId,
accountId: payload?.accountId,
refreshedAt: result?.refreshedAt,
balanceCount: Array.isArray(result?.balances)
? result?.balances.length
: undefined,
};
},
},
failure: {
event: { key: OPENBANKING_TELEMETRY_EVENTS.balancesRefreshFailed },
properties: ({ input, error }) => {
const payload = input as {
tenantId?: string;
accountId?: string;
};
return {
tenantId: payload?.tenantId,
accountId: payload?.accountId,
error:
error instanceof Error ? error.message : String(error ?? 'unknown'),
};
},
},
},
});