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.
This commit is contained in:
@@ -1,43 +1,25 @@
|
||||
package org.example.petshopdesktop.api.dto.inventory;
|
||||
|
||||
public class InventoryRequest {
|
||||
private Long productId;
|
||||
private Long storeId;
|
||||
private Integer stockQuantity;
|
||||
private Integer reorderLevel;
|
||||
private Long prodId;
|
||||
private Integer quantity;
|
||||
|
||||
public InventoryRequest() {
|
||||
}
|
||||
|
||||
public Long getProductId() {
|
||||
return productId;
|
||||
public Long getProdId() {
|
||||
return prodId;
|
||||
}
|
||||
|
||||
public void setProductId(Long productId) {
|
||||
this.productId = productId;
|
||||
public void setProdId(Long prodId) {
|
||||
this.prodId = prodId;
|
||||
}
|
||||
|
||||
public Long getStoreId() {
|
||||
return storeId;
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setStoreId(Long storeId) {
|
||||
this.storeId = storeId;
|
||||
}
|
||||
|
||||
public Integer getStockQuantity() {
|
||||
return stockQuantity;
|
||||
}
|
||||
|
||||
public void setStockQuantity(Integer stockQuantity) {
|
||||
this.stockQuantity = stockQuantity;
|
||||
}
|
||||
|
||||
public Integer getReorderLevel() {
|
||||
return reorderLevel;
|
||||
}
|
||||
|
||||
public void setReorderLevel(Integer reorderLevel) {
|
||||
this.reorderLevel = reorderLevel;
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,22 +1,33 @@
|
||||
package org.example.petshopdesktop.api.dto.inventory;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class InventoryResponse {
|
||||
private Long id;
|
||||
private Long inventoryId;
|
||||
private Long prodId;
|
||||
private String productName;
|
||||
private String categoryName;
|
||||
private String storeName;
|
||||
private Integer stockQuantity;
|
||||
private Integer reorderLevel;
|
||||
private Integer quantity;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public InventoryResponse() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
public Long getInventoryId() {
|
||||
return inventoryId;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
public void setInventoryId(Long inventoryId) {
|
||||
this.inventoryId = inventoryId;
|
||||
}
|
||||
|
||||
public Long getProdId() {
|
||||
return prodId;
|
||||
}
|
||||
|
||||
public void setProdId(Long prodId) {
|
||||
this.prodId = prodId;
|
||||
}
|
||||
|
||||
public String getProductName() {
|
||||
@@ -35,27 +46,27 @@ public class InventoryResponse {
|
||||
this.categoryName = categoryName;
|
||||
}
|
||||
|
||||
public String getStoreName() {
|
||||
return storeName;
|
||||
public Integer getQuantity() {
|
||||
return quantity;
|
||||
}
|
||||
|
||||
public void setStoreName(String storeName) {
|
||||
this.storeName = storeName;
|
||||
public void setQuantity(Integer quantity) {
|
||||
this.quantity = quantity;
|
||||
}
|
||||
|
||||
public Integer getStockQuantity() {
|
||||
return stockQuantity;
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setStockQuantity(Integer stockQuantity) {
|
||||
this.stockQuantity = stockQuantity;
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Integer getReorderLevel() {
|
||||
return reorderLevel;
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setReorderLevel(Integer reorderLevel) {
|
||||
this.reorderLevel = reorderLevel;
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,14 @@
|
||||
package org.example.petshopdesktop.api.dto.pet;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
|
||||
public class PetRequest {
|
||||
private String petName;
|
||||
private String species;
|
||||
private String breed;
|
||||
private LocalDate dateOfBirth;
|
||||
private String gender;
|
||||
private String color;
|
||||
private BigDecimal price;
|
||||
private String petSpecies;
|
||||
private String petBreed;
|
||||
private Integer petAge;
|
||||
private String petStatus;
|
||||
private BigDecimal petPrice;
|
||||
|
||||
public PetRequest() {
|
||||
}
|
||||
@@ -24,52 +21,28 @@ public class PetRequest {
|
||||
this.petName = petName;
|
||||
}
|
||||
|
||||
public String getSpecies() {
|
||||
return species;
|
||||
public String getPetSpecies() {
|
||||
return petSpecies;
|
||||
}
|
||||
|
||||
public void setSpecies(String species) {
|
||||
this.species = species;
|
||||
public void setPetSpecies(String petSpecies) {
|
||||
this.petSpecies = petSpecies;
|
||||
}
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
public String getPetBreed() {
|
||||
return petBreed;
|
||||
}
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
public void setPetBreed(String petBreed) {
|
||||
this.petBreed = petBreed;
|
||||
}
|
||||
|
||||
public LocalDate getDateOfBirth() {
|
||||
return dateOfBirth;
|
||||
public Integer getPetAge() {
|
||||
return petAge;
|
||||
}
|
||||
|
||||
public void setDateOfBirth(LocalDate dateOfBirth) {
|
||||
this.dateOfBirth = dateOfBirth;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
public void setPetAge(Integer petAge) {
|
||||
this.petAge = petAge;
|
||||
}
|
||||
|
||||
public String getPetStatus() {
|
||||
@@ -79,4 +52,12 @@ public class PetRequest {
|
||||
public void setPetStatus(String petStatus) {
|
||||
this.petStatus = petStatus;
|
||||
}
|
||||
|
||||
public BigDecimal getPetPrice() {
|
||||
return petPrice;
|
||||
}
|
||||
|
||||
public void setPetPrice(BigDecimal petPrice) {
|
||||
this.petPrice = petPrice;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,28 +1,28 @@
|
||||
package org.example.petshopdesktop.api.dto.pet;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
public class PetResponse {
|
||||
private Long id;
|
||||
private Long petId;
|
||||
private String petName;
|
||||
private String species;
|
||||
private String breed;
|
||||
private LocalDate dateOfBirth;
|
||||
private String gender;
|
||||
private String color;
|
||||
private BigDecimal price;
|
||||
private String petSpecies;
|
||||
private String petBreed;
|
||||
private Integer petAge;
|
||||
private String petStatus;
|
||||
private BigDecimal petPrice;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
|
||||
public PetResponse() {
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
public Long getPetId() {
|
||||
return petId;
|
||||
}
|
||||
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
public void setPetId(Long petId) {
|
||||
this.petId = petId;
|
||||
}
|
||||
|
||||
public String getPetName() {
|
||||
@@ -33,52 +33,28 @@ public class PetResponse {
|
||||
this.petName = petName;
|
||||
}
|
||||
|
||||
public String getSpecies() {
|
||||
return species;
|
||||
public String getPetSpecies() {
|
||||
return petSpecies;
|
||||
}
|
||||
|
||||
public void setSpecies(String species) {
|
||||
this.species = species;
|
||||
public void setPetSpecies(String petSpecies) {
|
||||
this.petSpecies = petSpecies;
|
||||
}
|
||||
|
||||
public String getBreed() {
|
||||
return breed;
|
||||
public String getPetBreed() {
|
||||
return petBreed;
|
||||
}
|
||||
|
||||
public void setBreed(String breed) {
|
||||
this.breed = breed;
|
||||
public void setPetBreed(String petBreed) {
|
||||
this.petBreed = petBreed;
|
||||
}
|
||||
|
||||
public LocalDate getDateOfBirth() {
|
||||
return dateOfBirth;
|
||||
public Integer getPetAge() {
|
||||
return petAge;
|
||||
}
|
||||
|
||||
public void setDateOfBirth(LocalDate dateOfBirth) {
|
||||
this.dateOfBirth = dateOfBirth;
|
||||
}
|
||||
|
||||
public String getGender() {
|
||||
return gender;
|
||||
}
|
||||
|
||||
public void setGender(String gender) {
|
||||
this.gender = gender;
|
||||
}
|
||||
|
||||
public String getColor() {
|
||||
return color;
|
||||
}
|
||||
|
||||
public void setColor(String color) {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public BigDecimal getPrice() {
|
||||
return price;
|
||||
}
|
||||
|
||||
public void setPrice(BigDecimal price) {
|
||||
this.price = price;
|
||||
public void setPetAge(Integer petAge) {
|
||||
this.petAge = petAge;
|
||||
}
|
||||
|
||||
public String getPetStatus() {
|
||||
@@ -88,4 +64,28 @@ public class PetResponse {
|
||||
public void setPetStatus(String petStatus) {
|
||||
this.petStatus = petStatus;
|
||||
}
|
||||
|
||||
public BigDecimal getPetPrice() {
|
||||
return petPrice;
|
||||
}
|
||||
|
||||
public void setPetPrice(BigDecimal petPrice) {
|
||||
this.petPrice = petPrice;
|
||||
}
|
||||
|
||||
public LocalDateTime getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(LocalDateTime createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public LocalDateTime getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(LocalDateTime updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user