Skip to content

chore: remove missions and tours dead code - #108

Merged
thomasluizon merged 1 commit into
mainfrom
chore/remove-missions-and-tours
Apr 1, 2026
Merged

chore: remove missions and tours dead code#108
thomasluizon merged 1 commit into
mainfrom
chore/remove-missions-and-tours

Conversation

@thomasluizon

Copy link
Copy Markdown
Owner

Summary

  • Drop HasDismissedMissions and CompletedTours columns from Users table
  • Delete DismissMissionsCommand and MarkTourCompletedCommand
  • Remove PUT /api/profile/missions/dismiss and PUT /api/profile/tour endpoints
  • Clean up related unit and domain tests

Companion to thomasluizon/orbit-ui#185 which replaces the old onboarding system.

Test plan

  • Run dotnet ef database update to apply migration
  • Verify GET /api/profile no longer returns hasDismissedMissions or completedTours
  • Verify all tests pass (dotnet test)

🤖 Generated with Claude Code

Remove HasDismissedMissions and CompletedTours from User entity,
ProfileResponse, and all related commands, endpoints, and tests.
These were used by the old onboarding system (missions checklist +
driver.js tours) which has been replaced by an interactive flow.

- Drop HasDismissedMissions and CompletedTours columns (migration)
- Delete DismissMissionsCommand and MarkTourCompletedCommand
- Remove PUT /api/profile/missions/dismiss and PUT /api/profile/tour endpoints
- Remove related unit and domain tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@thomasluizon
thomasluizon merged commit e1258ce into main Apr 1, 2026
3 checks passed
@thomasluizon
thomasluizon deleted the chore/remove-missions-and-tours branch April 1, 2026 00:56
thomasluizon added a commit that referenced this pull request Jun 4, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
#108)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
…ck (#108)

Aligns StreakFreezeAutoActivationService.LoadRecentCompletionsAsync with
UserStreakService.LoadStreakDataAsync by filtering out soft-deleted habits when
computing recent completions, so a deleted habit's log can no longer count as
activity for a date and suppress the auto-freeze. Adds DB-backed tests locking
the LoadRecentCompletionsAsync contract for soft-deleted and live habit logs.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
#108)

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
* feat(api): auto-activate streak freeze on inactive day (#108)

Add a dedicated StreakFreezeAutoActivationService BackgroundService that
auto-activates a streak freeze for a Pro user who held an active streak but
logged nothing on their fully-elapsed local "yesterday".

- Mirrors SlipAlertSchedulerService / HabitDueDateAdvancementService: poll
  interval, conservative UTC pre-filter, authoritative per-user TimeZoneHelper
  local-yesterday guard, single SaveChanges per tick.
- Pro-only (matches ActivateStreakFreezeCommand). Spends one freeze per missed
  day, bounded by MaxStreakFreezesAccumulated (inventory) and
  MaxStreakFreezesPerMonth (monthly).
- Presence-based: inserting a StreakFreeze row for the missed date preserves
  the streak on the next on-read RecalculateAsync; no direct streak mutation.
- Idempotent: new SentStreakFreezeAlert guard entity (unique UserId+FrozenDate)
  plus the existing StreakFreeze unique index, both re-checked before spending.
- Notifies via in-app Notification + push (IPushNotificationService); localized
  copy via LocaleHelper, mirroring GoalDeadlineNotificationService.
- EF migration AddSentStreakFreezeAlert; account reset purges the guard table;
  registered in ServiceCollectionExtensions and BackgroundServiceHealthCheck.

Unit tests cover the eligibility predicate, local-yesterday computation,
interval default, notification copy, and the guard entity.

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

* refactor(api): remove manual streak-freeze activation (auto-only) (#108)

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

* fix(api): exclude soft-deleted habits from auto-freeze completion check (#108)

Aligns StreakFreezeAutoActivationService.LoadRecentCompletionsAsync with
UserStreakService.LoadStreakDataAsync by filtering out soft-deleted habits when
computing recent completions, so a deleted habit's log can no longer count as
activity for a date and suppress the auto-freeze. Adds DB-backed tests locking
the LoadRecentCompletionsAsync contract for soft-deleted and live habit logs.

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
thomasluizon added a commit that referenced this pull request Jun 4, 2026
* feat(api): auto-activate streak freeze on inactive day (#108)

Add a dedicated StreakFreezeAutoActivationService BackgroundService that
auto-activates a streak freeze for a Pro user who held an active streak but
logged nothing on their fully-elapsed local "yesterday".

- Mirrors SlipAlertSchedulerService / HabitDueDateAdvancementService: poll
  interval, conservative UTC pre-filter, authoritative per-user TimeZoneHelper
  local-yesterday guard, single SaveChanges per tick.
- Pro-only (matches ActivateStreakFreezeCommand). Spends one freeze per missed
  day, bounded by MaxStreakFreezesAccumulated (inventory) and
  MaxStreakFreezesPerMonth (monthly).
- Presence-based: inserting a StreakFreeze row for the missed date preserves
  the streak on the next on-read RecalculateAsync; no direct streak mutation.
- Idempotent: new SentStreakFreezeAlert guard entity (unique UserId+FrozenDate)
  plus the existing StreakFreeze unique index, both re-checked before spending.
- Notifies via in-app Notification + push (IPushNotificationService); localized
  copy via LocaleHelper, mirroring GoalDeadlineNotificationService.
- EF migration AddSentStreakFreezeAlert; account reset purges the guard table;
  registered in ServiceCollectionExtensions and BackgroundServiceHealthCheck.

Unit tests cover the eligibility predicate, local-yesterday computation,
interval default, notification copy, and the guard entity.

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

* refactor(api): remove manual streak-freeze activation (auto-only) (#108)

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

* fix(api): exclude soft-deleted habits from auto-freeze completion check (#108)

Aligns StreakFreezeAutoActivationService.LoadRecentCompletionsAsync with
UserStreakService.LoadStreakDataAsync by filtering out soft-deleted habits when
computing recent completions, so a deleted habit's log can no longer count as
activity for a date and suppress the auto-freeze. Adds DB-backed tests locking
the LoadRecentCompletionsAsync contract for soft-deleted and live habit logs.

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

* feat(api): author feature-explanation markdown bundle (#84)

Add eight grounded markdown explainer files (streaks, frequencies,
gamification, paygate, schedule-math, freezes, notifications,
ai-memory) so the in-app AI answers feature questions from
code-accurate content. Each file carries a 6-key YAML frontmatter
and a body whose constants are copied verbatim from AppConstants,
LevelDefinitions, and the streak/schedule/paygate/reminder services.

Ship the bundle inside the API binary via the first EmbeddedResource
glob in the repo; resources embed as
Orbit.Application.Chat.Content.FeatureExplanations.<key>.md, the
documented loader contract for the downstream consumer.

Refs thomasluizon/orbit-ui-mobile#84

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

* docs(chat): freezes.md describes auto-activation model (#108)

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

* docs(chat): repoint freezes.md derived_from to auto-activation service (#108)

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

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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