ReviewsEntitySplitPayload reviews.entity.split@1
Generated at from
openvibe-contracts v0.34.2 and
openvibe-sdk v0.5.0.
- Version
- 1.0.0
- Owner
- reviews
- Visibility
- first-party
- Status
- active
- Compatibility
- backward
- Schema
https://openvibe.network/contracts/events/payloads/reviews.entity.split.v1.json
reviews.entity.split v1 (OpenVibe.Reviews server/reviews/service.js split → entityEvent). An editor undid a merge (POST /api/v1/entities/:ref/split, capability reviews.entity.split, a person only), in the transaction of the split: the merged_into link (link_id) is ended, the entity is active again with exactly the aliases and signals it had before the merge, and both aggregates are recomputed. A summary of the former target that cites signals which went back with the split is flagged and gets a pending revision in the same transaction; Search gets both entities' documents again (reviews.index_document.upserted). The signal ids are left out (they are in the entity's history). Envelope: subject { type: entity, id: <split entity ent_…> }, visibility public, priority important, actor the editor (user usr_…).
Fields
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
entity_id | string | yes | The entity split off again (subject.id); now state active. |
|
from_entity_id | string | yes | The entity it had been merged into. |
|
link_id | string | yes | The merged_into link this split ended (the link_id of the reviews.entity.merged event). |
|
signal_count | integer | yes | Active signals back with the entity (its own and those of entities merged into it). |
|
url | string | yes | Canonical URL of the split entity's page (/e/<slug>). |
|
from_url | string | null | yes | Canonical URL of the former target's page; null only if that entity no longer exists. |
|
note | string | null | yes | The editor's note (clipped to 500 characters); null when none was given. |
|
Examples
From the contract's own test fixtures: valid ones validate, rejected ones must fail.
Valid: no-note
{
"entity_id": "ent_01M38GW372A3PM7110AHHTYM7C",
"from_entity_id": "ent_01M38GW2QD088TQ08VN985JTXT",
"link_id": "lnk_01M38GW38EQW403PWP85Z8WVH5",
"signal_count": 0,
"url": "https://openvibe.reviews/e/portal-two",
"from_url": "https://openvibe.reviews/e/portal-2",
"note": null
}Valid: split
{
"entity_id": "ent_01M38GW372A3PM7110AHHTYM7C",
"from_entity_id": "ent_01M38GW2QD088TQ08VN985JTXT",
"link_id": "lnk_01M38GW38EQW403PWP85Z8WVH5",
"signal_count": 2,
"url": "https://openvibe.reviews/e/portal-two",
"from_url": "https://openvibe.reviews/e/portal-2",
"note": "Actually two different editions"
}Rejected: bad-link-id
{
"entity_id": "ent_01M38GW372A3PM7110AHHTYM7C",
"from_entity_id": "ent_01M38GW2QD088TQ08VN985JTXT",
"link_id": "merged_into",
"signal_count": 2,
"url": "https://openvibe.reviews/e/portal-two",
"from_url": "https://openvibe.reviews/e/portal-2",
"note": null
}Rejected: into-instead-of-from
{
"entity_id": "ent_01M38GW372A3PM7110AHHTYM7C",
"into_entity_id": "ent_01M38GW2QD088TQ08VN985JTXT",
"from_entity_id": "ent_01M38GW2QD088TQ08VN985JTXT",
"link_id": "lnk_01M38GW38EQW403PWP85Z8WVH5",
"signal_count": 2,
"url": "https://openvibe.reviews/e/portal-two",
"from_url": "https://openvibe.reviews/e/portal-2",
"note": null
}Rejected: missing-from-entity
{
"entity_id": "ent_01M38GW372A3PM7110AHHTYM7C",
"link_id": "lnk_01M38GW38EQW403PWP85Z8WVH5",
"signal_count": 2,
"url": "https://openvibe.reviews/e/portal-two",
"from_url": "https://openvibe.reviews/e/portal-2",
"note": null
}Validate
const contracts = require('openvibe-contracts');
contracts.validate('reviews.entity.split@1', value); // { valid, errors: [{ path, message }] }