Commit Graph

31 Commits

Author SHA1 Message Date
fad80e436f Backend correctness fixes 2026-03-10 16:47:04 -06:00
c56fb9ab00 Backend fixes 2026-03-10 16:05:05 -06:00
89d3accabc Add seed data migration and fix schema NOT NULL constraints 2026-03-10 13:10:52 -06:00
8b10696c84 Fix backend security, validation, and API contracts 2026-03-10 13:03:14 -06:00
7db2e63b79 Create 3 simple cross-platform run configurations
1. Pet Shop Application - Run Spring Boot (main run config)
2. Database - Start database containers
3. Reset Database - Clean volumes and restart (Maven-based, auto-stops)

All use IntelliJ Docker/Spring Boot/Maven integration (Windows/Mac/Linux).
Reset Database uses exec-maven-plugin to run docker compose down -v.
Stops automatically when complete.
2026-03-09 22:01:42 -06:00
015bb574b8 Add validation tests to detect run configuration drift
- Add spring-boot-starter-test dependency for JUnit Jupiter
- Validate main class exists and matches run config reference
- Validate module name matches pom.xml artifactId
- Validate schema.sql contains active column
- Prevents configuration breakage from refactoring
- Fails with clear messages pointing to which configs need updates

All 5 tests passing.
2026-03-09 22:01:42 -06:00
dec0986830 Fix ChatService customer ID domain logic
- FIXED: ChatService now uses customer.customerId instead of users.id for CUSTOMER role
- getConversations(): Resolve Customer entity to get customerId for filtering
- getConversation(): Verify ownership using customer.customerId
- sendMessage(): Updated signature to accept role parameter for staff assignment logic
- getMessages(): Verify conversation ownership using customer.customerId
- ChatController: Updated sendMessage call to pass user.getRole()

This fixes the domain bug where conversation.customerId (references customer table)
was being incorrectly populated with users.id instead of customer.customerId.

Phase 3B
2026-03-09 01:24:10 -06:00
a0c782f4cc Fix backend business logic and remove hardcoded IDs
- Add customerId to SaleRequest DTO
- Update SaleService to use AuthenticationHelper for employee attribution
- Populate sale.customer when customerId provided in request
- Fix AdoptionController to use authenticated customer instead of hardcoded ID 1
- Fix AppointmentController to use authenticated customer instead of hardcoded ID 1
- Fix RefundController to use authenticated customer instead of hardcoded ID 1
- Update data.sql sales to include customer linkage for refund testing
- Update Postman collection sale creation with customerId and items
2026-03-08 21:58:50 -06:00
a0d14e493f Fix backend user contract and add User-Employee-Customer linkage
- Add active field to User entity and users table
- Add userId linkage to Employee and Customer entities with unique constraints and FKs
- Add repository methods findByUserId and findAllByEmail
- Create UserBusinessLinkageService for shared employee/customer creation logic
- Create AuthenticationHelper utility for resolving authenticated users
- Update UserService to persist all user fields and create linked business entities
- Update AuthController register to set active and create linked customer
- Update DataInitializer to be idempotent and use shared linkage service
- Update Postman collection user endpoints with fullName, email, and active
2026-03-08 21:56:04 -06:00
4394e96329 Filter appointments and adoptions by customer 2026-03-08 15:38:52 -06:00
68087c8f82 Allow public GET access to services and categories 2026-03-08 15:17:49 -06:00
992e610e4b Fix DataInitializer and make products publicly accessible 2026-03-08 14:38:52 -06:00
cce4de566c Fix JPA schema validation to allow backend startup 2026-03-08 13:41:15 -06:00
2dedd5508f Add customer registration, profile management and refunds 2026-03-08 10:50:03 -06:00
6b182f2cc2 Fix Pet entity ID mapping for JPA compatibility 2026-03-08 10:14:08 -06:00
ad81bd031d Allow public viewing of pets and sales 2026-03-08 09:39:37 -06:00
3a93fea34f Fix database seeding, add security and complete missing endpoints 2026-03-08 09:11:26 -06:00
3a00209e1f Align backend schema with desktop application 2026-03-06 09:58:09 -07:00
9313ca74f4 Update Store and Pet services and DTOs 2026-03-05 16:58:37 -07:00
a018c98ce7 Add repositories for new entities and cleanup 2026-03-05 16:40:53 -07:00
90197ededd Align backend schema with desktop application 2026-03-05 16:39:57 -07:00
1755e2257f Handle null store in inventory response mapping 2026-03-05 11:08:02 -07:00
4c082abc18 Fix pet status enum to uppercase 2026-03-05 11:06:04 -07:00
d9689612f8 Allow null store in inventory 2026-03-05 11:03:47 -07:00
e57e4e11d8 Make inventory storeId optional 2026-03-05 11:02:04 -07:00
9ae6ddc48e Fix inventory and supplier API field names 2026-03-05 11:00:04 -07:00
caec657d5b Fix product API field names to match Postman 2026-03-05 10:53:49 -07:00
d7fb057e64 Match Postman API contract for desktop app
- Change bulk delete from POST /bulk-delete to DELETE with body
- Add search parameter support (q) to all list endpoints
- Add customer registration endpoint
- Add stores listing endpoint
- Add analytics dashboard endpoint (admin only)
- Update appointment availability to include storeId
- Add CUSTOMER role to User entity
- Implement search across all repositories
2026-03-05 08:44:49 -07:00
d6eaeb2d88 Restore complete implementations 2026-03-05 06:00:38 -07:00
5b4797fdcc Add Docker support with auto database initialization 2026-03-05 05:57:32 -07:00
aeb8002b2b Move backend to root directory 2026-03-05 05:57:32 -07:00