Skip to content
This repository was archived by the owner on Jun 29, 2026. It is now read-only.

feat: add competition group export format#55

Merged
taimos-projen[bot] merged 2 commits into
mainfrom
claude/competition-export-format-i86eE
Feb 26, 2026
Merged

feat: add competition group export format#55
taimos-projen[bot] merged 2 commits into
mainfrom
claude/competition-export-format-i86eE

Conversation

@hoegertn

@hoegertn hoegertn commented Feb 26, 2026

Copy link
Copy Markdown
Member

Add export format for competition groups following the same pattern as
the existing league group export. Includes TypeScript interfaces, JSON
schema, and sample data.

Key differences from league group export:

  • Group references a Competition (with association, date range,
    registration period, coordinators) instead of Season + League
  • Leader is optional (nullable) on competition groups
  • Competition includes registrationPermission enum and coordinators list

https://claude.ai/code/session_016HF5vDCksu4GiumToeZCKE

Summary by CodeRabbit

  • New Features
    • Adds competition group export: export full group and competition metadata, team rosters with player details, club scheduling preferences, gym/location info, and aggregate statistics.
    • Includes a representative sample export payload for previewing/export testing.

Add export format for competition groups following the same pattern as
the existing league group export. Includes TypeScript interfaces, JSON
schema, and sample data.

Key differences from league group export:
- Group references a Competition (with association, date range,
  registration period, coordinators) instead of Season + League
- Leader is optional (nullable) on competition groups
- Competition includes registrationPermission enum and coordinators list

https://claude.ai/code/session_016HF5vDCksu4GiumToeZCKE
@github-actions github-actions Bot requested a review from hoegerma February 26, 2026 06:33
@taimos-projen taimos-projen Bot enabled auto-merge February 26, 2026 06:33
@coderabbitai

coderabbitai Bot commented Feb 26, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Adds a new competition group export: JSON Schema, TypeScript interfaces, and a sample JSON payload describing competition metadata, teams, clubs, gyms, players, and aggregate statistics.

Changes

Cohort / File(s) Summary
Schema Definition
competition-group.schema.json
Adds JSON Schema for competition group export with root properties group, teams, clubs, gyms, statistics and 12 definitions (Address, Association, Competition, Coordinator, Leader, CompetitionGroupDetail, Person, PreferredMatchdayDate, Club, TeamDetail, Gym, CompetitionGroupStatistics).
TypeScript Data Models
src/export/competition-group.ts
Introduces exported TypeScript interfaces and two union types (RegistrationPermission, PreferredDateStatus) mirroring the schema for compile-time typing of the export payload.
Sample Data
samples/competition-group-sample.json
Adds a full example payload demonstrating the schema: competition, teams (with players), clubs (with preferred dates), gyms (with addresses), and statistics.

Sequence Diagram(s)

(Skipped — changes are schema, types, and sample data without multi-component runtime control flow.)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • hoegerma

Poem

🐇 I hopped through schemas, neat and bright,
Mapped teams and gyms by moonlit night,
Players, clubs, and dates in line,
Exported tidy — oh how fine!

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title 'feat: add competition group export format' accurately describes the main change: introducing a new export format for competition groups with TypeScript interfaces, JSON schema, and sample data.
Description check ✅ Passed The description covers the main purpose, notes key differences from the league group export, and includes a reference link, but does not formally address all template sections like testing, docs, and breaking changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/competition-export-format-i86eE

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (1)
competition-group.schema.json (1)

346-362: Consider using "integer" instead of "number" for count fields.

The statistics fields (totalTeams, totalPlayers, totalClubs, totalGyms) represent counts and should be whole numbers. Using "type": "integer" would be more precise and prevent fractional values. The same applies to CompetitionGroupDetail.number at line 182.

