Skip to content

feat: add Dagsoversigt day-overview sheet to timeplanning Excel exports#1601

Merged
renemadsen merged 3 commits into
stablefrom
feat/dagsoversigt-export-sheet
Jun 9, 2026
Merged

feat: add Dagsoversigt day-overview sheet to timeplanning Excel exports#1601
renemadsen merged 3 commits into
stablefrom
feat/dagsoversigt-export-sheet

Conversation

@renemadsen

Copy link
Copy Markdown
Member

Summary

Adds a localized Dagsoversigt (Day overview) worksheet as the first tab in both timeplanning Excel exports:

  • Single-worker (reports/file): Dagsoversigt + existing Dashboard sheet
  • All-workers (reports/file-all-workers): one combined Dagsoversigt (every worker's planning days, sorted by date then employee no.) + existing Total and per-site sheets

The sheet replicates the reference file layout: a banded Excel Table with a fixed 21-column layout — Employee no, Worker, weekday, date (dd/mm/yyyy), week number, all five shift blocks (start/stop/pause as real hh:mm time values), and net hours (0.00). Net hours reuse the existing override-aware computed value.

Translation

  • New resx key DayOverview (sheet name) added to the neutral resource + all 25 culture files. Lower-confidence translations to sanity-check: fi-FI, ro-RO, uk-UA, el-GR.
  • Every column header reuses an existing resx key (no new header keys).

Implementation notes

  • New cell styles (hh:mm = 165, dd/mm/yyyy = 164, 0.00) added to the shared stylesheet at new style indices (3/4/5); existing indices 0/1/2 untouched, so the other sheets are unchanged.
  • A single shared BuildDayOverviewWorksheet builds the sheet; called exactly once per workbook (one unique DayOverview Excel Table).
  • Known minor edge: a shift ending exactly at 24:00 (index 289) renders as 00:00 under hh:mm.

Tests

  • Unit test for the GetShiftTimeFraction time-of-day helper.
  • E2E tests: single-worker first-sheet/header/table + cell styles & OADate values; all-workers combined+sorted rows and sheet order.
  • Fixed an existing E2E helper (ReadShift1Cells) that assumed the first worksheet was the Dashboard sheet (now resolves Dashboard by name).

Design spec and implementation plan included under docs/superpowers/.

🤖 Generated with Claude Code

Adds a localized "Dagsoversigt" (Day overview) worksheet as the first tab
in both timeplanning Excel exports:
- single-worker export (reports/file): Dagsoversigt + existing Dashboard
- all-workers export (reports/file-all-workers): one combined Dagsoversigt
  (all workers' planning days, sorted by date then employee no.) + existing
  Total and per-site sheets

The sheet is a banded Excel Table with a fixed 21-column layout matching the
reference file: Employee no, Worker, weekday, date (dd/mm/yyyy), week number,
all five shift blocks (start/stop/pause as real hh:mm time values), and net
hours (0.00). Net hours reuse the existing override-aware computed value.

The sheet name is a new translatable resx key (DayOverview) added to the
neutral resource and all 25 culture files; every column header reuses an
existing resx key. New cell styles (hh:mm, 0.00, dd/mm/yyyy) were added to
the shared stylesheet without altering existing style indices.

Includes unit + E2E tests for the new sheet and a fix to an existing E2E
helper that assumed the first worksheet was the Dashboard sheet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 9, 2026 08:10
Add DagsoversigtWorksheetExportTests (shard g) and the existing
WorkingHoursExcelExportE2ETests (shard h) to the dotnet test matrix in both
the PR and master workflows, so the new day-overview sheet tests actually
run in CI.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI 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

Adds a new localized “Dagsoversigt” (Day overview) worksheet as the first tab in both TimePlanning Excel exports, providing a fixed 21-column, table-formatted day-by-day overview (including real date/time numeric values and net hours), while keeping existing sheets intact.

Changes:

  • Prepends a new Day overview worksheet to both single-worker and all-workers workbooks and generates it via a shared worksheet builder.
  • Extends the shared OpenXML stylesheet with new number formats/styles for time (hh:mm), date (dd/mm/yyyy), and net hours (0.00).
  • Adds end-to-end tests covering sheet order, headers/table definition, and numeric style/value correctness; updates an existing E2E helper to locate the Dashboard sheet by name.

Reviewed changes

Copilot reviewed 34 out of 35 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Services/TimePlanningWorkingHoursService/TimePlanningWorkingHoursService.cs Builds and inserts the new Day overview worksheet in both exports; adds helper methods for OpenXML cell creation and time-fraction conversion.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Infrastructure/Helpers/OpenXMLHelper.cs Adds custom numbering formats and new CellFormat entries (new style indices) for time/date/0.00 formatting.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.resx Adds neutral DayOverview resource key (sheet name).
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.Designer.cs Adds strongly-typed accessor for DayOverview.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.da.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.de.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.nl-NL.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.sv-SE.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.no-NO.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.fi-FI.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.fr-FR.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.es-ES.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.it-IT.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.pt-BR.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.pt-PT.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.pl-PL.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.et-EE.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.lv-LV.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.lt-LT.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.ro-RO.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.hr-HR.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.sl-SI.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.cs-CZ.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.sk-SK.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.hu-HU.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.bg-BG.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.el-GR.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.is-IS.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.uk-UA.resx Adds DayOverview translation.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/WorkingHoursExcelExportE2ETests.cs Updates helper logic to find the Dashboard sheet by name after introducing a new first sheet.
eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn.Test/DagsoversigtWorksheetExportTests.cs Adds E2E coverage for Day overview sheet order, headers/table definition, and numeric styles/values.
docs/superpowers/specs/2026-06-09-dagsoversigt-export-sheet-design.md Adds design spec describing the worksheet layout, behavior, and constraints.
docs/superpowers/plans/2026-06-09-dagsoversigt-export-sheet.md Adds implementation plan and verification steps for the feature.
Files not reviewed (1)
  • eFormAPI/Plugins/TimePlanning.Pn/TimePlanning.Pn/Resources/Translations.Designer.cs: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +3001 to +3021
for (int i = 0; i < siteIdCount; i++)
{
var doSite = await sdkContext.Sites.FirstOrDefaultAsync(x => x.MicrotingUid == siteIds[i]);
if (doSite == null) continue;
var doSiteWorker = await sdkContext.SiteWorkers.FirstAsync(x => x.SiteId == doSite.Id);
var doWorker = await sdkContext.Workers.FirstAsync(x => x.Id == doSiteWorker.WorkerId);
perSiteCache.TryGetValue(siteIds[i], out var doCache);
var doPlannings = doCache?.TimePlannings ?? new List<TimePlanningWorkingHoursModel>();
var doUseOneMinute = doCache?.AssignedSite?.UseOneMinuteIntervals ?? false;
foreach (var planning in doPlannings)
{
dayOverviewRows.Add(new DayOverviewRow
{
EmployeeNo = doWorker.EmployeeNo ?? string.Empty,
WorkerName = doSite.Name,
Date = planning.Date,
Planning = planning,
UseOneMinuteIntervals = doUseOneMinute
});
}
}
…y test

The export now adds the Dagsoversigt sheet as the first tab, so the Dashboard
data is no longer the first sheet. Select the Dashboard sheet by name instead
of by position so the JSON-parity comparison targets the correct sheet.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@renemadsen renemadsen merged commit 83e1419 into stable Jun 9, 2026
38 checks passed
@renemadsen renemadsen deleted the feat/dagsoversigt-export-sheet branch June 9, 2026 08:59
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.

2 participants