FoodPlan food.plan@1
Generated at from
openvibe-contracts v0.127.0 and
openvibe-sdk v0.37.0.
- Version
- 1.0.0
- Owner
- food
- Visibility
- public
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/food/plan.v1.json
food.plan@1: one saved plan on OpenVibe.Food.
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
id | string | yes |
| |
title | string | null | yes |
| |
people | integer | yes |
| |
days | integer | yes |
| |
budget | number | null | yes |
| |
created_at | string | yes |
| |
plan | object | yes | The plan as Food worked it out: spec, items (the shopping list), by_store, menu (one entry a day: breakfast, lunch, dinner, snack), group_coverage and totals (cost, cost_per_person_day, kcal, protein). Food may add fields. | |
plan.spec | object | yes | ||
plan.spec.people | integer | yes | ||
plan.spec.days | integer | yes | ||
plan.spec.budget | number | null | |||
plan.items | array of object | yes | ||
plan.menu | array of object | yes | ||
plan.menu[].day | integer | yes |
| |
plan.totals | object | yes | ||
plan.totals.cost | number | yes |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: week
{
"id": "pln_01JZ6Q4X8M2N3P4R5S6T7V8W9X",
"title": "Week for two",
"people": 2,
"days": 7,
"budget": 80,
"created_at": "2026-10-08T20:00:00.000Z",
"plan": {
"spec": {
"people": 2,
"days": 7,
"budget": 80
},
"items": [
{
"slug": "rice-long-grain-5lb",
"name": "Long grain rice, 5 lb",
"packs": 1
}
],
"menu": [
{
"day": 1,
"breakfast": [
"Oats"
],
"lunch": [],
"dinner": [
"Rice"
],
"snack": []
}
],
"totals": {
"cost": 41.2,
"kcal": 28000
}
}
}Rejected: bad-id
{
"id": "plan-1",
"title": "Week for two",
"people": 2,
"days": 7,
"budget": 80,
"created_at": "2026-10-08T20:00:00.000Z",
"plan": {
"spec": {
"people": 2,
"days": 7,
"budget": 80
},
"items": [
{
"slug": "rice-long-grain-5lb",
"name": "Long grain rice, 5 lb",
"packs": 1
}
],
"menu": [
{
"day": 1,
"breakfast": [
"Oats"
],
"lunch": [],
"dinner": [
"Rice"
],
"snack": []
}
],
"totals": {
"cost": 41.2,
"kcal": 28000
}
}
}Rejected: no-plan
{
"id": "pln_01JZ6Q4X8M2N3P4R5S6T7V8W9X",
"title": "Week for two",
"people": 2,
"days": 7,
"budget": 80,
"created_at": "2026-10-08T20:00:00.000Z"
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('food.plan@1', value); // { valid, errors: [{ path, message }] }