Skip to content

Raise work order from feedback

POST
/v1/actions/hospitality.action.raise_work_order_from_feedback/apply
curl --request POST \
--url https://api.aerandil.com/v1/actions/hospitality.action.raise_work_order_from_feedback/apply \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "branch": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "params": { "category": "hvac", "description": "example", "room_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "severity": "cosmetic", "staff_member_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "title": "example" }, "return_modified": false, "target": { "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "object_type": "hospitality.guest_feedback" } }'

Raise a work order for the fault a complaint or a suggestion reports — hubOS’s fault linked to a complaint. The order is created through create_work_order’s own path against room_id, or the feedback’s stay’s room when none is named, and links back (work_order_answers_feedback); an open case moves to in_progress. The feedback’s text is never copied onto the order — it is the guest’s, the order is read by engineering — so the title and description are the house’s words. Refuses a compliment and a closed case. A complaint may need more than one order; each call raises one. Emits guest_feedback.work_order_raised.

Effects: modify hospitality.guest_feedback; link hospitality.link.work_order_answers_feedback; create hospitality.work_order; link hospitality.link.work_order_from_triage; link hospitality.link.work_order_for_room; link hospitality.link.work_order_assigned_to; create hospitality.room_status_block; link hospitality.link.room_status_block_for_room; link hospitality.link.work_order_holds_block; modify hospitality.availability_day; link hospitality.link.work_order_for_asset; link hospitality.link.work_order_reported_by_stay; link hospitality.link.work_order_of_fault_type; link hospitality.link.work_order_for_area.

Media typeapplication/json
object
branch

Apply against an open branch’s overlay view instead of the canonical (main) plane. The action’s writes land in the branch’s copy-on-first-write overlay, its events in the branch’s own stream, and the invocation is journaled for merge-by-replay. Branch writes are action-only, so this is the write-side entry point to a branch (POST /v1/branches forks one).

string format: uuid
params
required
object
category
required
Work order category
string
Allowed values: hvac plumbing electrical furniture fixtures networking audio_visual structural exterior safety other
description
What engineering needs to know
string
room_id
The room (defaults to the feedback's stay's room)
string format: uuid
severity
required
Work order severity
string
Allowed values: cosmetic minor major blocking safety
staff_member_id
Engineer to assign on creation
string format: uuid
title
required
Title
string
return_modified

When true, the response carries modified_objects and modified_links projections — the engine reads the event log inside the same transaction so the projection observes the handler’s own writes.

boolean
target
required
object
id
required
string format: uuid
object_type
required
Allowed value: hospitality.guest_feedback

Action applied. modified_objects and modified_links populated when return_modified: true was supplied.

Media typeapplication/json
ApplyActionResponse

Envelope returned by the Aerandil action engine. correlation_id ties every event emitted by this invocation; modified_objects and modified_links project the events the handler emitted (per the action’s declared effects); warnings carries any non-blocking soft-validator observations.

object
correlation_id
required

Per-invocation correlation id; matches events.correlation_id for every event this action appended.

string format: uuid
modified_links
required

Links established or removed by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
from_id
required
string format: uuid
from_type
required
string
kind
required
Allowed values: linked
link_type
required
Allowed values: hospitality.link.work_order_answers_feedback hospitality.link.work_order_from_triage hospitality.link.work_order_for_room hospitality.link.work_order_assigned_to hospitality.link.room_status_block_for_room hospitality.link.work_order_holds_block hospitality.link.work_order_for_asset hospitality.link.work_order_reported_by_stay hospitality.link.work_order_of_fault_type hospitality.link.work_order_for_area
to_id
required
string format: uuid
to_type
required
string
modified_objects
required

Objects created, modified, or soft-deleted by this invocation. Empty when the caller did not request return_modified.

Array<object>
object
id
required
string format: uuid
kind
required
Allowed values: modified created
object_type
required
Allowed values: hospitality.guest_feedback hospitality.work_order hospitality.room_status_block hospitality.availability_day
warnings

Non-blocking soft-validator observations emitted during this invocation (e.g. comp-authority over-limit, recipe pour-cost over sell-price). Absent when no warnings were emitted.

Array<object>
object
message
required

Human-readable summary, suitable for logging or operator-UI surfacing.

string
object_type
required

Object type the warning was raised against.

string
property

Property the warning anchors to, when a single field is the locus. Absent for multi-field rules.

string
rule
required

Stable kebab-case rule identifier (e.g. comp-authority-over-limit).

string
Example
{
"modified_links": [
{
"kind": "linked",
"link_type": "hospitality.link.work_order_answers_feedback"
}
],
"modified_objects": [
{
"kind": "modified",
"object_type": "hospitality.guest_feedback"
}
]
}

Conflict — concurrent modification or unique constraint violation.

Validation error — parameter validation or business-rule violation.