Skip to content

Implement annual Raphcon expiry for admins to maintain game fairness#7

Draft
Copilot wants to merge 4 commits into
masterfrom
copilot/check-expired-raphcons-admin
Draft

Implement annual Raphcon expiry for admins to maintain game fairness#7
Copilot wants to merge 4 commits into
masterfrom
copilot/check-expired-raphcons-admin

Conversation

Copilot AI commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

Raphcons older than one year now automatically expire when an admin opens the app. Since Firebase Functions aren't available, this client-side approach ensures fairness without infrastructure costs.

Implementation

Data layer (raphcons_remote_datasource.dart)

  • Query active Raphcons where createdAt < (now - 365 days)
  • Batch update: mark isActive = false and decrement user raphconCount
  • Null-safe userId validation

Presentation layer (raphcon_bloc.dart)

  • ExpireOldRaphconsEvent triggers on admin login
  • Silent execution—no loading states or error notifications

UI integration (public_user_list_page.dart)

if (isAdminUser) {
  // Admin confirmed via AdminConfigService
  context.read<RaphconBloc>().add(ExpireOldRaphconsEvent());
}

Configuration (app_constants.dart)

  • raphconExpiryDays = 365 for easy adjustment

Security

Existing Firebase rules already enforce admin-only updates to raphcons. Firestore batch operations ensure atomicity. Soft delete preserves audit trail.

Original prompt

This section details on the original issue you should resolve

<issue_title>Als Beteiligter möchte ich, dass meine Raphcons ablaufen, um das Game fair zu halten</issue_title>
<issue_description>Raphcons sollten jährlich ablaufen. Da wir ein kostenloses Projekt haben, müssen wir auf firebase functions verzichten.

Daher die Idee, wenn ein Admin die app öffnet, muss gecheckt werden, ob abgelaufene Raphcons existieren.

Beachte security firebase rules.

Achtung: Nur bei Admins</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 3 commits December 12, 2025 12:29
Co-authored-by: tujii <8914318+tujii@users.noreply.github.com>
Co-authored-by: tujii <8914318+tujii@users.noreply.github.com>
Co-authored-by: tujii <8914318+tujii@users.noreply.github.com>
Copilot AI changed the title [WIP] Add check for expired Raphcons on admin app open Implement annual Raphcon expiry for admins to maintain game fairness Dec 12, 2025
Copilot AI requested a review from tujii December 12, 2025 12:34
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.

Als Beteiligter möchte ich, dass meine Raphcons ablaufen, um das Game fair zu halten

2 participants