BillingStaffActionPayload billing.staff.action@1

Generated at from openvibe-contracts v0.33.0 and openvibe-sdk v0.5.0.

Version
1.0.0
Owner
billing
Visibility
first-party
Status
active
Compatibility
backward
Decision
ADR-012
Schema
https://openvibe.network/contracts/events/payloads/billing.staff.action.v1.json

billing.staff.action v1 (OpenVibe.Billing server/console/audit.js record). A staff member completed an action in the Billing console (only outcome done is announced; refused actions stay in staff_audit). Holds no secrets: codes, payout reference, counts. Envelope: subject { type: staff_action, id: sa_… }, visibility internal, priority important, actor the staff user ({ type: user, id: usr_… }).

Fields

FieldTypeRequiredDescriptionConstraints
audit_idstringyes
  • pattern ^sa_[0-9A-HJKMNP-TV-Z]{26}$
actionstringyes
outcomeconstyes
  • = "done"
targetobject | nullyes
reasonstring | nullyes
  • maxLength 500
request_idstring | nullyes
detailobjectyesSmall whitelisted detail of the action.

Examples

From the contract's own test fixtures: valid ones validate, rejected ones must fail.

Valid: cashout-approve
{
  "audit_id": "sa_01JAB3C4D5E6F7G8H9J0K1MNQ9",
  "action": "cashout.approve",
  "outcome": "done",
  "target": {
    "type": "cashout",
    "id": "co_01JAB3C4D5E6F7G8H9J0K1MNQ5"
  },
  "reason": "verified payout email",
  "request_id": "req_abcdefgh",
  "detail": {
    "payout_reference": "8XK12345AB678901C"
  }
}
Rejected: refused-outcome
{
  "audit_id": "sa_01JAB3C4D5E6F7G8H9J0K1MNQ9",
  "action": "cashout.approve",
  "outcome": "refused",
  "target": {
    "type": "cashout",
    "id": "co_01JAB3C4D5E6F7G8H9J0K1MNQ5"
  },
  "reason": "verified payout email",
  "request_id": "req_abcdefgh",
  "detail": {
    "payout_reference": "8XK12345AB678901C"
  }
}

Validate

const contracts = require('openvibe-contracts');
contracts.validate('billing.staff.action@1', value);   // { valid, errors: [{ path, message }] }