Record keeping: 43.9/43.11 sign-off fields, AD method, status report

- Logbook entries record the signer's kind of certificate and number and
  an inspection's result; maintenance and inspection entries list what
  43.9 / 43.11 needs that's missing (flagged, not enforced). Transcription
  reads the certificate details too
- AD compliance records the method (inspection, terminating action, AMOC,
  not applicable) and the AD revision complied with, filled in from the AD
  when blank; the method sets the permanent / N/A flags
- Maintenance status report (91.417(a)(2)): total times, life-limited
  parts, time since overhaul, inspection and AD status, major alterations,
  open discrepancies; print or save as PDF; on maintenance share links too
- Archives carry the new fields

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 10:14:21 -05:00
1 parent a4b72cf2c1
commit a4ec7a691e
30 files changed
+515 -26

No files matched your search

+4 -2
View File
@@ -7,7 +7,8 @@ class AdCompliancesController < ApplicationController
ad = @aircraft.applicable_ads.find_by(id: params[:ad_id])
@compliance = AdCompliance.new(aircraft: @aircraft, airworthiness_directive: ad, date_complied: Date.current,
aircraft_hours_at_compliance: @aircraft.current_hours,
not_applicable: params[:not_applicable] == "1")
compliance_method: params[:not_applicable] == "1" ? "not_applicable" : "inspection")
@compliance.apply_method
@compliance.compliance_notes = "Not applicable: " if @compliance.not_applicable?
@compliance.fill_next_due
end
@@ -46,7 +47,8 @@ class AdCompliancesController < ApplicationController
def compliance_params
p = params.require(:ad_compliance).permit(
:airworthiness_directive_id, :date_complied, :compliance_notes, :permanent, :next_due_at_time,
:aircraft_hours_at_compliance, :logbook_entry_id, :inspection_record_id, :component_id, :not_applicable
:aircraft_hours_at_compliance, :logbook_entry_id, :inspection_record_id, :component_id,
:compliance_method, :ad_revision
)
p[:airworthiness_directive_id] = scoped_id(@aircraft.applicable_ads, p[:airworthiness_directive_id])
p[:logbook_entry_id] = scoped_id(@aircraft.logbook_entries, p[:logbook_entry_id])
@@ -50,7 +50,8 @@ class LogbookEntriesController < ApplicationController
def entry_params
p = params.require(:logbook_entry).permit(:log_type, :entry_type, :date, :text, :signoff_person,
:signoff_location, :aircraft_hours_at_entry, :document_id, :page_number)
:signoff_location, :aircraft_hours_at_entry, :document_id, :page_number,
:signoff_certificate_type, :signoff_certificate_number, :inspection_result)
p[:document_id] = scoped_id(@aircraft.documents, p[:document_id])
p
end
@@ -0,0 +1,10 @@
# Printable maintenance status report (Print / Save as PDF in the browser).
class MaintenanceReportsController < ApplicationController
include AircraftScoped
def show
@report = MaintenanceReport.new(@aircraft)
log_event("aircraft", "Maintenance status report viewed") if params[:print]
render layout: "report"
end
end
+9
View File
@@ -5,6 +5,15 @@ class SharedController < ApplicationController
skip_before_action :redirect_to_setup
layout "public"
# The maintenance status report, for "Maintenance Detail" links (mechanics,
# inspectors, buyers).
def report
@share = ShareToken.find_active(params[:token]) or raise ActiveRecord::RecordNotFound
raise ActiveRecord::RecordNotFound unless @share.maintenance?
@report = MaintenanceReport.new(@share.aircraft)
render "maintenance_reports/show", layout: "report"
end
def show
@share = ShareToken.find_active(params[:token]) or raise ActiveRecord::RecordNotFound
@aircraft = @share.aircraft