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
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
goal_id | string | yes |
| |
creator | identity.subject-ref | yes | ||
title | string | yes | ||
target_amount | integer | yes |
| |
current_amount | integer | yes | Settled total including any amount carried over from Live. | |
currency | string | yes | ||
status | enum | yes |
| |
reached | boolean | yes | ||
reason | enum | yes |
| |
interaction_id | string | null | yes | The interaction behind a contribution, reached or reversal change; null otherwise. |
|
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 }] }