Commit Graph

81 Commits

Author SHA1 Message Date
4b4f4b087e cut over employee phones 2026-03-14 20:22:14 -06:00
4fd2041fbb sync customer phone 2026-03-14 20:13:48 -06:00
efc9836c11 add user phone 2026-03-14 20:12:48 -06:00
bc9bd09d24 Keep original startup error message 2026-03-13 18:09:03 -06:00
462e37a443 Improve docker errors 2026-03-13 14:16:21 -06:00
885d968978 Find docker on windows 2026-03-13 14:13:31 -06:00
3cabc7b8ff Add startup checks 2026-03-13 10:25:50 -06:00
8368ff2359 Harden run configs 2026-03-13 10:05:32 -06:00
79e8eb08b8 Align websocket auth 2026-03-12 18:27:02 -06:00
9dcb4865fa Invalidate auth tokens 2026-03-12 18:16:20 -06:00
8fdd28cbbd Use claims auth 2026-03-12 17:44:39 -06:00
52889b90b3 Add token version 2026-03-12 17:36:16 -06:00
389b5685e3 Run flyway explicitly 2026-03-11 15:54:40 -06:00
29fd106e0c Fix backend run config 2026-03-11 15:38:42 -06:00
a3fa7f32ed Fix backend warnings 2026-03-11 14:11:06 -06:00
d2b26dc113 Upgrade to JDK 25 2026-03-11 09:26:15 -06:00
2b5ea87e88 Fix chat assertion 2026-03-11 08:40:58 -06:00
26ba6e3695 Update chat requests 2026-03-11 08:38:48 -06:00
8cb80d8ada Sync dev stack 2026-03-10 21:11:49 -06:00
c18ef16ef6 Add chat takeover 2026-03-10 20:52:00 -06:00
2e401a544f Fix chat auth 2026-03-10 20:04:26 -06:00
84c5f3c7b1 Add chat websocket flow 2026-03-10 18:56:18 -06:00
1a2f551c06 Add auth store info 2026-03-10 18:49:51 -06:00
bd3575ef26 Add avatar fixture 2026-03-10 18:41:28 -06:00
d874dd1af8 Fix postman collection 2026-03-10 18:37:00 -06:00
319293a59d Fix backend validation 2026-03-10 17:15:26 -06:00
a12e23a713 Clean imports 2026-03-10 16:47:09 -06:00
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
e6e44f70d8 Fix .gitignore to exclude user-specific files
- Remove tracked .idea/dataSources.xml (user-specific DB config)
- Remove tracked .idea/vcs.xml (user-specific VCS settings)
- Use whitelist approach for .idea/ directory
- Add patterns for temp/backup files (*.backup*, *.py, temp_*.json, etc.)
2026-03-10 00:03:15 -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
a1be1a5688 Improve Docker healthcheck to validate schema initialization
- Check for 'users' table existence instead of just mysqladmin ping
- Ensures schema.sql has executed before marking as healthy
- Add 40s start_period for initial schema load
- Prevents Spring Boot from connecting to uninitialized database
2026-03-09 22:01:42 -06:00
56bb4f19e8 Merge branch 'main' of github.com:RecentRunner/group-2-threaded-project-petshop-backend 2026-03-09 20:45:42 -06:00
2521806dea Add database auto-start configuration for development 2026-03-09 20:38:38 -06:00
3096b52cbb Merge pull request #2 from RecentRunner/customer
Fixes
2026-03-09 01:25:43 -06:00
64e6019d40 Fix Postman collection request bodies and add missing auth endpoints
Added missing authentication endpoints:
- POST /api/v1/auth/me/avatar (Upload Avatar)
- GET /api/v1/auth/me/avatar (Get Avatar)
- DELETE /api/v1/auth/me/avatar (Delete Avatar)
- POST /api/v1/auth/logout (Logout)

Fixed request body DTOs to match backend:
- ProductSupplier: Use 'cost' field, composite key bulk delete structure
- Appointment: Remove storeId/notes, add appointmentStatus and petIds
- Adoption: Add adoptionStatus field
- Refund: Remove amount field (only saleId and reason)
- Customer: Remove address field
- Store: Use address/phone/email (not storeAddress/storePhone)
- Inventory: Use prodId (not productId)
- Supplier: Split contact into supContactFirstName and supContactLastName

All 107 requests verified against backend controllers and DTOs.
JSON validation passed. Collection is production-ready.

Phase 3B
2026-03-09 01:24:23 -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
d86652b462 Reorganize Postman collection by resource 2026-03-08 15:39:50 -06:00
4394e96329 Filter appointments and adoptions by customer 2026-03-08 15:38:52 -06:00
d7d294130f Complete Postman collection with all endpoints 2026-03-08 15:23:16 -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