---
title: "deals.vote.changed@1 · OpenVibe.Services"
canonical: "https://openvibe.services/docs/contracts/deals.vote.changed"
updated: null
---

# deals.vote.changed@1 · OpenVibe.Services

HTML: [deals.vote.changed@1 · OpenVibe.Services](https://openvibe.services/docs/contracts/deals.vote.changed)

# DealsVoteChangedPayload `deals.vote.changed@1`

Generated at 2026-12-01 05:42:00 UTC from [`openvibe-contracts v0.454.0`](https://github.com/OpenVibers/OpenVibe.Contracts/tree/v0.454.0) and [`openvibe-sdk v0.193.0`](https://github.com/OpenVibers/OpenVibe.SDK/tree/v0.193.0).

- Version: 1.0.0
- Owner: deals
- Visibility: first-party
- Status: active
- Compatibility: backward
- Schema: [`https://openvibe.network/contracts/events/payloads/deals.vote.changed.v1.json`](/docs/contracts/deals.vote.changed.json)

deals.vote.changed v1 (OpenVibe.Deals server/domain/votes.js apply). A person's effective vote on an offer's merge group changed: set to +1 or -1 (PUT /offers/:id/vote, deals.vote.set) or removed, value 0 (DELETE /offers/:id/vote, deals.vote.remove). Nothing is sent when the vote did not change. Written in the transaction that stored the vote row and a hotness snapshot (reason vote). The payload carries counts and the recomputable hot@1 snapshot, not identities: the voter appears only as the envelope actor, and the IP hash and any vote-ring flags stay in Deals. Envelope: subject { type: offer, id: <canonical offer\_id> }, visibility internal, priority important (default), actor user:<voter usr\_…> (also when a service casts the vote for them). No consumer is built yet.

## Fields

| Field | Type | Required | Description | Constraints |
| --- | --- | --- | --- | --- |
| `offer_id` | string | yes | The canonical (root) offer of the merge group; the vote row is stored on it. | - `pattern ^dof_[0-9A-HJKMNP-TV-Z]{26}$` |
| `listing_id` | string | yes | The offer the request addressed: the root, or an offer merged into it. | - `pattern ^dof_[0-9A-HJKMNP-TV-Z]{26}$` |
| `value` | enum | yes | The new effective vote; 0 = removed. | - `one of 1, -1, 0` |
| `previous` | enum | yes | The effective vote before; always different from value. | - `one of 1, -1, 0` |
| `weight` | number | yes | Weight stored with this vote: 1, or DEALS\_NEW\_ACCOUNT\_WEIGHT (default 0.25) for an account new to Deals. |  |
| `votes` | object | yes | Tally of effective votes across the merge group after the change (a voter counts once). | - `no other fields` |
| `votes.up` | integer | yes |  | - `minimum 0` |
| `votes.down` | integer | yes |  | - `minimum 0` |
| `votes.up_weight` | number | yes | Sum of the up voters' weights, 4 decimals. |  |
| `votes.down_weight` | number | yes | Sum of the down voters' weights, 4 decimals. |  |
| `hotness` | object | yes | The snapshot taken with this vote; its inputs are kept in deal\_hotness\_snapshots (GET /api/v1/offers/:id/hotness). | - `no other fields` |
| `hotness.formula` | string | yes | Currently hot@1: hot = round6(score / (ageHours + 2)^1.5). | - `pattern ^hot@[0-9]+$` |
| `hotness.hot` | number | yes |  |  |
| `hotness.score` | number | yes | up\_weight - down\_weight, 4 decimals. |  |

## Examples

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

 Valid: removed-on-merged-listing

~~~~
{
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "listing_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPV",
  "value": 0,
  "previous": -1,
  "weight": 0.25,
  "votes": {
    "up": 3,
    "down": 0,
    "up_weight": 2.25,
    "down_weight": 0
  },
  "hotness": {
    "formula": "hot@1",
    "hot": 0.029138,
    "score": 2.25
  }
}
~~~~

Valid: upvote

~~~~
{
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "listing_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "value": 1,
  "previous": 0,
  "weight": 1,
  "votes": {
    "up": 3,
    "down": 1,
    "up_weight": 2.25,
    "down_weight": 1
  },
  "hotness": {
    "formula": "hot@1",
    "hot": 0.067496,
    "score": 1.25
  }
}
~~~~

Rejected: missing-hotness

~~~~
{
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "listing_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "value": 1,
  "previous": 0,
  "weight": 1,
  "votes": {
    "up": 3,
    "down": 1,
    "up_weight": 2.25,
    "down_weight": 1
  }
}
~~~~

Rejected: value-two

~~~~
{
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "listing_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "value": 2,
  "previous": 0,
  "weight": 1,
  "votes": {
    "up": 3,
    "down": 1,
    "up_weight": 2.25,
    "down_weight": 1
  },
  "hotness": {
    "formula": "hot@1",
    "hot": 0.067496,
    "score": 1.25
  }
}
~~~~

Rejected: voter-identity

~~~~
{
  "offer_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "listing_id": "dof_01JAB2C3D4E5F6G7H8J9K0MNPQ",
  "value": 1,
  "previous": 0,
  "weight": 1,
  "votes": {
    "up": 3,
    "down": 1,
    "up_weight": 2.25,
    "down_weight": 1
  },
  "hotness": {
    "formula": "hot@1",
    "hot": 0.067496,
    "score": 1.25
  },
  "subject": "usr_01JAB2C3D4E5F6G7H8J9K0MNPX"
}
~~~~

## Validate

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