Recras analytics

What data is inside

Claude queries three wide tables in ClickHouse. They are flattened copies of our Recras data (bookings, customers, invoices, payments, staff planning, e-mails and notes), rebuilt every four hours from a read-only mirror that is refreshed every 15 minutes. Claude never writes to Recras.

Tables at a glance

TableOne row perColumnsRowsLast export
flattened_bookingsbooking (with its customer, package, invoices, payments and staffing summarised)765,4042 h 35 min ago
2026-12-01 04:30:01 UTC
flattened_contact_momentscontact moment: an e-mail sent from Recras or a note on a contact3553,7292 h 35 min ago
2026-12-01 04:30:11 UTC
flattened_contactscontact: customer, supplier or staff member (with booking, invoice and communication totals)666,6502 h 35 min ago
2026-12-01 04:30:29 UTC
flattened_shiftsstaff shift: one person, one time slot, with role, vessel, booking and recorded hours734,0022 h 35 min ago
2026-12-01 04:30:40 UTC
flattened_staff_planning_notificationsshift line in a planning mail to a staff member (new, changed or cancelled, with the times as communicated)183,4052 h 34 min ago
2026-12-01 04:30:45 UTC

The full guide Claude reads before querying is available as guide.md.

Reading the data

Booking statuses

Statuses are Dutch, as in Recras:

informatie
information request
interesse
interest
optie
option
pending_online
online booking awaiting payment
reservering
reservation (confirmed)
definitief
definitive (confirmed)
gaande
ongoing (confirmed)
voltooid
completed (confirmed)
geannuleerd
cancelled

Revenue and volume questions normally count the four confirmed statuses and exclude cancellations, options and information requests. Claude states which statuses it included.

Conventions

flattened_bookings

Bookings with customer, contact person, company, package and aggregated lines/invoices/payments/shifts/contact moments. Use it for revenue, volume, package popularity, group sizes, lead times, cancellations and payment behaviour. The customer, main contact person, company and package are joined in as prefixed columns; invoices, payments, booking lines, shifts and contact moments are summarised as counts, sums and first/last dates.

Record (21 columns)
ididentifier
referencetext, may be empty
datedate, may be empty
statustext, may be empty
status_updated_atdate and time (UTC), may be empty
package_nametext, may be empty
package_idwhole number, may be empty
personswhole number, may be empty
online_bookingyes/no (1/0), may be empty
status_expiry_datedate, may be empty
particularstext, may be empty
should_invoiceyes/no (1/0), may be empty
draft_invoice_after_dayswhole number, may be empty
invoiced_amountamount (EUR), may be empty
book_process_idwhole number, may be empty
product_idwhole number, may be empty
created_atdate and time (UTC), may be empty
synced_atdate and time (UTC), may be empty
deleted_atdate and time (UTC), may be empty
package_person_countwhole number, may be empty
package_price_pp_inclamount (EUR), may be empty
Timeline (7 columns)
first_seen_atdate and time (UTC), may be empty
first_line_begin_atdate and time (UTC), may be empty
last_line_end_atdate and time (UTC), may be empty
first_invoice_datedate, may be empty
last_invoice_datedate, may be empty
last_payment_atdate and time (UTC), may be empty
last_contact_moment_atdate and time (UTC), may be empty
Costs (booking value as calculated by Recras) (7 columns)
cost_payment_termwhole number, may be empty
cost_customer_referencetext, may be empty
cost_total_incl_vatamount (EUR), may be empty
cost_company_idwhole number, may be empty
cost_remarktext, may be empty
cost_item_countcount (never empty)
cost_items_amountamount (EUR), may be empty
Customer (the contact the booking belongs to) (13 columns)
customer_idwhole number, may be empty
customer_contact_typetext, may be empty
customer_nametext, may be empty
customer_typetext, may be empty
customer_departmenttext, may be empty
customer_addresstext, may be empty
customer_postal_codetext, may be empty
customer_citytext, may be empty
customer_country_codetext, may be empty
customer_province_codetext, may be empty
customer_websitetext, may be empty
customer_company_idwhole number, may be empty
customer_deleted_atdate and time (UTC), may be empty
Main contact person (7 columns)
main_contact_person_idwhole number, may be empty
main_contact_first_nametext, may be empty
main_contact_last_nametext, may be empty
main_contact_gendertext, may be empty
main_contact_emailtext, may be empty
main_contact_phonetext, may be empty
main_contact_citytext, may be empty
Company (the invoicing company) (2 columns)
company_nametext, may be empty
company_display_nametext, may be empty
Package catalogue (the package definition, if it still exists) (1 columns)
package_catalog_nametext, may be empty
Booking lines (activities and products on the booking) (4 columns)
line_countcount (never empty)
line_quantity_totalwhole number, may be empty
line_product_countcount (never empty)
line_product_namestext, may be empty
Location / vessel (1 columns)
line_location_namestext, may be empty
Invoices (aggregates) (3 columns)
invoice_countcount (never empty)
invoice_total_incl_vatamount (EUR), may be empty
invoice_statusestext, may be empty
Payments (aggregates) (3 columns)
payment_countcount (never empty)
paid_totalamount (EUR), may be empty
outstanding_amountamount (EUR), may be empty
Staff shifts (aggregates) (4 columns)
shift_countcount (never empty)
shift_hoursnumber, may be empty
shift_staff_namestext, may be empty
shift_qualification_namestext, may be empty
Covering shifts (derived by location + time overlap) (2 columns)
covering_shift_countcount (never empty)
covering_skipper_namestext, may be empty
Contact moments (aggregates) (1 columns)
contact_moment_countcount (never empty)

