-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add payment type and reference #3003
base: main
Are you sure you want to change the base?
Conversation
|
||
safety_assured do | ||
change_table :payments, bulk: true do |t| | ||
t.column :payment_type, :enum, enum_type: 'payment_type', null: true |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will we need index on this column?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good catch I will add it
disable_ddl_transaction! | ||
|
||
def up | ||
add_column :invoices, :total_paid_amount_cents, :bigint, null: true, default: 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will in the future we update the existing paid invoices with real values? 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes I will do a migration to fill the values i was thinking on another pr but can be on this one
Context
This PR lays the groundwork for implementing manual/partial payment functionality in our system. It introduces necessary changes to the payments and invoices tables to enable the tracking and management of these new payment types and statuses.
Description
Migration: Add
payment_type
and reference columns to paymentspayment_type
column as an ENUM with values provider and manual.reference
column to store additional metadata for payments.Migration: Add
total_paid_amount_cents
column to invoicestotal_paid_amount_cents
column to track the cumulative amount paid toward an invoice.