7f35297025
Naser confirmed all remaining QA Review / Draft rows (97 subtasks, 16
parent rollups) are done in substance: the site has been in production
for roughly a year. Overrides the conservative QA-Review/Draft mapping
from the prior takeover commit (0f9d12c) at his explicit instruction.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1.6 KiB
1.6 KiB
id, title, status, date, parent
| id | title | status | date | parent |
|---|---|---|---|---|
| 11-1 | 11-1 Database Schema & Model Updates | Done | 2026-09-27 | 11 |
Description
As a developer, I want to extend the consultation system to support guest bookings, So that consultations can be created for both registered clients and anonymous guests. The existing foreign key consultations_user_id_foreign cascades on delete. With nullable user_id: - Guest consultations won't be affected by user deletions (they have no user) - Client consultations still cascade delete when user is deleted. Full implementation history: docs/stories/story-11.1-database-schema-model-updates.md
Acceptance Criteria
user_idcolumn changed to nullable onconsultationstableguest_namecolumn added (varchar 255, nullable)guest_emailcolumn added (varchar 255, nullable)guest_phonecolumn added (varchar 50, nullable)- Index added on
guest_emailfor 1-per-day lookup performance - Migration is reversible without data loss
- Existing consultations with
user_idunaffected Consultationmodel updated with new fillable fieldsisGuest()helper method returns true whenuser_idis nullgetClientName()helper returns guest_name or user->full_namegetClientEmail()helper returns guest_email or user->emailgetClientPhone()helper returns guest_phone or user->phone- Model validation ensures either user_id OR guest fields are present
ConsultationFactoryupdated withguest()state- Guest state generates fake guest_name, guest_email, guest_phone
- Guest state sets user_id to null