Files
group-2-threaded-project-pe…/PHASE_7_CHECKLIST.md

9.1 KiB

Phase 7: Service & DTO Update Checklist

Overview

All entity schemas have been updated. This checklist covers required changes to compile the application.


1. Store → StoreLocation Updates

Repositories

  • StoreRepository.java - Updated to use StoreLocation

Services

  • StoreService.java

    • Change all StoreStoreLocation
    • Update field references: store.getStoreLocation()store.getAddress()
    • Update DTOs to match StoreLocation fields
  • SaleService.java

    • Change Store storeStoreLocation store
    • Update .getStore() → returns StoreLocation
    • Update DTO mappings
  • InventoryService.java

    • Remove all Store/storeId references (inventory is now global)
    • Update queries to remove store filtering
  • AnalyticsService.java

    • Update Store references to StoreLocation

DTOs

  • dto/store/StoreRequest.java → rename/update to StoreLocationRequest

    • Update fields: add address, phone, email
    • Remove storeLocation field
  • dto/store/StoreResponse.java → rename/update to StoreLocationResponse

    • Change all field names to match StoreLocation entity
  • dto/sale/SaleResponse.java

    • Update Store references to StoreLocation
  • dto/inventory/InventoryResponse.java

    • Remove storeId and storeName fields

Controllers

  • StoreController.java
    • Update all Store references to StoreLocation

2. User → Employee Updates (Sales)

Services

  • SaleService.java
    • Change User employeeEmployee employee
    • Update repository/entity references
    • Map employee fields correctly (employeeId, firstName, lastName)

DTOs

  • dto/sale/SaleRequest.java

    • Change userIdemployeeId
  • dto/sale/SaleResponse.java

    • Add employee details (firstName, lastName, not username/fullName)

3. ID Field Name Changes

All Services - Update getter/setter calls:

  • PetService.java

    • .getId().getPetId()
    • .setId().setPetId()
  • CustomerService.java

    • .getId().getCustomerId()
    • .setId().setCustomerId()
  • ProductService.java

    • .getId().getProdId()
    • .setId().setProdId()
  • SupplierService.java

    • .getId().getSupId()
    • .setId().setSupId()
  • CategoryService.java

    • .getId().getCategoryId()
    • .setId().setCategoryId()
  • ServiceService.java (service for Service entity)

    • .getId().getServiceId()
    • .setId().setServiceId()
  • AdoptionService.java

    • .getId().getAdoptionId()
    • .setId().setAdoptionId()
  • AppointmentService.java

    • .getId().getAppointmentId()
    • .setId().setAppointmentId()
  • SaleService.java

    • .getId().getSaleId()
    • .setId().setSaleId()
  • SaleItemRepository.java / SaleService.java

    • .getId().getSaleItemId()
  • InventoryService.java

    • .getId().getInventoryId()
  • PurchaseOrderService.java

    • .getId().getPurchaseOrderId()
    • .setId().setPurchaseOrderId()

All DTOs - Update field names:

  • All Response DTOs: change id → specific ID field (petId, customerId, etc.)
  • All Request DTOs: update ID references accordingly

4. Enum → String Conversions

Services

  • PetService.java

    • Remove Pet.PetStatus enum references
    • Use String for status
    • Update validation to check string values ("Available", "Adopted", etc.)
  • AppointmentService.java

    • Remove Appointment.AppointmentStatus enum
    • Use String for appointmentStatus
    • Update validation to check string values ("Booked", "Completed", "Cancelled")
  • PurchaseOrderService.java

    • Remove PurchaseOrder.OrderStatus enum
    • Use String for status
    • Update validation to check string values ("Pending", "Delivered", etc.)

DTOs

  • dto/pet/PetRequest.java & PetResponse.java

    • Change PetStatus statusString petStatus
  • dto/appointment/AppointmentRequest.java & AppointmentResponse.java

    • Change AppointmentStatus statusString appointmentStatus
  • dto/purchaseorder/PurchaseOrderRequest.java & PurchaseOrderResponse.java

    • Change OrderStatus statusString status

5. Removed Fields - Delete References

