summaryrefslogtreecommitdiff
path: root/app/controllers/services/create_address_service.rb
blob: 5ded4f7ce01bfb4f8943e65d68f829c81744800c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# frozen_string_literal: true

module Services
  # The service for address creation.
  class CreateAddressService < AddressServicesBase
    attr_reader :address

    def call
      if already_existing_address.nil?
        @address = @user_account.addresses.create(@params)
      else
        add_address_to_user_addresses
        @address = already_existing_address
      end
    end
  end
end