Skip to content

feat(api): challenges list, invite push, participant set-habits (#204) - #276

Merged
thomasluizon merged 3 commits into
mainfrom
feature/coop-challenges-api
Jul 1, 2026
Merged

feat(api): challenges list, invite push, participant set-habits (#204)#276
thomasluizon merged 3 commits into
mainfrom
feature/coop-challenges-api

Conversation

@thomasluizon

@thomasluizon thomasluizon commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Paired backend for the co-op challenges UI (#204). Additive only — no DB migration; EF model snapshot unchanged.

Additions

  • GET /api/challenges — lists the caller's challenges (active-first, then completed) as a lightweight ChallengeListItemResponse[]; progress computed via the shared ChallengeProgressCalculator (extracted from the detail query). Enables the challenges list surface.
  • Invite push on createCreateChallengeCommand now notifies each invited friend (localized via LocaleHelper, non-fatal on failure), mirroring the accountability invite.
  • PUT /api/challenges/{id}/habitsSetChallengeHabitsCommand lets an active participant (incl. a create-time-invited friend) set their own linked habits so they can contribute. Replaces through the aggregate + EF orphan-removal.

Tests

GetUserChallengesQueryHandlerTests, SetChallengeHabitsCommandHandlerTests, and updated CreateChallengeCommandHandlerTests (invite push). dotnet build clean; Orbit.Application.Tests 2523 + Orbit.Domain.Tests 481 pass.

Merge order

Merge + deploy this before the client PR — the challenges UI depends on these endpoints. Backward-compatible (all additive), safe to deploy ahead of the client.

Refs thomasluizon/orbit-ui-mobile#204
Paired client PR: thomasluizon/orbit-ui-mobile#371

🤖 Generated with Claude Code

…its (#204)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon and others added 2 commits July 1, 2026 16:09
AgentCatalogServiceTests.EveryControllerAction_IsMappedToTheCatalog requires
every controller action be registered; add ChallengesController.GetMine and
SetHabits to the Manage Social capability's controller-action registry.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adds ChallengeValidatorsTests for GetUserChallengesQueryValidator and
SetChallengeHabitsCommandValidator (previously 0% covered), lifting new-code
coverage above the 80% quality gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@thomasluizon
thomasluizon merged commit 2af46c8 into main Jul 1, 2026
8 checks passed
@thomasluizon
thomasluizon deleted the feature/coop-challenges-api branch July 1, 2026 19:33
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