flattened_contact_moments

Contact moments (e-mails and notes) with their contact, contact person, staff member and booking. Use it for communication analyses: how much mail goes out, by whom, about which bookings, and how long before a booking is confirmed. The message text is included and can be long; booking_id is only known for about half of the moments.

Record (15 columns)
ididentifier
moment_typetext, may be empty
subjecttext, may be empty
to_customeryes/no (1/0), may be empty
stickyyes/no (1/0), may be empty
messagetext, may be empty
message_texttext, may be empty
message_lengthwhole number, may be empty
is_planning_mailyes/no (1/0), may be empty
planning_change_countcount (never empty)
signaturetext, may be empty
editable_untildate and time (UTC), may be empty
created_atdate and time (UTC), may be empty
synced_atdate and time (UTC), may be empty
deleted_atdate and time (UTC), may be empty
Contact (8 columns)
contact_idwhole number, may be empty
contact_person_idwhole number, may be empty
contact_typetext, may be empty
contact_contact_typetext, may be empty
contact_nametext, may be empty
contact_customer_typetext, may be empty
contact_citytext, may be empty
contact_company_idwhole number, may be empty
Bookings (aggregates or the linked booking) (6 columns)
booking_idwhole number, may be empty
booking_referencetext, may be empty
booking_datedate, may be empty
booking_statustext, may be empty
booking_package_nametext, may be empty
booking_personswhole number, may be empty
Staff member (2 columns)
staff_idwhole number, may be empty
staff_nametext, may be empty
Timeline (1 columns)
first_seen_atdate and time (UTC), may be empty
Contact person (3 columns)
person_first_nametext, may be empty
person_last_nametext, may be empty
person_emailtext, may be empty

flattened_contacts

Contacts of every type with company, main contact person and aggregated bookings/invoices/payments/contact moments/staff hours. Use it for customer rankings, repeat business, outstanding amounts per customer, communication load and (for staff) hours worked. Filter on contact_type = klant for customer questions.

