fix desktop adoption save

This commit is contained in:
2026-04-07 09:27:34 -06:00
parent 4d7f452a97
commit 858d13cadc
2 changed files with 15 additions and 0 deletions

View File

@@ -6,6 +6,7 @@ public class AdoptionRequest {
private Long petId;
private Long customerId;
private Long employeeId;
private Long sourceStoreId;
private LocalDate adoptionDate;
private String adoptionStatus;
@@ -36,6 +37,14 @@ public class AdoptionRequest {
this.employeeId = employeeId;
}
public Long getSourceStoreId() {
return sourceStoreId;
}
public void setSourceStoreId(Long sourceStoreId) {
this.sourceStoreId = sourceStoreId;
}
public LocalDate getAdoptionDate() {
return adoptionDate;
}

View File

@@ -190,10 +190,16 @@ public class AdoptionDialogController {
if (errorMsg.isEmpty()) {
try {
Long storeId = UserSession.getInstance().getStoreId();
if (storeId == null || storeId <= 0) {
throw new IllegalStateException("Store is not set for this account");
}
AdoptionRequest request = new AdoptionRequest();
request.setPetId(cbPet.getSelectionModel().getSelectedItem().getId());
request.setCustomerId(cbCustomer.getSelectionModel().getSelectedItem().getId());
request.setEmployeeId(cbEmployee.getSelectionModel().getSelectedItem().getId());
request.setSourceStoreId(storeId);
request.setAdoptionDate(dpAdoptionDate.getValue());
request.setAdoptionStatus(cbAdoptionStatus.getValue());