Certificates on user profiles, with "Sign as"

- Users add their FAA certificates (kind, number, optional expiry) on
  their profile; admins see them on the Users list
- "Sign as" on new/edited logbook entries and the squawk Resolve page
  fills the signer's name, kind of certificate and number (expired
  certificates aren't offered); deferrals default to mechanic for users
  with a mechanic certificate
- Weekly reminder lists certificates expiring within 60 days (or lapsed
  in the last 30), even when nothing else is due
- Preventive maintenance templates keep a certificate already chosen

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 11:08:21 -05:00
1 parent 5584ad59c5
commit aa262065b2
21 files changed
+253 -22

No files matched your search

+3 -2
View File
@@ -1,5 +1,6 @@
# Weekly email to aircraft owners listing what's overdue or coming due
# (inspections, ADs, components, expiring documents) and deferred items.
# (inspections, ADs, components, expiring documents), deferred items, new
# ADs, and the user's own certificates that are about to expire.
# Nothing is sent when nothing needs attention, or when email isn't set up.
class WeeklyReminderJob < ApplicationJob
queue_as :default
@@ -7,7 +8,7 @@ class WeeklyReminderJob < ApplicationJob
def perform
return unless MailSettings.configured?
User.where(reminder_emails: true).find_each do |user|
ReminderMailer.weekly(user).deliver_now if ReminderMailer.items_for(user).any?
ReminderMailer.weekly(user).deliver_now if ReminderMailer.anything_for?(user)
rescue StandardError => e
Rails.logger.warn("[reminders] #{user.id}: #{e.class}: #{e.message}")
end