Record (20 columns)
ididentifier
display_nametext, may be empty
nametext, may be empty
addresstext, may be empty
postal_codetext, may be empty
citytext, may be empty
country_codetext, may be empty
province_codetext, may be empty
websitetext, may be empty
vat_numbertext, may be empty
supplier_statustext, may be empty
pay_fromdate, may be empty
departmenttext, may be empty
self_hreftext, may be empty
emailtext, may be empty
phonetext, may be empty
plannableyes/no (1/0), may be empty
deactivated_atdate and time (UTC), may be empty
synced_atdate and time (UTC), may be empty
deleted_atdate and time (UTC), may be empty
Contact (2 columns)
contact_typetext, may be empty
contact_person_countcount (never empty)
Company (the invoicing company) (3 columns)
company_idwhole number, may be empty
company_nametext, may be empty
company_display_nametext, may be empty
Customer (the contact the booking belongs to) (1 columns)
customer_typetext, may be empty
Invoices (aggregates) (3 columns)
invoice_addressingtext, may be empty
invoice_countcount (never empty)
invoice_total_incl_vatamount (EUR), may be empty
Timeline (9 columns)
first_nametext, may be empty
last_nametext, may be empty
first_seen_atdate and time (UTC), may be empty
first_booking_datedate, may be empty
last_booking_datedate, may be empty
last_invoice_datedate, may be empty
last_payment_atdate and time (UTC), may be empty
first_contact_moment_atdate and time (UTC), may be empty
last_contact_moment_atdate and time (UTC), may be empty
Same person in the other contact type (4 columns)
person_keytext, may be empty
twin_contact_idwhole number, may be empty
twin_contact_typetext, may be empty
twin_matchtext, may be empty
Main contact person (12 columns)
main_contact_person_idwhole number, may be empty
main_contact_first_nametext, may be empty
main_contact_last_nametext, may be empty
main_contact_gendertext, may be empty
main_contact_salutationtext, may be empty
main_contact_emailtext, may be empty
main_contact_email2text, may be empty
main_contact_phonetext, may be empty
main_contact_phone2text, may be empty
main_contact_addresstext, may be empty
main_contact_postal_codetext, may be empty
main_contact_citytext, may be empty
Bookings (aggregates or the linked booking) (5 columns)
booking_countcount (never empty)
booking_confirmed_countcount (never empty)
booking_cancelled_countcount (never empty)
booking_persons_totalwhole number, may be empty
booking_cost_total_incl_vatamount (EUR), may be empty
Payments (aggregates) (3 columns)
payment_countcount (never empty)
paid_totalamount (EUR), may be empty
outstanding_amountamount (EUR), may be empty
Contact moments (aggregates) (1 columns)
contact_moment_countcount (never empty)
Staff shifts (aggregates) (1 columns)
shift_countcount (never empty)
Recorded hours (2 columns)
recorded_hours_countcount (never empty)
recorded_hours_totalnumber, may be empty

flattened_shifts

Staff shifts with staff member, role, location/vessel, linked booking and booking line, tasks, recorded hours, last planning notification and covered trips. Use it for the daily roster (who worked when, in which role, on which vessel), staffing per booking (which trips had a skipper), labour hours per trip, vessel or package, planned versus recorded hours, and workload per person per week or month. Role, location and booking come from the shift itself or, when missing there, from its first task. date is the local calendar date; begin_at and end_at are UTC. Statuses: bevestigd (confirmed), concept (draft), gevraagd (requested), geannuleerd (cancelled), geweigerd (declined). Recras keeps no modification history: last_notified_* shows what the staff member was last told by the daily planning mail, notification_in_sync whether that still matches, and covered_* which trips the shift covers by vessel and time overlap.

