Skip to content

Datamodellen

Alle tabellen leven in Supabase (PostgreSQL). UUIDs worden gegenereerd door Supabase (gen_random_uuid()).


KolomTypeVerplichtToelichting
iduuidPrimary key
first_nametext
last_nametext
emailtextUniek, gekoppeld aan Supabase Auth
phonetext
whatsapptextKan afwijken van telefoon
addresstext
emergency_contact_nametext
emergency_contact_phonetext
localetextnl / en / es / pap
notestextInterne notities (alleen admin)
onboarding_completedbooleanDefault: false
terms_accepted_attimestamptzMoment van akkoord voorwaarden
created_attimestamptz

KolomTypeVerplichtToelichting
iduuid
client_iduuidFK → clients
nametext
breedtext
date_of_birthdate
gendertextmale / female
neuteredboolean
weight_kgnumeric
colortext
microchip_numbertext
passport_numbertextHondenpaspoort nummer
photo_urltextOpgeslagen in Supabase Storage
trial_day_passedbooleanDefault: false. Verplicht voor andere diensten
trial_day_datedateDatum testdag doorlopen
vet_nametext
vet_phonetext
medical_conditionstext
medicationstextMedicijnen + dosering
allergiestext
insuredboolean
food_brandtext
food_amounttextBijv. “1 kop 2x per dag”
feeding_timestext
food_notestext
good_with_dogsboolean
good_with_childrenboolean
energy_leveltextlow / medium / high
behavior_notestext
special_notestextBijzonderheden voor volgend bezoek (bijv. eerdere ziekte, gedrag). Zichtbaar bij check-in
notestextAlgemene notities
activebooleanDefault: true
created_attimestamptz

KolomTypeVerplichtToelichting
iduuid
dog_iduuidFK → dogs
vaccine_typetextDHLPP / Bordetella / Rabies
date_administereddate
expiry_datedate
document_urltextUpload in Supabase Storage
verified_by_adminbooleanDefault: false
created_attimestamptz

KolomTypeVerplichtToelichting
iduuid
namejsonb{ nl, en, es, pap }
descriptionjsonb{ nl, en, es, pap }
typetextsingle / bundle / subscription
pricenumeric
price_unittextper_day / per_night / per_session / per_month
bundle_creditsintegerAlleen bij type bundle
bundle_expiry_daysintegerOptioneel: geldigheid bundel in dagen
activebooleanDefault: true
created_attimestamptz

KolomTypeVerplichtToelichting
iduuid
client_iduuidFK → clients
check_intimestamptz
check_outtimestamptzNull bij open check-out
statustextpending / confirmed / checked_in / checked_out / cancelled
room_typetextoutside_ac / ac_room / ac_deluxe / presidential
special_instructionstextAlgemene instructies voor deze boeking
authorized_pickuptextGeautoriseerde personen voor ophalen
medication_adminbooleanDefault: false. Medicatie toediening nodig?
total_amountnumericBerekend totaal
notestextInterne notities admin
cancelled_attimestamptz
cancelled_byuuidFK → users
cancellation_reasontext
created_attimestamptz

Alle fysieke kamers van het hotel.

KolomTypeVerplichtToelichting
iduuid
nametextBijv. “Kamer 1”, “Presidential Suite”
typetextoutside_ac / ac_room / ac_deluxe / presidential
capacityintegerMax aantal honden (normaal 1)
has_aircobooleanDefault: false
activebooleanDefault: true. Inactief = buiten gebruik
notestextBijv. “naast zwembad”, “extra groot”
created_attimestamptz

Welke hond zit in welke kamer, per boeking.

KolomTypeVerplichtToelichting
iduuid
room_iduuidFK → rooms
booking_iduuidFK → bookings
dog_iduuidFK → dogs
assigned_fromtimestamptzStart kameringebruikname (normaal check-in)
assigned_untiltimestamptzEinde kameringebruikname (normaal check-out)
assigned_byuuidFK → users (medewerker die toewijst)
created_attimestamptz

Unieke constraint: UNIQUE(room_id, assigned_from, assigned_until) — voorkomt dubbele toewijzing.


Koppeltabel: welke honden zitten in een boeking en welke dienst.

KolomTypeVerplichtToelichting
iduuid
booking_iduuidFK → bookings
dog_iduuidFK → dogs
service_iduuidFK → services
special_instructionstextPer hond specifiek voor dit verblijf
pricenumericPrijs op moment van boeking (snapshot)
bundle_usage_iduuidFK → bundle_usage (indien strippenkaart)

