Files
space-booking/backend/entrypoint.sh
Claude Agent a15951c645 feat: sistem de linkuri publice pentru proprietăți
Expune fluxul de rezervare anonimă printr-un link public partajabil
(/book/<slug>), cu calendar public, cod QR și proprietate demo publică.

Backend:
- slug + list_on_landing pe Property; utilitar slugify (diacritice RO,
  cuvinte rezervate, ban all-digit) + migrare idempotentă raw-DDL rulată
  din entrypoint; SQLite WAL + busy_timeout
- GET /public/properties/{slug_or_id}(+/spaces): rezolvare slug/ID, 404 uniform
- GET /public/spaces/{id}/busy: doar {start_time,end_time} (fără PII),
  pending+approved, tz-aware/interval>60z → 422, orfan/privat → 404
- availability: scrub user_name/title (fix scurgere PII)
- POST /public/bookings: overlap pending+approved, cap 5/email/spațiu/zi,
  rate-limit per-IP, suprimare notificări+email pe demo, email confirmare guest
- PATCH slug (409 duplicat / 422 format / 403 non-manager); guest_email EmailStr
- email guest la aprobare/respingere cu cod #RB-<id>
- teste noi: test_public.py + test_migrate_slug.py (33 teste)

Frontend:
- rută /book/:slug; PublicBooking rescris cu calendar grid manual
  (PublicCalendar + GuestBookingForm), 30min, 08-20, mobil day-view, RO
- card „Link public" în PropertyDetail: copy, edit slug, QR pe URL-ul cu ID
- secțiune proprietăți publice + CTA pe Landing; buton copy în Properties

Gate aprobat (U1-U3, G1 grid manual, G2 list_on_landing); G3-G5 în TODOS.md.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-11 19:04:58 +00:00

35 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
set -e
echo "[entrypoint] Running property slug migration..."
python migrate_add_property_slug.py
# Database tables are created automatically on application startup
# (app/main.py runs Base.metadata.create_all). The first user to register
# becomes the superadmin (the instance owner), so no admin seeding is needed.
#
# The demo seed (seed_db.py) plants sample accounts and content for LOCAL
# DEVELOPMENT only. It is opt-in: set RUN_SEED=1 to enable it. Never set
# RUN_SEED=1 in production.
if [ "${RUN_SEED}" = "1" ]; then
echo "[entrypoint] RUN_SEED=1 -> running demo database seed..."
python seed_db.py
fi
# Public demo account (enabled by default, see settings.demo_email):
# (re)create the demo account and its sample data at boot, then reset it
# periodically in the background (default: every 3h; override with
# DEMO_RESET_INTERVAL, in seconds). Set DEMO_EMAIL="" to disable.
echo "[entrypoint] Resetting demo account..."
python reset_demo.py || echo "[entrypoint] WARNING: demo reset failed (continuing)"
(
while true; do
sleep "${DEMO_RESET_INTERVAL:-10800}"
echo "[entrypoint] Scheduled demo reset..."
python reset_demo.py || echo "[entrypoint] WARNING: demo reset failed"
done
) &
echo "[entrypoint] Starting application..."
exec "$@"