fix desktop adoption save
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user