Commit Graph

587 Commits

Author SHA1 Message Date
a93846e2d1 Merge pull request #33 from RecentRunner/api-migration
Api migration
2026-03-09 16:27:30 -06:00
4a2cdbe9c5 Complete desktop DTO integration and controller fixes
**Critical DTO Fixes:**
- ServiceResponse/Request: id → serviceId, price → servicePrice, description → serviceDesc
- SaleItemRequest: productId → prodId, removed unitPrice (backend doesn't require)
- SaleItemResponse: id → saleItemId, added prodId, removed lineTotal (calculated locally)
- TopProduct: added productId, quantitySold Integer → Long, totalRevenue → revenue
- DailySales: date LocalDate → String, totalSales → revenue, added salesCount

**Controller Updates:**
- Updated 17+ controllers and dialog controllers to use renamed DTO fields
- Fixed AnalyticsController to use nested SalesSummary and InventorySummary structures
- Fixed ServiceController/ServiceDialogController to use serviceDuration
- Fixed LoginController CUSTOMER rejection to use lblError instead of missing showError()
- Updated all ProductResponse, SupplierResponse, PetResponse, AdoptionResponse, etc. usages

**Files Changed:**
- 6 DTO classes (service, sale, analytics)
- 17+ controller classes across main and dialog controllers

**Verification:**
- Desktop project compiles successfully with mvn clean compile
- All critical JSON mapping misalignments resolved
- Phase 6, 7, and 8 complete
2026-03-09 11:57:05 -06:00
Alex
2628f63f8c Updated design to look like JavaFX project
- updated the fxml file to have the same theming as desktop project
- removed old unused files to project neatness

TODO:
-hook up backend to application
-complete CRUD for each entity
- change text so it uses String.xml values
-add more info to profile if needed
-give pets their own profile
-fix small bug with status bar color not changing
2026-03-09 04:10:00 -06:00
6f87763a6d Complete final DTO verification and alignment
Changes:
- PetRequest: Fixed all field names to match backend contract
  - species → petSpecies
  - breed → petBreed
  - price → petPrice
  - dateOfBirth/gender/color → petAge (backend uses Integer age)
- PetResponse: Fixed all field names to match backend contract
  - id → petId
  - species → petSpecies
  - breed → petBreed
  - price → petPrice
  - Removed desktop-only fields (dateOfBirth, gender, color)
  - Added backend fields (petAge, createdAt, updatedAt)
- InventoryRequest: Fixed all field names to match backend contract
  - productId → prodId
  - stockQuantity → quantity
  - Removed desktop-only fields (storeId, reorderLevel)
- InventoryResponse: Fixed all field names to match backend contract
  - id → inventoryId
  - stockQuantity → quantity
  - Removed desktop-only fields (storeName, reorderLevel)
  - Added backend fields (prodId, createdAt, updatedAt)

All DTOs now use proper types (BigDecimal for prices, LocalDate/LocalDateTime for dates).
Desktop DTOs are fully aligned with backend contracts.
2026-03-09 01:35:48 -06:00
37327742ae Fix desktop UX and configuration
Changes:
- MainLayoutController: Analytics access restricted to ADMIN only
  - STAFF users default to Sales view instead of Analytics
  - Logo click redirects STAFF to Sales, ADMIN to Analytics
  - Analytics button hidden for STAFF users
- LoginController: Added CUSTOMER login rejection with clear message
  - CUSTOMER role users are now rejected at login with helpful error
  - Directs customers to use web/mobile applications instead
- Configuration cleanup: Removed connectionpetstore.properties from project root
  - Config file remains in src/main/resources for proper packaging
  - ApiConfig already loads from classpath correctly

These changes ensure proper role-based access control and clean configuration management.
2026-03-09 01:32:40 -06:00
90a6d5d464 Fix desktop structural DTO changes
Changes:
- PurchaseOrderResponse: id → purchaseOrderId
- SaleResponse: id → saleId
- DashboardResponse: restructured to use nested SalesSummary and InventorySummary classes matching backend structure
- Added TopProduct and DailySales support
- Inventory DTOs review pending (storeName/reorderLevel fields may need manual UI check)

These changes align desktop response DTOs with backend structural requirements.
2026-03-09 01:30:49 -06:00
3096b52cbb Merge pull request #2 from RecentRunner/customer
Fixes
2026-03-09 01:25:43 -06:00
1fb7da3800 Align desktop DTOs to match backend field names
Phase 5: Simple DTO field renames

AdoptionResponse:
- id → adoptionId

AppointmentResponse:
- id → appointmentId
- petNames: String → List<String>

ProductResponse/ProductRequest:
- id → prodId
- productName → prodName
- description → prodDesc
- price → prodPrice

ServiceResponse:
- description → serviceDesc
- price → servicePrice
- Added serviceDuration field

SupplierResponse/SupplierRequest:
- id → supId
- supplierName → supCompany
- contactPerson → supContactFirstName
- Added supContactLastName field
- email → supEmail
- phone → supPhone

UserRequest/UserResponse already use fullName (no changes needed)

All field names now match backend DTOs exactly.
Controllers and views may need updates to reference new field names.

Phase 5
2026-03-09 01:24:55 -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
000c1f8859 Align desktop user contract with backend
- Replace firstName and lastName with fullName and email in UserRequest
- Add email and updatedAt to UserResponse
- Update StaffRegisterDialogController to build fullName from firstName + lastName
- Update StaffRegisterDialogController to include email validation and send email
- Update StaffAccountsController to use backend email from UserResponse instead of hardcoding blank
2026-03-08 22:02:28 -06:00
d4e532a798 Fix desktop ProductSupplier to use composite keys
- Remove id field from ProductSupplierResponse
- Rename supplierPrice to cost in ProductSupplierResponse and ProductSupplierRequest
- Update ProductSupplierApi to use composite keys (productId, supplierId) for update and delete
- Update ProductSupplierController delete logic to iterate and delete with composite keys
- Update ProductSupplierController mapping to use getCost() instead of getSupplierPrice()
- Update ProductSupplierDialogController to pass both productId and supplierId to update
- Update ProductSupplierDialogController to use setCost() instead of setSupplierPrice()
- Remove unused selectedId field from ProductSupplierDialogController
2026-03-08 22:01: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
59de8ae1aa Fix null pointers and unsafe parsing bugs 2026-03-08 10:05:09 -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
Alex
55f545b380 Added Profile page
- Changed layout of profile page
- made it so we can edit phone and email on profile page
- can take photos or use gallery to change profile photo

TODO:
- change theme of app to stay consistent with desktop app
- change text so it uses String.xml values
-add more info to profile if needed
-give pets their own profile
-connect to backend when its ready
2026-03-08 01:51:22 -07:00
aa011205a0 Configure Jackson to ignore unknown properties 2026-03-07 17:53:41 -07:00
2bf09ea76d Remove docker configs and database run configuration 2026-03-07 17:47:09 -07:00
b5084c6d2e Remove database package and references 2026-03-07 17:45:12 -07:00
a6e424de41 Fix compilation errors in controllers 2026-03-07 17:07:43 -07:00
0e8ec35995 Remove mysql-connector-j dependency 2026-03-07 17:04:46 -07:00
8f88cc41a8 Complete InventoryDialogController migration 2026-03-07 17:04:24 -07:00
2b8cd22204 Migrate all controllers to REST API 2026-03-07 17:02:53 -07:00
87f616d08e Migrate Pet controllers to REST API 2026-03-07 13:28:45 -07:00
58e29f307e Migrate Product controllers to REST API 2026-03-07 13:23:16 -07:00
4fc518af07 Update authentication to use REST API 2026-03-07 13:21:09 -07:00
24c14eec7d Add API infrastructure and DTOs 2026-03-07 13:20:11 -07:00
62ad3881a2 Merge pull request #1 from RecentRunner/fixes
Fixes
2026-03-07 12:19:52 -07:00
3a00209e1f Align backend schema with desktop application 2026-03-06 09:58:09 -07:00
Alex
c7a959d4f6 Added Nav Bar and Refactor some activities to fragments
- Added a nav bar to go to customer chat and staff profile
- refactored the activities for pets, suppliers, services and it's detailed activates to make the newly added nav bar to work on all screens.

TODO:
- add functionalities to profile and chat fragments
- change theme of app to stay consistent with desktop app
- change text so it uses String.xml values
2026-03-06 04:49:15 -07:00
9313ca74f4 Update Store and Pet services and DTOs 2026-03-05 16:58:37 -07:00
8f6644f11f Add comprehensive Phase 7 checklist 2026-03-05 16:53:35 -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
33c85ae495 Add desktop schema SQL with auth table 2026-03-05 12:24:55 -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