Skip to content

feat(company): serialize employees timeframes to topcompanies_prs.json#239

Merged
Progi1984 merged 1 commit into
PrestaShop:masterfrom
PrestaEdit:feat/company-employees-export
Jul 22, 2026
Merged

feat(company): serialize employees timeframes to topcompanies_prs.json#239
Progi1984 merged 1 commit into
PrestaShop:masterfrom
PrestaEdit:feat/company-employees-export

Conversation

@PrestaEdit

Copy link
Copy Markdown
Contributor

Summary

  • Company::toArray() now embeds the full employees map — login → [{ start_date, end_date }, …] — sourced from var/data/companies.json.
  • Traces already loaded this data to attribute each merged PR to the company employing the author at merge time; it just was never propagated to the JSON consumed by the front. Publishing it lets the front render a proper members table (entry/departure per period, still-active flag, multiple periods per person) instead of relying on the ad-hoc contributors list, which is the derived set of PR authors — a different, noisier population.
  • The toArray() docblock is widened to array<string, mixed> because the shape now nests employees[].time_frames[]. phpstan (level max) is green on src/DTO/Company.php, and callers only consume the array via json_encode.

Test plan

  • vendor/bin/phpstan analyse src/DTO/Company.php --level=max → No errors.
  • php bin/console traces:generate:topcompaniestopcompanies_prs.json regenerated successfully; PrestaShop entry now carries employees (69 entries) alongside the pre-existing contributors (85 entries).
  • Sample serialization matches the input:
    json { "login": "0x346e3730", "time_frames": [{ "start_date": "2022-10-03", "end_date": "2023-06-30" }] }
  • Downstream front (TopContributors) consumes the new field to render a per-employee table with periods, tenure, and Active/Left status.

🤖 Generated with Claude Code

Company::toArray() now embeds the full `employees` map — login →
[{ start_date, end_date }, …] — sourced from var/data/companies.json.

Traces already loaded this to attribute each PR to the company employing
the author at merge time; it just was not propagated to the JSON
consumed by the front. Publishing it enables the front to render a
proper members table (entry/departure per period, still-active flag,
multiple periods per person) instead of relying on the ad-hoc
`contributors` list, which is the derived set of PR authors — a
different (and noisier) population.

The docblock is widened to `array<string, mixed>` because the shape
now nests `employees[].time_frames[]`; phpstan is happy and the
callers only consume the whole array via json_encode.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Progi1984
Progi1984 merged commit dffb734 into PrestaShop:master Jul 22, 2026
3 checks passed
@github-project-automation github-project-automation Bot moved this from Ready for review to Merged in PR Dashboard Jul 22, 2026
@ps-jarvis ps-jarvis moved this from Merged to Ready for review in PR Dashboard Jul 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Ready for review

Development

Successfully merging this pull request may close these issues.

3 participants