Last active
July 3, 2020 17:26
-
-
Save NilsonLima/f46207fdd7289ef2befcc0de875f90bb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Smartphone::Contract::ChangeDevice < BaseInteraction | |
def call | |
return unless valid_interaction? | |
persist_models! | |
return unless changed_certificate.success? | |
check_imei_async | |
notify_user | |
end | |
def valid_interaction? | |
not_suspended? | |
&& invoices_settled? | |
&& current_device_misatch_previous? | |
&& previous_attributes_valid? | |
&& new_attributes_valid? | |
&& suspended_subscription.success? | |
end | |
def not_suspended? | |
# | |
end | |
def invoices_settled? | |
# | |
end | |
def current_device_misatch_previous? | |
# | |
end | |
def previous_attributes_valid? | |
# | |
end | |
def new_attributes_valid? | |
# | |
end | |
def suspended_subscription | |
# | |
end | |
def changed_certificate | |
# | |
end | |
def check_imei_async | |
# | |
end | |
def notify_user | |
# | |
end | |
def persist_models! | |
# | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment