CouponsStatusRequest coupons.status-request@1
Generated at from
openvibe-contracts v0.53.0 and
openvibe-sdk v0.11.0.
- Version
- 1.0.0
- Owner
- coupons
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/coupons/status-request.v1.json
coupons.status-request@1: the body of POST /api/v1/coupons/:id/status on OpenVibe.Coupons (coupons.status.update; staff or a service): disabled, expired (not while disabled) or active (re-enable: the status is recomputed from reports and time); reported_working and reported_failed cannot be set by anyone.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
status | enum | yes |
| |
note | string | null |
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: disable
{
"status": "disabled",
"note": "merchant asked us to remove it"
}Rejected: report-status
{
"status": "reported_working"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('coupons.status-request@1', value); // { valid, errors: [{ path, message }] }