DealsFlagRequest deals.flag-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/flag-request.v1.json

deals.flag-request@1: the body of POST /api/v1/offers/:id/flags on OpenVibe.Deals (deals.flag.create; a person): { kind, reason?, duplicate_of? } — duplicate_of (the other deal, id, slug or /d/ link) is required for kind duplicate. An open flag of the same kind by the same person is refreshed, not repeated.

Fields

FieldTypeRequiredDescriptionConstraints
kindenumyes
  • one of "expired", "price_wrong", "spam", "duplicate", "other"
reasonstring | null
  • maxLength 500
duplicate_ofstring | null

Examples

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

Valid: duplicate
{
  "kind": "duplicate",
  "duplicate_of": "https://openvibe.deals/d/usb-c-capture-card-79"
}
Rejected: duplicate-without-target
{
  "kind": "duplicate",
  "reason": "seen it"
}

Validate

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