1
0
mirror of https://github.com/LaCasemate/fab-manager.git synced 2025-01-18 07:52:23 +01:00

renamed RepaymentSchedule to PaymentSchedule

This commit is contained in:
Sylvain 2020-10-27 16:02:41 +01:00
parent 0912374719
commit 840be2c6c0
6 changed files with 25 additions and 25 deletions

View File

@ -1,8 +1,8 @@
# frozen_string_literal: true # frozen_string_literal: true
# RepaymentSchedule is a way for members to pay something (especially a Subscription) with multiple payment, # PaymentSchedule is a way for members to pay something (especially a Subscription) with multiple payment,
# staged on a long period rather than with a single payment # staged on a long period rather than with a single payment
class RepaymentSchedule < ApplicationRecord class PaymentSchedule < ApplicationRecord
belongs_to :scheduled, polymorphic: true belongs_to :scheduled, polymorphic: true
belongs_to :wallet_transaction belongs_to :wallet_transaction
belongs_to :coupon belongs_to :coupon

View File

@ -0,0 +1,6 @@
# frozen_string_literal: true
# Represents a due date and the associated amount for a PaymentSchedule
class PaymentScheduleItem < ApplicationRecord
belongs_to :payment_schedule
end

View File

@ -1,6 +0,0 @@
# frozen_string_literal: true
# Represents a due date and the associated amount for a RepaymentSchedule
class RepaymentScheduleItem < ApplicationRecord
belongs_to :repayment_schedule
end

View File

@ -1,10 +1,10 @@
# frozen_string_literal: true # frozen_string_literal: true
# Saves RepaymentSchedules in database. # Saves PaymentSchedules in database.
# It allows to pay with multiple payments # It allows to pay with multiple payments
class CreateRepaymentSchedules < ActiveRecord::Migration[5.2] class CreatePaymentSchedules < ActiveRecord::Migration[5.2]
def change def change
create_table :repayment_schedules do |t| create_table :payment_schedules do |t|
t.references :scheduled, polymorphic: true t.references :scheduled, polymorphic: true
t.integer :total t.integer :total
t.string :stp_subscription_id t.string :stp_subscription_id

View File

@ -0,0 +1,14 @@
# frozen_string_literal: true
# Save each due dates for PaymentSchedules
class CreatePaymentScheduleItems < ActiveRecord::Migration[5.2]
def change
create_table :payment_schedule_items do |t|
t.integer :amount
t.datetime :due_date
t.belongs_to :payment_schedule, foreign_key: true
t.timestamps
end
end
end

View File

@ -1,14 +0,0 @@
# frozen_string_literal: true
# Save each due dates for RepaymentSchedules
class CreateRepaymentScheduleItems < ActiveRecord::Migration[5.2]
def change
create_table :repayment_schedule_items do |t|
t.integer :amount
t.datetime :due_date
t.belongs_to :repayment_schedule, foreign_key: true
t.timestamps
end
end
end