Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #35

Merged
merged 3 commits into from Jan 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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