Files
kvitt/contracts/examples/sync/pull-page.json
T
jacobh2 c6df2ab8f5 M1: contracts and vectors (SPEC v0.1, schema 1)
contracts/openapi.yaml (OpenAPI 3.1, E-1..E-33, error shape and the
exhaustive error code enum, device bearer scheme), contracts/schema/
server-v1.sql (SPEC §14.1 verbatim), seven test-vector files per §14.5.5,
80 examples (every JSON body of §14.3.4, every error code, sync pull/push,
every FCM push type), and tools/contracts-check.py (stdlib-only reference
of §9.1, §9.3, §9.4 and §14.5.4 plus shape checks; the M1 gate).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-17 20:57:59 +02:00

324 lines
9.4 KiB
JSON

{
"epoch": "30b85fb529aac0016dc91650841005b9",
"since": 0,
"next_since": 921,
"has_more": true,
"server_time": "2026-10-25T12:00:00.000Z",
"users": [
{
"id": "0192a000-0000-7000-8000-000000000001",
"role": "admin",
"display_name": "Jacob",
"picture_version": null,
"created_at": "2026-10-17T06:12:40.512Z",
"updated_at": "2026-10-17T06:12:40.512Z",
"server_version": 11
},
{
"id": "0192a000-0000-7000-8000-000000000002",
"role": "member",
"display_name": "Anna",
"picture_version": 2,
"created_at": "2026-10-17T07:01:15.000Z",
"updated_at": "2026-10-17T07:05:00.250Z",
"server_version": 12
}
],
"categories": [
{
"id": "01920000-0000-7000-8000-000000000001",
"default_key": "groceries",
"name": null,
"icon": "shopping_cart",
"color": "green",
"sort_order": 10,
"created_at": "2026-10-17T00:00:00.000Z",
"updated_at": "2026-10-17T00:00:00.000Z",
"archived_at": null,
"deleted_at": null,
"server_version": 1
},
{
"id": "01920000-0000-7000-8000-000000000002",
"default_key": "restaurants",
"name": null,
"icon": "restaurant",
"color": "orange",
"sort_order": 20,
"created_at": "2026-10-17T00:00:00.000Z",
"updated_at": "2026-10-17T00:00:00.000Z",
"archived_at": null,
"deleted_at": null,
"server_version": 2
}
],
"accounts": [
{
"id": "0192a003-0000-7000-8000-000000000001",
"name": "Vardag",
"default_shares": [
{
"user_id": "0192a000-0000-7000-8000-000000000001",
"share_bp": 5000
},
{
"user_id": "0192a000-0000-7000-8000-000000000002",
"share_bp": 5000
}
],
"created_by_user_id": "0192a000-0000-7000-8000-000000000001",
"created_at": "2026-10-17T07:10:00.000Z",
"updated_at": "2026-10-17T07:10:00.000Z",
"archived_at": null,
"deleted_at": null,
"server_version": 13
}
],
"recurring_templates": [
{
"id": "0192a004-0000-7000-8000-000000000001",
"account_id": "0192a003-0000-7000-8000-000000000001",
"category_id": "01920000-0000-7000-8000-000000000003",
"amount_ore": 1250000,
"description": "Hyra",
"notes": "",
"payer_user_id": "0192a000-0000-7000-8000-000000000001",
"split_mode": "ratio",
"splits": [
{
"user_id": "0192a000-0000-7000-8000-000000000001",
"share_bp": 6000,
"share_ore": null
},
{
"user_id": "0192a000-0000-7000-8000-000000000002",
"share_bp": 4000,
"share_ore": null
}
],
"day_of_month": 25,
"start_period": "2026-10",
"end_period": null,
"paused": false,
"last_generated_period": "2026-10",
"next_occurrence_date": "2026-11-25",
"created_by_user_id": "0192a000-0000-7000-8000-000000000001",
"updated_by_user_id": "0192a000-0000-7000-8000-000000000001",
"created_at": "2026-10-17T06:30:02.004Z",
"updated_at": "2026-10-25T05:00:00.031Z",
"deleted_at": null,
"server_version": 921
}
],
"expenses": [
{
"id": "01929c5e-1111-7aaa-8bbb-000000000001",
"account_id": "0192a003-0000-7000-8000-000000000001",
"category_id": "01920000-0000-7000-8000-000000000001",
"amount_ore": 41200,
"description": "ICA Maxi",
"notes": "",
"expense_date": "2026-10-16",
"payer_user_id": "0192a000-0000-7000-8000-000000000001",
"split_mode": "default",
"splits": [
{
"user_id": "0192a000-0000-7000-8000-000000000001",
"share_ore": 20600,
"share_bp": 5000
},
{
"user_id": "0192a000-0000-7000-8000-000000000002",
"share_ore": 20600,
"share_bp": 5000
}
],
"recurring_template_id": null,
"recurring_period": null,
"created_by_user_id": "0192a000-0000-7000-8000-000000000001",
"updated_by_user_id": "0192a000-0000-7000-8000-000000000001",
"created_at": "2026-10-16T17:02:11.123Z",
"updated_at": "2026-10-16T17:02:11.123Z",
"deleted_at": null,
"server_version": 913
},
{
"id": "01929c5e-1111-7aaa-8bbb-000000000002",
"account_id": "0192a003-0000-7000-8000-000000000001",
"category_id": "01920000-0000-7000-8000-000000000002",
"amount_ore": 1001,
"description": "Fika",
"notes": "Kanelbullar\noch kaffe",
"expense_date": "2026-10-15",
"payer_user_id": "0192a000-0000-7000-8000-000000000002",
"split_mode": "exact",
"splits": [
{
"user_id": "0192a000-0000-7000-8000-000000000001",
"share_ore": 701,
"share_bp": null
},
{
"user_id": "0192a000-0000-7000-8000-000000000002",
"share_ore": 300,
"share_bp": null
}
],
"recurring_template_id": null,
"recurring_period": null,
"created_by_user_id": "0192a000-0000-7000-8000-000000000002",
"updated_by_user_id": "0192a000-0000-7000-8000-000000000002",
"created_at": "2026-10-15T10:00:00.000Z",
"updated_at": "2026-10-15T10:00:00.000Z",
"deleted_at": null,
"server_version": 914
},
{
"id": "01929c5e-1111-7aaa-8bbb-000000000003",
"account_id": "0192a003-0000-7000-8000-000000000001",
"category_id": "01920000-0000-7000-8000-000000000003",
"amount_ore": 1250000,
"description": "Hyra",
"notes": "",
"expense_date": "2026-10-25",
"payer_user_id": "0192a000-0000-7000-8000-000000000001",
"split_mode": "ratio",
"splits": [
{
"user_id": "0192a000-0000-7000-8000-000000000001",
"share_ore": 750000,
"share_bp": 6000
},
{
"user_id": "0192a000-0000-7000-8000-000000000002",
"share_ore": 500000,
"share_bp": 4000
}
],
"recurring_template_id": "0192a004-0000-7000-8000-000000000001",
"recurring_period": "2026-10",
"created_by_user_id": "0192a000-0000-7000-8000-000000000001",
"updated_by_user_id": "0192a000-0000-7000-8000-000000000001",
"created_at": "2026-10-25T05:00:00.031Z",
"updated_at": "2026-10-25T05:00:00.031Z",
"deleted_at": null,
"server_version": 919
}
],
"settlements": [
{
"id": "0192a005-0000-7000-8000-000000000001",
"from_user_id": "0192a000-0000-7000-8000-000000000002",
"to_user_id": "0192a000-0000-7000-8000-000000000001",
"amount_ore": 50000,
"settlement_date": "2026-10-16",
"note": "Swish",
"allocations": [
{
"account_id": "0192a003-0000-7000-8000-000000000001",
"amount_ore": 30000
},
{
"account_id": "0192a003-0000-7000-8000-000000000002",
"amount_ore": 20000
}
],
"created_by_user_id": "0192a000-0000-7000-8000-000000000002",
"updated_by_user_id": "0192a000-0000-7000-8000-000000000002",
"created_at": "2026-10-16T18:00:00.000Z",
"updated_at": "2026-10-16T18:00:00.000Z",
"deleted_at": null,
"server_version": 915
}
],
"audit_entries": [
{
"id": "0192a006-0000-7000-8000-000000000001",
"entity_type": "expense",
"entity_id": "01929c5e-1111-7aaa-8bbb-000000000001",
"action": "create",
"source": "app",
"actor_user_id": "0192a000-0000-7000-8000-000000000001",
"client_at": "2026-10-16T17:02:11.123Z",
"server_at": "2026-10-16T17:02:12.480Z",
"changes": [
{
"field": "account_id",
"old": null,
"new": "0192a003-0000-7000-8000-000000000001"
},
{
"field": "category_id",
"old": null,
"new": "01920000-0000-7000-8000-000000000001"
},
{
"field": "payer_user_id",
"old": null,
"new": "0192a000-0000-7000-8000-000000000001"
},
{
"field": "amount_ore",
"old": null,
"new": 41200
},
{
"field": "description",
"old": null,
"new": "ICA Maxi"
},
{
"field": "notes",
"old": null,
"new": ""
},
{
"field": "expense_date",
"old": null,
"new": "2026-10-16"
},
{
"field": "split_mode",
"old": null,
"new": "default"
},
{
"field": "splits",
"old": null,
"new": [
{
"user_id": "0192a000-0000-7000-8000-000000000001",
"share_ore": 20600,
"share_bp": 5000
},
{
"user_id": "0192a000-0000-7000-8000-000000000002",
"share_ore": 20600,
"share_bp": 5000
}
]
}
],
"server_version": 916
},
{
"id": "0192a006-0000-7000-8000-000000000002",
"entity_type": "settlement",
"entity_id": "0192a005-0000-7000-8000-000000000001",
"action": "update",
"source": "app",
"actor_user_id": "0192a000-0000-7000-8000-000000000002",
"client_at": "2026-10-16T18:05:00.000Z",
"server_at": "2026-10-16T18:05:01.200Z",
"changes": [
{
"field": "note",
"old": "",
"new": "Swish"
}
],
"server_version": 917
}
]
}