♻️ Proposed fix for statistics
     "CompetitionGroupStatistics": {
       "type": "object",
       "required": ["totalTeams", "totalPlayers", "totalClubs", "totalGyms"],
       "properties": {
         "totalTeams": {
-          "type": "number"
+          "type": "integer"
         },
         "totalPlayers": {
-          "type": "number"
+          "type": "integer"
         },
         "totalClubs": {
-          "type": "number"
+          "type": "integer"
         },
         "totalGyms": {
-          "type": "number"
+          "type": "integer"
         }
       }
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@competition-group.schema.json` around lines 346 - 362, The numeric statistics
fields are counts and should be integers: update the JSON Schema for
CompetitionGroupStatistics so each property totalTeams, totalPlayers,
totalClubs, and totalGyms uses "type": "integer" (keep the required array
unchanged), and likewise change CompetitionGroupDetail.number to "type":
"integer" so the schema enforces whole-number counts rather than allowing
fractional values.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@competition-group.schema.json`:
- Around line 204-243: The JSON Schema for the Person object is missing "gender"
in its required array, causing a mismatch with the TypeScript Person interface;
update the Person schema's required list to include "gender" so the required
array contains
["id","firstName","lastName","dateOfBirth","uciCode","nationality","clubId","gender"]
ensuring the schema's required fields (refer to the Person object, its
"properties" block, and the existing required array) match the TypeScript
interface.
- Around line 244-263: The JSON Schema for PreferredMatchdayDate is missing
gymId in the required array despite the TypeScript interface requiring gymId
(can be null); update the PreferredMatchdayDate schema by adding "gymId" to the
required list so the property must be present (keeping its type as
["string","null"] and format "uuid") to match the TypeScript interface.

In `@samples/competition-group-sample.json`:
- Line 3: The sample uses a prefixed ID
("cg-a1b2c3d4-e5f6-7890-abcd-ef1234567890") that violates the schema's
"format":"uuid" constraint; update the "id" value in
samples/competition-group-sample.json to a valid UUID string (e.g.,
"a1b2c3d4-e5f6-7890-abcd-ef1234567890") or, if prefixed IDs are intentional,
remove or relax the "format":"uuid" constraint in the schema; target the "id"
field in the sample (and any other sample IDs) or the schema's UUID constraint
accordingly.

---

Nitpick comments:
In `@competition-group.schema.json`:
- Around line 346-362: The numeric statistics fields are counts and should be
integers: update the JSON Schema for CompetitionGroupStatistics so each property
totalTeams, totalPlayers, totalClubs, and totalGyms uses "type": "integer" (keep
the required array unchanged), and likewise change CompetitionGroupDetail.number
to "type": "integer" so the schema enforces whole-number counts rather than
allowing fractional values.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between c957e0e and 5968a4b.

📒 Files selected for processing (3)
  • competition-group.schema.json
  • samples/competition-group-sample.json
  • src/export/competition-group.ts

Comment thread competition-group.schema.json
Comment thread competition-group.schema.json
Comment thread samples/competition-group-sample.json Outdated
- Add "gender" to Person required fields in JSON schema
- Add "gymId" to PreferredMatchdayDate required fields in JSON schema
- Use "integer" type instead of "number" for count and numeric fields
  (CompetitionGroupStatistics, CompetitionGroupDetail.number, minAge, maxAge)
- Fix sample data UUIDs: remove prefixes (cg-, comp-, cl-, etc.) to
  comply with the "format": "uuid" schema constraint

https://claude.ai/code/session_016HF5vDCksu4GiumToeZCKE

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
competition-group.schema.json (1)

204-227: Previous review comments addressed; consider adding enum validation for gender.

The gender field is now correctly included in the required array (addressing the previous review feedback). However, the field is defined as a plain string without constraints. If gender uses a controlled vocabulary (e.g., "m", "f", "d" for diverse), consider adding an enum to improve validation.

♻️ Optional: Add enum constraint for gender
         "gender": {
-          "type": "string"
+          "type": "string",
+          "enum": ["m", "f", "d"]
         },
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@competition-group.schema.json` around lines 204 - 227, The Person schema's
gender property is currently an unconstrained string; update
Person.properties.gender to include an enum with the allowed values (e.g., "m",
"f", "d" or whatever controlled vocabulary your domain uses) so validation
enforces only those values, and ensure the enum matches any existing
consumers/users of Person (update docs/tests if needed).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@competition-group.schema.json`:
- Around line 204-227: The Person schema's gender property is currently an
unconstrained string; update Person.properties.gender to include an enum with
the allowed values (e.g., "m", "f", "d" or whatever controlled vocabulary your
domain uses) so validation enforces only those values, and ensure the enum
matches any existing consumers/users of Person (update docs/tests if needed).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5968a4b and 43c2d61.

📒 Files selected for processing (2)
  • competition-group.schema.json
  • samples/competition-group-sample.json

@taimos-projen taimos-projen Bot added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit c6b3c57 Feb 26, 2026
6 checks passed
@taimos-projen taimos-projen Bot deleted the claude/competition-export-format-i86eE branch February 26, 2026 08:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants