This update adds complete tenant management to the backend:
- Added tenant models, repositories, services, and handlers
- Added user registration flow that creates tenant + user in a transaction
- Added tenant retrieval endpoints (GetTenant, GetMyTenant)
- Configured new routes and integrated handlers into SetUpRoutes
- Wired repositories, services, and handlers into main.go
- Implemented slug generation, validation, and transactional creation logic
Includes updates across:
- models (tenants)
- repositories (tenant_repository)
- services (tenant_service)
- handlers (tenant_handler, user_handler)
- routes and main.go for full system integration
This commit introduces a complete PostgreSQL developer workflow for the Aurganize backend,
fully integrated with the Dockerized database environment.
Included changes:
• Added initial migration
• Added development seed script with temporary RLS disable/enable logic
• Added test operation script to validate if the entries are working as expected
• Added docker-aware backup script:
- Dumps DB from inside postgres container
- Stores compressed .sql.gz backups outside repo
- Auto-cleans old backups
• Added docker-aware restore script:
- Drops and recreates DB
- Restores from compressed backups
• Added Docker-based database health check:
- Moved health_check.sql to database/tests/
- Added health_check.sh wrapper to run through docker exec
• Updated directory structure for database scripts and tests
• Ensured all scripts auto-detect container, user, and file locations
This improves developer experience and standardizes database operations for the entire backend team.
Story: E1-004 - PostgreSQL Database Setup