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
This commit is contained in:
2026-03-09 01:24:55 -06:00
parent 000c1f8859
commit 1fb7da3800
7 changed files with 130 additions and 103 deletions

View File

@@ -3,7 +3,7 @@ package org.example.petshopdesktop.api.dto.adoption;
import java.time.LocalDate; import java.time.LocalDate;
public class AdoptionResponse { public class AdoptionResponse {
private Long id; private Long adoptionId;
private String petName; private String petName;
private String customerName; private String customerName;
private LocalDate adoptionDate; private LocalDate adoptionDate;
@@ -12,12 +12,12 @@ public class AdoptionResponse {
public AdoptionResponse() { public AdoptionResponse() {
} }
public Long getId() { public Long getAdoptionId() {
return id; return adoptionId;
} }
public void setId(Long id) { public void setAdoptionId(Long adoptionId) {
this.id = id; this.adoptionId = adoptionId;
} }
public String getPetName() { public String getPetName() {

View File

@@ -4,9 +4,9 @@ import java.time.LocalDate;
import java.time.LocalTime; import java.time.LocalTime;
public class AppointmentResponse { public class AppointmentResponse {
private Long id; private Long appointmentId;
private String customerName; private String customerName;
private String petNames; private java.util.List<String> petNames;
private String serviceName; private String serviceName;
private LocalDate appointmentDate; private LocalDate appointmentDate;
private LocalTime appointmentTime; private LocalTime appointmentTime;
@@ -15,12 +15,12 @@ public class AppointmentResponse {
public AppointmentResponse() { public AppointmentResponse() {
} }
public Long getId() { public Long getAppointmentId() {
return id; return appointmentId;
} }
public void setId(Long id) { public void setAppointmentId(Long appointmentId) {
this.id = id; this.appointmentId = appointmentId;
} }
public String getCustomerName() { public String getCustomerName() {
@@ -31,11 +31,11 @@ public class AppointmentResponse {
this.customerName = customerName; this.customerName = customerName;
} }
public String getPetNames() { public java.util.List<String> getPetNames() {
return petNames; return petNames;
} }
public void setPetNames(String petNames) { public void setPetNames(java.util.List<String> petNames) {
this.petNames = petNames; this.petNames = petNames;
} }

View File

@@ -3,20 +3,20 @@ package org.example.petshopdesktop.api.dto.product;
import java.math.BigDecimal; import java.math.BigDecimal;
public class ProductRequest { public class ProductRequest {
private String productName; private String prodName;
private Long categoryId; private Long categoryId;
private BigDecimal price; private BigDecimal prodPrice;
private String description; private String prodDesc;
public ProductRequest() { public ProductRequest() {
} }
public String getProductName() { public String getProdName() {
return productName; return prodName;
} }
public void setProductName(String productName) { public void setProdName(String prodName) {
this.productName = productName; this.prodName = prodName;
} }
public Long getCategoryId() { public Long getCategoryId() {
@@ -27,19 +27,19 @@ public class ProductRequest {
this.categoryId = categoryId; this.categoryId = categoryId;
} }
public BigDecimal getPrice() { public BigDecimal getProdPrice() {
return price; return prodPrice;
} }
public void setPrice(BigDecimal price) { public void setProdPrice(BigDecimal prodPrice) {
this.price = price; this.prodPrice = prodPrice;
} }
public String getDescription() { public String getProdDesc() {
return description; return prodDesc;
} }
public void setDescription(String description) { public void setProdDesc(String prodDesc) {
this.description = description; this.prodDesc = prodDesc;
} }
} }

View File

@@ -3,29 +3,29 @@ package org.example.petshopdesktop.api.dto.product;
import java.math.BigDecimal; import java.math.BigDecimal;
public class ProductResponse { public class ProductResponse {
private Long id; private Long prodId;
private String productName; private String prodName;
private String categoryName; private String categoryName;
private BigDecimal price; private BigDecimal prodPrice;
private String description; private String prodDesc;
public ProductResponse() { public ProductResponse() {
} }
public Long getId() { public Long getProdId() {
return id; return prodId;
} }
public void setId(Long id) { public void setProdId(Long prodId) {
this.id = id; this.prodId = prodId;
} }
public String getProductName() { public String getProdName() {
return productName; return prodName;
} }
public void setProductName(String productName) { public void setProdName(String prodName) {
this.productName = productName; this.prodName = prodName;
} }
public String getCategoryName() { public String getCategoryName() {
@@ -36,19 +36,19 @@ public class ProductResponse {
this.categoryName = categoryName; this.categoryName = categoryName;
} }
public BigDecimal getPrice() { public BigDecimal getProdPrice() {
return price; return prodPrice;
} }
public void setPrice(BigDecimal price) { public void setProdPrice(BigDecimal prodPrice) {
this.price = price; this.prodPrice = prodPrice;
} }
public String getDescription() { public String getProdDesc() {
return description; return prodDesc;
} }
public void setDescription(String description) { public void setProdDesc(String prodDesc) {
this.description = description; this.prodDesc = prodDesc;
} }
} }

View File

@@ -5,8 +5,9 @@ import java.math.BigDecimal;
public class ServiceResponse { public class ServiceResponse {
private Long id; private Long id;
private String serviceName; private String serviceName;
private BigDecimal price; private BigDecimal servicePrice;
private String description; private String serviceDesc;
private Integer serviceDuration;
public ServiceResponse() { public ServiceResponse() {
} }
@@ -27,19 +28,27 @@ public class ServiceResponse {
this.serviceName = serviceName; this.serviceName = serviceName;
} }
public BigDecimal getPrice() { public BigDecimal getServicePrice() {
return price; return servicePrice;
} }
public void setPrice(BigDecimal price) { public void setServicePrice(BigDecimal servicePrice) {
this.price = price; this.servicePrice = servicePrice;
} }
public String getDescription() { public String getServiceDesc() {
return description; return serviceDesc;
} }
public void setDescription(String description) { public void setServiceDesc(String serviceDesc) {
this.description = description; this.serviceDesc = serviceDesc;
}
public Integer getServiceDuration() {
return serviceDuration;
}
public void setServiceDuration(Integer serviceDuration) {
this.serviceDuration = serviceDuration;
} }
} }

View File

@@ -1,45 +1,54 @@
package org.example.petshopdesktop.api.dto.supplier; package org.example.petshopdesktop.api.dto.supplier;
public class SupplierRequest { public class SupplierRequest {
private String supplierName; private String supCompany;
private String contactPerson; private String supContactFirstName;
private String phone; private String supContactLastName;
private String email; private String supPhone;
private String supEmail;
private String address; private String address;
public SupplierRequest() { public SupplierRequest() {
} }
public String getSupplierName() { public String getSupCompany() {
return supplierName; return supCompany;
} }
public void setSupplierName(String supplierName) { public void setSupCompany(String supCompany) {
this.supplierName = supplierName; this.supCompany = supCompany;
} }
public String getContactPerson() { public String getSupContactFirstName() {
return contactPerson; return supContactFirstName;
} }
public void setContactPerson(String contactPerson) { public void setSupContactFirstName(String supContactFirstName) {
this.contactPerson = contactPerson; this.supContactFirstName = supContactFirstName;
} }
public String getPhone() { public String getSupContactLastName() {
return phone; return supContactLastName;
} }
public void setPhone(String phone) { public void setSupContactLastName(String supContactLastName) {
this.phone = phone; this.supContactLastName = supContactLastName;
} }
public String getEmail() { public String getSupPhone() {
return email; return supPhone;
} }
public void setEmail(String email) { public void setSupPhone(String supPhone) {
this.email = email; this.supPhone = supPhone;
}
public String getSupEmail() {
return supEmail;
}
public void setSupEmail(String supEmail) {
this.supEmail = supEmail;
} }
public String getAddress() { public String getAddress() {

View File

@@ -1,54 +1,63 @@
package org.example.petshopdesktop.api.dto.supplier; package org.example.petshopdesktop.api.dto.supplier;
public class SupplierResponse { public class SupplierResponse {
private Long id; private Long supId;
private String supplierName; private String supCompany;
private String contactPerson; private String supContactFirstName;
private String phone; private String supContactLastName;
private String email; private String supPhone;
private String supEmail;
private String address; private String address;
public SupplierResponse() { public SupplierResponse() {
} }
public Long getId() { public Long getSupId() {
return id; return supId;
} }
public void setId(Long id) { public void setSupId(Long supId) {
this.id = id; this.supId = supId;
} }
public String getSupplierName() { public String getSupCompany() {
return supplierName; return supCompany;
} }
public void setSupplierName(String supplierName) { public void setSupCompany(String supCompany) {
this.supplierName = supplierName; this.supCompany = supCompany;
} }
public String getContactPerson() { public String getSupContactFirstName() {
return contactPerson; return supContactFirstName;
} }
public void setContactPerson(String contactPerson) { public void setSupContactFirstName(String supContactFirstName) {
this.contactPerson = contactPerson; this.supContactFirstName = supContactFirstName;
} }
public String getPhone() { public String getSupContactLastName() {
return phone; return supContactLastName;
} }
public void setPhone(String phone) { public void setSupContactLastName(String supContactLastName) {
this.phone = phone; this.supContactLastName = supContactLastName;
} }
public String getEmail() { public String getSupPhone() {
return email; return supPhone;
} }
public void setEmail(String email) { public void setSupPhone(String supPhone) {
this.email = email; this.supPhone = supPhone;
}
public String getSupEmail() {
return supEmail;
}
public void setSupEmail(String supEmail) {
this.supEmail = supEmail;
} }
public String getAddress() { public String getAddress() {