Class: Moderate::Services::IntakeAppeal
- Inherits:
-
Object
- Object
- Moderate::Services::IntakeAppeal
- Defined in:
- lib/moderate/services/intake_appeal.rb
Overview
IntakeAppeal — persistence path for a DSA Article 20 internal complaint (“appeal”) against a moderation decision.
Art. 20 requires an internal complaint-handling system that is FREE, by ELECTRONIC means, open for AT LEAST SIX MONTHS after the decision, and decided by a human (not solely automated). This service owns only the intake half: validating + persisting the complaint and emitting the ‘appeal_received` receipt. The human decision lives in ResolveAppeal. See: eur-lex.europa.eu/eli/reg/2022/2065/oj (Article 20).
The model enforces the legal preconditions (the report must be closed and its appeal window still open) as validations, so a save that violates them returns false with errors — this service doesn’t re-implement that, it just runs the surrounding side effects on success.
HOST-AGNOSTIC: the appellant may be a User (a logged-in affected party) OR an anonymous notifier (name + email) appealing a public-notice decision. We never assume a User.
Instance Attribute Summary collapse
-
#appeal ⇒ Object
readonly
Returns the value of attribute appeal.
Instance Method Summary collapse
-
#initialize(appeal:, report:, appellant: nil) ⇒ IntakeAppeal
constructor
A new instance of IntakeAppeal.
- #save ⇒ Object
Constructor Details
#initialize(appeal:, report:, appellant: nil) ⇒ IntakeAppeal
Returns a new instance of IntakeAppeal.
29 30 31 32 |
# File 'lib/moderate/services/intake_appeal.rb', line 29 def initialize(appeal:, report:, appellant: nil) @appeal = appeal @appeal.assign_attributes(report: report, appellant: appellant) end |
Instance Attribute Details
#appeal ⇒ Object (readonly)
Returns the value of attribute appeal.
34 35 36 |
# File 'lib/moderate/services/intake_appeal.rb', line 34 def appeal @appeal end |
Instance Method Details
#save ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/moderate/services/intake_appeal.rb', line 36 def save return false unless appeal.save deliver_receipt audit_intake true end |