Sha256: d1ee2d8cc9e52073570ef15ddbf1066577fe43aae420e323200c5bed4c790022
Contents?: true
Size: 975 Bytes
Versions: 30
Compression:
Stored size: 975 Bytes
Contents
# frozen_string_literal: true require_dependency "renalware/letters/letter" module Renalware module Letters class Letter::PendingReview < Letter def self.policy_class PendingReviewLetterPolicy end def revise(params) params = LetterParamsProcessor.new(patient).call(params) self.attributes = params end def reject(by:) becomes!(Draft).tap { |letter| letter.by = by } end def sign(by:) build_signature(user: by, signed_at: Time.current) self.approved_by = by self.approved_at = Time.current self.by = by self end def generate_archive(by:, presenter: default_presenter) becomes!(Approved).tap do |letter| letter.by = by letter.build_archive(by: by, content: presenter.content) end end private def default_presenter LetterPresenterFactory.new(self) end end end end
Version data entries
30 entries across 30 versions & 1 rubygems