Add Initial OfflineTransactionRefund
This commit is contained in:
parent
9a58b9f684
commit
7e02530fda
5 changed files with 48 additions and 0 deletions
7
app/models/offline_transaction_refund.rb
Normal file
7
app/models/offline_transaction_refund.rb
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||||
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
|
class OfflineTransactionRefund < ApplicationRecord
|
||||||
|
belongs_to :payment
|
||||||
|
end
|
|
@ -0,0 +1,13 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||||
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
|
class CreateOfflineTransactionRefunds < ActiveRecord::Migration[6.1]
|
||||||
|
def change
|
||||||
|
create_table :offline_transaction_refunds, id: :string do |t|
|
||||||
|
t.references :payment, foreign_key:true
|
||||||
|
|
||||||
|
t.timestamps
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
|
@ -606,6 +606,13 @@ ActiveRecord::Schema.define(version: 2021_06_02_220525) do
|
||||||
t.index ["payment_id"], name: "index_offline_transaction_charges_on_payment_id"
|
t.index ["payment_id"], name: "index_offline_transaction_charges_on_payment_id"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
create_table "offline_transaction_refunds", id: :string, force: :cascade do |t|
|
||||||
|
t.bigint "payment_id"
|
||||||
|
t.datetime "created_at", precision: 6, null: false
|
||||||
|
t.datetime "updated_at", precision: 6, null: false
|
||||||
|
t.index ["payment_id"], name: "index_offline_transaction_refunds_on_payment_id"
|
||||||
|
end
|
||||||
|
|
||||||
create_table "offline_transactions", id: :string, force: :cascade do |t|
|
create_table "offline_transactions", id: :string, force: :cascade do |t|
|
||||||
t.integer "amount", null: false
|
t.integer "amount", null: false
|
||||||
t.datetime "created_at", precision: 6, null: false
|
t.datetime "created_at", precision: 6, null: false
|
||||||
|
@ -1039,8 +1046,10 @@ ActiveRecord::Schema.define(version: 2021_06_02_220525) do
|
||||||
add_foreign_key "modern_campaign_gifts", "campaign_gifts"
|
add_foreign_key "modern_campaign_gifts", "campaign_gifts"
|
||||||
add_foreign_key "object_event_hook_configs", "nonprofits"
|
add_foreign_key "object_event_hook_configs", "nonprofits"
|
||||||
add_foreign_key "offline_transaction_charges", "payments"
|
add_foreign_key "offline_transaction_charges", "payments"
|
||||||
|
add_foreign_key "offline_transaction_refunds", "payments"
|
||||||
add_foreign_key "recurrences", "recurring_donations"
|
add_foreign_key "recurrences", "recurring_donations"
|
||||||
add_foreign_key "recurrences", "supporters"
|
add_foreign_key "recurrences", "supporters"
|
||||||
|
add_foreign_key "offline_transaction_refunds", "payments"
|
||||||
add_foreign_key "stripe_charges", "payments"
|
add_foreign_key "stripe_charges", "payments"
|
||||||
add_foreign_key "stripe_refunds", "payments"
|
add_foreign_key "stripe_refunds", "payments"
|
||||||
add_foreign_key "subtransaction_payments", "subtransactions"
|
add_foreign_key "subtransaction_payments", "subtransactions"
|
||||||
|
|
10
spec/factories/offline_transaction_refunds.rb
Normal file
10
spec/factories/offline_transaction_refunds.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||||
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
|
FactoryBot.define do
|
||||||
|
factory :offline_transaction_refund do
|
||||||
|
payment { "" }
|
||||||
|
created { "2021-04-12 17:24:33" }
|
||||||
|
end
|
||||||
|
end
|
9
spec/models/offline_transaction_refund_spec.rb
Normal file
9
spec/models/offline_transaction_refund_spec.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
# frozen_string_literal: true
|
||||||
|
|
||||||
|
# License: AGPL-3.0-or-later WITH WTO-AP-3.0-or-later
|
||||||
|
# Full license explanation at https://github.com/houdiniproject/houdini/blob/master/LICENSE
|
||||||
|
require 'rails_helper'
|
||||||
|
|
||||||
|
RSpec.describe OfflineTransactionRefund, type: :model do
|
||||||
|
pending "add some examples to (or delete) #{__FILE__}"
|
||||||
|
end
|
Loading…
Reference in a new issue