Skip to content

feat(api): cooperative challenges domain (#200) - #272

Merged
thomasluizon merged 4 commits into
mainfrom
issue-200
Jun 30, 2026
Merged

feat(api): cooperative challenges domain (#200)#272
thomasluizon merged 4 commits into
mainfrom
issue-200

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Backend half of #200 (paired with the orbit-ui-mobile shared-types PR). No client UI (that's #204).

What

  • Challenge + ChallengeParticipant cooperative domain (no per-user ranking). coop_goal = target count + period (sum of contributing logs); streak_together = strict all-must-log shared streak. Each participant links own habit(s); join via friend-invite or join code (capped). create/join/leave/detail endpoints. Migration AddChallenges. Read-side aggregation (habit-log hot path untouched).
  • Team Player (on join) + Mission Accomplished (on coop_goal target-reach) achievements (resolve to fix(api): idempotent habit logging via partial unique index #196's now-merged definitions).

Validation

dotnet build 0 errors; full suite green in implementation.

Refs thomasluizon/orbit-ui-mobile#200. Migration is part of the serialized Phase-5 set.

🤖 Generated with Claude Code

thomasluizon and others added 2 commits June 30, 2026 17:11
Add a cooperative Challenges domain: Challenge + ChallengeParticipant +
ChallengeParticipantHabit entities (no per-user ranking), CoopGoal (summed
target over a window) and StreakTogether (strict all-must-log shared streak)
types, create/join/leave/detail endpoints with FluentValidation, friend-invite
auto-join + Crockford-base32 join code, and read-side shared-progress
aggregation mirroring HabitMetricsCalculator. Completion + Mission Accomplished
fire from a post-log seam (IChallengeProgressService); Team Player on join.

Team Player / Mission Accomplished award via the conventional string ids passed
to AchievementChecks.TryGrant, which no-op until #196 ships the definitions.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon and others added 2 commits June 30, 2026 20:10
# Conflicts:
#	src/Orbit.Api/Extensions/ResultActionResultExtensions.cs
#	src/Orbit.Application/Common/ErrorCodes.cs
#	src/Orbit.Application/Common/ErrorMessages.cs
#	src/Orbit.Domain/Common/DomainConstants.cs
#	src/Orbit.Infrastructure/Persistence/OrbitDbContext.cs
#	src/Orbit.Infrastructure/Services/AgentCatalogService.Capabilities.cs
#	src/Orbit.Infrastructure/Services/DistributedRateLimitService.cs
…r/MissionAccomplished now #196 ships

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon merged commit 7bd2e15 into main Jun 30, 2026
1 check passed
@thomasluizon
thomasluizon deleted the issue-200 branch June 30, 2026 23:15
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
78.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

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