POST/crew/{crewId}/state-records/preview
Shows the states one crew member would be in between from and to if a booking were added, without creating it. Send exactly one of: the
plan blocks of new work, the procurementResourceId of an organization need, or the eventProcurementResourceId of an event need the person
would fill (its plan is read from the event). Nothing is written; the booking's blocks come back with source.isCandidate. Compare
with OrgCrew_GetCrewStateRecords for the current answer. crewId comes from OrgCrew_GetCrew, procurementResourceId from
Procurements_GetProcurement, block typeIds from ResourceTypes_GetScheduleBlockTypes. Needs Crew.View at the organization.
Path Parameters
| Field | Type | Required | Description |
|---|
| crewId | uuid | Required | |
Request Body
| Field | Type | Required | Description |
|---|
| from | date-time | Optional | |
| to | date-time | Optional | |
| procurementResourceId | uuid | Optional | |
| eventProcurementResourceId | uuid | Optional | |
| blocks | PreviewCrewStateRecordsRequestBlockInfo[] | Optional | |
PreviewCrewStateRecordsRequestBlockInfo
| Field | Type | Description |
|---|
| typeId | uuid | |
| startDateTime | date-time | |
| endDateTime | date-time | |
Response
| Field | Type | Description |
|---|
| crewId | uuid | |
| from | date-time | |
| to | date-time | |
| records | GetCrewStateRecordsResponseRecordInfo[]| null | |
| blocks | GetCrewStateRecordsResponseBlockInfo[]| null | |
GetCrewStateRecordsResponseRecordInfo
| Field | Type | Description |
|---|
| stateId | uuid | |
| state | GetCrewStateRecordsResponseStateInfo | |
| ruleId | uuid | |
| ruleName | string| null | |
| startDateTime | date-time | |
| endDateTime | date-time| null | |
| isActual | boolean | |
| explanation | GetCrewStateRecordsResponseExplanationInfo | |
GetCrewStateRecordsResponseBlockInfo
| Field | Type | Description |
|---|
| id | uuid | |
| typeId | uuid| null | |
| startDateTime | date-time | |
| endDateTime | date-time | |
| isActual | boolean | |
| source | GetCrewScheduleBlocksResponseSourceInfo | |
| states | GetCrewStateRecordsResponseSegmentInfo[]| null | |
GetCrewStateRecordsResponseStateInfo
| Field | Type | Description |
|---|
| name | string| null | |
| color | string| null | |
| icon | string| null | |
| sortOrder | integer | |
GetCrewStateRecordsResponseExplanationInfo
| Field | Type | Description |
|---|
| threshold | GetCrewStateRecordsResponseThresholdInfo | |
| countedFrom | date-time| null | |
| sources | GetCrewStateRecordsResponseSourceHoursInfo[]| null | |
GetCrewScheduleBlocksResponseSourceInfo
| Field | Type | Description |
|---|
| resourceReservationId | uuid| null | |
| eventReservationId | uuid| null | |
| eventId | uuid| null | |
| eventName | string| null | |
| isCandidate | boolean | |
GetCrewStateRecordsResponseSegmentInfo
| Field | Type | Description |
|---|
| stateId | uuid | |
| ruleId | uuid | |
| startDateTime | date-time | |
| endDateTime | date-time | |
GetCrewStateRecordsResponseThresholdInfo
| Field | Type | Description |
|---|
| value | number | |
| unit | string| null | |
GetCrewStateRecordsResponseSourceHoursInfo
| Field | Type | Description |
|---|
| eventId | uuid| null | |
| eventName | string| null | |
| isOrgDirect | boolean | |
| isCandidate | boolean | |
| actualHours | number | |
| planHours | number | |