Skip to content

feat!: group work-package schedule fields in WorkPackageSchedule - #59

Merged
davidnmbond merged 1 commit into
mainfrom
feat/work-package-schedule
Nov 9, 2026
Merged

davidnmbond merged 1 commit into
mainfrom
feat/work-package-schedule

Conversation

@davidnmbond

Copy link
Copy Markdown
Contributor

Groups the work-package scheduling and estimate fields in a new WorkPackageSchedule object, removing the duplicated property block that Codacy graded C (37% duplication) on WorkPackage.cs and WorkPackageUpdate.cs.

Breaking change (version 3.0 → 3.1): ScheduleManually, StartDate, DueDate, Date, EstimatedTime and DerivedEstimatedTime move from WorkPackage and WorkPackageUpdate into their Schedule property, so workPackage.StartDate becomes workPackage.Schedule.StartDate.

Wire format unchanged: OpenProject sends and expects these as top-level JSON fields. FlatScheduleConverterFactory, registered in the client's JSON options (Refit's defaults plus this converter), reads them from the top level into Schedule and writes them back to the top level, leaving null fields out. WorkPackageCreate is not changed.

Tests (WorkPackageScheduleJsonTests): reading flat fields into Schedule, writing an update flat with nulls omitted, and work packages inside a collection. Local run with CI's filter (Category!=Integration): 11 passed; line coverage 74.6%.

WorkPackage and WorkPackageUpdate expose ScheduleManually, StartDate, DueDate, Date, EstimatedTime and DerivedEstimatedTime through a Schedule property. A converter keeps them flat in the JSON, as OpenProject sends and expects them. Breaking: workPackage.StartDate becomes workPackage.Schedule.StartDate; version 3.1.
@codacy-production

codacy-production Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 11 complexity · -2 duplication

Metric Results
Complexity 11
Duplication -2

View in Codacy

🟢 Coverage 100.00% diff coverage · +5.96% coverage variation

Metric Results
Coverage variation ✅ +5.96% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (8ac75f1) 166 114 68.67%
Head commit (575ff35) 205 (+39) 153 (+39) 74.63% (+5.96%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#59) 39 39 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

AI Reviewer: first review requested successfully. AI can make mistakes. Always validate suggestions.

Run reviewer

TIP This summary will be updated as you push new changes.

@codacy-production codacy-production Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

✅ No blocking issues noticed

No blocking findings were identified. The reviewed changes have corresponding coverage for flat schedule serialization/deserialization, collection handling, null omission, and both read/write converter paths.

Test suggestions

  • Deserialize flat schedule fields into WorkPackage.Schedule.
  • Serialize WorkPackageUpdate.Schedule as flat fields with null values omitted.
  • Deserialize collection items using the flat schedule converter.
  • Exercise converter behavior for both reading and writing IHasSchedule implementations.

Make this review better

TIP Add a ticket key to the branch or title so the reviewer can check the PR against it. Or tell us which ticket tracker you use here.

TIP How was this review? Give us feedback

@davidnmbond
davidnmbond merged commit 4e173dd into main Nov 9, 2026
8 checks passed
@davidnmbond
davidnmbond deleted the feat/work-package-schedule branch November 9, 2026 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant