Skip to content

Commit

Permalink
Merge pull request #35 from plantlogic/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
ChristopherLeeWilliams committed Jan 10, 2020
2 parents 8f7154f + df0c780 commit 9f0ef31
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
Expand Up @@ -55,6 +55,7 @@ public RestDTO updateRanchData(@PathVariable("id") String id, @Valid @RequestBod
card.get().setThinDate(ranch.getThinDate());
card.get().setHoeDate(ranch.getHoeDate());
card.get().setHarvestDate(ranch.getHarvestDate());
card.get().setComment(ranch.getComment());
ranchRepository.save(card.get());
return new RestSuccess();
} else return new RestFailure("Card ID not found, or you don't have permission to access this card.");
Expand Down
Expand Up @@ -34,6 +34,7 @@ public class Card {
private String ranchManagerName;
private String lotNumber;
private String shipperID;
private String comment;

private Date wetDate;
private Date thinDate;
Expand Down Expand Up @@ -182,6 +183,14 @@ public String getShipperID() {
public void setShipperID(String shipperID) {
this.shipperID = shipperID;
}

public String getComment() {
return comment;
}

public void setComment(String comment) {
this.comment = comment;
}

public Date getWetDate() {
return wetDate;
Expand Down
Expand Up @@ -32,11 +32,21 @@ public CommonInitBuilder chemicalRateUnits() {
return this;
}

public CommonInitBuilder irrigationMethod() {
common.add(new CommonData<List<String>>("irrigationMethod", new ArrayList<>()));
return this;
}

public CommonInitBuilder tractorOperators() {
common.add(new CommonData<List<String>>("tractorOperators", new ArrayList<>()));
return this;
}

public CommonInitBuilder tractorWork() {
common.add(new CommonData<List<String>>("tractorWork", new ArrayList<>()));
return this;
}

public CommonInitBuilder bedTypes() {
common.add(new CommonData<List<Integer>>("bedTypes", new ArrayList<>()));
return this;
Expand Down
Expand Up @@ -26,10 +26,18 @@ public void initDatabase() {
commonRepository.saveAll((new CommonInitBuilder()).chemicalRateUnits().build());
}

if (!commonRepository.existsById("irrigationMethod")) {
commonRepository.saveAll((new CommonInitBuilder()).irrigationMethod().build());
}

if (!commonRepository.existsById("tractorOperators")) {
commonRepository.saveAll((new CommonInitBuilder()).tractorOperators().build());
}

if (!commonRepository.existsById("tractorWork")) {
commonRepository.saveAll((new CommonInitBuilder()).tractorWork().build());
}

if (!commonRepository.existsById("bedTypes")) {
commonRepository.saveAll((new CommonInitBuilder()).bedTypes().build());
}
Expand Down

0 comments on commit 9f0ef31

Please sign in to comment.