Skip to content

Commit

Permalink
Save activity names in db
Browse files Browse the repository at this point in the history
  • Loading branch information
JoelCourtney committed Sep 25, 2024
1 parent b4cc768 commit a844340
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public record SchedulingActivity(
ActivityDirectiveId topParent,
ActivityDirectiveId anchorId,
boolean anchoredToStart,
boolean isNew
boolean isNew,
String name
) {

public static SchedulingActivity of(
Expand All @@ -62,7 +63,8 @@ public static SchedulingActivity of(
null,
anchorId,
anchoredToStart,
isNew
isNew,
null
);
}

Expand All @@ -86,12 +88,13 @@ public static SchedulingActivity of(
topParent,
anchorId,
anchoredToStart,
isNew
isNew,
null
);
}

public SchedulingActivity withNewDuration(Duration duration){
return SchedulingActivity.of(
return new SchedulingActivity(
this.id,
this.type,
this.startOffset,
Expand All @@ -100,12 +103,13 @@ public SchedulingActivity withNewDuration(Duration duration){
this.topParent,
this.anchorId,
this.anchoredToStart,
this.isNew()
this.isNew(),
this.name
);
}

public SchedulingActivity withNewAnchor(ActivityDirectiveId anchorId, boolean anchoredToStart, Duration startOffset) {
return SchedulingActivity.of(
return new SchedulingActivity(
this.id,
this.type,
startOffset,
Expand All @@ -114,12 +118,13 @@ public SchedulingActivity withNewAnchor(ActivityDirectiveId anchorId, boolean an
this.topParent,
anchorId,
anchoredToStart,
this.isNew
this.isNew,
this.name
);
}

public SchedulingActivity withNewDirectiveId(ActivityDirectiveId id) {
return SchedulingActivity.of(
return new SchedulingActivity(
id,
this.type,
startOffset,
Expand All @@ -128,12 +133,13 @@ public SchedulingActivity withNewDirectiveId(ActivityDirectiveId id) {
this.topParent,
this.anchorId,
this.anchoredToStart,
this.isNew
this.isNew,
this.name
);
}

public SchedulingActivity withNewTopParent(ActivityDirectiveId topParent) {
return SchedulingActivity.of(
return new SchedulingActivity(
this.id,
this.type,
startOffset,
Expand All @@ -142,12 +148,13 @@ public SchedulingActivity withNewTopParent(ActivityDirectiveId topParent) {
topParent,
this.anchorId,
this.anchoredToStart,
this.isNew
this.isNew,
this.name
);
}

public static SchedulingActivity fromExistingActivityDirective(ActivityDirectiveId id, ActivityDirective activity, ActivityType type, Duration duration){
return SchedulingActivity.of(
return new SchedulingActivity(
id,
type,
activity.startOffset(),
Expand All @@ -156,7 +163,8 @@ public static SchedulingActivity fromExistingActivityDirective(ActivityDirective
null,
activity.anchorId(),
activity.anchoredToStart(),
false
false,
null
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,8 @@ public Duration valueAt(Duration start, final EquationSolvingAlgorithms.History<
null,
null,
true,
true
true,
null
);
Duration computedDuration = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ data class InMemoryEditablePlan(
is DirectiveStart.Absolute -> true
is DirectiveStart.Anchor -> s.anchorPoint == DirectiveStart.Anchor.AnchorPoint.Start
},
isNew
isNew,
name
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -582,6 +582,8 @@ mutation createAllPlanActivityDirectives($activities: [activity_directive_insert
.add("start_offset", act.startOffset().toString())
.add("anchored_to_start", act.anchoredToStart());

if (act.name() != null) insertionObject = insertionObject.add("name", act.name());

//add duration to parameters if controllable
final var insertionObjectArguments = Json.createObjectBuilder();
if(act.getType().getDurationType() instanceof DurationType.Controllable durationType){
Expand Down

0 comments on commit a844340

Please sign in to comment.