Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 12, 2025

Checklist

  • Merged database migrations into 1 database migration.
  • Tested database migrations from origin/staging (git checkout staging ; git pull ; bundle exec rails db:reset ; git checkout BRANCH ; bundle exec rails db:migrate).

Summary

Fixes two issues and adds a database migration to resolve schema inconsistency:

Zatladder Controller: When no Amber users exist, fallback to sofia_account users instead of crashing:

users = User.in_amber.any? ? User.in_amber : User.sofia_account
@users_spendings = users.calculate_spendings(from:, to:)

OTP Authentication: Accept 1-period drift to handle clock skew between client and server:

sofia_account.authenticate_otp(params[:verification_code], drift: 1)

Database Migration: Adds order_total column back to orders table if missing, resolving schema.rb inconsistency.

Other information

Migration is idempotent using column_exists? check to safely run on environments where the column may already exist.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

Copilot AI changed the title [WIP] Fix inconsistency in schema.rb Fix Zatladder fallback and OTP drift tolerance Dec 12, 2025
Copilot AI requested a review from lodewiges December 12, 2025 16:40
@lodewiges lodewiges closed this Dec 12, 2025
@lodewiges lodewiges deleted the copilot/sub-pr-1172 branch January 14, 2026 09:26
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.

2 participants