Record (17 columns)
ididentifier
statustext, may be empty
begin_atdate and time (UTC), may be empty
end_atdate and time (UTC), may be empty
datedate, may be empty
weekdaytext, may be empty
internal_referencetext, may be empty
remarktext, may be empty
notetext, may be empty
created_atdate and time (UTC), may be empty
created_bywhole number, may be empty
updated_bywhole number, may be empty
is_generatedyes/no (1/0), may be empty
product_idwhole number, may be empty
product_nametext, may be empty
synced_atdate and time (UTC), may be empty
deleted_atdate and time (UTC), may be empty
Planning (2 columns)
planned_minuteswhole number, may be empty
planned_hoursnumber, may be empty
Timeline (1 columns)
first_seen_atdate and time (UTC), may be empty
Staff member (6 columns)
staff_idwhole number, may be empty
staff_nametext, may be empty
staff_contact_typetext, may be empty
staff_emailtext, may be empty
staff_company_idwhole number, may be empty
staff_customer_contact_idwhole number, may be empty
Role (qualification) (3 columns)
qualification_idwhole number, may be empty
qualification_nametext, may be empty
task_qualification_namestext, may be empty
Location / vessel (3 columns)
location_idwhole number, may be empty
location_nametext, may be empty
line_location_idwhole number, may be empty
Bookings (aggregates or the linked booking) (11 columns)
booking_idwhole number, may be empty
booking_referencetext, may be empty
booking_datedate, may be empty
booking_statustext, may be empty
booking_package_nametext, may be empty
booking_personswhole number, may be empty
booking_cost_total_incl_vatamount (EUR), may be empty
booking_customer_idwhole number, may be empty
booking_customer_nametext, may be empty
booking_customer_typetext, may be empty
booking_line_idwhole number, may be empty
Booking lines (activities and products on the booking) (5 columns)
line_product_idwhole number, may be empty
line_product_nametext, may be empty
line_begin_atdate and time (UTC), may be empty
line_end_atdate and time (UTC), may be empty
line_quantitywhole number, may be empty
Shift tasks (4 columns)
task_countcount (never empty)
task_descriptionstext, may be empty
task_begin_atdate and time (UTC), may be empty
task_end_atdate and time (UTC), may be empty
Recorded hours (8 columns)
recorded_countcount (never empty)
recorded_begin_atdate and time (UTC), may be empty
recorded_end_atdate and time (UTC), may be empty
recorded_break_minuteswhole number, may be empty
recorded_minuteswhole number, may be empty
recorded_hoursnumber, may be empty
recorded_notestext, may be empty
hours_differencenumber, may be empty
Planning notifications (from the daily mails to staff) (8 columns)
notification_countcount (never empty)
last_notified_atdate and time (UTC), may be empty
last_notified_change_typetext, may be empty
last_notified_begin_atdate and time (UTC), may be empty
last_notified_end_atdate and time (UTC), may be empty
last_notified_statustext, may be empty
notification_matchtext, may be empty
notification_in_syncyes/no (1/0), may be empty
Covered trips (derived by location + time overlap) (5 columns)
covered_booking_countcount (never empty)
covered_booking_idstext, may be empty
covered_booking_referencestext, may be empty
covered_package_namestext, may be empty
covered_persons_totalwhole number, may be empty

flattened_staff_planning_notifications

Shift lines from the daily planning mails to staff (new/changed/cancelled with times), matched to the current shift. The communicated history of shifts. Recras mails every staff member a daily digest (07:02) with the shifts that were added, changed or cancelled the day before; this table holds one row per shift line with the times as printed (converted to UTC) and the previous times for changes. matched_shift_id links the line to the current shift when staff, begin and end match exactly, or when the staff member has only one shift that day.

Record (8 columns)
ididentifier
sent_atdate and time (UTC), may be empty
change_typetext, may be empty
begin_atdate and time (UTC), may be empty
end_atdate and time (UTC), may be empty
statustext, may be empty
positionwhole number, may be empty
matchtext, may be empty
Contact moments (aggregates) (1 columns)
contact_moment_idwhole number, may be empty
Staff member (2 columns)
staff_idwhole number, may be empty
staff_nametext, may be empty
Staff shifts (aggregates) (1 columns)
shift_datedate, may be empty
Previous values (from the mail) (2 columns)
previous_begin_atdate and time (UTC), may be empty
previous_end_atdate and time (UTC), may be empty
Matched shift (4 columns)
matched_shift_idwhole number, may be empty
matched_shift_statustext, may be empty
matched_shift_begin_atdate and time (UTC), may be empty
matched_shift_end_atdate and time (UTC), may be empty