mirror of
https://github.com/LaCasemate/fab-manager.git
synced 2024-12-02 13:24:20 +01:00
17 lines
545 B
Ruby
17 lines
545 B
Ruby
# frozen_string_literal: true
|
|
|
|
# Provides helper methods for Reservation actions
|
|
class Reservations::Reserve
|
|
attr_accessor :user_id, :operator_profile_id
|
|
|
|
def initialize(user_id, operator_profile_id)
|
|
@user_id = user_id
|
|
@operator_profile_id = operator_profile_id
|
|
end
|
|
|
|
def pay_and_save(reservation, payment_details: nil, payment_intent_id: nil)
|
|
reservation.statistic_profile_id = StatisticProfile.find_by(user_id: user_id).id
|
|
reservation.save_with_payment(operator_profile_id, payment_details, payment_intent_id)
|
|
end
|
|
end
|