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