Sub-components on logbook entries (e.g. the oil filter on the engine)

- Once a component is chosen, its sub-components are offered on the entry
  form (and the squawk Resolve page); ticked ones are saved with their
  total time and time since service, worked out from the airframe total
  time like the component's (editable; blank before it was installed)
- Entry page and printed PDFs list each sub-component with its serial
  number and times; parts without an overhaul type read "Since service"
- Archives carry them: the original format's list of components per entry
  (first = the entry's component, the rest = sub-components)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rickyandClaude Opus 5.5 committed 2026-11-07 12:54:49 -05:00
1 parent 72e1d7760f
commit 7caa213e7a
16 files changed
+249 -22

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
# A sub-component a logbook entry also covers (the oil filter on the engine…)
# and its times at the entry.
class LogbookEntryPart < ApplicationRecord
belongs_to :logbook_entry
belongs_to :component
validates :component_id, uniqueness: { scope: :logbook_entry_id }
validates :hours_at_entry, :since_overhaul_at_entry, numericality: { greater_than_or_equal_to: 0 }, allow_nil: true
end