TipsGoalUpdatedPayload tips.goal.updated@1

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

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

tips.goal.updated v1 (OpenVibe.Tips server/domain/goals.js changed). A goal was created, edited or closed, or its settled total moved (a contribution, the contribution that reached it, a reversal). Envelope: subject { type: goal, id: tgoal_…, revision }, visibility internal, priority important, actor service:tips.

Fields

FieldTypeRequiredDescriptionConstraints
goal_idstringyes
  • pattern ^tgoal_[0-9A-HJKMNP-TV-Z]{26}$
creatoridentity.subject-refyes
titlestringyes
target_amountintegeryes
  • minimum 1
current_amountintegeryesSettled total including any amount carried over from Live.
currencystringyes
statusenumyes
  • one of "active", "closed"
reachedbooleanyes
reasonenumyes
  • one of "created", "updated", "closed", "contribution", "reached", "reversal"
interaction_idstring | nullyesThe interaction behind a contribution, reached or reversal change; null otherwise.
  • pattern ^tint_[0-9A-HJKMNP-TV-Z]{26}$

Examples

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

Valid: contribution
{
  "goal_id": "tgoal_01JAB3C4D5E6F7G8H9J0K1MNPS",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "title": "New microphone",
  "target_amount": 10000,
  "current_amount": 2500,
  "currency": "vibes-bits",
  "status": "active",
  "reached": false,
  "reason": "contribution",
  "interaction_id": "tint_01JAB3C4D5E6F7G8H9J0K1MNPQ"
}
Valid: created
{
  "goal_id": "tgoal_01JAB3C4D5E6F7G8H9J0K1MNPS",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "title": "New microphone",
  "target_amount": 10000,
  "current_amount": 0,
  "currency": "vibes-bits",
  "status": "active",
  "reached": false,
  "reason": "created",
  "interaction_id": null
}
Rejected: no-reason
{
  "goal_id": "tgoal_01JAB3C4D5E6F7G8H9J0K1MNPS",
  "creator": {
    "type": "user",
    "id": "usr_01JAB2C3D4E5F6G7H8J9K0MNPQ"
  },
  "title": "New microphone",
  "target_amount": 10000,
  "current_amount": 2500,
  "currency": "vibes-bits",
  "status": "active",
  "reached": false,
  "interaction_id": "tint_01JAB3C4D5E6F7G8H9J0K1MNPQ"
}

Validate

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