DealsWatchRequest deals.watch-request@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/watch-request.v1.json
deals.watch-request@1: the body of POST /api/v1/watches on OpenVibe.Deals (deals.watch.create; the acting person): kind keyword or search (query with at least one word; a search is saved without notifications), product (product, a slug or id), or price_below (max_price and currency, with a product or keywords). label is optional (120 characters). There is a per-person limit (429 watch.limit).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
kind | enum | yes |
| |
query | string | null |
| ||
product | string | null | |||
max_price | string | number | null | A decimal amount; always with its currency. | ||
currency | string | null | ISO 4217; Deals never assumes one. |
| |
label | string | null |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: price
{
"kind": "price_below",
"query": "capture card",
"max_price": "60",
"currency": "USD",
"label": "cheap capture card"
}Rejected: no-price
{
"kind": "price_below",
"query": "capture card"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('deals.watch-request@1', value); // { valid, errors: [{ path, message }] }