1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2024-12-11 22:24:21 +01:00
fab-manager/app/views/api/coupons/_coupon.json.jbuilder
Sylvain 728ae4310c improved testing of payment schedules + some fixes
TODO: fix the test
rails test test/integration/reservations/create_test.rb
Reservations::CreateTest#test_user_reserves_a_machine_and_renew_a_subscription_with_payment_schedule_and_coupon_and_wallet [test/integration/reservations/create_test.rb:841]
Minitest::Assertion: Expected: "stripe"
  Actual: nil
2020-12-30 18:43:33 +01:00

5 lines
257 B
Ruby

json.extract! coupon, :id, :name, :code, :type, :percent_off, :valid_until, :validity_per_user, :max_usages, :active, :created_at
json.amount_off (coupon.amount_off / 100.00) unless coupon.amount_off.nil?
json.usages coupon.usages
json.status coupon.status