Strippenkaarten en trainingspakketten.

KolomTypeVerplichtToelichting
iduuid
client_iduuidFK → clients
dog_iduuidFK → dogs
service_iduuidFK → services
typetextstrippenkaart / training
total_creditsintegerGekocht aantal
used_creditsintegerDefault: 0
expires_atdateOptioneel
price_paidnumeric
payment_iduuidFK → payments
purchased_attimestamptz

remaining_credits is een computed column: total_credits - used_credits


KolomTypeVerplichtToelichting
iduuid
bundle_iduuidFK → bundles
booking_iduuidFK → bookings
credits_usedintegerDefault: 1
used_attimestamptz

KolomTypeVerplichtToelichting
iduuid
bundle_iduuidFK → bundles
dog_iduuidFK → dogs
lesson_numberintegerLes 1, 2, 3…
scheduled_attimestamptz
statustextscheduled / completed / missed / cancelled
trainer_notestextZichtbaar voor klant
created_attimestamptz

Unlimited daycare abonnementen.

KolomTypeVerplichtToelichting
iduuid
client_iduuidFK → clients
dog_iduuidFK → dogs
service_iduuidFK → services
start_datedate
end_datedateNull = doorlopend
price_per_monthnumeric
billing_dayintegerDag van de maand (bijv. 1)
statustextactive / paused / cancelled
next_billing_datedate

KolomTypeVerplichtToelichting
iduuid
subscription_iduuidFK → subscriptions
period_startdate
period_enddate
amountnumeric
due_datedate
statustextpending / paid / overdue / cancelled
reminder_countintegerDefault: 0
last_reminder_attimestamptz

KolomTypeVerplichtToelichting
iduuid
booking_iduuidFK → bookings (null bij bundel/abonnement)
bundle_iduuidFK → bundles
subscription_invoice_iduuidFK → subscription_invoices
amountnumeric
methodtextsentoo / card / cash / pin
statustextpending / success / failed / cancelled / expired
sentoo_transaction_idtextAlleen bij Sentoo
sentoo_payment_urltextBetaallink voor klant
paid_attimestamptz
marked_byuuidFK → users (bij handmatig)
created_attimestamptz

Medewerkers van het hotel (admin panel toegang).

KolomTypeVerplichtToelichting
iduuidGekoppeld aan Supabase Auth
emailtext
first_nametext
last_nametext
roletextadmin / medewerker / trainer
activebooleanDefault: true
created_attimestamptz

KolomTypeVerplichtToelichting
iduuid
invoice_numbertextAuto-increment, bijv. 2026000238
booking_iduuidFK → bookings (null bij bundel/abonnement)
bundle_iduuidFK → bundles
subscription_invoice_iduuidFK → subscription_invoices
client_iduuidFK → clients
statustextdraft / concept / approved / sent / paid / cancelled
subtotalnumericSom van regels
tax_bbonumeric6% BBO
tax_bazvnumeric1.5% BAZV
totalnumericEindtotaal
discount_percentnumericKorting percentage (indien van toepassing)
discount_reasontextBijv. “Langdurig verblijf >30 dagen”
concept_notestextAdmin notities bij concept-factuur
approved_byuuidFK → users
approved_attimestamptz
sent_attimestamptz
due_datedateVervaldatum
created_attimestamptz
draft → concept → approved → sent → paid
→ cancelled
  • draft: automatisch gegenereerd door systeem
  • concept: handmatige controle nodig (langdurig verblijf, kortingen)
  • approved: goedgekeurd door admin, klaar om te versturen
  • sent: verstuurd naar klant met betaallink
  • paid: betaald via Sentoo webhook of handmatig gemarkeerd
  • cancelled: geannuleerd

Regelitems per factuur. Eén regel per hond per dienst.

KolomTypeVerplichtToelichting
iduuid
invoice_iduuidFK → invoices
dog_iduuidFK → dogs
service_iduuidFK → services
descriptiontextBijv. “AC Room Deluxe - Max - 5 dagen”
quantitynumericAantal dagen/lessen/stuks
unit_pricenumericPrijs per eenheid
discount_percentnumericKorting op deze regel
line_totalnumericquantity * unit_price * (1 - discount)

KolomTypeVerplichtToelichting
iduuid
user_iduuidFK → users
actiontextcreate / update / delete / approve
entity_typetextbooking / invoice / payment / dog / client
entity_iduuid
metadatajsonbGewijzigde velden
created_attimestamptz