Skip to content
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(revshare): Add db columns for partners and self_billed invoices #3062

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/models/customer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ def ensure_slug
# Table name: customers
#
# id :uuid not null, primary key
# account_type :enum default("customer"), not null
# address_line1 :string
# address_line2 :string
# city :string
Expand Down Expand Up @@ -278,6 +279,7 @@ def ensure_slug
#
# Indexes
#
# index_customers_on_account_type (account_type)
# index_customers_on_applied_dunning_campaign_id (applied_dunning_campaign_id)
# index_customers_on_deleted_at (deleted_at)
# index_customers_on_external_id_and_organization_id (external_id,organization_id) UNIQUE WHERE (deleted_at IS NULL)
Expand Down
2 changes: 2 additions & 0 deletions app/models/invoice.rb
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ def status_changed_to_finalized?
# progressive_billing_credit_amount_cents :bigint default(0), not null
# ready_for_payment_processing :boolean default(TRUE), not null
# ready_to_be_refreshed :boolean default(FALSE), not null
# self_billed :boolean default(FALSE), not null
# skip_charges :boolean default(FALSE), not null
# status :integer default("finalized"), not null
# sub_total_excluding_taxes_amount_cents :bigint default(0), not null
Expand Down Expand Up @@ -502,6 +503,7 @@ def status_changed_to_finalized?
# index_invoices_on_organization_id (organization_id)
# index_invoices_on_payment_overdue (payment_overdue)
# index_invoices_on_ready_to_be_refreshed (ready_to_be_refreshed) WHERE (ready_to_be_refreshed = true)
# index_invoices_on_self_billed (self_billed)
# index_invoices_on_sequential_id (sequential_id)
# index_invoices_on_status (status)
#
Expand Down
12 changes: 12 additions & 0 deletions db/migrate/20250114163522_add_account_type_to_customers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

class AddAccountTypeToCustomers < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
create_enum :customer_account_type, %w[customer partner]
add_column :customers, :account_type, :enum, enum_type: "customer_account_type", default: "customer", null: false

add_index :customers, :account_type, algorithm: :concurrently
end
end
10 changes: 10 additions & 0 deletions db/migrate/20250114172823_add_self_billed_to_invoices.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# frozen_string_literal: true

class AddSelfBilledToInvoices < ActiveRecord::Migration[7.1]
disable_ddl_transaction!

def change
add_column :invoices, :self_billed, :boolean, default: false, null: false
add_index :invoices, :self_billed, algorithm: :concurrently
end
end
7 changes: 6 additions & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading