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

Feature/track support staff appointment percentage #295

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,9 @@ public SectionGroup updateSectionGroup(@PathVariable long sectionGroupId, @Reque
originalSectionGroup.setTeachingAssistantAppointments(sectionGroup.getTeachingAssistantAppointments());
originalSectionGroup.setReaderAppointments(sectionGroup.getReaderAppointments());

originalSectionGroup.setTaAppointmentPercentage(sectionGroup.getTaAppointmentPercentage());
originalSectionGroup.setReaderAppointmentPercentage(sectionGroup.getReaderAppointmentPercentage());

return sectionGroupService.save(originalSectionGroup);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,14 @@ public Object deserialize(JsonParser jsonParser, DeserializationContext deserial
sg.setReaderAppointments(node.get("readerAppointments").floatValue());
}

if (node.has("taAppointmentPercentage") && node.hasNonNull("taAppointmentPercentage")) {
sg.setTaAppointmentPercentage(node.get("taAppointmentPercentage").intValue());
}

if (node.has("readerAppointmentPercentage") && node.hasNonNull("readerAppointmentPercentage")) {
sg.setReaderAppointmentPercentage(node.get("readerAppointmentPercentage").intValue());
}

if (node.has("showTheStaff")) {
sg.setShowTheStaff(node.get("showTheStaff").booleanValue());
}
Expand Down
12 changes: 11 additions & 1 deletion src/main/java/edu/ucdavis/dss/ipa/entities/SectionGroup.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class SectionGroup extends BaseEntity {
private List<TeachingAssignment> teachingAssignments = new ArrayList<TeachingAssignment>();
private List<Activity> activities = new ArrayList<Activity>();
private String termCode;
private Integer plannedSeats;
private Integer plannedSeats, taAppointmentPercentage, readerAppointmentPercentage;
private Float teachingAssistantAppointments, readerAppointments;
private Boolean showTheStaff = false;

Expand Down Expand Up @@ -191,4 +191,14 @@ public Float getReaderAppointments() {
public void setReaderAppointments(Float readerAppointments) {
this.readerAppointments = readerAppointments;
}

@JsonProperty
public Integer getTaAppointmentPercentage() { return taAppointmentPercentage; }

public void setTaAppointmentPercentage(Integer taAppointmentPercentage) { this.taAppointmentPercentage = taAppointmentPercentage; }

@JsonProperty
public Integer getReaderAppointmentPercentage() { return readerAppointmentPercentage; }

public void setReaderAppointmentPercentage(Integer readerAppointmentPercentage) { this.readerAppointmentPercentage = readerAppointmentPercentage; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
public class SectionGroupCost extends BaseEntity {
private long id;
private BudgetScenario budgetScenario;
private Integer sectionCount;
private Integer sectionCount, taAppointmentPercentage, readerAppointmentPercentage;
private Long enrollment;
private Instructor instructor;
private Instructor originalInstructor;
Expand Down Expand Up @@ -64,6 +64,10 @@ public void setTaCount(Float taCount) {
this.taCount = taCount;
}

public Integer getTaAppointmentPercentage() { return taAppointmentPercentage; }

public void setTaAppointmentPercentage(Integer taAppointmentPercentage) { this.taAppointmentPercentage = taAppointmentPercentage; }

public Integer getSectionCount() {
return sectionCount;
}
Expand All @@ -80,6 +84,10 @@ public void setReaderCount(Float readerCount) {
this.readerCount = readerCount;
}

public Integer getReaderAppointmentPercentage() { return readerAppointmentPercentage; }

public void setReaderAppointmentPercentage(Integer readerAppointmentPercentage) { this.readerAppointmentPercentage = readerAppointmentPercentage; }

public BigDecimal getCost() {
return cost;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,21 @@ public SectionGroupCost updateFromSectionGroup(SectionGroup sectionGroup, Budget
sectionGroupCost.setTaCount(sectionGroup.getTeachingAssistantAppointments());
}

if (sectionGroupCost.getTaAppointmentPercentage() != sectionGroup.getTaAppointmentPercentage()) {
updateRequired = true;
sectionGroupCost.setTaAppointmentPercentage(sectionGroup.getReaderAppointmentPercentage());
}

if (sectionGroupCost.getReaderCount() != sectionGroup.getReaderAppointments()) {
updateRequired = true;
sectionGroupCost.setReaderCount(sectionGroup.getReaderAppointments());
}

if (sectionGroupCost.getReaderAppointmentPercentage() != sectionGroup.getReaderAppointmentPercentage()) {
updateRequired = true;
sectionGroupCost.setReaderAppointmentPercentage(sectionGroup.getReaderAppointmentPercentage());
}

Instructor instructor = null;
InstructorType instructorType = null;

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
ALTER TABLE `SectionGroups` ADD COLUMN `TaAppointmentPercentage` INT(11) NULL;
ALTER TABLE `SectionGroups` ADD COLUMN `ReaderAppointmentPercentage` INT(11) NULL;
ALTER TABLE `SectionGroupCosts` ADD COLUMN `TaAppointmentPercentage` INT(11) NULL;
ALTER TABLE `SectionGroupCosts` ADD COLUMN `ReaderAppointmentPercentage` INT(11) NULL;