CustomerService.java & DTOs

  • Remove customerAddress field
  • Update Customer entity mappings

SupplierService.java & DTOs

  • Remove active field
  • Remove supplierAddress field
  • Split contact: supplierContactsupContactFirstName + supContactLastName

ServiceService.java & DTOs

  • Remove active field

ProductService.java & DTOs

  • Remove active field

SaleService.java & DTOs

  • Remove customer field (sales no longer track customer)
  • Remove subtotal field
  • Remove tax field
  • Remove notes field
  • Change totaltotalAmount

SaleItemService/DTOs

  • Remove subtotal field from SaleItem

InventoryService.java & DTOs

  • Remove reorderLevel field
  • Remove lastRestocked field

PurchaseOrderService.java & DTOs

  • Remove expectedDelivery field
  • Remove totalAmount field
  • Remove notes field
  • Remove items list (PurchaseOrderItem not in desktop schema)

AdoptionService.java & DTOs

  • Remove adoptionFee field
  • Remove notes field
  • Add adoptionStatus field

6. Renamed Fields (snake_case → camelCase)

Customer

  • customer_name → split to firstName + lastName
  • customer_emailemail
  • customer_phonephone

Pet

  • pet_namepetName
  • pet_speciespetSpecies
  • pet_breedpetBreed
  • pet_agepetAge
  • pet_statuspetStatus
  • pet_pricepetPrice

Product

  • product_nameprodName
  • product_descriptionprodDesc
  • product_priceprodPrice
  • category_idcategoryId (FK)

Supplier

  • supplier_namesupCompany
  • supplier_contactsupContactFirstName + supContactLastName
  • supplier_emailsupEmail
  • supplier_phonesupPhone

Category

  • category_namecategoryName
  • category_descriptioncategoryType

Service

  • service_nameserviceName
  • service_descriptionserviceDesc
  • service_priceservicePrice
  • service_duration_minutesserviceDuration

Sale

  • sale_datesaleDate
  • employee_idemployeeId (FK)
  • store_idstoreId (FK)
  • totaltotalAmount
  • payment_methodpaymentMethod
  • Add isRefund field
  • Add originalSaleId field (FK to sale)

SaleItem

  • sale_idsaleId (FK)
  • product_idprodId (FK)
  • unit_priceunitPrice

Appointment

  • appointment_dateappointmentDate
  • appointment_timeappointmentTime
  • statusappointmentStatus
  • Join table: appointment_petsappointmentPet

Adoption

  • pet_idpetId (FK)
  • customer_idcustomerId (FK)
  • adoption_dateadoptionDate
  • Add adoptionStatus

Inventory

  • product_idprodId (FK)

ProductSupplier

  • product_idprodId (FK)
  • supplier_idsupId (FK)
  • cost_pricecost

PurchaseOrder

  • supplier_idsupId (FK)
  • order_dateorderDate

7. New Entities - Add Services/Controllers (Optional)

These entities exist but may not need full CRUD yet:

  • EmployeeService.java - basic CRUD for employees
  • EmployeeController.java - REST endpoints for employees
  • ActivityLogService.java - logging service
  • Employee/ActivityLog DTOs

8. DropdownController Updates

  • DropdownController.java
    • Update queries for renamed columns
    • Update Store → StoreLocation references
    • Fix any broken field references

9. Validation & Error Messages

After making all changes above:

  • Search codebase for any remaining references to removed fields
  • Update validation error messages to use new field names
  • Update API documentation (Swagger annotations)

Quick Search Commands

Find remaining issues:

# Find Store references (should be StoreLocation)
grep -r "import.*\.Store;" src/main/java --include="*.java"

# Find .getId() calls (should be specific IDs)
grep -r "\.getId()" src/main/java/com/petshop/backend/service

# Find enum references
grep -r "PetStatus\|AppointmentStatus\|OrderStatus" src/main/java --include="*.java"

# Find removed fields
grep -r "customerAddress\|subtotal\|active" src/main/java --include="*.java"

Testing After Changes

  1. Verify compilation: mvn clean compile
  2. Run tests: mvn test
  3. Start services: docker-compose up -d
  4. Test endpoints with updated field names