DealsFlagResult deals.flag-result@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- deals
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/deals/flag-result.v1.json
deals.flag-result@1: the answer of POST /api/v1/offers/:id/flags on OpenVibe.Deals: { flag: { id, kind, status }, created } (201 when created, 200 when an open flag was refreshed).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
flag | object | yes | ||
flag.id | string | yes | ||
flag.kind | string | yes | ||
flag.status | string | yes | ||
created | boolean | yes |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: created
{
"flag": {
"id": "dfl_01JAB2C3D4E5F6G7H8J9K0MNPQ",
"kind": "expired",
"status": "open"
},
"created": true
}Rejected: no-flag
{
"created": true
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('deals.flag-result@1', value); // { valid, errors: [{ path, message }] }