├── .annotaterb.yml
├── .cursor
└── rules
│ ├── rails-general.mdc
│ └── ripper_5_mode.mdc
├── .dockerignore
├── .env.dist
├── .git-blame-ignore-revs
├── .gitattributes
├── .github
├── ISSUE_TEMPLATE
│ ├── bug_report.md
│ ├── config.yml
│ └── feature_request.md
└── workflows
│ ├── internal-build.yml
│ ├── linters.yml
│ ├── migrations-test.yml
│ ├── release.yml
│ └── spec.yml
├── .gitignore
├── .irbrc
├── .rspec
├── .rubocop.yml
├── .ruby-version
├── .tool-versions
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── Dockerfile
├── Dockerfile.dev
├── Gemfile
├── Gemfile.lock
├── Guardfile
├── LICENSE
├── PULL_REQUEST_TEMPLATE.md
├── README.md
├── Rakefile
├── app
├── assets
│ └── config
│ │ └── manifest.js
├── config
│ └── permissions
│ │ ├── definition.yml
│ │ ├── role-finance.yml
│ │ └── role-manager.yml
├── consumers
│ ├── application_consumer.rb
│ └── events_charged_in_advance_consumer.rb
├── contracts
│ └── queries
│ │ ├── billable_metrics_query_filters_contract.rb
│ │ ├── customers_query_filters_contract.rb
│ │ ├── payment_receipts_query_filters_contract.rb
│ │ └── payments_query_filters_contract.rb
├── controllers
│ ├── admin
│ │ ├── base_controller.rb
│ │ ├── invoices_controller.rb
│ │ ├── memberships_controller.rb
│ │ └── organizations_controller.rb
│ ├── api
│ │ ├── base_controller.rb
│ │ └── v1
│ │ │ ├── activity_logs_controller.rb
│ │ │ ├── add_ons_controller.rb
│ │ │ ├── analytics
│ │ │ ├── base_controller.rb
│ │ │ ├── gross_revenues_controller.rb
│ │ │ ├── invoice_collections_controller.rb
│ │ │ ├── invoiced_usages_controller.rb
│ │ │ ├── mrrs_controller.rb
│ │ │ └── overdue_balances_controller.rb
│ │ │ ├── applied_coupons_controller.rb
│ │ │ ├── billable_metrics_controller.rb
│ │ │ ├── billing_entities_controller.rb
│ │ │ ├── coupons_controller.rb
│ │ │ ├── credit_notes_controller.rb
│ │ │ ├── customers
│ │ │ ├── applied_coupons_controller.rb
│ │ │ └── usage_controller.rb
│ │ │ ├── customers_controller.rb
│ │ │ ├── data_api
│ │ │ ├── base_controller.rb
│ │ │ └── usages_controller.rb
│ │ │ ├── events_controller.rb
│ │ │ ├── fees_controller.rb
│ │ │ ├── invoices_controller.rb
│ │ │ ├── lifetime_usages_controller.rb
│ │ │ ├── organizations_controller.rb
│ │ │ ├── payment_receipts_controller.rb
│ │ │ ├── payment_requests_controller.rb
│ │ │ ├── payments_controller.rb
│ │ │ ├── plans_controller.rb
│ │ │ ├── subscriptions
│ │ │ └── alerts_controller.rb
│ │ │ ├── subscriptions_controller.rb
│ │ │ ├── taxes_controller.rb
│ │ │ ├── wallet_transactions_controller.rb
│ │ │ ├── wallets_controller.rb
│ │ │ ├── webhook_endpoints_controller.rb
│ │ │ └── webhooks_controller.rb
│ ├── application_controller.rb
│ ├── concerns
│ │ ├── api_errors.rb
│ │ ├── api_responses.rb
│ │ ├── authenticable_user.rb
│ │ ├── common.rb
│ │ ├── customer_portal_user.rb
│ │ ├── organization_header.rb
│ │ ├── pagination.rb
│ │ └── trackable.rb
│ ├── dev_tools
│ │ ├── invoices_controller.rb
│ │ └── payment_receipts_controller.rb
│ ├── graphql_controller.rb
│ └── webhooks_controller.rb
├── graphql
│ ├── concerns
│ │ ├── authenticable_api_user.rb
│ │ ├── authenticable_customer_portal_user.rb
│ │ ├── can_require_permissions.rb
│ │ ├── execution_error_responder.rb
│ │ └── required_organization.rb
│ ├── extensions
│ │ └── field_authorization_extension.rb
│ ├── lago_api_schema.rb
│ ├── mutations
│ │ ├── add_ons
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── adjusted_fees
│ │ │ ├── create.rb
│ │ │ └── destroy.rb
│ │ ├── api_keys
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ ├── rotate.rb
│ │ │ └── update.rb
│ │ ├── applied_coupons
│ │ │ ├── create.rb
│ │ │ └── terminate.rb
│ │ ├── auth
│ │ │ ├── google
│ │ │ │ ├── accept_invite.rb
│ │ │ │ ├── login_user.rb
│ │ │ │ └── register_user.rb
│ │ │ └── okta
│ │ │ │ ├── accept_invite.rb
│ │ │ │ ├── authorize.rb
│ │ │ │ └── login.rb
│ │ ├── base_mutation.rb
│ │ ├── billable_metrics
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── billing_entities
│ │ │ ├── apply_taxes.rb
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ ├── remove_taxes.rb
│ │ │ ├── update.rb
│ │ │ └── update_applied_dunning_campaign.rb
│ │ ├── coupons
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ ├── terminate.rb
│ │ │ └── update.rb
│ │ ├── credit_notes
│ │ │ ├── create.rb
│ │ │ ├── download.rb
│ │ │ ├── retry_tax_reporting.rb
│ │ │ ├── update.rb
│ │ │ └── void.rb
│ │ ├── customer_portal
│ │ │ ├── download_invoice.rb
│ │ │ ├── generate_url.rb
│ │ │ ├── update_customer.rb
│ │ │ └── wallet_transactions
│ │ │ │ └── create.rb
│ │ ├── customers
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ ├── update.rb
│ │ │ └── update_invoice_grace_period.rb
│ │ ├── data_exports
│ │ │ ├── credit_notes
│ │ │ │ └── create.rb
│ │ │ └── invoices
│ │ │ │ └── create.rb
│ │ ├── dunning_campaigns
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── integration_collection_mappings
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── integration_items
│ │ │ ├── fetch_accounts.rb
│ │ │ └── fetch_items.rb
│ │ ├── integration_mappings
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── integrations
│ │ │ ├── anrok
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── avalara
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── destroy.rb
│ │ │ ├── fetch_draft_invoice_taxes.rb
│ │ │ ├── hubspot
│ │ │ │ ├── create.rb
│ │ │ │ ├── sync_invoice.rb
│ │ │ │ └── update.rb
│ │ │ ├── netsuite
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── okta
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── salesforce
│ │ │ │ ├── create.rb
│ │ │ │ ├── sync_invoice.rb
│ │ │ │ └── update.rb
│ │ │ ├── sync_credit_note.rb
│ │ │ ├── sync_invoice.rb
│ │ │ └── xero
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ ├── invites
│ │ │ ├── accept.rb
│ │ │ ├── create.rb
│ │ │ ├── revoke.rb
│ │ │ └── update.rb
│ │ ├── invoice_custom_sections
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── invoices
│ │ │ ├── create.rb
│ │ │ ├── download.rb
│ │ │ ├── finalize.rb
│ │ │ ├── finalize_all.rb
│ │ │ ├── lose_dispute.rb
│ │ │ ├── refresh.rb
│ │ │ ├── retry.rb
│ │ │ ├── retry_all.rb
│ │ │ ├── retry_all_payments.rb
│ │ │ ├── retry_payment.rb
│ │ │ ├── retry_tax_provider_voiding.rb
│ │ │ ├── update.rb
│ │ │ └── void.rb
│ │ ├── login_user.rb
│ │ ├── memberships
│ │ │ ├── revoke.rb
│ │ │ └── update.rb
│ │ ├── organizations
│ │ │ └── update.rb
│ │ ├── password_resets
│ │ │ ├── create.rb
│ │ │ └── reset.rb
│ │ ├── payment_providers
│ │ │ ├── adyen
│ │ │ │ ├── base.rb
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── cashfree
│ │ │ │ ├── base.rb
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── destroy.rb
│ │ │ ├── gocardless
│ │ │ │ ├── base.rb
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ ├── moneyhash
│ │ │ │ ├── base.rb
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ │ └── stripe
│ │ │ │ ├── base.rb
│ │ │ │ ├── create.rb
│ │ │ │ └── update.rb
│ │ ├── payment_receipts
│ │ │ └── download.rb
│ │ ├── payment_requests
│ │ │ └── create.rb
│ │ ├── payments
│ │ │ └── create.rb
│ │ ├── plans
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── register_user.rb
│ │ ├── subscriptions
│ │ │ ├── create.rb
│ │ │ ├── terminate.rb
│ │ │ └── update.rb
│ │ ├── taxes
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ ├── usage_monitoring
│ │ │ └── alerts
│ │ │ │ ├── create.rb
│ │ │ │ ├── destroy.rb
│ │ │ │ └── update.rb
│ │ ├── wallet_transactions
│ │ │ └── create.rb
│ │ ├── wallets
│ │ │ ├── create.rb
│ │ │ ├── terminate.rb
│ │ │ └── update.rb
│ │ ├── webhook_endpoints
│ │ │ ├── create.rb
│ │ │ ├── destroy.rb
│ │ │ └── update.rb
│ │ └── webhooks
│ │ │ └── retry.rb
│ ├── resolvers
│ │ ├── activity_log_resolver.rb
│ │ ├── activity_logs_resolver.rb
│ │ ├── add_on_resolver.rb
│ │ ├── add_ons_resolver.rb
│ │ ├── analytics
│ │ │ ├── gross_revenues_resolver.rb
│ │ │ ├── invoice_collections_resolver.rb
│ │ │ ├── invoiced_usages_resolver.rb
│ │ │ ├── mrrs_resolver.rb
│ │ │ └── overdue_balances_resolver.rb
│ │ ├── api_key_resolver.rb
│ │ ├── api_keys_resolver.rb
│ │ ├── auth
│ │ │ └── google
│ │ │ │ └── auth_url_resolver.rb
│ │ ├── base_resolver.rb
│ │ ├── billable_metric_resolver.rb
│ │ ├── billable_metrics_resolver.rb
│ │ ├── billing_entities_resolver.rb
│ │ ├── billing_entity_resolver.rb
│ │ ├── billing_entity_taxes_resolver.rb
│ │ ├── coupon_resolver.rb
│ │ ├── coupons_resolver.rb
│ │ ├── credit_note_resolver.rb
│ │ ├── credit_notes
│ │ │ └── estimate_resolver.rb
│ │ ├── credit_notes_resolver.rb
│ │ ├── current_user_resolver.rb
│ │ ├── customer_portal
│ │ │ ├── analytics
│ │ │ │ ├── invoice_collections_resolver.rb
│ │ │ │ └── overdue_balances_resolver.rb
│ │ │ ├── customer_resolver.rb
│ │ │ ├── customers
│ │ │ │ └── usage_resolver.rb
│ │ │ ├── invoices_resolver.rb
│ │ │ ├── organization_resolver.rb
│ │ │ ├── subscription_resolver.rb
│ │ │ ├── subscriptions_resolver.rb
│ │ │ └── wallets_resolver.rb
│ │ ├── customer_resolver.rb
│ │ ├── customers
│ │ │ ├── invoices_resolver.rb
│ │ │ ├── subscriptions_resolver.rb
│ │ │ └── usage_resolver.rb
│ │ ├── customers_resolver.rb
│ │ ├── data_api
│ │ │ ├── mrrs
│ │ │ │ └── plans_resolver.rb
│ │ │ ├── mrrs_resolver.rb
│ │ │ ├── prepaid_credits_resolver.rb
│ │ │ ├── revenue_streams
│ │ │ │ ├── customers_resolver.rb
│ │ │ │ └── plans_resolver.rb
│ │ │ ├── revenue_streams_resolver.rb
│ │ │ ├── usages
│ │ │ │ ├── aggregated_amounts_resolver.rb
│ │ │ │ └── invoiced_resolver.rb
│ │ │ └── usages_resolver.rb
│ │ ├── dunning_campaign_resolver.rb
│ │ ├── dunning_campaigns_resolver.rb
│ │ ├── event_resolver.rb
│ │ ├── events_resolver.rb
│ │ ├── integration_collection_mapping_resolver.rb
│ │ ├── integration_collection_mappings_resolver.rb
│ │ ├── integration_items_resolver.rb
│ │ ├── integration_mapping_resolver.rb
│ │ ├── integration_mappings_resolver.rb
│ │ ├── integration_resolver.rb
│ │ ├── integrations
│ │ │ └── subsidiaries_resolver.rb
│ │ ├── integrations_resolver.rb
│ │ ├── invite_resolver.rb
│ │ ├── invites_resolver.rb
│ │ ├── invoice_credit_notes_resolver.rb
│ │ ├── invoice_custom_section_resolver.rb
│ │ ├── invoice_custom_sections_resolver.rb
│ │ ├── invoice_resolver.rb
│ │ ├── invoices_resolver.rb
│ │ ├── memberships_resolver.rb
│ │ ├── organization_resolver.rb
│ │ ├── password_reset_resolver.rb
│ │ ├── payment_provider_resolver.rb
│ │ ├── payment_providers_resolver.rb
│ │ ├── payment_requests_resolver.rb
│ │ ├── payment_resolver.rb
│ │ ├── payments_resolver.rb
│ │ ├── plan_resolver.rb
│ │ ├── plans_resolver.rb
│ │ ├── subscription_resolver.rb
│ │ ├── subscriptions_resolver.rb
│ │ ├── tax_resolver.rb
│ │ ├── taxes_resolver.rb
│ │ ├── usage_monitoring
│ │ │ ├── alert_resolver.rb
│ │ │ └── subscription_alerts_resolver.rb
│ │ ├── version_resolver.rb
│ │ ├── wallet_resolver.rb
│ │ ├── wallet_transaction_resolver.rb
│ │ ├── wallet_transactions_resolver.rb
│ │ ├── wallets_resolver.rb
│ │ ├── webhook_endpoint_resolver.rb
│ │ ├── webhook_endpoints_resolver.rb
│ │ ├── webhook_resolver.rb
│ │ └── webhooks_resolver.rb
│ └── types
│ │ ├── activity_logs
│ │ ├── activity_source_enum.rb
│ │ ├── activity_type_enum.rb
│ │ ├── object.rb
│ │ ├── resource_object.rb
│ │ └── resource_type_enum.rb
│ │ ├── add_ons
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── adjusted_fees
│ │ ├── adjusted_fee_type_enum.rb
│ │ └── create_input.rb
│ │ ├── analytics
│ │ ├── gross_revenues
│ │ │ └── object.rb
│ │ ├── invoice_collections
│ │ │ └── object.rb
│ │ ├── invoiced_usages
│ │ │ └── object.rb
│ │ ├── mrrs
│ │ │ └── object.rb
│ │ └── overdue_balances
│ │ │ └── object.rb
│ │ ├── api_keys
│ │ ├── object.rb
│ │ ├── rotate_input.rb
│ │ ├── sanitized_object.rb
│ │ └── update_input.rb
│ │ ├── applied_add_ons
│ │ └── object.rb
│ │ ├── applied_coupons
│ │ └── object.rb
│ │ ├── auth
│ │ ├── google
│ │ │ └── auth_url.rb
│ │ └── okta
│ │ │ ├── accept_invite_input.rb
│ │ │ └── authorize.rb
│ │ ├── base_argument.rb
│ │ ├── base_connection.rb
│ │ ├── base_edge.rb
│ │ ├── base_enum.rb
│ │ ├── base_field.rb
│ │ ├── base_input_object.rb
│ │ ├── base_interface.rb
│ │ ├── base_object.rb
│ │ ├── base_scalar.rb
│ │ ├── base_union.rb
│ │ ├── billable_metric_filters
│ │ ├── input.rb
│ │ └── object.rb
│ │ ├── billable_metrics
│ │ ├── aggregation_type_enum.rb
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ ├── rounding_function_enum.rb
│ │ ├── update_input.rb
│ │ └── weighted_interval_enum.rb
│ │ ├── billing_entities
│ │ ├── billing_configuration.rb
│ │ ├── billing_configuration_input.rb
│ │ ├── create_input.rb
│ │ ├── document_numbering_enum.rb
│ │ ├── email_settings_enum.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── charge_filters
│ │ ├── input.rb
│ │ ├── object.rb
│ │ └── values.rb
│ │ ├── charges
│ │ ├── charge_model_enum.rb
│ │ ├── graduated_percentage_range.rb
│ │ ├── graduated_percentage_range_input.rb
│ │ ├── graduated_range.rb
│ │ ├── graduated_range_input.rb
│ │ ├── input.rb
│ │ ├── object.rb
│ │ ├── properties.rb
│ │ ├── properties_input.rb
│ │ ├── regroup_paid_fees_enum.rb
│ │ ├── volume_range.rb
│ │ └── volume_range_input.rb
│ │ ├── commitments
│ │ ├── commitment_type_enum.rb
│ │ ├── input.rb
│ │ └── object.rb
│ │ ├── country_code_enum.rb
│ │ ├── coupons
│ │ ├── coupon_type_enum.rb
│ │ ├── create_input.rb
│ │ ├── expiration_enum.rb
│ │ ├── frequency_enum.rb
│ │ ├── limitation_input.rb
│ │ ├── object.rb
│ │ ├── status_enum.rb
│ │ └── update_input.rb
│ │ ├── credit_note_items
│ │ ├── estimate.rb
│ │ ├── input.rb
│ │ └── object.rb
│ │ ├── credit_notes
│ │ ├── applied_taxes
│ │ │ └── object.rb
│ │ ├── credit_status_type_enum.rb
│ │ ├── estimate.rb
│ │ ├── object.rb
│ │ ├── reason_type_enum.rb
│ │ └── refund_status_type_enum.rb
│ │ ├── currency_enum.rb
│ │ ├── customer_portal
│ │ ├── customers
│ │ │ ├── object.rb
│ │ │ └── update_input.rb
│ │ ├── organizations
│ │ │ └── object.rb
│ │ ├── wallet_transactions
│ │ │ └── object.rb
│ │ └── wallets
│ │ │ └── object.rb
│ │ ├── customers
│ │ ├── account_type_enum.rb
│ │ ├── address.rb
│ │ ├── address_input.rb
│ │ ├── billing_configuration.rb
│ │ ├── billing_configuration_input.rb
│ │ ├── create_customer_input.rb
│ │ ├── customer_type_enum.rb
│ │ ├── finalize_zero_amount_invoice_enum.rb
│ │ ├── metadata
│ │ │ ├── input.rb
│ │ │ └── object.rb
│ │ ├── object.rb
│ │ ├── update_customer_input.rb
│ │ └── usage
│ │ │ ├── charge.rb
│ │ │ ├── charge_filter.rb
│ │ │ ├── current.rb
│ │ │ └── grouped_usage.rb
│ │ ├── data_api
│ │ ├── metadata.rb
│ │ ├── mrrs
│ │ │ ├── object.rb
│ │ │ └── plans
│ │ │ │ ├── collection.rb
│ │ │ │ └── object.rb
│ │ ├── prepaid_credits
│ │ │ └── object.rb
│ │ ├── revenue_streams
│ │ │ ├── customers
│ │ │ │ ├── collection.rb
│ │ │ │ └── object.rb
│ │ │ ├── object.rb
│ │ │ ├── order_by_enum.rb
│ │ │ └── plans
│ │ │ │ ├── collection.rb
│ │ │ │ └── object.rb
│ │ ├── time_granularity_enum.rb
│ │ └── usages
│ │ │ ├── aggregated_amounts
│ │ │ └── object.rb
│ │ │ ├── invoiced
│ │ │ └── object.rb
│ │ │ └── object.rb
│ │ ├── data_exports
│ │ ├── credit_notes
│ │ │ ├── create_input.rb
│ │ │ ├── export_type_enum.rb
│ │ │ └── filters_input.rb
│ │ ├── format_type_enum.rb
│ │ ├── invoices
│ │ │ ├── create_input.rb
│ │ │ ├── export_type_enum.rb
│ │ │ └── filters_input.rb
│ │ ├── object.rb
│ │ └── status_enum.rb
│ │ ├── dunning_campaign_thresholds
│ │ ├── input.rb
│ │ └── object.rb
│ │ ├── dunning_campaigns
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── error_details
│ │ ├── error_codes_enum.rb
│ │ └── object.rb
│ │ ├── events
│ │ └── object.rb
│ │ ├── fees
│ │ ├── amount_details
│ │ │ ├── graduated_percentage_range.rb
│ │ │ ├── graduated_range.rb
│ │ │ └── object.rb
│ │ ├── applied_taxes
│ │ │ └── object.rb
│ │ ├── object.rb
│ │ └── types_enum.rb
│ │ ├── integration_collection_mappings
│ │ ├── create_input.rb
│ │ ├── mapping_type_enum.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── integration_customers
│ │ ├── anrok.rb
│ │ ├── avalara.rb
│ │ ├── hubspot.rb
│ │ ├── input.rb
│ │ ├── netsuite.rb
│ │ ├── salesforce.rb
│ │ └── xero.rb
│ │ ├── integration_items
│ │ ├── item_type_enum.rb
│ │ └── object.rb
│ │ ├── integration_mappings
│ │ ├── create_input.rb
│ │ ├── mappable_type_enum.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── integrations
│ │ ├── accounts
│ │ │ └── object.rb
│ │ ├── anrok.rb
│ │ ├── anrok
│ │ │ ├── create_input.rb
│ │ │ └── update_input.rb
│ │ ├── avalara.rb
│ │ ├── avalara
│ │ │ ├── create_input.rb
│ │ │ └── update_input.rb
│ │ ├── hubspot.rb
│ │ ├── hubspot
│ │ │ ├── create_input.rb
│ │ │ ├── targeted_objects_enum.rb
│ │ │ └── update_input.rb
│ │ ├── integration_type_enum.rb
│ │ ├── netsuite.rb
│ │ ├── netsuite
│ │ │ ├── create_input.rb
│ │ │ └── update_input.rb
│ │ ├── object.rb
│ │ ├── okta.rb
│ │ ├── okta
│ │ │ ├── create_input.rb
│ │ │ └── update_input.rb
│ │ ├── premium_integration_type_enum.rb
│ │ ├── salesforce.rb
│ │ ├── salesforce
│ │ │ ├── create_input.rb
│ │ │ ├── sync_invoice_input.rb
│ │ │ └── update_input.rb
│ │ ├── subsidiaries
│ │ │ └── object.rb
│ │ ├── sync_credit_note_input.rb
│ │ ├── sync_hubspot_invoice_input.rb
│ │ ├── sync_invoice_input.rb
│ │ ├── tax_objects
│ │ │ ├── breakdown_object.rb
│ │ │ └── fee_object.rb
│ │ ├── xero.rb
│ │ └── xero
│ │ │ ├── create_input.rb
│ │ │ └── update_input.rb
│ │ ├── invites
│ │ ├── object.rb
│ │ └── status_type_enum.rb
│ │ ├── invoice_custom_sections
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── invoice_subscriptions
│ │ └── object.rb
│ │ ├── invoices
│ │ ├── applied_taxes
│ │ │ ├── object.rb
│ │ │ └── whole_invoice_applicable_tax_code_enum.rb
│ │ ├── create_invoice_input.rb
│ │ ├── fee_input.rb
│ │ ├── invoice_item.rb
│ │ ├── invoice_type_enum.rb
│ │ ├── metadata
│ │ │ ├── input.rb
│ │ │ └── object.rb
│ │ ├── object.rb
│ │ ├── payment_status_type_enum.rb
│ │ ├── status_type_enum.rb
│ │ ├── tax_status_type_enum.rb
│ │ └── update_invoice_input.rb
│ │ ├── membership_type.rb
│ │ ├── memberships
│ │ ├── metadata.rb
│ │ ├── role_enum.rb
│ │ └── status_enum.rb
│ │ ├── mutation_type.rb
│ │ ├── node_type.rb
│ │ ├── obfuscated_string_type.rb
│ │ ├── organizations
│ │ ├── base_organization_type.rb
│ │ ├── billing_configuration.rb
│ │ ├── billing_configuration_input.rb
│ │ ├── current_organization_type.rb
│ │ ├── document_numbering_enum.rb
│ │ ├── email_settings_enum.rb
│ │ ├── organization_type.rb
│ │ └── update_organization_input.rb
│ │ ├── payables
│ │ └── object.rb
│ │ ├── payloads
│ │ ├── login_user_type.rb
│ │ └── register_user_type.rb
│ │ ├── payment_provider_customers
│ │ ├── provider.rb
│ │ ├── provider_input.rb
│ │ └── provider_payment_methods_enum.rb
│ │ ├── payment_providers
│ │ ├── adyen.rb
│ │ ├── adyen_input.rb
│ │ ├── cashfree.rb
│ │ ├── cashfree_input.rb
│ │ ├── gocardless.rb
│ │ ├── gocardless_input.rb
│ │ ├── moneyhash.rb
│ │ ├── moneyhash_input.rb
│ │ ├── object.rb
│ │ ├── provider_type_enum.rb
│ │ ├── stripe.rb
│ │ ├── stripe_input.rb
│ │ └── update_input.rb
│ │ ├── payment_receipts
│ │ └── object.rb
│ │ ├── payment_requests
│ │ ├── create_input.rb
│ │ └── object.rb
│ │ ├── payments
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ ├── payable_payment_status_enum.rb
│ │ └── payment_type_enum.rb
│ │ ├── permissions_type.rb
│ │ ├── plans
│ │ ├── create_input.rb
│ │ ├── interval_enum.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── query_type.rb
│ │ ├── reset_passwords
│ │ └── object.rb
│ │ ├── subscriptions
│ │ ├── billing_time_enum.rb
│ │ ├── charge_overrides_input.rb
│ │ ├── create_subscription_input.rb
│ │ ├── lifetime_usage_object.rb
│ │ ├── next_subscription_type_enum.rb
│ │ ├── object.rb
│ │ ├── plan_overrides_input.rb
│ │ ├── status_type_enum.rb
│ │ ├── update_subscription_input.rb
│ │ └── usage_threshold_overrides_input.rb
│ │ ├── taxes
│ │ ├── applied_tax.rb
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ └── update_input.rb
│ │ ├── timezone_enum.rb
│ │ ├── usage_monitoring
│ │ └── alerts
│ │ │ ├── alert_type_enum.rb
│ │ │ ├── create_input.rb
│ │ │ ├── object.rb
│ │ │ ├── threshold_input.rb
│ │ │ ├── threshold_object.rb
│ │ │ └── update_input.rb
│ │ ├── usage_thresholds
│ │ ├── input.rb
│ │ └── object.rb
│ │ ├── user_type.rb
│ │ ├── utils
│ │ └── current_version.rb
│ │ ├── wallet_transactions
│ │ ├── metadata_input.rb
│ │ ├── metadata_object.rb
│ │ ├── object.rb
│ │ ├── status_enum.rb
│ │ ├── transaction_status_enum.rb
│ │ └── transaction_type_enum.rb
│ │ ├── wallets
│ │ ├── applies_to.rb
│ │ ├── applies_to_input.rb
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ ├── recurring_transaction_rules
│ │ │ ├── create_input.rb
│ │ │ ├── interval_enum.rb
│ │ │ ├── method_enum.rb
│ │ │ ├── object.rb
│ │ │ ├── transaction_metadata_input.rb
│ │ │ ├── transaction_metadata_object.rb
│ │ │ ├── trigger_enum.rb
│ │ │ └── update_input.rb
│ │ ├── status_enum.rb
│ │ └── update_input.rb
│ │ ├── webhook_endpoints
│ │ ├── create_input.rb
│ │ ├── object.rb
│ │ ├── signature_algo_enum.rb
│ │ └── update_input.rb
│ │ └── webhooks
│ │ ├── object.rb
│ │ └── status_enum.rb
├── jobs
│ ├── application_job.rb
│ ├── bill_add_on_job.rb
│ ├── bill_non_invoiceable_fees_job.rb
│ ├── bill_paid_credit_job.rb
│ ├── bill_subscription_job.rb
│ ├── billable_metric_filters
│ │ └── destroy_all_job.rb
│ ├── billable_metrics
│ │ └── delete_events_job.rb
│ ├── charges
│ │ ├── create_children_job.rb
│ │ ├── destroy_children_job.rb
│ │ └── update_children_job.rb
│ ├── clock
│ │ ├── activate_subscriptions_job.rb
│ │ ├── api_keys
│ │ │ └── track_usage_job.rb
│ │ ├── compute_all_daily_usages_job.rb
│ │ ├── consume_subscription_refreshed_queue_job.rb
│ │ ├── create_interval_wallet_transactions_job.rb
│ │ ├── events_validation_job.rb
│ │ ├── finalize_invoices_job.rb
│ │ ├── free_trial_subscriptions_biller_job.rb
│ │ ├── inbound_webhooks_cleanup_job.rb
│ │ ├── inbound_webhooks_retry_job.rb
│ │ ├── mark_invoices_as_payment_overdue_job.rb
│ │ ├── process_all_subscription_activities_job.rb
│ │ ├── process_dunning_campaigns_job.rb
│ │ ├── refresh_draft_invoices_job.rb
│ │ ├── refresh_lifetime_usages_job.rb
│ │ ├── refresh_wallets_ongoing_balance_job.rb
│ │ ├── retry_failed_invoices_job.rb
│ │ ├── retry_generating_subscription_invoices_job.rb
│ │ ├── subscriptions_biller_job.rb
│ │ ├── subscriptions_to_be_terminated_job.rb
│ │ ├── terminate_coupons_job.rb
│ │ ├── terminate_ended_subscriptions_job.rb
│ │ ├── terminate_recurring_transaction_rules_job.rb
│ │ ├── terminate_wallets_job.rb
│ │ └── webhooks_cleanup_job.rb
│ ├── clock_job.rb
│ ├── concerns
│ │ ├── concurrency_throttlable.rb
│ │ └── sentry_cron_concern.rb
│ ├── credit_notes
│ │ ├── generate_pdf_job.rb
│ │ ├── provider_taxes
│ │ │ └── report_job.rb
│ │ └── refunds
│ │ │ ├── adyen_create_job.rb
│ │ │ ├── gocardless_create_job.rb
│ │ │ └── stripe_create_job.rb
│ ├── customers
│ │ ├── retry_vies_check_job.rb
│ │ └── terminate_relations_job.rb
│ ├── daily_usages
│ │ ├── compute_job.rb
│ │ ├── fill_from_invoice_job.rb
│ │ └── fill_history_job.rb
│ ├── data_exports
│ │ ├── combine_parts_job.rb
│ │ ├── export_resources_job.rb
│ │ └── process_part_job.rb
│ ├── database_migrations
│ │ ├── fix_invoices_organization_sequential_id_job.rb
│ │ ├── populate_add_ons_taxes_with_organization_job.rb
│ │ ├── populate_adjusted_fees_with_organization_job.rb
│ │ ├── populate_applied_coupons_with_organization_job.rb
│ │ ├── populate_applied_invoice_custom_sections_with_organization_job.rb
│ │ ├── populate_applied_usage_thresholds_with_organization_job.rb
│ │ ├── populate_billable_metric_filters_with_organization_job.rb
│ │ ├── populate_billing_entities_taxes_with_organization_job.rb
│ │ ├── populate_charge_filter_values_with_organization_job.rb
│ │ ├── populate_charge_filters_with_organization_job.rb
│ │ ├── populate_charges_taxes_with_organization_job.rb
│ │ ├── populate_charges_with_organization_job.rb
│ │ ├── populate_commitments_taxes_with_organization_job.rb
│ │ ├── populate_commitments_with_organization_job.rb
│ │ ├── populate_coupon_targets_with_organization_job.rb
│ │ ├── populate_credit_note_items_with_organization_job.rb
│ │ ├── populate_credit_notes_taxes_with_organization_job.rb
│ │ ├── populate_credit_notes_with_organization_job.rb
│ │ ├── populate_credits_with_organization_job.rb
│ │ ├── populate_customer_metadata_with_organization_job.rb
│ │ ├── populate_customers_taxes_with_organization_job.rb
│ │ ├── populate_data_export_parts_with_organization_job.rb
│ │ ├── populate_dunning_campaign_thresholds_with_organization_job.rb
│ │ ├── populate_fees_taxes_with_organization_job.rb
│ │ ├── populate_fees_with_billing_entity_id_job.rb
│ │ ├── populate_fees_with_organization_from_invoice_job.rb
│ │ ├── populate_fees_with_organization_from_subscription_job.rb
│ │ ├── populate_idempotency_records_with_organization_job.rb
│ │ ├── populate_integration_collection_mappings_with_organization_job.rb
│ │ ├── populate_integration_customers_with_organization_job.rb
│ │ ├── populate_integration_items_with_organization_job.rb
│ │ ├── populate_integration_mappings_with_organization_job.rb
│ │ ├── populate_integration_resources_with_organization_job.rb
│ │ ├── populate_invoice_metadata_with_organization_job.rb
│ │ ├── populate_invoice_subscriptions_with_organization_job.rb
│ │ ├── populate_invoices_billing_entity_sequential_id_job.rb
│ │ ├── populate_invoices_payment_requests_with_organization_job.rb
│ │ ├── populate_invoices_taxes_with_organization_job.rb
│ │ ├── populate_payment_provider_customers_with_organization_job.rb
│ │ ├── populate_payments_with_organization_from_invoice_job.rb
│ │ ├── populate_payments_with_organization_from_payment_request_job.rb
│ │ ├── populate_plans_taxes_with_organization_job.rb
│ │ ├── populate_recurring_transaction_rules_with_organization_job.rb
│ │ ├── populate_refunds_with_organization_job.rb
│ │ ├── populate_subscriptions_with_organization_job.rb
│ │ ├── populate_usage_thresholds_with_organization_job.rb
│ │ ├── populate_wallet_transactions_with_organization_job.rb
│ │ ├── populate_wallets_with_organization_job.rb
│ │ └── populate_webhooks_with_organization_job.rb
│ ├── dunning_campaigns
│ │ ├── bulk_process_job.rb
│ │ └── process_attempt_job.rb
│ ├── events
│ │ ├── create_batch_job.rb
│ │ ├── pay_in_advance_job.rb
│ │ ├── pay_in_advance_kafka_job.rb
│ │ ├── post_process_job.rb
│ │ └── post_validation_job.rb
│ ├── fees
│ │ └── create_pay_in_advance_job.rb
│ ├── inbound_webhooks
│ │ └── process_job.rb
│ ├── integration_customers
│ │ ├── create_job.rb
│ │ └── update_job.rb
│ ├── integrations
│ │ ├── aggregator
│ │ │ ├── credit_notes
│ │ │ │ └── create_job.rb
│ │ │ ├── fetch_items_job.rb
│ │ │ ├── invoices
│ │ │ │ ├── create_job.rb
│ │ │ │ └── hubspot
│ │ │ │ │ ├── create_customer_association_job.rb
│ │ │ │ │ ├── create_job.rb
│ │ │ │ │ └── update_job.rb
│ │ │ ├── payments
│ │ │ │ └── create_job.rb
│ │ │ ├── perform_sync_job.rb
│ │ │ ├── send_restlet_endpoint_job.rb
│ │ │ ├── subscriptions
│ │ │ │ └── hubspot
│ │ │ │ │ ├── create_customer_association_job.rb
│ │ │ │ │ ├── create_job.rb
│ │ │ │ │ └── update_job.rb
│ │ │ └── sync_custom_objects_and_properties_job.rb
│ │ ├── avalara
│ │ │ └── fetch_company_id_job.rb
│ │ └── hubspot
│ │ │ ├── companies
│ │ │ └── deploy_properties_job.rb
│ │ │ ├── contacts
│ │ │ └── deploy_properties_job.rb
│ │ │ ├── invoices
│ │ │ └── deploy_object_job.rb
│ │ │ ├── save_portal_id_job.rb
│ │ │ └── subscriptions
│ │ │ └── deploy_object_job.rb
│ ├── invoices
│ │ ├── create_pay_in_advance_charge_job.rb
│ │ ├── finalize_all_job.rb
│ │ ├── finalize_job.rb
│ │ ├── generate_pdf_and_notify_job.rb
│ │ ├── generate_pdf_job.rb
│ │ ├── payments
│ │ │ ├── adyen_create_job.rb
│ │ │ ├── create_job.rb
│ │ │ ├── gocardless_create_job.rb
│ │ │ ├── moneyhash_create_job.rb
│ │ │ ├── retry_all_job.rb
│ │ │ └── stripe_create_job.rb
│ │ ├── prepaid_credit_job.rb
│ │ ├── provider_taxes
│ │ │ ├── pull_taxes_and_apply_job.rb
│ │ │ └── void_job.rb
│ │ ├── refresh_draft_job.rb
│ │ ├── retry_all_job.rb
│ │ ├── update_all_invoice_grace_period_from_billing_entity_job.rb
│ │ ├── update_fees_payment_status_job.rb
│ │ └── update_grace_period_from_billing_entity_job.rb
│ ├── lifetime_usages
│ │ ├── flag_refresh_from_plan_update_job.rb
│ │ └── recalculate_and_check_job.rb
│ ├── payment_provider_customers
│ │ ├── adyen_checkout_url_job.rb
│ │ ├── adyen_create_job.rb
│ │ ├── gocardless_checkout_url_job.rb
│ │ ├── gocardless_create_job.rb
│ │ ├── moneyhash_checkout_url_job.rb
│ │ ├── moneyhash_create_job.rb
│ │ ├── stripe_checkout_url_job.rb
│ │ ├── stripe_create_job.rb
│ │ └── stripe_sync_funding_instructions_job.rb
│ ├── payment_providers
│ │ ├── adyen
│ │ │ └── handle_event_job.rb
│ │ ├── cancel_payment_authorization_job.rb
│ │ ├── cashfree
│ │ │ └── handle_event_job.rb
│ │ ├── gocardless
│ │ │ └── handle_event_job.rb
│ │ ├── moneyhash
│ │ │ └── handle_event_job.rb
│ │ └── stripe
│ │ │ ├── handle_event_job.rb
│ │ │ ├── refresh_webhook_job.rb
│ │ │ └── register_webhook_job.rb
│ ├── payment_receipts
│ │ ├── create_job.rb
│ │ ├── generate_pdf_and_notify_job.rb
│ │ └── generate_pdf_job.rb
│ ├── payment_requests
│ │ └── payments
│ │ │ ├── adyen_create_job.rb
│ │ │ ├── create_job.rb
│ │ │ ├── gocardless_create_job.rb
│ │ │ ├── moneyhash_create_job.rb
│ │ │ └── stripe_create_job.rb
│ ├── payments
│ │ ├── manual_create_job.rb
│ │ └── set_payment_method_and_create_receipt_job.rb
│ ├── plans
│ │ ├── destroy_job.rb
│ │ └── update_amount_job.rb
│ ├── segment_identify_job.rb
│ ├── segment_track_job.rb
│ ├── send_email_job.rb
│ ├── send_http_webhook_job.rb
│ ├── send_webhook_job.rb
│ ├── subscriptions
│ │ ├── flag_refreshed_job.rb
│ │ ├── organization_billing_job.rb
│ │ └── terminate_job.rb
│ ├── taxes
│ │ ├── update_all_eu_taxes_job.rb
│ │ └── update_organization_eu_taxes_job.rb
│ ├── usage_monitoring
│ │ ├── process_organization_subscription_activities_job.rb
│ │ └── process_subscription_activity_job.rb
│ ├── wallet_transactions
│ │ └── create_job.rb
│ └── wallets
│ │ └── refresh_ongoing_balance_job.rb
├── legacy_inputs
│ └── base_legacy_input.rb
├── mailers
│ ├── api_key_mailer.rb
│ ├── application_mailer.rb
│ ├── credit_note_mailer.rb
│ ├── data_export_mailer.rb
│ ├── invoice_mailer.rb
│ ├── password_reset_mailer.rb
│ ├── payment_receipt_mailer.rb
│ ├── payment_request_mailer.rb
│ └── webhook_mailer.rb
├── models
│ ├── add_on.rb
│ ├── add_on
│ │ └── applied_tax.rb
│ ├── adjusted_fee.rb
│ ├── analytics
│ │ ├── base.rb
│ │ ├── gross_revenue.rb
│ │ ├── invoice_collection.rb
│ │ ├── invoiced_usage.rb
│ │ ├── mrr.rb
│ │ └── overdue_balance.rb
│ ├── api_key.rb
│ ├── application_record.rb
│ ├── applied_add_on.rb
│ ├── applied_coupon.rb
│ ├── applied_invoice_custom_section.rb
│ ├── applied_pricing_unit.rb
│ ├── applied_usage_threshold.rb
│ ├── billable_metric.rb
│ ├── billable_metric_filter.rb
│ ├── billing_entity.rb
│ ├── billing_entity
│ │ ├── applied_invoice_custom_section.rb
│ │ └── applied_tax.rb
│ ├── cached_aggregation.rb
│ ├── charge.rb
│ ├── charge
│ │ └── applied_tax.rb
│ ├── charge_filter.rb
│ ├── charge_filter_value.rb
│ ├── clickhouse
│ │ ├── activity_log.rb
│ │ ├── base_record.rb
│ │ ├── events_enriched.rb
│ │ └── events_raw.rb
│ ├── commitment.rb
│ ├── commitment
│ │ └── applied_tax.rb
│ ├── concerns
│ │ ├── billing_entity_timezone.rb
│ │ ├── charge_properties_validation.rb
│ │ ├── currencies.rb
│ │ ├── customer_timezone.rb
│ │ ├── integration_mappable.rb
│ │ ├── organization_timezone.rb
│ │ ├── paper_trail_traceable.rb
│ │ ├── ransack_uuid_search.rb
│ │ ├── secrets_storable.rb
│ │ ├── sequenced.rb
│ │ └── settings_storable.rb
│ ├── coupon.rb
│ ├── coupon_target.rb
│ ├── credit.rb
│ ├── credit_note.rb
│ ├── credit_note
│ │ └── applied_tax.rb
│ ├── credit_note_item.rb
│ ├── customer.rb
│ ├── customer
│ │ ├── applied_invoice_custom_section.rb
│ │ └── applied_tax.rb
│ ├── daily_usage.rb
│ ├── data_export.rb
│ ├── data_export_part.rb
│ ├── deprecation.rb
│ ├── dunning_campaign.rb
│ ├── dunning_campaign_threshold.rb
│ ├── error_detail.rb
│ ├── event.rb
│ ├── events
│ │ ├── common.rb
│ │ └── last_hour_mv.rb
│ ├── events_record.rb
│ ├── fee.rb
│ ├── fee
│ │ └── applied_tax.rb
│ ├── group.rb
│ ├── group_property.rb
│ ├── idempotency_record.rb
│ ├── inbound_webhook.rb
│ ├── integration_collection_mappings
│ │ ├── anrok_collection_mapping.rb
│ │ ├── avalara_collection_mapping.rb
│ │ ├── base_collection_mapping.rb
│ │ ├── netsuite_collection_mapping.rb
│ │ └── xero_collection_mapping.rb
│ ├── integration_customers
│ │ ├── anrok_customer.rb
│ │ ├── avalara_customer.rb
│ │ ├── base_customer.rb
│ │ ├── hubspot_customer.rb
│ │ ├── netsuite_customer.rb
│ │ ├── salesforce_customer.rb
│ │ └── xero_customer.rb
│ ├── integration_item.rb
│ ├── integration_mappings
│ │ ├── anrok_mapping.rb
│ │ ├── avalara_mapping.rb
│ │ ├── base_mapping.rb
│ │ ├── netsuite_mapping.rb
│ │ └── xero_mapping.rb
│ ├── integration_resource.rb
│ ├── integrations
│ │ ├── anrok_integration.rb
│ │ ├── avalara_integration.rb
│ │ ├── base_integration.rb
│ │ ├── hubspot_integration.rb
│ │ ├── netsuite_integration.rb
│ │ ├── okta_integration.rb
│ │ ├── salesforce_integration.rb
│ │ └── xero_integration.rb
│ ├── invite.rb
│ ├── invoice.rb
│ ├── invoice
│ │ └── applied_tax.rb
│ ├── invoice_custom_section.rb
│ ├── invoice_custom_section_selection.rb
│ ├── invoice_subscription.rb
│ ├── lifetime_usage.rb
│ ├── membership.rb
│ ├── metadata
│ │ ├── customer_metadata.rb
│ │ └── invoice_metadata.rb
│ ├── organization.rb
│ ├── password_reset.rb
│ ├── payment.rb
│ ├── payment_intent.rb
│ ├── payment_provider_customers
│ │ ├── adyen_customer.rb
│ │ ├── base_customer.rb
│ │ ├── cashfree_customer.rb
│ │ ├── gocardless_customer.rb
│ │ ├── moneyhash_customer.rb
│ │ └── stripe_customer.rb
│ ├── payment_providers
│ │ ├── adyen_provider.rb
│ │ ├── base_provider.rb
│ │ ├── cashfree_provider.rb
│ │ ├── gocardless_provider.rb
│ │ ├── moneyhash_provider.rb
│ │ └── stripe_provider.rb
│ ├── payment_receipt.rb
│ ├── payment_request.rb
│ ├── payment_request
│ │ └── applied_invoice.rb
│ ├── permission.rb
│ ├── plan.rb
│ ├── plan
│ │ └── applied_tax.rb
│ ├── pricing_unit.rb
│ ├── quantified_event.rb
│ ├── recurring_transaction_rule.rb
│ ├── refund.rb
│ ├── subscription.rb
│ ├── subscription_usage.rb
│ ├── tax.rb
│ ├── usage_monitoring.rb
│ ├── usage_monitoring
│ │ ├── alert.rb
│ │ ├── alert_threshold.rb
│ │ ├── billable_metric_current_usage_amount_alert.rb
│ │ ├── billable_metric_current_usage_units_alert.rb
│ │ ├── current_usage_amount_alert.rb
│ │ ├── lifetime_usage_amount_alert.rb
│ │ ├── subscription_activity.rb
│ │ └── triggered_alert.rb
│ ├── usage_threshold.rb
│ ├── user.rb
│ ├── wallet.rb
│ ├── wallet_credit.rb
│ ├── wallet_transaction.rb
│ ├── webhook.rb
│ └── webhook_endpoint.rb
├── queries
│ ├── activity_logs_query.rb
│ ├── add_ons_query.rb
│ ├── applied_coupons_query.rb
│ ├── base_filters.rb
│ ├── base_query.rb
│ ├── billable_metrics_query.rb
│ ├── coupons_query.rb
│ ├── credit_notes_query.rb
│ ├── customers_query.rb
│ ├── dunning_campaigns_query.rb
│ ├── events_query.rb
│ ├── fees_query.rb
│ ├── integration_collection_mappings_query.rb
│ ├── integration_items_query.rb
│ ├── integration_mappings_query.rb
│ ├── invoices_query.rb
│ ├── past_usage_query.rb
│ ├── payment_receipts_query.rb
│ ├── payment_requests_query.rb
│ ├── payments_query.rb
│ ├── plans_query.rb
│ ├── subscriptions_query.rb
│ ├── taxes_query.rb
│ ├── usage_monitoring
│ │ └── alerts_query.rb
│ ├── wallet_transactions_query.rb
│ ├── wallets_query.rb
│ ├── webhook_endpoints_query.rb
│ └── webhooks_query.rb
├── serializers
│ ├── collection_serializer.rb
│ ├── error_serializer.rb
│ ├── model_serializer.rb
│ └── v1
│ │ ├── activity_log_serializer.rb
│ │ ├── add_on_serializer.rb
│ │ ├── analytics
│ │ ├── gross_revenue_serializer.rb
│ │ ├── invoice_collection_serializer.rb
│ │ ├── invoiced_usage_serializer.rb
│ │ ├── mrr_serializer.rb
│ │ └── overdue_balance_serializer.rb
│ │ ├── applied_coupon_serializer.rb
│ │ ├── applied_usage_threshold_serializer.rb
│ │ ├── billable_metric_expression_result_serializer.rb
│ │ ├── billable_metric_filter_serializer.rb
│ │ ├── billable_metric_serializer.rb
│ │ ├── billing_entity_serializer.rb
│ │ ├── charge_filter_serializer.rb
│ │ ├── charge_serializer.rb
│ │ ├── commitment_serializer.rb
│ │ ├── coupon_serializer.rb
│ │ ├── credit_note_item_serializer.rb
│ │ ├── credit_note_serializer.rb
│ │ ├── credit_notes
│ │ ├── applied_tax_serializer.rb
│ │ ├── estimate_serializer.rb
│ │ └── payment_provider_refund_error_serializer.rb
│ │ ├── credit_serializer.rb
│ │ ├── customer_serializer.rb
│ │ ├── customers
│ │ ├── charge_usage_serializer.rb
│ │ ├── metadata_serializer.rb
│ │ ├── past_usage_serializer.rb
│ │ └── usage_serializer.rb
│ │ ├── error_detail_serializer.rb
│ │ ├── errors
│ │ ├── error_serializer_factory.rb
│ │ └── stripe_error_serializer.rb
│ │ ├── event_error_serializer.rb
│ │ ├── event_serializer.rb
│ │ ├── events_validation_errors_serializer.rb
│ │ ├── fee_serializer.rb
│ │ ├── fees
│ │ └── applied_tax_serializer.rb
│ │ ├── integration_customer_serializer.rb
│ │ ├── integrations
│ │ ├── customer_error_serializer.rb
│ │ ├── provider_error_serializer.rb
│ │ └── taxes
│ │ │ ├── customer_error_serializer.rb
│ │ │ └── fee_error_serializer.rb
│ │ ├── invoice_custom_section_serializer.rb
│ │ ├── invoice_serializer.rb
│ │ ├── invoices
│ │ ├── applied_invoice_custom_section_serializer.rb
│ │ ├── applied_tax_serializer.rb
│ │ ├── billing_period_serializer.rb
│ │ ├── metadata_serializer.rb
│ │ └── payment_dispute_lost_serializer.rb
│ │ ├── lifetime_usage_serializer.rb
│ │ ├── membership_serializer.rb
│ │ ├── organization_serializer.rb
│ │ ├── payment_providers
│ │ ├── customer_checkout_serializer.rb
│ │ ├── customer_error_serializer.rb
│ │ ├── error_serializer.rb
│ │ ├── invoice_payment_error_serializer.rb
│ │ ├── invoice_payment_serializer.rb
│ │ ├── payment_request_payment_error_serializer.rb
│ │ ├── wallet_transaction_payment_error_serializer.rb
│ │ └── wallet_transaction_payment_serializer.rb
│ │ ├── payment_receipt_serializer.rb
│ │ ├── payment_request_serializer.rb
│ │ ├── payment_serializer.rb
│ │ ├── payments
│ │ └── requires_action_serializer.rb
│ │ ├── plan_serializer.rb
│ │ ├── subscription_serializer.rb
│ │ ├── tax_serializer.rb
│ │ ├── usage_monitoring
│ │ ├── alert_serializer.rb
│ │ └── triggered_alert_serializer.rb
│ │ ├── usage_threshold_serializer.rb
│ │ ├── wallet_serializer.rb
│ │ ├── wallet_transaction_serializer.rb
│ │ ├── wallets
│ │ └── recurring_transaction_rule_serializer.rb
│ │ └── webhook_endpoint_serializer.rb
├── services
│ ├── add_ons
│ │ ├── apply_taxes_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ └── update_service.rb
│ ├── adjusted_fees
│ │ ├── create_service.rb
│ │ └── destroy_service.rb
│ ├── admin
│ │ └── organizations
│ │ │ └── update_service.rb
│ ├── analytics
│ │ ├── base_service.rb
│ │ ├── gross_revenues_service.rb
│ │ ├── invoice_collections_service.rb
│ │ ├── invoiced_usages_service.rb
│ │ ├── mrrs_service.rb
│ │ └── overdue_balances_service.rb
│ ├── api_keys
│ │ ├── cache_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── rotate_service.rb
│ │ ├── track_usage_service.rb
│ │ └── update_service.rb
│ ├── applied_coupons
│ │ ├── amount_service.rb
│ │ ├── create_service.rb
│ │ ├── lock_service.rb
│ │ ├── recredit_service.rb
│ │ └── terminate_service.rb
│ ├── applied_pricing_units
│ │ ├── create_service.rb
│ │ └── update_service.rb
│ ├── auth
│ │ ├── google_service.rb
│ │ └── okta
│ │ │ ├── accept_invite_service.rb
│ │ │ ├── authorize_service.rb
│ │ │ ├── base_service.rb
│ │ │ └── login_service.rb
│ ├── base_result.rb
│ ├── base_service.rb
│ ├── base_validator.rb
│ ├── billable_metric_filters
│ │ ├── create_or_update_batch_service.rb
│ │ └── destroy_all_service.rb
│ ├── billable_metrics
│ │ ├── aggregation_factory.rb
│ │ ├── aggregations
│ │ │ ├── apply_rounding_service.rb
│ │ │ ├── base_service.rb
│ │ │ ├── count_service.rb
│ │ │ ├── custom_service.rb
│ │ │ ├── latest_service.rb
│ │ │ ├── max_service.rb
│ │ │ ├── sum_service.rb
│ │ │ ├── unique_count_service.rb
│ │ │ └── weighted_sum_service.rb
│ │ ├── breakdown
│ │ │ ├── item.rb
│ │ │ ├── sum_service.rb
│ │ │ └── unique_count_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── evaluate_expression_service.rb
│ │ ├── expression_cache_service.rb
│ │ ├── prorated_aggregations
│ │ │ ├── base_service.rb
│ │ │ ├── sum_service.rb
│ │ │ └── unique_count_service.rb
│ │ └── update_service.rb
│ ├── billing_entities
│ │ ├── change_eu_tax_management_service.rb
│ │ ├── change_invoice_numbering_service.rb
│ │ ├── create_service.rb
│ │ ├── deselect_invoice_custom_section_service.rb
│ │ ├── resolve_service.rb
│ │ ├── select_invoice_custom_section_service.rb
│ │ ├── taxes
│ │ │ ├── apply_taxes_service.rb
│ │ │ ├── base_service.rb
│ │ │ ├── manage_taxes_service.rb
│ │ │ └── remove_taxes_service.rb
│ │ ├── update_applied_dunning_campaign_service.rb
│ │ ├── update_invoice_grace_period_service.rb
│ │ ├── update_invoice_payment_due_date_service.rb
│ │ └── update_service.rb
│ ├── cache_service.rb
│ ├── charge_filters
│ │ ├── create_or_update_batch_service.rb
│ │ ├── event_matching_service.rb
│ │ └── matching_and_ignored_service.rb
│ ├── charges
│ │ ├── amount_details
│ │ │ ├── range_graduated_percentage_service.rb
│ │ │ └── range_graduated_service.rb
│ │ ├── apply_pay_in_advance_charge_model_service.rb
│ │ ├── apply_taxes_service.rb
│ │ ├── build_default_properties_service.rb
│ │ ├── charge_model_factory.rb
│ │ ├── charge_models
│ │ │ ├── base_service.rb
│ │ │ ├── custom_service.rb
│ │ │ ├── dynamic_service.rb
│ │ │ ├── graduated_percentage_service.rb
│ │ │ ├── graduated_service.rb
│ │ │ ├── grouped_service.rb
│ │ │ ├── package_service.rb
│ │ │ ├── percentage_service.rb
│ │ │ ├── prorated_graduated_service.rb
│ │ │ ├── standard_service.rb
│ │ │ └── volume_service.rb
│ │ ├── create_children_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_children_service.rb
│ │ ├── destroy_service.rb
│ │ ├── estimate_instant
│ │ │ ├── percentage_service.rb
│ │ │ └── standard_service.rb
│ │ ├── filter_charge_model_properties_service.rb
│ │ ├── override_service.rb
│ │ ├── pay_in_advance
│ │ │ └── amount_details_calculator.rb
│ │ ├── pay_in_advance_aggregation_service.rb
│ │ ├── update_children_service.rb
│ │ ├── update_service.rb
│ │ └── validators
│ │ │ ├── base_service.rb
│ │ │ ├── graduated_percentage_service.rb
│ │ │ ├── graduated_service.rb
│ │ │ ├── package_service.rb
│ │ │ ├── percentage_service.rb
│ │ │ ├── standard_service.rb
│ │ │ └── volume_service.rb
│ ├── commitments
│ │ ├── apply_taxes_service.rb
│ │ ├── calculate_amount_service.rb
│ │ ├── calculate_prorated_coefficient_service.rb
│ │ ├── dates_service.rb
│ │ ├── fetch_invoices_service.rb
│ │ ├── minimum
│ │ │ ├── calculate_true_up_fee_service.rb
│ │ │ ├── in_advance
│ │ │ │ ├── calculate_true_up_fee_service.rb
│ │ │ │ ├── dates_service.rb
│ │ │ │ └── fetch_invoices_service.rb
│ │ │ └── in_arrears
│ │ │ │ ├── calculate_true_up_fee_service.rb
│ │ │ │ ├── dates_service.rb
│ │ │ │ └── fetch_invoices_service.rb
│ │ └── override_service.rb
│ ├── coupons
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── preview_service.rb
│ │ ├── terminate_service.rb
│ │ ├── update_service.rb
│ │ └── validate_service.rb
│ ├── credit_notes
│ │ ├── apply_taxes_service.rb
│ │ ├── create_from_progressive_billing_invoice.rb
│ │ ├── create_from_termination.rb
│ │ ├── create_service.rb
│ │ ├── estimate_service.rb
│ │ ├── generate_service.rb
│ │ ├── provider_taxes
│ │ │ └── report_service.rb
│ │ ├── recredit_service.rb
│ │ ├── refresh_draft_service.rb
│ │ ├── refunds
│ │ │ ├── adyen_service.rb
│ │ │ ├── gocardless_service.rb
│ │ │ └── stripe_service.rb
│ │ ├── update_service.rb
│ │ ├── validate_item_service.rb
│ │ ├── validate_service.rb
│ │ └── void_service.rb
│ ├── credits
│ │ ├── applied_coupon_service.rb
│ │ ├── applied_coupons_service.rb
│ │ ├── applied_prepaid_credit_service.rb
│ │ ├── credit_note_service.rb
│ │ └── progressive_billing_service.rb
│ ├── customer_portal
│ │ ├── customer_update_service.rb
│ │ └── generate_url_service.rb
│ ├── customers
│ │ ├── apply_taxes_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── eu_auto_taxes_service.rb
│ │ ├── generate_checkout_url_service.rb
│ │ ├── manage_invoice_custom_sections_service.rb
│ │ ├── metadata
│ │ │ └── update_service.rb
│ │ ├── payment_provider_finder.rb
│ │ ├── terminate_relations_service.rb
│ │ ├── update_currency_service.rb
│ │ ├── update_invoice_grace_period_service.rb
│ │ ├── update_invoice_payment_due_date_service.rb
│ │ ├── update_service.rb
│ │ └── upsert_from_api_service.rb
│ ├── daily_usages
│ │ ├── compute_all_service.rb
│ │ ├── compute_diff_service.rb
│ │ ├── compute_service.rb
│ │ ├── fill_from_invoice_service.rb
│ │ └── fill_history_service.rb
│ ├── data_api
│ │ ├── base_service.rb
│ │ ├── mrrs
│ │ │ └── plans_service.rb
│ │ ├── mrrs_service.rb
│ │ ├── prepaid_credits_service.rb
│ │ ├── revenue_streams
│ │ │ ├── customers_service.rb
│ │ │ └── plans_service.rb
│ │ ├── revenue_streams_service.rb
│ │ ├── usages
│ │ │ ├── aggregated_amounts_service.rb
│ │ │ └── invoiced_service.rb
│ │ └── usages_service.rb
│ ├── data_exports
│ │ ├── combine_parts_service.rb
│ │ ├── create_part_service.rb
│ │ ├── create_service.rb
│ │ ├── csv
│ │ │ ├── base_csv_service.rb
│ │ │ ├── credit_note_items.rb
│ │ │ ├── credit_notes.rb
│ │ │ ├── invoice_fees.rb
│ │ │ └── invoices.rb
│ │ ├── export_resources_service.rb
│ │ └── process_part_service.rb
│ ├── dunning_campaigns
│ │ ├── bulk_process_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── process_attempt_service.rb
│ │ └── update_service.rb
│ ├── error_details
│ │ ├── base_service.rb
│ │ └── create_service.rb
│ ├── events
│ │ ├── calculate_expression_service.rb
│ │ ├── common_factory.rb
│ │ ├── create_batch_service.rb
│ │ ├── create_service.rb
│ │ ├── pay_in_advance_service.rb
│ │ ├── post_process_service.rb
│ │ ├── post_validation_service.rb
│ │ ├── stores
│ │ │ ├── base_store.rb
│ │ │ ├── clickhouse
│ │ │ │ ├── unique_count_query.rb
│ │ │ │ └── weighted_sum_query.rb
│ │ │ ├── clickhouse_store.rb
│ │ │ ├── postgres
│ │ │ │ ├── unique_count_query.rb
│ │ │ │ └── weighted_sum_query.rb
│ │ │ ├── postgres_store.rb
│ │ │ └── store_factory.rb
│ │ └── validate_creation_service.rb
│ ├── fees
│ │ ├── add_on_service.rb
│ │ ├── apply_provider_taxes_service.rb
│ │ ├── apply_taxes_service.rb
│ │ ├── charge_service.rb
│ │ ├── commitments
│ │ │ └── minimum
│ │ │ │ └── create_service.rb
│ │ ├── create_pay_in_advance_service.rb
│ │ ├── create_true_up_service.rb
│ │ ├── destroy_service.rb
│ │ ├── estimate_instant
│ │ │ ├── base_service.rb
│ │ │ ├── batch_pay_in_advance_service.rb
│ │ │ └── pay_in_advance_service.rb
│ │ ├── estimate_pay_in_advance_service.rb
│ │ ├── init_from_adjusted_charge_fee_service.rb
│ │ ├── one_off_service.rb
│ │ ├── paid_credit_service.rb
│ │ ├── subscription_service.rb
│ │ └── update_service.rb
│ ├── idempotency_records
│ │ ├── create_service.rb
│ │ └── key_service.rb
│ ├── inbound_webhooks
│ │ ├── create_service.rb
│ │ ├── process_service.rb
│ │ └── validate_payload_service.rb
│ ├── integration_collection_mappings
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── factory.rb
│ │ └── update_service.rb
│ ├── integration_customers
│ │ ├── anrok_service.rb
│ │ ├── avalara_service.rb
│ │ ├── base_service.rb
│ │ ├── create_or_update_service.rb
│ │ ├── create_service.rb
│ │ ├── factory.rb
│ │ ├── hubspot_service.rb
│ │ ├── netsuite_service.rb
│ │ ├── salesforce_service.rb
│ │ ├── update_service.rb
│ │ └── xero_service.rb
│ ├── integration_mappings
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── factory.rb
│ │ └── update_service.rb
│ ├── integrations
│ │ ├── aggregator
│ │ │ ├── account_information_service.rb
│ │ │ ├── accounts_service.rb
│ │ │ ├── base_payload.rb
│ │ │ ├── base_service.rb
│ │ │ ├── companies
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── create_service.rb
│ │ │ │ ├── payloads
│ │ │ │ │ ├── factory.rb
│ │ │ │ │ └── hubspot.rb
│ │ │ │ └── update_service.rb
│ │ │ ├── contacts
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── create_service.rb
│ │ │ │ ├── payloads
│ │ │ │ │ ├── anrok.rb
│ │ │ │ │ ├── avalara.rb
│ │ │ │ │ ├── base_payload.rb
│ │ │ │ │ ├── factory.rb
│ │ │ │ │ ├── hubspot.rb
│ │ │ │ │ ├── netsuite.rb
│ │ │ │ │ └── xero.rb
│ │ │ │ └── update_service.rb
│ │ │ ├── credit_notes
│ │ │ │ ├── create_service.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── anrok.rb
│ │ │ │ │ ├── base_payload.rb
│ │ │ │ │ ├── factory.rb
│ │ │ │ │ ├── netsuite.rb
│ │ │ │ │ └── xero.rb
│ │ │ ├── custom_object_service.rb
│ │ │ ├── invoices
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── create_service.rb
│ │ │ │ ├── hubspot
│ │ │ │ │ ├── base_service.rb
│ │ │ │ │ ├── create_customer_association_service.rb
│ │ │ │ │ ├── create_service.rb
│ │ │ │ │ └── update_service.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── anrok.rb
│ │ │ │ │ ├── base_payload.rb
│ │ │ │ │ ├── factory.rb
│ │ │ │ │ ├── hubspot.rb
│ │ │ │ │ ├── netsuite.rb
│ │ │ │ │ └── xero.rb
│ │ │ ├── items_service.rb
│ │ │ ├── payments
│ │ │ │ ├── create_service.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── base_payload.rb
│ │ │ │ │ ├── factory.rb
│ │ │ │ │ ├── netsuite.rb
│ │ │ │ │ └── xero.rb
│ │ │ ├── request_limit_error.rb
│ │ │ ├── send_restlet_endpoint_service.rb
│ │ │ ├── subscriptions
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── hubspot
│ │ │ │ │ ├── base_service.rb
│ │ │ │ │ ├── create_customer_association_service.rb
│ │ │ │ │ ├── create_service.rb
│ │ │ │ │ └── update_service.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── base_payload.rb
│ │ │ │ │ ├── factory.rb
│ │ │ │ │ └── hubspot.rb
│ │ │ ├── subsidiaries_service.rb
│ │ │ ├── sync_service.rb
│ │ │ └── taxes
│ │ │ │ ├── avalara
│ │ │ │ └── fetch_company_id_service.rb
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── credit_notes
│ │ │ │ ├── create_service.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── anrok.rb
│ │ │ │ │ ├── avalara.rb
│ │ │ │ │ └── factory.rb
│ │ │ │ └── invoices
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── create_draft_service.rb
│ │ │ │ ├── create_service.rb
│ │ │ │ ├── negate_service.rb
│ │ │ │ ├── payloads
│ │ │ │ ├── anrok.rb
│ │ │ │ ├── avalara.rb
│ │ │ │ └── factory.rb
│ │ │ │ └── void_service.rb
│ │ ├── anrok
│ │ │ ├── create_service.rb
│ │ │ └── update_service.rb
│ │ ├── avalara
│ │ │ ├── create_service.rb
│ │ │ ├── fetch_company_id_service.rb
│ │ │ └── update_service.rb
│ │ ├── destroy_service.rb
│ │ ├── hubspot
│ │ │ ├── companies
│ │ │ │ └── deploy_properties_service.rb
│ │ │ ├── contacts
│ │ │ │ └── deploy_properties_service.rb
│ │ │ ├── create_service.rb
│ │ │ ├── invoices
│ │ │ │ ├── deploy_object_service.rb
│ │ │ │ └── deploy_properties_service.rb
│ │ │ ├── save_portal_id_service.rb
│ │ │ ├── subscriptions
│ │ │ │ ├── deploy_object_service.rb
│ │ │ │ └── deploy_properties_service.rb
│ │ │ └── update_service.rb
│ │ ├── netsuite
│ │ │ ├── create_service.rb
│ │ │ └── update_service.rb
│ │ ├── okta
│ │ │ ├── create_service.rb
│ │ │ └── update_service.rb
│ │ ├── salesforce
│ │ │ ├── create_service.rb
│ │ │ ├── invoices
│ │ │ │ └── sync_service.rb
│ │ │ └── update_service.rb
│ │ └── xero
│ │ │ ├── create_service.rb
│ │ │ └── update_service.rb
│ ├── invites
│ │ ├── accept_service.rb
│ │ ├── create_service.rb
│ │ ├── revoke_service.rb
│ │ ├── update_service.rb
│ │ └── validate_service.rb
│ ├── invoice_custom_sections
│ │ ├── create_service.rb
│ │ ├── deselect_all_service.rb
│ │ ├── destroy_service.rb
│ │ ├── funding_instructions_formatter_service.rb
│ │ └── update_service.rb
│ ├── invoices
│ │ ├── add_on_service.rb
│ │ ├── advance_charges_service.rb
│ │ ├── aggregate_amounts_and_taxes_from_fees.rb
│ │ ├── apply_invoice_custom_sections_service.rb
│ │ ├── apply_provider_taxes_service.rb
│ │ ├── apply_taxes_service.rb
│ │ ├── calculate_fees_service.rb
│ │ ├── compute_amounts_from_fees.rb
│ │ ├── compute_taxes_and_totals_service.rb
│ │ ├── create_advance_charges_invoice_subscription_service.rb
│ │ ├── create_generating_service.rb
│ │ ├── create_invoice_subscription_service.rb
│ │ ├── create_one_off_service.rb
│ │ ├── create_pay_in_advance_charge_service.rb
│ │ ├── customer_usage_service.rb
│ │ ├── finalize_batch_service.rb
│ │ ├── finalize_open_credit_service.rb
│ │ ├── generate_pdf_service.rb
│ │ ├── lose_dispute_service.rb
│ │ ├── metadata
│ │ │ └── update_service.rb
│ │ ├── paid_credit_service.rb
│ │ ├── payments
│ │ │ ├── adyen_service.rb
│ │ │ ├── cashfree_service.rb
│ │ │ ├── connection_error.rb
│ │ │ ├── create_service.rb
│ │ │ ├── deliver_error_webhook_service.rb
│ │ │ ├── generate_payment_url_service.rb
│ │ │ ├── gocardless_service.rb
│ │ │ ├── mark_overdue_service.rb
│ │ │ ├── moneyhash_service.rb
│ │ │ ├── payment_providers
│ │ │ │ └── factory.rb
│ │ │ ├── rate_limit_error.rb
│ │ │ ├── retry_batch_service.rb
│ │ │ ├── retry_service.rb
│ │ │ └── stripe_service.rb
│ │ ├── preview
│ │ │ ├── build_subscription_service.rb
│ │ │ ├── credits_service.rb
│ │ │ ├── find_subscriptions_service.rb
│ │ │ ├── subscription_plan_change_service.rb
│ │ │ ├── subscription_termination_service.rb
│ │ │ └── subscriptions_service.rb
│ │ ├── preview_context_service.rb
│ │ ├── preview_service.rb
│ │ ├── progressive_billing_service.rb
│ │ ├── provider_taxes
│ │ │ ├── pull_taxes_and_apply_service.rb
│ │ │ └── void_service.rb
│ │ ├── refresh_draft_and_finalize_service.rb
│ │ ├── refresh_draft_service.rb
│ │ ├── retry_batch_service.rb
│ │ ├── retry_service.rb
│ │ ├── subscription_service.rb
│ │ ├── sync_salesforce_id_service.rb
│ │ ├── transition_to_final_status_service.rb
│ │ ├── update_all_invoice_grace_period_from_billing_entity_service.rb
│ │ ├── update_grace_period_from_billing_entity_service.rb
│ │ ├── update_service.rb
│ │ └── void_service.rb
│ ├── lifetime_usages
│ │ ├── calculate_service.rb
│ │ ├── check_thresholds_service.rb
│ │ ├── find_last_and_next_thresholds_service.rb
│ │ ├── flag_refresh_from_invoice_service.rb
│ │ ├── flag_refresh_from_plan_update_service.rb
│ │ ├── update_service.rb
│ │ ├── usage_thresholds
│ │ │ └── check_service.rb
│ │ └── usage_thresholds_completion_service.rb
│ ├── memberships
│ │ ├── create_service.rb
│ │ ├── revoke_service.rb
│ │ └── update_service.rb
│ ├── organizations
│ │ ├── create_service.rb
│ │ └── update_service.rb
│ ├── password_resets
│ │ ├── create_service.rb
│ │ └── reset_service.rb
│ ├── payment_intents
│ │ └── fetch_service.rb
│ ├── payment_provider_customers
│ │ ├── adyen_service.rb
│ │ ├── cashfree_service.rb
│ │ ├── factory.rb
│ │ ├── gocardless_service.rb
│ │ ├── moneyhash_service.rb
│ │ ├── stripe
│ │ │ ├── check_payment_method_service.rb
│ │ │ ├── retrieve_latest_payment_method_service.rb
│ │ │ ├── sync_funding_instructions_service.rb
│ │ │ └── update_payment_method_service.rb
│ │ ├── stripe_service.rb
│ │ └── update_service.rb
│ ├── payment_providers
│ │ ├── adyen
│ │ │ ├── customers
│ │ │ │ └── create_service.rb
│ │ │ ├── handle_event_service.rb
│ │ │ ├── handle_incoming_webhook_service.rb
│ │ │ ├── payments
│ │ │ │ └── create_service.rb
│ │ │ └── webhooks
│ │ │ │ ├── base_service.rb
│ │ │ │ └── chargeback_service.rb
│ │ ├── adyen_service.rb
│ │ ├── base_service.rb
│ │ ├── cashfree
│ │ │ ├── customers
│ │ │ │ └── create_service.rb
│ │ │ ├── handle_event_service.rb
│ │ │ ├── handle_incoming_webhook_service.rb
│ │ │ ├── payments
│ │ │ │ └── create_service.rb
│ │ │ └── webhooks
│ │ │ │ ├── base_service.rb
│ │ │ │ └── payment_link_event_service.rb
│ │ ├── cashfree_service.rb
│ │ ├── create_customer_factory.rb
│ │ ├── create_payment_factory.rb
│ │ ├── destroy_service.rb
│ │ ├── find_service.rb
│ │ ├── gocardless
│ │ │ ├── customers
│ │ │ │ └── create_service.rb
│ │ │ ├── handle_event_service.rb
│ │ │ ├── handle_incoming_webhook_service.rb
│ │ │ └── payments
│ │ │ │ └── create_service.rb
│ │ ├── gocardless_service.rb
│ │ ├── moneyhash
│ │ │ ├── base_service.rb
│ │ │ ├── customers
│ │ │ │ └── create_service.rb
│ │ │ ├── handle_incoming_webhook_service.rb
│ │ │ ├── payments
│ │ │ │ └── create_service.rb
│ │ │ └── validate_incoming_webhook_service.rb
│ │ ├── moneyhash_service.rb
│ │ ├── stripe
│ │ │ ├── base_service.rb
│ │ │ ├── customers
│ │ │ │ └── create_service.rb
│ │ │ ├── handle_event_service.rb
│ │ │ ├── handle_incoming_webhook_service.rb
│ │ │ ├── payments
│ │ │ │ ├── authorize_service.rb
│ │ │ │ └── create_service.rb
│ │ │ ├── refresh_webhook_service.rb
│ │ │ ├── register_webhook_service.rb
│ │ │ ├── validate_incoming_webhook_service.rb
│ │ │ └── webhooks
│ │ │ │ ├── base_service.rb
│ │ │ │ ├── charge_dispute_closed_service.rb
│ │ │ │ ├── customer_updated_service.rb
│ │ │ │ ├── payment_intent_payment_failed_service.rb
│ │ │ │ ├── payment_intent_succeeded_service.rb
│ │ │ │ └── setup_intent_succeeded_service.rb
│ │ └── stripe_service.rb
│ ├── payment_receipts
│ │ ├── create_service.rb
│ │ └── generate_pdf_service.rb
│ ├── payment_requests
│ │ ├── create_service.rb
│ │ ├── payments
│ │ │ ├── adyen_service.rb
│ │ │ ├── cashfree_service.rb
│ │ │ ├── create_service.rb
│ │ │ ├── deliver_error_webhook_service.rb
│ │ │ ├── generate_payment_url_service.rb
│ │ │ ├── gocardless_service.rb
│ │ │ ├── moneyhash_service.rb
│ │ │ ├── payment_providers
│ │ │ │ └── factory.rb
│ │ │ ├── stripe_service.rb
│ │ │ └── updatable.rb
│ │ └── update_service.rb
│ ├── payments
│ │ ├── lose_dispute_service.rb
│ │ ├── manual_create_service.rb
│ │ └── set_payment_method_data_service.rb
│ ├── plans
│ │ ├── apply_taxes_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ ├── override_service.rb
│ │ ├── prepare_destroy_service.rb
│ │ ├── update_amount_service.rb
│ │ ├── update_service.rb
│ │ └── update_usage_thresholds_service.rb
│ ├── pricing_units
│ │ ├── create_service.rb
│ │ └── update_service.rb
│ ├── subscriptions
│ │ ├── activate_service.rb
│ │ ├── charge_cache_middleware.rb
│ │ ├── charge_cache_service.rb
│ │ ├── consume_subscription_refreshed_queue_service.rb
│ │ ├── create_service.rb
│ │ ├── dates
│ │ │ ├── monthly_service.rb
│ │ │ ├── quarterly_service.rb
│ │ │ ├── weekly_service.rb
│ │ │ └── yearly_service.rb
│ │ ├── dates_service.rb
│ │ ├── flag_refreshed_service.rb
│ │ ├── free_trial_billing_service.rb
│ │ ├── organization_billing_service.rb
│ │ ├── plan_upgrade_service.rb
│ │ ├── progressive_billed_amount.rb
│ │ ├── terminate_service.rb
│ │ ├── terminated_dates_service.rb
│ │ ├── update_service.rb
│ │ └── validate_service.rb
│ ├── taxes
│ │ ├── auto_generate_service.rb
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ └── update_service.rb
│ ├── usage_monitoring
│ │ ├── base_service.rb
│ │ ├── concerns
│ │ │ └── create_or_update_concern.rb
│ │ ├── create_alert_service.rb
│ │ ├── destroy_alert_service.rb
│ │ ├── process_alert_service.rb
│ │ ├── process_all_subscription_activities_service.rb
│ │ ├── process_organization_subscription_activities_service.rb
│ │ ├── process_subscription_activity_service.rb
│ │ ├── track_subscription_activity_service.rb
│ │ └── update_alert_service.rb
│ ├── usage_thresholds
│ │ └── override_service.rb
│ ├── users_service.rb
│ ├── utils
│ │ ├── activity_log.rb
│ │ ├── datetime.rb
│ │ ├── money_with_precision.rb
│ │ ├── pdf_generator.rb
│ │ ├── segment_track.rb
│ │ └── timezone.rb
│ ├── validators
│ │ ├── decimal_amount_service.rb
│ │ ├── expiration_date_validator.rb
│ │ ├── metadata_validator.rb
│ │ └── range_bounds_validator.rb
│ ├── wallet_transactions
│ │ ├── create_from_params_service.rb
│ │ ├── create_service.rb
│ │ ├── mark_as_failed_service.rb
│ │ ├── payments
│ │ │ └── generate_payment_url_service.rb
│ │ ├── recredit_service.rb
│ │ ├── settle_service.rb
│ │ ├── validate_service.rb
│ │ └── void_service.rb
│ ├── wallets
│ │ ├── apply_paid_credits_service.rb
│ │ ├── balance
│ │ │ ├── decrease_service.rb
│ │ │ ├── increase_service.rb
│ │ │ ├── refresh_ongoing_service.rb
│ │ │ └── update_ongoing_service.rb
│ │ ├── create_interval_wallet_transactions_service.rb
│ │ ├── create_service.rb
│ │ ├── recurring_transaction_rules
│ │ │ ├── create_service.rb
│ │ │ ├── terminate_service.rb
│ │ │ ├── update_service.rb
│ │ │ └── validate_service.rb
│ │ ├── terminate_service.rb
│ │ ├── threshold_top_up_service.rb
│ │ ├── update_service.rb
│ │ ├── validate_limitations_service.rb
│ │ ├── validate_recurring_transaction_rules_service.rb
│ │ └── validate_service.rb
│ ├── webhook_endpoints
│ │ ├── create_service.rb
│ │ ├── destroy_service.rb
│ │ └── update_service.rb
│ └── webhooks
│ │ ├── base_service.rb
│ │ ├── credit_notes
│ │ ├── created_service.rb
│ │ ├── generated_service.rb
│ │ └── payment_provider_refund_failure_service.rb
│ │ ├── customers
│ │ ├── created_service.rb
│ │ ├── updated_service.rb
│ │ └── vies_check_service.rb
│ │ ├── events
│ │ ├── error_service.rb
│ │ └── validation_errors_service.rb
│ │ ├── fees
│ │ └── pay_in_advance_created_service.rb
│ │ ├── integrations
│ │ ├── accounting_customer_created_service.rb
│ │ ├── accounting_customer_error_service.rb
│ │ ├── crm_customer_created_service.rb
│ │ ├── crm_customer_error_service.rb
│ │ ├── customer_created_service.rb
│ │ ├── customer_error_service.rb
│ │ ├── provider_error_service.rb
│ │ └── taxes
│ │ │ ├── error_service.rb
│ │ │ └── fee_error_service.rb
│ │ ├── invoices
│ │ ├── add_on_created_service.rb
│ │ ├── created_service.rb
│ │ ├── drafted_service.rb
│ │ ├── generated_service.rb
│ │ ├── one_off_created_service.rb
│ │ ├── paid_credit_added_service.rb
│ │ ├── payment_dispute_lost_service.rb
│ │ ├── payment_overdue_service.rb
│ │ ├── payment_status_updated_service.rb
│ │ ├── resynced_service.rb
│ │ └── voided_service.rb
│ │ ├── notify_failure_service.rb
│ │ ├── payment_providers
│ │ ├── customer_checkout_service.rb
│ │ ├── customer_created_service.rb
│ │ ├── customer_error_service.rb
│ │ ├── error_service.rb
│ │ ├── invoice_payment_failure_service.rb
│ │ ├── payment_request_payment_failure_service.rb
│ │ └── wallet_transaction_payment_failure_service.rb
│ │ ├── payment_receipts
│ │ ├── created_service.rb
│ │ └── generated_service.rb
│ │ ├── payment_requests
│ │ ├── created_service.rb
│ │ └── payment_status_updated_service.rb
│ │ ├── payments
│ │ └── requires_action_service.rb
│ │ ├── retry_service.rb
│ │ ├── send_http_service.rb
│ │ ├── subscriptions
│ │ ├── started_service.rb
│ │ ├── terminated_service.rb
│ │ ├── termination_alert_service.rb
│ │ ├── trial_ended_service.rb
│ │ ├── updated_service.rb
│ │ └── usage_thresholds_reached_service.rb
│ │ ├── usage_monitoring
│ │ └── alert_triggered_service.rb
│ │ ├── wallet_transactions
│ │ ├── created_service.rb
│ │ └── updated_service.rb
│ │ └── wallets
│ │ ├── created_service.rb
│ │ ├── depleted_ongoing_balance_service.rb
│ │ ├── terminated_service.rb
│ │ └── updated_service.rb
├── support
│ ├── dotted_hash.rb
│ ├── idempotency.rb
│ └── regex.rb
├── validators
│ ├── adyen_url_validator.rb
│ ├── country_code_validator.rb
│ ├── email_array_validator.rb
│ ├── email_validator.rb
│ ├── image_validator.rb
│ ├── language_code_validator.rb
│ ├── timezone_validator.rb
│ └── url_validator.rb
└── views
│ ├── api_key_mailer
│ ├── created.slim
│ ├── destroyed.slim
│ └── rotated.slim
│ ├── credit_note_mailer
│ └── created.slim
│ ├── data_export_mailer
│ └── completed.slim
│ ├── helpers
│ ├── fee_display_helper.rb
│ ├── interval_helper.rb
│ ├── line_break_helper.rb
│ ├── money_helper.rb
│ ├── rounding_helper.rb
│ ├── slim_helper.rb
│ └── tax_helper.rb
│ ├── invoice_mailer
│ └── finalized.slim
│ ├── layouts
│ └── mailer.slim
│ ├── password_reset_mailer
│ └── requested.slim
│ ├── payment_receipt_mailer
│ └── created.slim
│ ├── payment_request_mailer
│ └── requested.slim
│ ├── templates
│ ├── credit_notes
│ │ ├── _details.slim
│ │ ├── _eu_tax_management.slim
│ │ ├── _powered_by_logo.slim
│ │ ├── _styles.slim
│ │ ├── credit_note.slim
│ │ └── self_billed.slim
│ ├── invoices
│ │ ├── v1.slim
│ │ ├── v2.slim
│ │ ├── v3.slim
│ │ ├── v3
│ │ │ ├── _credit.slim
│ │ │ ├── _custom_sections.slim
│ │ │ ├── _subscription_details.slim
│ │ │ ├── _subscriptions_summary.slim
│ │ │ ├── _true_up_fee.slim
│ │ │ ├── charge.slim
│ │ │ └── one_off.slim
│ │ ├── v4.slim
│ │ └── v4
│ │ │ ├── _charge.slim
│ │ │ ├── _charge_percentage.slim
│ │ │ ├── _credit.slim
│ │ │ ├── _custom_sections.slim
│ │ │ ├── _default_fee.slim
│ │ │ ├── _default_fee_with_filters.slim
│ │ │ ├── _eu_tax_management.slim
│ │ │ ├── _fee_with_filters.slim
│ │ │ ├── _fees_without_filters.slim
│ │ │ ├── _graduated.slim
│ │ │ ├── _graduated_percentage.slim
│ │ │ ├── _one_off.slim
│ │ │ ├── _package.slim
│ │ │ ├── _percentage.slim
│ │ │ ├── _powered_by_logo.slim
│ │ │ ├── _progressive_billing_details.slim
│ │ │ ├── _subscription_details.slim
│ │ │ ├── _subscriptions_summary.slim
│ │ │ ├── _true_up_fee.slim
│ │ │ ├── _volume.slim
│ │ │ ├── charge.slim
│ │ │ ├── one_off.slim
│ │ │ └── self_billed.slim
│ └── payment_receipts
│ │ ├── v1.slim
│ │ └── v1
│ │ ├── _payment_request.slim
│ │ ├── _powered_by_logo.slim
│ │ └── _styles.slim
│ └── webhook_mailer
│ └── failure_notification.slim
├── bin
├── bundle
├── rails
├── rake
└── setup
├── ci
└── clickhouse
│ └── config.xml
├── clock.rb
├── config.ru
├── config
├── application.rb
├── boot.rb
├── database.yml
├── environment.rb
├── environments
│ ├── development.rb
│ ├── production.rb
│ ├── staging.rb
│ └── test.rb
├── i18n-tasks.yml
├── initializers
│ ├── aasm.rb
│ ├── active_job_uniqueness.rb
│ ├── analytics_ruby.rb
│ ├── console.rb
│ ├── cors.rb
│ ├── filter_parameter_logging.rb
│ ├── graphiql.rb
│ ├── license.rb
│ ├── lograge.rb
│ ├── money.rb
│ ├── open_telemetry.rb
│ ├── paper_trail.rb
│ ├── rsa_keys.rb
│ ├── sentry.rb
│ ├── sidekiq.rb
│ ├── stripe.rb
│ ├── throttling.rb
│ ├── version.rb
│ └── zeitwerk.rb
├── locales
│ ├── de.yml
│ ├── de
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
│ ├── en.yml
│ ├── en
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── password_reset.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
│ ├── es.yml
│ ├── es
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
│ ├── fr.yml
│ ├── fr
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
│ ├── it.yml
│ ├── it
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
│ ├── nb.yml
│ ├── nb
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
│ ├── sv.yml
│ └── sv
│ │ ├── commitment.yml
│ │ ├── credit_note.yml
│ │ ├── email.yml
│ │ ├── invoice.yml
│ │ ├── payment_receipt.yml
│ │ └── webhook_endpoint.yml
├── newrelic.yml
├── puma.rb
├── routes.rb
├── sidekiq
│ ├── sidekiq.yml
│ ├── sidekiq_billing.yml
│ ├── sidekiq_clock.yml
│ ├── sidekiq_events.yml
│ ├── sidekiq_payments.yml
│ ├── sidekiq_pdfs.yml
│ └── sidekiq_webhook.yml
├── storage.yml
└── versions.yml
├── db
├── clickhouse_migrate
│ ├── 20231024084411_create_events_raw.rb
│ ├── 20231026124912_create_events_raw_queue.rb
│ ├── 20231030163703_create_events_raw_mv.rb
│ ├── 20240705080709_create_events_enriched.rb
│ ├── 20240705084952_create_events_enriched_queue.rb
│ ├── 20240705085501_create_events_enriched_mv.rb
│ ├── 20250416103745_create_activity_logs.rb
│ ├── 20250416104012_create_activity_logs_queue.rb
│ └── 20250416104534_create_activity_logs_mv.rb
├── migrate
│ ├── 20220525122759_init_schema.rb
│ ├── 20220526101535_create_applied_add_ons.rb
│ ├── 20220530091046_add_metadata_to_events.rb
│ ├── 20220601150058_add_add_on_to_fees.rb
│ ├── 20220602145819_add_bill_charges_monthly_to_plans.rb
│ ├── 20220607082458_add_charges_from_date_on_invoices.rb
│ ├── 20220609080806_create_payment_providers.rb
│ ├── 20220610134535_create_payment_provider_customers.rb
│ ├── 20220610143942_add_payment_provider_to_customers.rb
│ ├── 20220613130634_add_invoice_type_to_invoices.rb
│ ├── 20220614110841_add_status_to_invoices.rb
│ ├── 20220617124108_create_payments.rb
│ ├── 20220620141910_add_invoice_fields_to_organizations.rb
│ ├── 20220620150551_add_slug_to_customers.rb
│ ├── 20220621090834_add_number_to_invoices.rb
│ ├── 20220621153030_create_active_storage_tables.active_storage.rb
│ ├── 20220629133308_add_file_to_invoices.rb
│ ├── 20220704145333_fill_event_timestamps.rb
│ ├── 20220705155228_add_unaccent_extension.rb
│ ├── 20220713171816_change_active_storage_attachments_id_type.rb
│ ├── 20220718083657_create_wallets.rb
│ ├── 20220718124337_add_name_to_subscriptions.rb
│ ├── 20220721150658_create_wallet_transactions.rb
│ ├── 20220722123417_add_subscription_id_to_events.rb
│ ├── 20220725152220_add_unique_id_to_subscriptions.rb
│ ├── 20220727132848_create_invoice_subscriptions.rb
│ ├── 20220727161448_add_customer_to_invoices.rb
│ ├── 20220728144707_add_anniversary_fields_to_subscriptions.rb
│ ├── 20220729055309_add_properties_to_fees.rb
│ ├── 20220729062203_remove_invoice_columns.rb
│ ├── 20220801101144_add_consumed_amount_to_wallets.rb
│ ├── 20220807210117_add_invoice_id_to_wallet_transactions.rb
│ ├── 20220809083243_fill_customer_id_on_invoices.rb
│ ├── 20220811155332_refresh_stripe_webhooks.rb
│ ├── 20220816120137_update_properties_on_percentage_charges.rb
│ ├── 20220817092945_remove_invoice_from_wallet_transaction.rb
│ ├── 20220817095619_add_invoiceable_and_type_to_fees.rb
│ ├── 20220818141616_add_events_count_to_fees.rb
│ ├── 20220818151052_remove_amount_currency_null_constraint_from_charges.rb
│ ├── 20220823135203_change_precision_and_scale_for_decimal_fields.rb
│ ├── 20220823145421_rename_unique_id_to_external_id_on_subscriptions.rb
│ ├── 20220824113131_rename_customer_id_to_external_id_on_customers.rb
│ ├── 20220825051923_add_wallet_transaction_to_invoice.rb
│ ├── 20220829094054_create_persisted_metrics.rb
│ ├── 20220831113537_update_fee_type.rb
│ ├── 20220905095529_rename_persisted_metrics_into_persisted_events.rb
│ ├── 20220905142834_add_billable_metric_id_to_persisted_events.rb
│ ├── 20220906065059_add_membership_status_and_revoked_at.rb
│ ├── 20220906130714_add_invites.rb
│ ├── 20220915092730_add_currency_to_customers.rb
│ ├── 20220916131538_add_parent_id_on_plans.rb
│ ├── 20220919133338_run_customer_currency_task.rb
│ ├── 20220921095507_add_coupon_type_and_percentage_rate_to_coupons.rb
│ ├── 20220922105251_add_frequency_and_frequency_duration_to_coupons.rb
│ ├── 20220923092906_add_expiration_date_to_coupons.rb
│ ├── 20220930123935_create_credit_notes.rb
│ ├── 20220930134327_create_credit_note_items.rb
│ ├── 20220930143002_add_credit_note_id_to_credits.rb
│ ├── 20221004092737_create_groups.rb
│ ├── 20221007075812_run_customer_currency_task_again.rb
│ ├── 20221010083509_rename_credit_credit_note.rb
│ ├── 20221010142031_update_credit_notes.rb
│ ├── 20221011083520_rename_credit_note_items.rb
│ ├── 20221011133055_create_group_properties.rb
│ ├── 20221013140147_update_graduated_properties_to_hash.rb
│ ├── 20221018144521_add_legacy_flag_to_invoices.rb
│ ├── 20221020093745_add_credit_amount_to_invoices.rb
│ ├── 20221021135428_add_properties_to_persisted_events.rb
│ ├── 20221021135946_fill_properties_on_persisted_events.rb
│ ├── 20221024090308_add_refund_fields_to_credit_notes.rb
│ ├── 20221028091920_add_group_id_to_fees.rb
│ ├── 20221028124549_create_refunds.rb
│ ├── 20221028160705_fix_currency_on_invoices.rb
│ ├── 20221031141549_add_voided_at_to_credit_notes.rb
│ ├── 20221031144907_add_description_to_credit_notes.rb
│ ├── 20221107151038_add_vat_rates_to_credit_note.rb
│ ├── 20221110151027_changes_credit_note_items_columns.rb
│ ├── 20221114102649_fill_sync_with_provider_field.rb
│ ├── 20221115100834_add_invoice_grace_period.rb
│ ├── 20221115110223_add_unique_index_on_customers_external_id.rb
│ ├── 20221115135840_add_frequency_duration_remaining_to_applied_coupons.rb
│ ├── 20221115155550_add_timezone_to_organizations.rb
│ ├── 20221115160325_add_timezone_to_customers.rb
│ ├── 20221118084547_add_refunded_at_to_credit_notes.rb
│ ├── 20221118093903_fill_frequency_duration_remaining_field.rb
│ ├── 20221122163328_rename_status_on_invoices.rb
│ ├── 20221125111605_add_issuing_date_to_credit_notes.rb
│ ├── 20221128132620_change_fees_boundaries.rb
│ ├── 20221129133433_change_expiration_dates_type.rb
│ ├── 20221202130126_rename_wallets_expiration_date.rb
│ ├── 20221205112007_add_reusable_to_coupons.rb
│ ├── 20221206094412_change_subscription_date_type.rb
│ ├── 20221208140608_add_timezone_to_invoices.rb
│ ├── 20221208142739_add_properties_to_invoice_subscriptions.rb
│ ├── 20221212153810_add_source_to_invoice_subscriptions.rb
│ ├── 20221216154033_add_payment_retry_columns_to_invoices.rb
│ ├── 20221219111209_change_invoice_subscription_source.rb
│ ├── 20221222164226_finalize_invoices.rb
│ ├── 20221226091020_add_nullable_to_invoice_grace_period.rb
│ ├── 20230102150636_change_invoices_default_status.rb
│ ├── 20230105094302_add_nullable_to_fee_id_on_credit_note_items.rb
│ ├── 20230106152449_turn_all_amount_cents_to_bigint.rb
│ ├── 20230109095957_add_status_to_credit_notes.rb
│ ├── 20230118100324_add_deleted_at_to_billable_metrics.rb
│ ├── 20230125104957_create_coupon_plans.rb
│ ├── 20230126103454_add_deleted_at_to_plans.rb
│ ├── 20230127140904_add_pending_deletion_to_plans.rb
│ ├── 20230131144740_add_deleted_at_to_add_ons.rb
│ ├── 20230131152047_add_deleted_at_to_coupons.rb
│ ├── 20230202110407_add_index_to_payment_provider_customers.rb
│ ├── 20230202150407_add_deleted_at_to_customers.rb
│ ├── 20230202163249_add_organization_id_to_invoices.rb
│ ├── 20230203132157_add_deleted_at_to_coupon_plans.rb
│ ├── 20230206143214_create_webhooks.rb
│ ├── 20230207110702_add_document_locale_to_customers_and_organizations.rb
│ ├── 20230214100638_change_webhooks_organization_id_to_uuid.rb
│ ├── 20230214145444_add_default_to_vat_rate.rb
│ ├── 20230216140543_create_versions.rb
│ ├── 20230216145442_change_webhooks_object_nullable.rb
│ ├── 20230221070501_create_customer_metadata.rb
│ ├── 20230221102035_add_precise_amount_cents_to_credit_note_items.rb
│ ├── 20230227145104_add_instant_to_charges.rb
│ ├── 20230301122720_create_invoice_metadata.rb
│ ├── 20230307131524_add_instant_event_id_to_fees.rb
│ ├── 20230313145506_add_email_settings_to_organizations.rb
│ ├── 20230323112252_add_payment_status_to_fees.rb
│ ├── 20230327134418_remove_payment_provider_null_constraint_on_refunds.rb
│ ├── 20230328161507_create_password_resets.rb
│ ├── 20230403093407_add_balance_cents_to_wallets.rb
│ ├── 20230403094044_add_billable_metric_limitations_to_coupons.rb
│ ├── 20230411083336_add_min_amount_cents_to_charges.rb
│ ├── 20230411085545_fix_wallet_consumed_amount_currency_naming.rb
│ ├── 20230414074225_add_version_to_invoices.rb
│ ├── 20230414130437_add_currency_to_invoices.rb
│ ├── 20230417094339_add_fees_amount_cents_to_invoices.rb
│ ├── 20230417122020_add_coupons_amount_cents_to_invoices.rb
│ ├── 20230417131515_add_credit_notes_amount_cents_to_invoices.rb
│ ├── 20230417140356_add_prepaid_credit_amount_cents_to_invoices.rb
│ ├── 20230418151450_add_subtotals_to_invoices.rb
│ ├── 20230419123538_add_true_up_fee_id_to_fees.rb
│ ├── 20230420114754_remove_invoice_credit_amount.rb
│ ├── 20230420120806_remove_invoice_amount.rb
│ ├── 20230421094757_add_before_vat_to_credits.rb
│ ├── 20230424091446_add_coupons_adjustment_amount_to_credit_notes.rb
│ ├── 20230424092207_add_one_off_columns_to_fees.rb
│ ├── 20230424150952_drop_internal_credit_notes_vat_amounts.rb
│ ├── 20230424154516_add_precise_amounts_to_credit_notes.rb
│ ├── 20230424210224_rename_true_up_fee_id_on_fees.rb
│ ├── 20230425130239_change_default_invoice_version.rb
│ ├── 20230503143229_create_tax_rates.rb
│ ├── 20230505093030_change_credits_id_type.rb
│ ├── 20230510113501_create_customers_tax_rates.rb
│ ├── 20230511124419_rename_customers_tax_rates_to_applied_tax_rates.rb
│ ├── 20230517093556_rename_instant_to_pay_in_advance.rb
│ ├── 20230522091400_add_unique_index_on_memberships.rb
│ ├── 20230522093423_rename_tax_rates_to_taxes.rb
│ ├── 20230522113810_add_invoiceable_to_charges.rb
│ ├── 20230523094557_rename_invoices_vat_fields.rb
│ ├── 20230523140656_rename_credit_notes_vat_fields.rb
│ ├── 20230524130637_rename_fees_vat_fields.rb
│ ├── 20230525120005_create_fees_taxes.rb
│ ├── 20230525122232_create_invoices_taxes.rb
│ ├── 20230525154612_create_credit_notes_taxes.rb
│ ├── 20230529093955_rename_applied_taxes_to_customers_taxes.rb
│ ├── 20230602090325_add_boundaries_to_invoice_subscriptions.rb
│ ├── 20230606085050_add_recurring_to_billable_metrics.rb
│ ├── 20230606164458_add_tax_identification_number.rb
│ ├── 20230608085013_remove_properties_from_invoice_subscriptions.rb
│ ├── 20230608133543_rename_persistent_to_quentified_event.rb
│ ├── 20230608154821_add_unique_index_to_invoice_subscriptions.rb
│ ├── 20230614191603_create_webhook_endpoints.rb
│ ├── 20230615183805_add_event_refrence_to_quantified_events.rb
│ ├── 20230619101701_add_base_amount_cents_to_credit_notes_applied_taxes.rb
│ ├── 20230620211201_add_unique_index_to_webhook_urls.rb
│ ├── 20230626123648_unify_invoices_taxes_rate.rb
│ ├── 20230626124005_migrate_organization_taxes.rb
│ ├── 20230627080605_add_prorated_to_charges.rb
│ ├── 20230629100018_add_description_to_coupon.rb
│ ├── 20230704112230_fix_organizations_taxes.rb
│ ├── 20230704144027_create_plans_taxes.rb
│ ├── 20230704150108_create_charges_taxes.rb
│ ├── 20230705213846_update_provider_payment_methods_for_stripe_customers.rb
│ ├── 20230713122526_rename_credit_before_vat.rb
│ ├── 20230717090135_add_precise_coupons_amount_cents_to_fees.rb
│ ├── 20230719100256_migrate_recurring_count_and_unique_count_aggregation.rb
│ ├── 20230720204311_add_signature_to_webhook_endpoints.rb
│ ├── 20230721073114_fix_credit_before_taxes.rb
│ ├── 20230726165711_add_net_payment_term_on_organization_and_customer.rb
│ ├── 20230726171737_add_payment_due_date_to_invoice.rb
│ ├── 20230727163611_create_add_ons_taxes.rb
│ ├── 20230731095510_remove_index_from_invoice_subscriptions.rb
│ ├── 20230731135721_add_net_payment_term_to_invoice.rb
│ ├── 20230808144739_fill_invoice_payment_due_date.rb
│ ├── 20230811081854_populate_fees_precise_coupons_amount_cents.rb
│ ├── 20230811120622_populate_fees_amount_cents_in_invoice_taxes.rb
│ ├── 20230816091053_add_external_salesforce_id_to_customers.rb
│ ├── 20230817092555_set_default_properties_to_charges.rb
│ ├── 20230821135235_add_unique_constraint_to_group_properties.rb
│ ├── 20230828085627_add_ending_at_to_subscriptions.rb
│ ├── 20230830120517_remove_status_from_groups.rb
│ ├── 20230905081225_add_weighted_interval_to_billable_metric.rb
│ ├── 20230907064335_add_invoice_display_name_to_plans.rb
│ ├── 20230907153404_add_group_id_to_quantified_events.rb
│ ├── 20230911083923_add_total_aggregated_units_to_fees.rb
│ ├── 20230911185900_add_unique_index_to_applied_taxes.rb
│ ├── 20230912082000_add_invoice_display_name_to_fees.rb
│ ├── 20230912082057_add_invoice_value_to_groups.rb
│ ├── 20230912082112_add_invoice_display_name_to_add_ons.rb
│ ├── 20230913123123_add_invoice_display_name_to_charges.rb
│ ├── 20230915073205_update_code_index_on_plans.rb
│ ├── 20230915120854_remove_events_foreign_keys.rb
│ ├── 20230915135256_add_invoice_display_name_to_group_properties.rb
│ ├── 20230918090426_add_index_to_events.rb
│ ├── 20230920083133_add_gin_index_to_events.rb
│ ├── 20230922064617_remove_parent_id_from_plans.rb
│ ├── 20230926132500_add_external_ids_to_events.rb
│ ├── 20230926144126_fill_event_external_ids.rb
│ ├── 20231001070407_add_voided_at_to_invoices.rb
│ ├── 20231010085938_deduplicate_events_transaction_id.rb
│ ├── 20231010090849_events_transaction_id_uniqueness.rb
│ ├── 20231016115055_create_cached_aggregations.rb
│ ├── 20231017082921_fill_cached_aggregations.rb
│ ├── 20231020091031_convert_unit_amount_cents_to_decimal.rb
│ ├── 20231027144605_add_precise_unit_amount_to_fees.rb
│ ├── 20231101080314_add_default_currency_to_organizations.rb
│ ├── 20231102085146_add_missing_indexes_to_subscriptions_and_plans.rb
│ ├── 20231102141929_add_index_on_event_external_subscription_id.rb
│ ├── 20231102154537_change_precision_to_precise_unit_amount.rb
│ ├── 20231103144201_create_recurring_transaction_rules.rb
│ ├── 20231106145424_delete_versions_for_group_properties.rb
│ ├── 20231107110809_undiscard_incorrectly_deleted_events.rb
│ ├── 20231109141829_create_last_hour_events_mv.rb
│ ├── 20231109154934_add_events_validation_index.rb
│ ├── 20231114092154_add_amount_details_to_fees.rb
│ ├── 20231117123744_add_organization_id_to_quantified_events.rb
│ ├── 20231123095209_add_unique_index_on_invoice_subscriptions.rb
│ ├── 20231123105540_add_fields_for_new_document_numbering.rb
│ ├── 20231128092231_update_default_amount_details_on_fees.rb
│ ├── 20231129145100_add_eu_tax_management_to_organizations.rb
│ ├── 20231130085817_change_default_invoice_version_to_v4.rb
│ ├── 20231201091348_add_code_and_name_to_payment_providers.rb
│ ├── 20231204131333_add_payment_provider_code_to_customers.rb
│ ├── 20231204151512_add_auto_generated_to_taxes.rb
│ ├── 20231205153156_remove_events_quantified_events_relation.rb
│ ├── 20231207095229_add_clickhouse_flag_to_organizations.rb
│ ├── 20231214103653_add_unique_index_on_invoice_sequential_id.rb
│ ├── 20231214133638_add_unique_index_on_invoice_organization_sequential_id.rb
│ ├── 20231218170631_add_rate_to_percentage_amount_details.rb
│ ├── 20231219121735_update_last_hour_events_mv_to_version2.rb
│ ├── 20231220115621_update_organization_sequential_id_index.rb
│ ├── 20231220140936_create_adjusted_fees.rb
│ ├── 20240103125624_add_group_id_to_adjusted_fees.rb
│ ├── 20240104152816_add_ready_to_be_refreshed_to_invoices.rb
│ ├── 20240111140424_create_billable_metric_filters.rb
│ ├── 20240111151140_create_charge_filters.rb
│ ├── 20240111155133_create_charge_filter_values.rb
│ ├── 20240112091706_add_charge_filter_id_to_fees.rb
│ ├── 20240115094827_create_commitments.rb
│ ├── 20240115102012_create_commitment_applied_taxes.rb
│ ├── 20240115130517_add_credits_auto_refreshed_to_organizations.rb
│ ├── 20240118135350_remove_credits_auto_refreshed_from_organizations.rb
│ ├── 20240118140703_add_grouped_by_to_cached_aggregations.rb
│ ├── 20240118141022_add_grouped_by_to_fees.rb
│ ├── 20240123104811_change_fees_grouped_by_type.rb
│ ├── 20240125080718_add_grouped_by_to_adjusted_fees.rb
│ ├── 20240129155938_add_grouped_by_to_quantified_events.rb
│ ├── 20240205160647_remove_organization_sequential_id_index_from_invoices.rb
│ ├── 20240227161430_add_invoice_display_name_to_charge_filters.rb
│ ├── 20240301133006_add_charge_filter_id_to_cached_aggregations.rb
│ ├── 20240305093058_update_last_hour_events_mv_to_version3.rb
│ ├── 20240305164449_add_missing_charge_filter_id_relations.rb
│ ├── 20240308104003_rollback_post_validation_view.rb
│ ├── 20240308150801_update_last_hour_events_mv.rb
│ ├── 20240311091817_add_index_on_last_hour_events_mv.rb
│ ├── 20240312141641_add_new_index_to_groups.rb
│ ├── 20240314163426_add_multiple_values_to_charge_filter_values.rb
│ ├── 20240314165306_migrate_groups_to_filters.rb
│ ├── 20240314170211_add_charge_filter_id_to_quantified_events.rb
│ ├── 20240314172008_link_filters_to_cached_aggregation.rb
│ ├── 20240327071539_add_payment_disputed_to_invoices.rb
│ ├── 20240328075919_add_trial_ended_at_to_subscriptions.rb
│ ├── 20240328153701_remove_unique_count_quantified_events.rb
│ ├── 20240329112415_fill_subscriptions_trial_ended_at.rb
│ ├── 20240403084644_add_integrations_setup.rb
│ ├── 20240404123257_add_skip_charges_bool_in_invoices.rb
│ ├── 20240411114759_create_integrations_base_mappings.rb
│ ├── 20240412085450_create_integration_collection_mappings.rb
│ ├── 20240412133335_add_invoice_type_to_invoice_subscriptions.rb
│ ├── 20240415122310_add_custom_aggregator_to_billable_metrics.rb
│ ├── 20240419071607_add_transaction_status_to_wallet_transactions.rb
│ ├── 20240419085012_create_integration_items.rb
│ ├── 20240423155113_add_organization_timestamp_index_on_events.rb
│ ├── 20240424110420_rename_integration_items_columns.rb
│ ├── 20240424124802_add_depleted_ongoing_balance_to_wallets.rb
│ ├── 20240425082113_create_integration_customers.rb
│ ├── 20240425131701_update_cached_aggregations.rb
│ ├── 20240426143059_add_integration_item_uniqueness_index.rb
│ ├── 20240429141108_add_custom_aggregation_to_organizations.rb
│ ├── 20240430100120_add_role_to_invite.rb
│ ├── 20240430133150_add_invoiced_to_transaction_status.rb
│ ├── 20240502075803_add_filters_missing_indexes.rb
│ ├── 20240502095122_add_indexes_to_subscriptions.rb
│ ├── 20240506085424_migrate_quantified_events_to_cached_aggregations.rb
│ ├── 20240514072741_add_method_to_recurring_transaction_rules.rb
│ ├── 20240514081110_create_integration_resources.rb
│ ├── 20240520115450_add_integration_id_to_integration_resources.rb
│ ├── 20240521143531_add_target_ongoing_balance_to_recurring_transaction_rules.rb
│ ├── 20240522105942_add_resource_type_to_integration_resources.rb
│ ├── 20240530123427_add_started_at_to_recurring_transaction_rules.rb
│ ├── 20240603080144_fix_quantified_event_migration.rb
│ ├── 20240603095841_refresh_cached_aggregations.rb
│ ├── 20240604141208_change_integration_customer_external_id_nullable_option.rb
│ ├── 20240607095155_add_event_transaction_id_to_cached_aggregations.rb
│ ├── 20240607095208_add_event_transaction_id_to_fees.rb
│ ├── 20240611074215_add_payment_overdue_to_invoices.rb
│ ├── 20240619082054_add_in_advance_charge_periodic_invoicing_reason.rb
│ ├── 20240625090742_create_data_exports.rb
│ ├── 20240626094521_add_shipping_address_to_customers.rb
│ ├── 20240628083654_add_membership_id_and_organization_id_to_data_exports.rb
│ ├── 20240628083830_remove_user_id_from_data_exports.rb
│ ├── 20240701083355_create_billable_metrics_grouped_charges.rb
│ ├── 20240701184757_add_deleted_at_to_fees.rb
│ ├── 20240702081109_add_regroup_paid_fees_to_charges.rb
│ ├── 20240703061352_add_lago_version_to_versions.rb
│ ├── 20240705125619_update_billable_metrics_grouped_charges_to_version_2.rb
│ ├── 20240706204557_remove_data_exports_resource_query_null_constraint.rb
│ ├── 20240708081356_update_last_hour_events_mv_v04.rb
│ ├── 20240708195226_remove_null_constraint_on_applied_taxes.rb
│ ├── 20240711091155_add_fee_deleted_at_index.rb
│ ├── 20240711094255_add_invoice_payment_overdue_index.rb
│ ├── 20240712090133_add_index_to_fees.rb
│ ├── 20240716153753_add_index_on_fees_pay_in_advance_event_transaction_id.rb
│ ├── 20240716154636_add_index_on_subscriptions_previous_subscription_id.rb
│ ├── 20240718080929_update_billable_metrics_grouped_charges_to_version_3.rb
│ ├── 20240718105718_create_integration_error_details.rb
│ ├── 20240722201341_add_index_to_invoices_status.rb
│ ├── 20240723150221_remove_integration_reference_from_error_detail.rb
│ ├── 20240723150304_add_invoice_requires_successful_payment.rb
│ ├── 20240729133823_create_payable_groups.rb
│ ├── 20240729134020_add_index_on_payable_group_id.rb
│ ├── 20240729151049_add_payable_type_and_payable_id_to_payments.rb
│ ├── 20240729152352_add_index_on_payments_payable_id_and_payable_type.rb
│ ├── 20240729154334_add_index_on_events_external_subscription_id_with_included.rb
│ ├── 20240801134832_create_payment_requests.rb
│ ├── 20240801134833_add_index_on_payment_requests_payable_id_and_payable_type.rb
│ ├── 20240801142242_alter_events_vacuum_settings.rb
│ ├── 20240802115017_create_progressive_billing_tresholds.rb
│ ├── 20240807072052_rename_progressive_billing_tresholds.rb
│ ├── 20240807100609_add_metadata_to_wallet_transactions.rb
│ ├── 20240807113700_rename_usage_tresholds.rb
│ ├── 20240808080611_remove_amount_currency_from_usage_tresholds.rb
│ ├── 20240808085506_add_metadata_to_recurring_transaction_rules.rb
│ ├── 20240808132042_create_lifetime_usage.rb
│ ├── 20240812130655_re_add_unique_index_on_record_id.rb
│ ├── 20240813095718_add_usage_threshold_id_to_fees.rb
│ ├── 20240813121307_add_progressive_billing_to_invoicing_reason.rb
│ ├── 20240814144137_add_organization_id_to_payment_requests_and_payable_groups.rb
│ ├── 20240816075711_add_negative_amount_cents_to_invoice.rb
│ ├── 20240819092354_add_deleted_at_to_usage_thresholds.rb
│ ├── 20240820090312_attach_progressive_billing_invoices_to_credits.rb
│ ├── 20240820125840_add_progressive_billing_credit_amount_cents_to_invoices.rb
│ ├── 20240821093145_create_invoices_payment_requests.rb
│ ├── 20240821172352_add_finalize_zero_amount_invoice_to_organizations.rb
│ ├── 20240821174724_add_finalize_zero_amount_invoice_to_customers.rb
│ ├── 20240822080031_add_historical_usage_to_lifetime_usage.rb
│ ├── 20240822082727_remove_usage_threshold_relation_from_fees.rb
│ ├── 20240822142524_add_payment_retry_columns_to_payment_requests.rb
│ ├── 20240823092643_create_applied_usage_thresholds.rb
│ ├── 20240829093425_add_precise_amount_cents_columns.rb
│ ├── 20240906154644_add_firstname_and_lastname_to_customers.rb
│ ├── 20240906170048_add_customer_type_to_customers.rb
│ ├── 20240910093646_change_tax_id_null_on_credit_note_applied_taxes.rb
│ ├── 20240910111203_update_indexes_for_credit_notes_taxes.rb
│ ├── 20240917144243_add_precise_total_amount_cents_to_event.rb
│ ├── 20240917145042_add_index_on_precise_total_amount_cents.rb
│ ├── 20240920084727_change_wallet_transactions_metadata_default.rb
│ ├── 20240920091133_change_recurring_transaction_rules_transaction_metadata_default.rb
│ ├── 20240924114730_add_taxes_deduction_rate_fields_to_fees_and_applied_taxes.rb
│ ├── 20241001105523_add_deleted_at_to_payment_providers.rb
│ ├── 20241001112117_add_deleted_at_to_payment_provider_customers.rb
│ ├── 20241007083747_create_dunning_campaigns.rb
│ ├── 20241007092701_create_dunning_campaign_thresholds.rb
│ ├── 20241008080209_add_lock_version_to_wallets.rb
│ ├── 20241010055733_add_reference_to_credit_note_from_wallet_transaction.rb
│ ├── 20241011123148_add_foreign_key_constraint_to_credit_note_id_at_wallet_transaction.rb
│ ├── 20241011123621_change_validate_on_foreign_key_from_wallet_transaction_to_credit_note.rb
│ ├── 20241014000100_add_provider_payment_data_to_payments.rb
│ ├── 20241014093451_add_ready_to_be_refreshed_to_wallets.rb
│ ├── 20241015132635_add_parent_id_to_charges.rb
│ ├── 20241016104211_add_dunning_campaign_to_customers.rb
│ ├── 20241016133129_add_clickhouse_events_store_to_organizations.rb
│ ├── 20241017082601_add_expression_to_billable_metric.rb
│ ├── 20241018112637_add_expression_index_to_billable_metrics.rb
│ ├── 20241021095706_create_daily_usages.rb
│ ├── 20241021140054_create_api_keys.rb
│ ├── 20241022144437_add_parent_to_charges_from_plan_parent.rb
│ ├── 20241024082941_create_data_export_parts.rb
│ ├── 20241025081408_add_refreshed_at_to_daily_usage.rb
│ ├── 20241029141351_add_rounding_options_to_billable_metrics.rb
│ ├── 20241030123528_add_hmac_key_to_organizations.rb
│ ├── 20241031095225_add_expires_at_to_api_keys.rb
│ ├── 20241031102231_create_invoice_errors.rb
│ ├── 20241031123415_add_applied_to_organization_unique_index_to_dunning_campaigns.rb
│ ├── 20241101151559_add_last_used_at_to_api_keys.rb
│ ├── 20241106104515_remove_not_null_constraint_from_email_in_payment_requests.rb
│ ├── 20241107093418_add_name_to_api_keys.rb
│ ├── 20241108103702_add_usage_diff_to_daily_usages.rb
│ ├── 20241113181629_add_precise_amount_cents_to_adjusted_fee.rb
│ ├── 20241118103032_fulfill_adjusted_fee_unit_precise_amount_cents.rb
│ ├── 20241118165935_add_deleted_at_to_dunning_campaign_thresholds.rb
│ ├── 20241119110219_update_unique_index_on_dunning_campaign_thresholds.rb
│ ├── 20241119114948_add_dunning_campaign_completed_to_customers.rb
│ ├── 20241120085057_add_deleted_at_to_dunning_campaigns.rb
│ ├── 20241120090305_update_unique_index_on_dunning_campaigns.rb
│ ├── 20241120094557_add_permissions_to_api_keys.rb
│ ├── 20241122104537_add_organization_id_to_fees.rb
│ ├── 20241122105133_add_organization_id_fk_to_fees.rb
│ ├── 20241122105327_validate_fees_organizations_foreign_key.rb
│ ├── 20241122111534_create_invoice_custom_sections.rb
│ ├── 20241122134430_create_invoice_custom_section_selections.rb
│ ├── 20241122140603_create_applied_invoice_custom_sections.rb
│ ├── 20241122141158_add_skip_invoice_custom_sections_to_customers.rb
│ ├── 20241125194753_update_unique_index_applied_to_organization_per_organization.rb
│ ├── 20241126102447_set_dunning_campaign_completed_to_customers.rb
│ ├── 20241126103448_add_dunning_campaign_id_to_payment_requests.rb
│ ├── 20241126141853_update_index_charges_on_billable_metric_id.rb
│ ├── 20241128091634_remove_dunning_campaign_completed_from_customers.rb
│ ├── 20241128132010_add_new_permissions_to_api_keys.rb
│ ├── 20241213142739_change_null_payment_provider_payment_id.rb
│ ├── 20241213182343_create_inbound_webhooks.rb
│ ├── 20241216110525_add_payable_payment_status_to_payment.rb
│ ├── 20241216140931_add_tax_status_to_invoices.rb
│ ├── 20241217120924_add_indexes_to_invoices.rb
│ ├── 20241219122151_add_processing_at_to_inbound_webhooks.rb
│ ├── 20241219145642_add_usage_date_to_daily_usages.rb
│ ├── 20241219152909_add_index_on_usage_date_to_daily_usages.rb
│ ├── 20241220084758_fix_charge_properties_with_double_values.rb
│ ├── 20241220095049_backfill_payable_payment_status.rb
│ ├── 20241220160748_index_cached_aggregation.rb
│ ├── 20241223144027_backfill_failed_payable_payment_status.rb
│ ├── 20241223154437_add_indices_to_inbound_webhooks.rb
│ ├── 20241224141116_add_payment_type_and_reference_to_payments.rb
│ ├── 20241224142141_add_total_paid_amount_cents_to_invoices.rb
│ ├── 20241227154337_remove_code_uniqueness_constraint_on_invoice_custom_sections.rb
│ ├── 20241227161927_add_new_index_on_code_for_invoice_custom_sections.rb
│ ├── 20250103124802_drop_zero_amount_fees.rb
│ ├── 20250114163522_add_account_type_to_customers.rb
│ ├── 20250114172823_add_self_billed_to_invoices.rb
│ ├── 20250120151959_add_unique_event_index_on_fees.rb
│ ├── 20250122112050_delete_sequence_generation_invoice_error_for_generated_invoices.rb
│ ├── 20250122130735_change_unique_index_in_payments.rb
│ ├── 20250205184611_add_index_on_invoices_org_seq_id.rb
│ ├── 20250207094842_add_applied_grace_period_to_invoices.rb
│ ├── 20250207142402_backfill_applied_grace_period_on_draft_invoices.rb
│ ├── 20250212123207_backfill_invoices_and_payments.rb
│ ├── 20250214091021_add_index_to_in_advance_charges.rb
│ ├── 20250217152051_migrate_invoice_error_to_error_detail.rb
│ ├── 20250218165958_drop_invoice_error_table.rb
│ ├── 20250219124948_create_billing_entities.rb
│ ├── 20250219152213_add_references_to_billing_entities.rb
│ ├── 20250219164502_create_billing_entities_taxes.rb
│ ├── 20250219205535_fix_invoices_with_incorrect_total_paid_amount.rb
│ ├── 20250220085848_add_unique_index_to_provider_payment_id.rb
│ ├── 20250220180112_create_payment_receipts.rb
│ ├── 20250220180113_add_payment_receipt_counter_to_customers.rb
│ ├── 20250220180114_create_before_payment_receipt_insert_trigger.rb
│ ├── 20250220223944_add_provider_payment_method_data_to_payments.rb
│ ├── 20250227091909_remove_is_default_from_billing_entity.rb
│ ├── 20250227155522_fix_metadata_in_wallet_transactions_and_recurring_rules.rb
│ ├── 20250303104151_add_code_uniqueness_index_to_billing_entities.rb
│ ├── 20250304163656_create_billing_entity_per_each_organization.rb
│ ├── 20250310213734_add_expiration_and_termination_to_recurring_transaction_rules.rb
│ ├── 20250318093216_add_failed_at_to_wallet_transactions.rb
│ ├── 20250318175216_mark_pending_wallet_transactions_as_failed.rb
│ ├── 20250324122757_add_email_bcc_to_dunning_campaign.rb
│ ├── 20250324125056_add_provider_payment_method_id_to_payments.rb
│ ├── 20250325145324_assign_customers_to_billing_entities.rb
│ ├── 20250325162648_assign_invoices_to_billing_entities.rb
│ ├── 20250327130155_remove_default_billing_entity_sequential_id_on_invoices.rb
│ ├── 20250327130156_change_invoices_index_on_billing_entity_sequential_id.rb
│ ├── 20250402113844_fill_missing_invoice_id_on_wallet_transactions.rb
│ ├── 20250402135038_assign_discarded_customers_to_billing_entities.rb
│ ├── 20250402150920_add_billing_entity_id_not_null_check_constraint.rb
│ ├── 20250402150959_validate_add_non_null_to_invoices_billing_entity_id.rb
│ ├── 20250402151113_add_foreign_key_constraints_to_invoices_billing_entity_id.rb
│ ├── 20250402151747_validate_foreign_key_billing_entities_on_invoices.rb
│ ├── 20250402151900_add_billing_entity_id_not_null_check_constraint_to_customers.rb
│ ├── 20250402151930_validate_add_non_null_to_customers_billing_entity_id.rb
│ ├── 20250402152000_add_foreign_key_constraints_to_customers_billing_entity_id.rb
│ ├── 20250402152030_validate_foreign_key_billing_entities_on_customers.rb
│ ├── 20250402152100_add_billing_entity_id_not_null_check_constraint_to_fees.rb
│ ├── 20250402152130_validate_add_non_null_to_fees_billing_entity_id.rb
│ ├── 20250402152200_add_foreign_key_constraints_to_fees_billing_entity_id.rb
│ ├── 20250402152230_validate_foreign_key_billing_entities_on_fees.rb
│ ├── 20250403093628_ensure_organization_last_invoice_got_organization_sequential_id.rb
│ ├── 20250403110833_add_section_type_to_invoice_custom_sections.rb
│ ├── 20250407000001_create_customers_export_view.rb
│ ├── 20250407202459_add_section_type_index_to_invoice_custom_sections.rb
│ ├── 20250408121522_ensure_all_billing_entities_have_invoice_sequential_id.rb
│ ├── 20250409100421_add_finalized_at_timestamp_to_invoices.rb
│ ├── 20250409140652_add_organization_id_not_null_check_constraint_to_fees.rb
│ ├── 20250409140720_validate_add_non_null_to_fees_organization_id.rb
│ ├── 20250411074202_drop_index_events_on_subscription_id.rb
│ ├── 20250411110825_drop_index_events_on_external_subscription_id_and_code_and_timestamp.rb
│ ├── 20250411110934_drop_index_events_on_subscription_id_and_code_and_timestamp.rb
│ ├── 20250411112117_drop_index_events_on_organization_id_and_code_and_created_at.rb
│ ├── 20250411152022_migrate_applied_taxes_to_billing_entities.rb
│ ├── 20250414091130_create_idempotency_records.rb
│ ├── 20250414121455_drop_cached_aggregations_group_indexes.rb
│ ├── 20250414122643_drop_cached_aggregation_timestamp_lookup.rb
│ ├── 20250414122904_change_cached_aggregation_lookup.rb
│ ├── 20250415143607_enqueue_update_all_eu_taxes_job.rb
│ ├── 20250416125600_create_payment_intents.rb
│ ├── 20250424135624_add_organization_id_to_charges.rb
│ ├── 20250424140359_add_organization_id_fk_to_charges.rb
│ ├── 20250424140537_validate_charges_organizations_foreign_key.rb
│ ├── 20250425102306_add_organization_to_add_ons_taxes.rb
│ ├── 20250425102447_add_organization_id_fk_to_add_ons_taxes.rb
│ ├── 20250425102555_validates_add_ons_taxes_organizations_foreign_key.rb
│ ├── 20250425122510_add_organization_id_to_subscriptions.rb
│ ├── 20250425122641_add_organization_id_fk_to_subscription.rb
│ ├── 20250425122705_validate_subscriptions_organizations_foreign_key.rb
│ ├── 20250425123733_add_organization_id_to_adjusted_fees.rb
│ ├── 20250425124100_add_organization_id_fk_to_adjusted_fees.rb
│ ├── 20250425124305_validate_adjusted_fees_organizations_foreign_key.rb
│ ├── 20250425124804_add_organization_id_to_wallets.rb
│ ├── 20250425124826_add_organization_id_fk_to_wallets.rb
│ ├── 20250425124942_validate_wallets_organizations_foreign_key.rb
│ ├── 20250425130332_add_organization_id_to_wallet_transactions.rb
│ ├── 20250425130345_add_organization_id_fk_to_wallet_transactions.rb
│ ├── 20250425130412_validate_wallets_transactions_organization_foreign_key.rb
│ ├── 20250425132247_add_organization_id_to_applied_coupons.rb
│ ├── 20250425132724_add_organization_id_to_payments.rb
│ ├── 20250425132757_add_organization_id_fk_to_paymants.rb
│ ├── 20250425132821_validate_payments_organizations_foreign_key.rb
│ ├── 20250425134826_add_organization_id_fk_to_applied_coupons.rb
│ ├── 20250425134911_validate_applied_coupons_organizations_foreign_key.rb
│ ├── 20250428111042_ensure_organization_last_invoice_got_organization_sequential_id_retry.rb
│ ├── 20250428130107_add_organization_id_to_webhooks.rb
│ ├── 20250428130129_add_organization_id_fk_to_webhooks.rb
│ ├── 20250428130148_validate_webhooks_organizations_foreign_key.rb
│ ├── 20250428140111_add_organization_id_to_usage_thresholds.rb
│ ├── 20250428140126_add_organization_id_fk_to_usage_thresholds.rb
│ ├── 20250428140148_validate_usage_thresholds_organizations_foreign_key.rb
│ ├── 20250428154444_add_organization_id_to_plans_taxes.rb
│ ├── 20250428154500_add_organization_id_fk_to_plans_taxes.rb
│ ├── 20250428154519_validate_plans_taxes_organizations_foreign_key.rb
│ ├── 20250429100148_create_usage_monitoring_subscription_activities.rb
│ ├── 20250429100149_add_organization_id_to_invoice_subscriptions.rb
│ ├── 20250429100150_add_organization_id_fk_to_invoice_subscriptions.rb
│ ├── 20250429100151_validate_invoice_subscriptions_organizations_foreign_key.rb
│ ├── 20250429100152_add_organization_id_to_payment_provider_customers.rb
│ ├── 20250429100153_add_organization_id_fk_to_payment_provider_customers.rb
│ ├── 20250429100154_validate_payment_provider_customers_organizations_foreign_key.rb
│ ├── 20250429150114_add_organization_id_to_invoices_taxes.rb
│ ├── 20250429150128_add_organization_id_fk_to_invoices_taxes.rb
│ ├── 20250429150146_validate_invoices_taxes_organizations_foreign_key.rb
│ ├── 20250505125308_add_organization_id_to_idempotency_records.rb
│ ├── 20250505125335_add_organization_id_fk_to_idempotency_records.rb
│ ├── 20250505125354_validate_idempotency_records_organizations_foreign_key.rb
│ ├── 20250505135819_add_organization_id_to_charge_filters.rb
│ ├── 20250505135820_add_organization_id_fk_to_charge_filters.rb
│ ├── 20250505135821_validate_charge_filters_organizations_foreign_key.rb
│ ├── 20250505140926_add_organization_id_to_charges_taxes.rb
│ ├── 20250505140927_add_organization_id_fk_to_charges_taxes.rb
│ ├── 20250505140928_validate_charges_taxes_organizations_foreign_key.rb
│ ├── 20250505142219_add_organization_id_to_credits.rb
│ ├── 20250505142220_add_organization_id_fk_to_credits.rb
│ ├── 20250505142221_validate_credits_organizations_foreign_key.rb
│ ├── 20250505161357_add_organization_id_to_credit_notes.rb
│ ├── 20250505161358_add_organization_id_fk_to_credit_notes.rb
│ ├── 20250505161359_validate_credit_notes_organizations_foreign_key.rb
│ ├── 20250506084020_add_organization_id_to_applied_invoice_custom_sections.rb
│ ├── 20250506084021_add_organization_id_fk_to_applied_invoice_custom_sections.rb
│ ├── 20250506084022_validate_applied_invoice_custom_sections_organizations_foreign_key.rb
│ ├── 20250506084827_add_organization_id_to_applied_usage_thresholds.rb
│ ├── 20250506084828_add_organization_id_fk_to_applied_usage_thresholds.rb
│ ├── 20250506084829_validate_applied_usage_thresholds_organizations_foreign_key.rb
│ ├── 20250506085758_add_organization_id_to_customer_metadata.rb
│ ├── 20250506085759_add_organization_id_fk_to_customer_metadata.rb
│ ├── 20250506085760_validate_customer_metadata_organizations_foreign_key.rb
│ ├── 20250506115437_add_organization_id_to_billable_metric_filters.rb
│ ├── 20250506115438_add_organization_id_fk_to_billable_metric_filters.rb
│ ├── 20250506115439_validate_billable_metric_filters_organizations_foreign_key.rb
│ ├── 20250506121530_add_organization_id_to_fees_taxes.rb
│ ├── 20250506121531_add_organization_id_fk_to_fees_taxes.rb
│ ├── 20250506121532_validate_fees_taxes_organizations_foreign_key.rb
│ ├── 20250506144000_add_organization_id_to_invoices_payment_requests.rb
│ ├── 20250506144001_add_organization_id_fk_to_invoices_payment_requests.rb
│ ├── 20250506144002_validate_invoices_payment_requests_organizations_foreign_key.rb
│ ├── 20250506145849_add_organization_id_to_invoice_metadata.rb
│ ├── 20250506145850_add_organization_id_fk_to_invoice_metadata.rb
│ ├── 20250506145851_validate_invoice_metadata_organizations_foreign_key.rb
│ ├── 20250506170753_update_net_payment_term_on_billing_entity.rb
│ ├── 20250507110137_fix_billing_entity_document_numbering_prefix.rb
│ ├── 20250507154910_update_nil_eu_tax_management_on_billing_entities.rb
│ ├── 20250512081332_add_lock_version_to_wallet_transactions.rb
│ ├── 20250512122606_add_organization_id_to_billing_entities_taxes.rb
│ ├── 20250512122607_add_organization_id_fk_to_billing_entities_taxes.rb
│ ├── 20250512122608_validate_billing_entities_taxes_organizations_foreign_key.rb
│ ├── 20250512123539_add_organization_id_to_credit_notes_taxes.rb
│ ├── 20250512123540_add_organization_id_fk_to_credit_notes_taxes.rb
│ ├── 20250512123541_validate_credit_notes_taxes_organizations_foreign_key.rb
│ ├── 20250512130614_add_organization_id_to_customers_taxes.rb
│ ├── 20250512130615_add_organization_id_fk_to_customers_taxes.rb
│ ├── 20250512130616_validate_customers_taxes_organizations_foreign_key.rb
│ ├── 20250512142912_add_organization_id_to_data_export_parts.rb
│ ├── 20250512142913_add_organization_id_fk_to_data_export_parts.rb
│ ├── 20250512142914_validate_data_export_parts_organizations_foreign_key.rb
│ ├── 20250512144218_add_organization_id_to_dunning_campaign_thresholds.rb
│ ├── 20250512144219_add_organization_id_fk_to_dunning_campaign_thresholds.rb
│ ├── 20250512144220_validate_dunning_campaign_thresholds_organizations_foreign_key.rb
│ ├── 20250512151246_add_organization_id_to_coupon_targets.rb
│ ├── 20250512151247_add_organization_id_fk_to_coupon_targets.rb
│ ├── 20250512151248_validate_coupon_targets_organizations_foreign_key.rb
│ ├── 20250513132423_add_organization_id_to_commitments.rb
│ ├── 20250513132424_add_organization_id_fk_to_commitments.rb
│ ├── 20250513132425_validate_commitments_organizations_foreign_key.rb
│ ├── 20250513144352_add_organization_id_to_commitments_taxes.rb
│ ├── 20250513144353_add_organization_id_fk_to_commitments_taxes.rb
│ ├── 20250513144354_validate_commitments_taxes_organizations_foreign_key.rb
│ ├── 20250513151258_add_organization_id_to_credit_note_items.rb
│ ├── 20250513151259_add_organization_id_fk_to_credit_note_items.rb
│ ├── 20250513151260_validate_credit_note_items_organizations_foreign_key.rb
│ ├── 20250513152805_add_organization_id_to_integration_resources.rb
│ ├── 20250513152806_add_organization_id_fk_to_integration_resources.rb
│ ├── 20250513152807_validate_integration_resources_organizations_foreign_key.rb
│ ├── 20250513153628_add_organization_id_to_integration_customers.rb
│ ├── 20250513153629_add_organization_id_fk_to_integration_customers.rb
│ ├── 20250513153630_validate_integration_customers_organizations_foreign_key.rb
│ ├── 20250515083649_add_billing_entity_id_to_payment_receipts.rb
│ ├── 20250515083802_populate_payment_receipts_billing_entity_id.rb
│ ├── 20250515083935_set_payment_receipts_not_null_constraint_on_billing_entity_id.rb
│ ├── 20250515085230_validate_set_payment_receipts_not_null_constraint_on_billing_entity_id.rb
│ ├── 20250516084025_rebuild_invoice_index_on_billing_entity_sequential_id.rb
│ ├── 20250516095313_add_organization_id_to_integration_items.rb
│ ├── 20250516095314_add_organization_id_fk_to_integration_items.rb
│ ├── 20250516095315_validate_integration_items_organizations_foreign_key.rb
│ ├── 20250516100024_add_organization_id_to_integration_mappings.rb
│ ├── 20250516100025_add_organization_id_fk_to_integration_mappings.rb
│ ├── 20250516100026_validate_integration_mappings_organizations_foreign_key.rb
│ ├── 20250516115755_add_organization_id_to_charge_filter_values.rb
│ ├── 20250516115756_add_organization_id_fk_to_charge_filter_values.rb
│ ├── 20250516115757_validate_charge_filter_values_organizations_foreign_key.rb
│ ├── 20250517100023_create_pricing_units.rb
│ ├── 20250519084647_add_organization_id_to_recurring_transaction_rules.rb
│ ├── 20250519084648_add_organization_id_fk_to_recurring_transaction_rules.rb
│ ├── 20250519084649_validate_recurring_transaction_rules_organizations_foreign_key.rb
│ ├── 20250519085909_add_organization_id_to_integration_collection_mappings.rb
│ ├── 20250519085910_add_organization_id_fk_to_integration_collection_mappings.rb
│ ├── 20250519085911_validate_integration_collection_mappings_organizations_foreign_key.rb
│ ├── 20250519092051_add_organization_id_to_refunds.rb
│ ├── 20250519092052_add_organization_id_fk_to_refunds.rb
│ ├── 20250519092053_validate_refunds_organizations_foreign_key.rb
│ ├── 20250520080000_create_usage_monitoring_alerts.rb
│ ├── 20250520143628_update_exports_views_with_organization_id.rb
│ ├── 20250520155108_add_billable_metric_usage_units_alert_type_to_enum.rb
│ ├── 20250520170402_add_lifetime_usage_amount_alert_type_to_enum.rb
│ ├── 20250521095733_create_customers_invoice_custom_sections.rb
│ ├── 20250521104239_create_billing_entities_invoice_custom_sections.rb
│ ├── 20250521135607_create_customer_applied_invoice_custom_section_records.rb
│ ├── 20250521151540_create_billing_entity_invoice_custom_sections_records.rb
│ ├── 20250522134155_create_exports_daily_usages.rb
│ ├── 20250526111147_add_allowed_fee_types_to_wallets.rb
│ ├── 20250526130953_populate_billing_entity_applied_dunning_campaign.rb
│ ├── 20250526133152_add_foreign_key_on_billing_entities_applied_dunning_campaign_id.rb
│ ├── 20250526133654_drop_clickhouse_aggregation_from_organizations.rb
│ ├── 20250526134136_validate_added_foreign_key_on_applied_dunning_campaign_at_billing_entities.rb
│ ├── 20250530112903_add_precise_credit_notes_amount_cents_to_fees.rb
│ ├── 20250602075710_replace_alert_type_enum.rb
│ ├── 20250602145535_create_flat_filters.rb
│ └── 20250609121102_create_applied_pricing_units.rb
├── seeds.rb
├── seeds
│ ├── 01_base.rb
│ ├── alerting.rb
│ ├── invoices.rb
│ └── webhooks.rb
├── structure.sql
└── views
│ ├── billable_metrics_grouped_charges_v01.sql
│ ├── billable_metrics_grouped_charges_v02.sql
│ ├── billable_metrics_grouped_charges_v03.sql
│ ├── exports_applied_coupons_v01.sql
│ ├── exports_applied_coupons_v02.sql
│ ├── exports_billable_metrics_v01.sql
│ ├── exports_charges_v01.sql
│ ├── exports_charges_v02.sql
│ ├── exports_coupons_v01.sql
│ ├── exports_credit_notes_taxes_v01.sql
│ ├── exports_credit_notes_taxes_v02.sql
│ ├── exports_credit_notes_v01.sql
│ ├── exports_credit_notes_v02.sql
│ ├── exports_customers_v01.sql
│ ├── exports_daily_usages_v01.sql
│ ├── exports_fees_taxes_v01.sql
│ ├── exports_fees_taxes_v02.sql
│ ├── exports_fees_v01.sql
│ ├── exports_invoices_taxes_v01.sql
│ ├── exports_invoices_taxes_v02.sql
│ ├── exports_invoices_v01.sql
│ ├── exports_plans_v01.sql
│ ├── exports_subscriptions_v01.sql
│ ├── exports_subscriptions_v02.sql
│ ├── exports_taxes_v01.sql
│ ├── exports_wallet_transactions_v01.sql
│ ├── exports_wallet_transactions_v02.sql
│ ├── exports_wallets_v01.sql
│ ├── exports_wallets_v02.sql
│ ├── flat_filters_v01.sql
│ ├── last_hour_events_mv_v01.sql
│ ├── last_hour_events_mv_v02.sql
│ ├── last_hour_events_mv_v03.sql
│ └── last_hour_events_mv_v04.sql
├── dev
└── cops
│ └── service_call_cop.rb
├── karafka.rb
├── lib
├── active_job
│ ├── json_log_subscriber.rb
│ ├── logging.rb
│ └── uniqueness
│ │ └── strategies
│ │ └── until_executed_patch.rb
├── current_context.rb
├── generators
│ └── organization_id_generator
│ │ ├── organization_id_generator_generator.rb
│ │ └── templates
│ │ ├── add_organization_id_fk_migration.rb.erb
│ │ ├── add_organization_id_migration.rb.erb
│ │ ├── job_template.rb.erb
│ │ └── validate_organization_foreign_key_migration.rb.erb
├── karafka
│ └── lago_monitor.rb
├── lago
│ └── adyen
│ │ ├── error_handlable.rb
│ │ └── params.rb
├── lago_eu_vat
│ ├── lago_eu_vat.rb
│ └── lago_eu_vat
│ │ ├── eu_vat_rates.json
│ │ └── rate.rb
├── lago_http_client
│ ├── lago_http_client.rb
│ └── lago_http_client
│ │ ├── client.rb
│ │ └── http_error.rb
├── lago_utils
│ ├── lago_utils.rb
│ └── lago_utils
│ │ ├── license.rb
│ │ ├── ruby_sandbox.rb
│ │ ├── ruby_sandbox
│ │ ├── runner.rb
│ │ ├── safe_environment.rb
│ │ ├── sandbox_error.rb
│ │ └── sanitizer.rb
│ │ └── version.rb
└── tasks
│ ├── annotate_rb.rake
│ ├── applied_coupons.rake
│ ├── cache.rake
│ ├── coupons.rake
│ ├── custom_aggregation.rake
│ ├── customers.rake
│ ├── daily_usages.rake
│ ├── db.rake
│ ├── events.rake
│ ├── fees.rake
│ ├── filters.rake
│ ├── invoices.rake
│ ├── lago.rake
│ ├── memberships.rake
│ ├── migrations
│ └── organization_id.rake
│ ├── organizations.rake
│ ├── signup.rake
│ ├── stripe.rake
│ ├── subscriptions.rake
│ ├── tests
│ └── seed_plans.rake
│ └── upgrade_verification.rake
├── log
└── .keep
├── public
├── assets
│ └── images
│ │ ├── lago-logo-email.png
│ │ └── lago-logo-invoice.png
└── robots.txt
├── schema.graphql
├── schema.json
├── scripts
├── generate.rsa.sh
├── generate.version.sh
├── karafka.web.sh
├── migrate.dev.sh
├── migrate.sh
├── start.api.sh
├── start.billing.worker.sh
├── start.clock.sh
├── start.clock.worker.sh
├── start.dev.sh
├── start.events.consumer.sh
├── start.events.worker.sh
├── start.payments.worker.sh
├── start.pdfs.worker.sh
├── start.sh
├── start.webhook.worker.sh
└── start.worker.sh
├── spec
├── clockwork_spec.rb
├── consumers
│ └── events_charged_in_advance_consumer_spec.rb
├── contracts
│ └── queries
│ │ ├── billable_metrics_query_filters_contract_spec.rb
│ │ ├── customers_query_filters_contract_spec.rb
│ │ ├── payment_receipts_query_filters_contract_spec.rb
│ │ └── payments_query_filters_contract_spec.rb
├── controllers
│ └── concerns
│ │ └── trackable_spec.rb
├── cop_helper.rb
├── factories
│ ├── add_on_applied_taxes.rb
│ ├── add_ons.rb
│ ├── adjusted_fees.rb
│ ├── api_keys.rb
│ ├── applied_add_ons.rb
│ ├── applied_coupons.rb
│ ├── applied_invoice_custom_sections.rb
│ ├── applied_pricing_units.rb
│ ├── applied_usage_thresholds.rb
│ ├── billable_metric_filters.rb
│ ├── billable_metrics.rb
│ ├── billing_entities.rb
│ ├── billing_entity_applied_invoice_custom_sections.rb
│ ├── billing_entity_applied_taxes.rb
│ ├── cached_aggregations.rb
│ ├── charge_applied_taxes.rb
│ ├── charge_filter_values.rb
│ ├── charge_filters.rb
│ ├── charges.rb
│ ├── clickhouse
│ │ ├── activity_logs.rb
│ │ └── events_enriched.rb
│ ├── clickhouse_events.rb
│ ├── commitment_applied_taxes.rb
│ ├── commitments.rb
│ ├── common.rb
│ ├── common_events.rb
│ ├── coupon_targets.rb
│ ├── coupons.rb
│ ├── credit_note_applied_taxes.rb
│ ├── credit_note_items.rb
│ ├── credit_notes.rb
│ ├── credits.rb
│ ├── customer_applied_invoice_custom_sections.rb
│ ├── customer_applied_taxes.rb
│ ├── customer_metadata.rb
│ ├── customers.rb
│ ├── daily_usages.rb
│ ├── data_export_parts.rb
│ ├── data_exports.rb
│ ├── dunning_campaign_thresholds.rb
│ ├── dunning_campaigns.rb
│ ├── error_details.rb
│ ├── events.rb
│ ├── fee_applied_taxes.rb
│ ├── fees.rb
│ ├── idempotency_records.rb
│ ├── images
│ │ ├── big_sized_logo.jpg
│ │ ├── logo.gif
│ │ └── logo.png
│ ├── inbound_webhooks.rb
│ ├── integration_collection_mappings.rb
│ ├── integration_customers.rb
│ ├── integration_items.rb
│ ├── integration_mappings.rb
│ ├── integration_resources.rb
│ ├── integrations.rb
│ ├── invites.rb
│ ├── invoice_applied_taxes.rb
│ ├── invoice_custom_sections.rb
│ ├── invoice_metadata.rb
│ ├── invoice_subscriptions.rb
│ ├── invoices.rb
│ ├── lifetime_usage.rb
│ ├── memberships.rb
│ ├── organizations.rb
│ ├── password_resets.rb
│ ├── payment_intents.rb
│ ├── payment_provider_customers.rb
│ ├── payment_providers.rb
│ ├── payment_receipts.rb
│ ├── payment_request_applied_invoices.rb
│ ├── payment_requests.rb
│ ├── payment_responses.rb
│ ├── payments.rb
│ ├── plan_applied_taxes.rb
│ ├── plans.rb
│ ├── pricing_units.rb
│ ├── recurring_transaction_rules.rb
│ ├── refund_responses.rb
│ ├── refunds.rb
│ ├── subscriptions.rb
│ ├── taxes.rb
│ ├── usage_monitoring
│ │ ├── alert_thresholds.rb
│ │ ├── alerts.rb
│ │ ├── subscription_activities.rb
│ │ └── triggered_alerts.rb
│ ├── usage_thresholds.rb
│ ├── users.rb
│ ├── utils.rb
│ ├── wallet_transactions.rb
│ ├── wallets.rb
│ ├── webhook_endpoints.rb
│ └── webhooks.rb
├── fixtures
│ ├── adyen
│ │ ├── chargeback_lost_event.json
│ │ ├── chargeback_won_event.json
│ │ ├── webhook_authorisation_payment_response.json
│ │ ├── webhook_authorisation_payment_response_invalid_payable.json
│ │ ├── webhook_authorisation_payment_response_payment_request.json
│ │ ├── webhook_authorisation_response.json
│ │ └── webhook_refund_response.json
│ ├── blank.pdf
│ ├── cashfree
│ │ ├── payment_link_event_payment.json
│ │ └── payment_link_event_payment_request.json
│ ├── export.csv
│ ├── gocardless
│ │ ├── events.json
│ │ ├── events_invalid_payable_type.json
│ │ ├── events_payment_request.json
│ │ └── events_refund.json
│ ├── integration_aggregator
│ │ ├── account_information_response.json
│ │ ├── accounts_response.json
│ │ ├── bad_gateway_error.html
│ │ ├── companies
│ │ │ ├── failure_hash_response.json
│ │ │ ├── success_hash_response.json
│ │ │ └── success_string_response.json
│ │ ├── contacts
│ │ │ ├── failure_hash_response.json
│ │ │ ├── success_hash_response.json
│ │ │ └── success_string_response.json
│ │ ├── credit_notes
│ │ │ ├── failure_hash_response.json
│ │ │ ├── success_hash_response.json
│ │ │ └── success_string_response.json
│ │ ├── custom_object_response.json
│ │ ├── error_auth_response.json
│ │ ├── error_payload_response.json
│ │ ├── error_response.json
│ │ ├── invoices
│ │ │ ├── failure_hash_response.json
│ │ │ ├── hubspot
│ │ │ │ ├── failure_hash_response.json
│ │ │ │ └── success_hash_response.json
│ │ │ ├── success_hash_response.json
│ │ │ └── success_string_response.json
│ │ ├── items_response.json
│ │ ├── payments
│ │ │ ├── failure_hash_response.json
│ │ │ ├── success_hash_response.json
│ │ │ └── success_string_response.json
│ │ ├── subscriptions
│ │ │ └── hubspot
│ │ │ │ ├── failure_hash_response.json
│ │ │ │ └── success_hash_response.json
│ │ ├── subsidiaries_response.json
│ │ ├── tax_items_response.json
│ │ └── taxes
│ │ │ ├── companies
│ │ │ ├── failed_response.json
│ │ │ └── success_response.json
│ │ │ └── invoices
│ │ │ ├── api_limit_response.json
│ │ │ ├── failure_response.json
│ │ │ ├── failure_response_locked_void.json
│ │ │ ├── failure_response_void.json
│ │ │ ├── success_response.json
│ │ │ ├── success_response_multiple_fees.json
│ │ │ ├── success_response_negate.json
│ │ │ ├── success_response_seller_pays_taxes.json
│ │ │ └── success_response_void.json
│ ├── lago_data_api
│ │ ├── mrrs.json
│ │ ├── mrrs_plans.json
│ │ ├── prepaid_credits.json
│ │ ├── revenue_streams.json
│ │ ├── revenue_streams_customers.json
│ │ ├── revenue_streams_plans.json
│ │ ├── usages.json
│ │ ├── usages_aggregated_amounts.json
│ │ └── usages_invoiced.json
│ ├── moneyhash
│ │ ├── card_token.created.json
│ │ ├── card_token.deleted.json
│ │ ├── card_token.updated.json
│ │ ├── checkout_url_response.json
│ │ ├── create_customer.json
│ │ ├── intent.processed.json
│ │ ├── intent.time_expired.json
│ │ ├── recurring_mit_payment_failure_response.json
│ │ ├── recurring_mit_payment_payload.json
│ │ ├── recurring_mit_payment_success_response.json
│ │ ├── transaction.purchase.failed.json
│ │ ├── transaction.purchase.pending_authentication.json
│ │ ├── transaction.purchase.successful.json
│ │ └── webhook_signature_response.json
│ └── stripe
│ │ ├── 2020-08-27
│ │ ├── customer_list_payment_methods_empty_response.json
│ │ ├── customer_list_payment_methods_response.json
│ │ ├── customer_retrieve_response.json
│ │ ├── payment_intent_authorization_failed_response.json
│ │ ├── payment_intent_card_declined_response.json
│ │ ├── retrieve_payment_method_response.json
│ │ ├── webhook_endpoint_create_response.json
│ │ ├── webhook_endpoint_update_response.json
│ │ └── webhooks
│ │ │ ├── charge_dispute_closed.json
│ │ │ ├── charge_refund_updated.json
│ │ │ ├── customer_updated.json
│ │ │ ├── payment_intent_payment_failed.json
│ │ │ ├── payment_intent_succeeded.json
│ │ │ ├── payment_method_detached.json
│ │ │ └── setup_intent_succeeded.json
│ │ ├── 2024-09-30.acacia
│ │ ├── retrieve_payment_method.json
│ │ ├── retrieve_payment_method_response.json
│ │ └── webhooks
│ │ │ └── payment_intent_succeeded.json
│ │ └── 2025-04-30.basil
│ │ ├── customer_list_payment_methods_empty_response.json
│ │ ├── customer_list_payment_methods_response.json
│ │ ├── customer_retrieve_response.json
│ │ ├── payment_intent_authorization_failed_response.json
│ │ ├── payment_intent_card_declined_response.json
│ │ ├── retrieve_payment_method_response.json
│ │ ├── webhook_endpoint_create_response.json
│ │ ├── webhook_endpoint_update_response.json
│ │ └── webhooks
│ │ ├── charge_dispute_closed.json
│ │ ├── charge_refund_updated.json
│ │ ├── customer_updated.json
│ │ ├── payment_intent_payment_failed.json
│ │ ├── payment_intent_succeeded.json
│ │ ├── payment_method_detached.json
│ │ └── setup_intent_succeeded.json
├── graphql
│ ├── concerns
│ │ ├── authenticable_api_user_spec.rb
│ │ ├── authenticable_customer_portal_user_spec.rb
│ │ ├── can_require_permissions_spec.rb
│ │ └── required_organization_spec.rb
│ ├── lago_api_schema_spec.rb
│ ├── mutations
│ │ ├── add_ons
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── adjusted_fees
│ │ │ ├── create_spec.rb
│ │ │ └── destroy_spec.rb
│ │ ├── api_keys
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ ├── rotate_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── applied_coupons
│ │ │ ├── create_spec.rb
│ │ │ └── terminate_spec.rb
│ │ ├── auth
│ │ │ ├── google
│ │ │ │ ├── accept_invite_spec.rb
│ │ │ │ ├── login_user_spec.rb
│ │ │ │ └── register_user_spec.rb
│ │ │ └── okta
│ │ │ │ ├── accept_invite_spec.rb
│ │ │ │ ├── authorize_spec.rb
│ │ │ │ └── login_spec.rb
│ │ ├── billable_metrics
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── billing_entities
│ │ │ ├── apply_taxes_spec.rb
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ ├── remove_taxes_spec.rb
│ │ │ ├── update_applied_dunning_campaign_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── coupons
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ ├── terminate_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── credit_notes
│ │ │ ├── create_spec.rb
│ │ │ ├── download_spec.rb
│ │ │ ├── retry_tax_reporting_spec.rb
│ │ │ ├── update_spec.rb
│ │ │ └── void_spec.rb
│ │ ├── customer_portal
│ │ │ ├── download_invoice_spec.rb
│ │ │ ├── generate_url_spec.rb
│ │ │ ├── update_customer_spec.rb
│ │ │ └── wallet_transactions
│ │ │ │ └── create_spec.rb
│ │ ├── customers
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ ├── update_invoice_grace_period_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── data_exports
│ │ │ ├── credit_notes
│ │ │ │ └── create_spec.rb
│ │ │ └── invoices
│ │ │ │ └── create_spec.rb
│ │ ├── dunning_campaigns
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── integration_collection_mappings
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── integration_items
│ │ │ ├── fetch_accounts_spec.rb
│ │ │ └── fetch_items_spec.rb
│ │ ├── integration_mappings
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── integrations
│ │ │ ├── anrok
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── avalara
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ ├── fetch_draft_invoice_taxes_spec.rb
│ │ │ ├── hubspot
│ │ │ │ ├── create_spec.rb
│ │ │ │ ├── sync_invoice_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── netsuite
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── okta
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── salesforce
│ │ │ │ ├── create_spec.rb
│ │ │ │ ├── sync_invoice_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── sync_credit_note_spec.rb
│ │ │ ├── sync_invoice_spec.rb
│ │ │ └── xero
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ ├── invites
│ │ │ ├── accept_spec.rb
│ │ │ ├── create_spec.rb
│ │ │ ├── revoke_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── invoice_custom_sections
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── invoices
│ │ │ ├── create_spec.rb
│ │ │ ├── download_spec.rb
│ │ │ ├── finalize_all_spec.rb
│ │ │ ├── finalize_spec.rb
│ │ │ ├── lose_dispute_spec.rb
│ │ │ ├── refresh_spec.rb
│ │ │ ├── retry_all_payments_spec.rb
│ │ │ ├── retry_all_spec.rb
│ │ │ ├── retry_payment_spec.rb
│ │ │ ├── retry_spec.rb
│ │ │ ├── retry_tax_provider_voiding_spec.rb
│ │ │ ├── update_spec.rb
│ │ │ └── void_spec.rb
│ │ ├── login_user_spec.rb
│ │ ├── memberships
│ │ │ ├── revoke_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── organizations
│ │ │ └── update_spec.rb
│ │ ├── password_resets
│ │ │ ├── create_spec.rb
│ │ │ └── reset_spec.rb
│ │ ├── payment_providers
│ │ │ ├── adyen
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── cashfree
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ ├── gocardless
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ │ └── stripe
│ │ │ │ ├── create_spec.rb
│ │ │ │ └── update_spec.rb
│ │ ├── payment_receipts
│ │ │ └── download_spec.rb
│ │ ├── payment_requests
│ │ │ └── create_spec.rb
│ │ ├── payments
│ │ │ └── create_spec.rb
│ │ ├── plans
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── register_user_spec.rb
│ │ ├── subscriptions
│ │ │ ├── create_spec.rb
│ │ │ ├── terminate_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── taxes
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── usage_monitoring
│ │ │ └── alerts
│ │ │ │ ├── create_spec.rb
│ │ │ │ ├── destroy_spec.rb
│ │ │ │ └── update_spec.rb
│ │ ├── wallet_transactions
│ │ │ └── create_spec.rb
│ │ ├── wallets
│ │ │ ├── create_spec.rb
│ │ │ ├── terminate_spec.rb
│ │ │ └── update_spec.rb
│ │ ├── webhook_endpoints
│ │ │ ├── create_spec.rb
│ │ │ ├── destroy_spec.rb
│ │ │ └── update_spec.rb
│ │ └── webhooks
│ │ │ └── retry_spec.rb
│ ├── resolvers
│ │ ├── activity_log_resolver_spec.rb
│ │ ├── activity_logs_resolver_spec.rb
│ │ ├── add_on_resolver_spec.rb
│ │ ├── add_ons_resolver_spec.rb
│ │ ├── analytics
│ │ │ ├── gross_revenues_resolver_spec.rb
│ │ │ ├── invoice_collections_resolver_spec.rb
│ │ │ ├── invoiced_usages_resolver_spec.rb
│ │ │ ├── mrrs_resolver_spec.rb
│ │ │ └── overdue_balances_resolver_spec.rb
│ │ ├── api_key_resolver_spec.rb
│ │ ├── api_keys_resolver_spec.rb
│ │ ├── auth
│ │ │ └── google
│ │ │ │ └── auth_url_resolver_spec.rb
│ │ ├── billable_metric_resolver_spec.rb
│ │ ├── billable_metrics_resolver_spec.rb
│ │ ├── billing_entities_resolver_spec.rb
│ │ ├── billing_entity_resolver_spec.rb
│ │ ├── billing_entity_taxes_resolver_spec.rb
│ │ ├── coupon_resolver_spec.rb
│ │ ├── coupons_resolver_spec.rb
│ │ ├── credit_note_resolver_spec.rb
│ │ ├── credit_notes
│ │ │ └── estimate_resolver_spec.rb
│ │ ├── credit_notes_resolver_spec.rb
│ │ ├── current_user_resolver_spec.rb
│ │ ├── customer_portal
│ │ │ ├── analytics
│ │ │ │ ├── invoice_collections_resolver_spec.rb
│ │ │ │ └── overdue_balances_resolver_spec.rb
│ │ │ ├── customer_resolver_spec.rb
│ │ │ ├── customers
│ │ │ │ └── usage_resolver_spec.rb
│ │ │ ├── invoices_resolver_spec.rb
│ │ │ ├── organization_resolver_spec.rb
│ │ │ ├── subscription_resolver_spec.rb
│ │ │ ├── subscriptions_resolver_spec.rb
│ │ │ └── wallets_resolver_spec.rb
│ │ ├── customer_resolver_spec.rb
│ │ ├── customers
│ │ │ ├── invoices_resolver_spec.rb
│ │ │ ├── subscriptions_resolver_spec.rb
│ │ │ └── usage_resolver_spec.rb
│ │ ├── customers_resolver_spec.rb
│ │ ├── data_api
│ │ │ ├── mrrs
│ │ │ │ └── plans_resolver_spec.rb
│ │ │ ├── mrrs_resolver_spec.rb
│ │ │ ├── prepaid_credits_resolver_spec.rb
│ │ │ ├── revenue_streams
│ │ │ │ ├── customers_resolver_spec.rb
│ │ │ │ └── plans_resolver_spec.rb
│ │ │ ├── revenue_streams_resolver_spec.rb
│ │ │ ├── usages
│ │ │ │ ├── aggregated_amounts_resolver_spec.rb
│ │ │ │ └── invoiced_resolver_spec.rb
│ │ │ └── usages_resolver_spec.rb
│ │ ├── dunning_campaign_resolver_spec.rb
│ │ ├── dunning_campaigns_resolver_spec.rb
│ │ ├── event_resolver_spec.rb
│ │ ├── events_resolver_spec.rb
│ │ ├── integration_collection_mapping_resolver_spec.rb
│ │ ├── integration_collection_mappings_resolver_spec.rb
│ │ ├── integration_items_resolver_spec.rb
│ │ ├── integration_mapping_resolver_spec.rb
│ │ ├── integration_mappings_resolver_spec.rb
│ │ ├── integration_resolver_spec.rb
│ │ ├── integrations
│ │ │ └── subsidiaries_resolver_spec.rb
│ │ ├── integrations_resolver_spec.rb
│ │ ├── invite_resolver_spec.rb
│ │ ├── invites_resolver_spec.rb
│ │ ├── invoice_credit_notes_resolver_spec.rb
│ │ ├── invoice_custom_section_resolver_spec.rb
│ │ ├── invoice_custom_sections_resolver_spec.rb
│ │ ├── invoice_resolver_spec.rb
│ │ ├── invoices_resolver_spec.rb
│ │ ├── memberships_resolver_spec.rb
│ │ ├── organization_resolver_spec.rb
│ │ ├── password_reset_resolver_spec.rb
│ │ ├── payment_provider_resolver_spec.rb
│ │ ├── payment_providers_resolver_spec.rb
│ │ ├── payment_requests_resolver_spec.rb
│ │ ├── payment_resolver_spec.rb
│ │ ├── payments_resolver_spec.rb
│ │ ├── plan_resolver_spec.rb
│ │ ├── plans_resolver_spec.rb
│ │ ├── subscription_resolver_spec.rb
│ │ ├── subscriptions_resolver_spec.rb
│ │ ├── tax_resolver_spec.rb
│ │ ├── taxes_resolver_spec.rb
│ │ ├── usage_monitoring
│ │ │ ├── alert_resolver_spec.rb
│ │ │ └── subscription_alerts_resolver_spec.rb
│ │ ├── version_resolver_spec.rb
│ │ ├── wallet_resolver_spec.rb
│ │ ├── wallet_transaction_resolver_spec.rb
│ │ ├── wallets_resolver_spec.rb
│ │ ├── wallets_resolver_transactions_spec.rb
│ │ ├── webhook_endpoint_resolver_spec.rb
│ │ ├── webhook_endpoints_resolver_spec.rb
│ │ ├── webhook_resolver_spec.rb
│ │ └── webhooks_resolver_spec.rb
│ └── types
│ │ ├── activity_logs
│ │ ├── activity_source_enum_spec.rb
│ │ ├── activity_type_enum_spec.rb
│ │ ├── object_spec.rb
│ │ ├── resource_object_spec.rb
│ │ └── resource_type_enum_spec.rb
│ │ ├── add_ons
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── adjusted_fees
│ │ └── create_input_spec.rb
│ │ ├── analytics
│ │ ├── gross_revenues
│ │ │ └── object_spec.rb
│ │ ├── invoice_collections
│ │ │ └── object_spec.rb
│ │ ├── invoiced_usages
│ │ │ └── object_spec.rb
│ │ ├── mrrs
│ │ │ └── object_spec.rb
│ │ └── overdue_balances
│ │ │ └── object_spec.rb
│ │ ├── api_keys
│ │ ├── object_spec.rb
│ │ ├── rotate_input_spec.rb
│ │ ├── sanitized_object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── applied_coupons
│ │ └── object_spec.rb
│ │ ├── billable_metric_filters
│ │ ├── input_spec.rb
│ │ └── object_spec.rb
│ │ ├── billable_metrics
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── billing_entities
│ │ ├── billing_configuration_input_spec.rb
│ │ ├── billing_configuration_spec.rb
│ │ ├── create_input_spec.rb
│ │ ├── document_numbering_enum_spec.rb
│ │ ├── email_settings_enum_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── charge_filters
│ │ ├── input_spec.rb
│ │ └── object_spec.rb
│ │ ├── charges
│ │ ├── input_spec.rb
│ │ ├── object_spec.rb
│ │ ├── properties_input_spec.rb
│ │ └── properties_spec.rb
│ │ ├── commitments
│ │ ├── input_spec.rb
│ │ └── object_spec.rb
│ │ ├── credit_note_items
│ │ └── estimate_spec.rb
│ │ ├── credit_notes
│ │ ├── estimate_spec.rb
│ │ └── object_spec.rb
│ │ ├── customer_portal
│ │ ├── customers
│ │ │ ├── object_spec.rb
│ │ │ └── update_input_spec.rb
│ │ ├── organizations
│ │ │ └── object_spec.rb
│ │ ├── wallet_transactions
│ │ │ └── object_spec.rb
│ │ └── wallets
│ │ │ └── object_spec.rb
│ │ ├── customers
│ │ ├── account_type_enum_spec.rb
│ │ ├── create_customer_input_spec.rb
│ │ ├── customer_type_enum_spec.rb
│ │ ├── object_spec.rb
│ │ ├── update_customer_input_spec.rb
│ │ └── usage
│ │ │ ├── charge_filter_spec.rb
│ │ │ ├── charge_spec.rb
│ │ │ └── grouped_usage_spec.rb
│ │ ├── data_api
│ │ ├── metadata_spec.rb
│ │ ├── mrrs
│ │ │ ├── object_spec.rb
│ │ │ └── plans
│ │ │ │ ├── collection_spec.rb
│ │ │ │ └── object_spec.rb
│ │ ├── prepaid_credits
│ │ │ └── object_spec.rb
│ │ ├── revenue_streams
│ │ │ ├── customers
│ │ │ │ ├── collection_spec.rb
│ │ │ │ └── object_spec.rb
│ │ │ ├── object_spec.rb
│ │ │ ├── order_by_enum_spec.rb
│ │ │ └── plans
│ │ │ │ ├── collection_spec.rb
│ │ │ │ └── object_spec.rb
│ │ ├── time_granularity_enum_spec.rb
│ │ └── usages
│ │ │ ├── aggregated_amounts
│ │ │ └── object_spec.rb
│ │ │ ├── invoiced
│ │ │ └── object_spec.rb
│ │ │ └── object_spec.rb
│ │ ├── data_exports
│ │ ├── credit_notes
│ │ │ └── filters_input_spec.rb
│ │ ├── invoices
│ │ │ └── filters_input_spec.rb
│ │ └── object_spec.rb
│ │ ├── dunning_campaign_thresholds
│ │ ├── input_spec.rb
│ │ └── object_spec.rb
│ │ ├── dunning_campaigns
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── fees
│ │ └── object_spec.rb
│ │ ├── integration_collection_mappings
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── integration_customers
│ │ ├── anrok_spec.rb
│ │ ├── avalara_spec.rb
│ │ ├── hubspot_spec.rb
│ │ ├── input_spec.rb
│ │ ├── netsuite_spec.rb
│ │ ├── salesforce_spec.rb
│ │ └── xero_spec.rb
│ │ ├── integration_items
│ │ └── object_spec.rb
│ │ ├── integration_mappings
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── integrations
│ │ ├── accounts
│ │ │ └── object_spec.rb
│ │ ├── anrok_spec.rb
│ │ ├── avalara
│ │ │ ├── create_input_spec.rb
│ │ │ └── update_input_spec.rb
│ │ ├── avalara_spec.rb
│ │ ├── hubspot
│ │ │ ├── create_input_spec.rb
│ │ │ ├── targeted_objects_enum_spec.rb
│ │ │ └── update_input_spec.rb
│ │ ├── hubspot_spec.rb
│ │ ├── netsuite_spec.rb
│ │ ├── premium_integration_type_enum_spec.rb
│ │ ├── salesforce
│ │ │ ├── create_input_spec.rb
│ │ │ ├── sync_invoice_input_spec.rb
│ │ │ └── update_input_spec.rb
│ │ ├── salesforce_spec.rb
│ │ ├── subsidiaries
│ │ │ └── object_spec.rb
│ │ ├── sync_credit_note_input_spec.rb
│ │ ├── sync_hubspot_invoice_input_spec.rb
│ │ ├── sync_invoice_input_spec.rb
│ │ └── xero_spec.rb
│ │ ├── invoice_custom_sections
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── invoice_subscriptions
│ │ └── object_spec.rb
│ │ ├── invoices
│ │ ├── fee_input_spec.rb
│ │ └── object_spec.rb
│ │ ├── membership_type_spec.rb
│ │ ├── organizations
│ │ ├── current_organization_type_spec.rb
│ │ ├── organization_type_spec.rb
│ │ └── update_organization_input_spec.rb
│ │ ├── payables
│ │ └── object_spec.rb
│ │ ├── payment_provider_customers
│ │ └── provider_payment_methods_enum_spec.rb
│ │ ├── payment_providers
│ │ ├── adyen_input_spec.rb
│ │ ├── adyen_spec.rb
│ │ ├── cashfree_input_spec.rb
│ │ ├── cashfree_spec.rb
│ │ ├── gocardless_input_spec.rb
│ │ ├── gocardless_spec.rb
│ │ ├── stripe_input_spec.rb
│ │ ├── stripe_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── payment_receipts
│ │ └── object_spec.rb
│ │ ├── payment_requests
│ │ └── object_spec.rb
│ │ ├── payments
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ ├── payable_payment_status_enum_spec.rb
│ │ └── payment_type_enum_spec.rb
│ │ ├── permissions_type_spec.rb
│ │ ├── plans
│ │ ├── create_input_spec.rb
│ │ ├── object_spec.rb
│ │ └── update_input_spec.rb
│ │ ├── subscriptions
│ │ ├── charge_overrides_input_spec.rb
│ │ ├── lifetime_usage_object_spec.rb
│ │ ├── object_spec.rb
│ │ ├── plan_overrides_input_spec.rb
│ │ └── usage_threshold_overrides_input_spec.rb
│ │ ├── usage_thresholds
│ │ ├── input_spec.rb
│ │ └── object_spec.rb
│ │ ├── wallet_transactions
│ │ ├── metadata_input_spec.rb
│ │ ├── metadata_object_spec.rb
│ │ └── object_spec.rb
│ │ ├── wallets
│ │ ├── object_spec.rb
│ │ └── recurring_transaction_rules
│ │ │ ├── create_input_spec.rb
│ │ │ ├── object_spec.rb
│ │ │ ├── transaction_metadata_input_spec.rb
│ │ │ ├── transaction_metadata_object_spec.rb
│ │ │ └── update_input_spec.rb
│ │ ├── webhook_endpoints
│ │ └── object_spec.rb
│ │ └── webhooks
│ │ └── object_spec.rb
├── i18n_spec.rb
├── integration
│ └── stripe
│ │ └── simple_payment_integration_spec.rb
├── jobs
│ ├── bill_add_on_job_spec.rb
│ ├── bill_paid_credit_job_spec.rb
│ ├── bill_subscription_job_spec.rb
│ ├── billable_metric_filters
│ │ └── destroy_all_job_spec.rb
│ ├── billable_metrics
│ │ └── delete_events_job_spec.rb
│ ├── charges
│ │ ├── create_children_job_spec.rb
│ │ ├── destroy_children_job_spec.rb
│ │ └── update_children_job_spec.rb
│ ├── clock
│ │ ├── api_keys
│ │ │ └── track_usage_job_spec.rb
│ │ ├── compute_all_daily_usages_job_spec.rb
│ │ ├── consume_subscription_refreshed_queue_job_spec.rb
│ │ ├── create_interval_wallet_transactions_job_spec.rb
│ │ ├── events_validation_job_spec.rb
│ │ ├── finalize_invoices_job_spec.rb
│ │ ├── inbound_webhooks_cleanup_job_spec.rb
│ │ ├── inbound_webhooks_retry_job_spec.rb
│ │ ├── mark_invoices_as_payment_overdue_job_spec.rb
│ │ ├── process_all_subscription_activities_job_spec.rb
│ │ ├── process_dunning_campaigns_job_spec.rb
│ │ ├── refresh_draft_invoices_jobs_spec.rb
│ │ ├── refresh_lifetime_usages_job_spec.rb
│ │ ├── refresh_wallets_ongoing_balance_job_spec.rb
│ │ ├── retry_failed_invoices_job_spec.rb
│ │ ├── retry_generating_subscription_invoices_job_spec.rb
│ │ ├── subscriptions_biller_job_spec.rb
│ │ ├── subscriptions_to_be_terminated_job_spec.rb
│ │ ├── terminate_ended_subscriptions_job_spec.rb
│ │ ├── terminate_recurring_transaction_rules_job_spec.rb
│ │ ├── terminate_wallets_job_spec.rb
│ │ └── webhooks_cleanup_job_spec.rb
│ ├── credit_notes
│ │ ├── generate_pdf_job_spec.rb
│ │ ├── provider_taxes
│ │ │ └── report_job_spec.rb
│ │ └── refunds
│ │ │ ├── adyen_create_job_spec.rb
│ │ │ ├── gocardless_create_job_spec.rb
│ │ │ └── stripe_create_job_spec.rb
│ ├── customers
│ │ ├── retry_vies_check_job_spec.rb
│ │ └── terminate_relations_job_spec.rb
│ ├── daily_usages
│ │ ├── compute_job_spec.rb
│ │ └── fill_from_invoice_job_spec.rb
│ ├── data_exports
│ │ ├── combine_parts_job_spec.rb
│ │ ├── export_resources_job_spec.rb
│ │ └── process_part_job_spec.rb
│ ├── database_migrations
│ │ └── fix_invoices_organization_sequential_id_job_spec.rb
│ ├── dunning_campaigns
│ │ ├── bulk_process_job_spec.rb
│ │ └── process_attempt_job_spec.rb
│ ├── events
│ │ ├── pay_in_advance_job_spec.rb
│ │ └── post_process_job_spec.rb
│ ├── fees
│ │ └── create_pay_in_advance_job_spec.rb
│ ├── inbound_webhooks
│ │ └── process_job_spec.rb
│ ├── integration_customers
│ │ ├── create_job_spec.rb
│ │ └── update_job_spec.rb
│ ├── integrations
│ │ ├── aggregator
│ │ │ ├── credit_notes
│ │ │ │ └── create_job_spec.rb
│ │ │ ├── fetch_items_job_spec.rb
│ │ │ ├── invoices
│ │ │ │ ├── create_job_spec.rb
│ │ │ │ └── hubspot
│ │ │ │ │ ├── create_customer_association_job_spec.rb
│ │ │ │ │ ├── create_job_spec.rb
│ │ │ │ │ └── update_job_spec.rb
│ │ │ ├── payments
│ │ │ │ └── create_job_spec.rb
│ │ │ ├── perform_sync_job_spec.rb
│ │ │ ├── send_restlet_endpoint_job_spec.rb
│ │ │ ├── subscriptions
│ │ │ │ └── hubspot
│ │ │ │ │ ├── create_customer_association_job_spec.rb
│ │ │ │ │ ├── create_job_spec.rb
│ │ │ │ │ └── update_job_spec.rb
│ │ │ └── sync_custom_objects_and_properties_job_spec.rb
│ │ ├── avalara
│ │ │ └── fetch_company_id_job_spec.rb
│ │ └── hubspot
│ │ │ ├── companies
│ │ │ └── deploy_properties_job_spec.rb
│ │ │ ├── contacts
│ │ │ └── deploy_properties_job_spec.rb
│ │ │ ├── invoices
│ │ │ └── deploy_object_job_spec.rb
│ │ │ ├── save_portal_id_job_spec.rb
│ │ │ └── subscriptions
│ │ │ └── deploy_object_job_spec.rb
│ ├── invoices
│ │ ├── create_pay_in_advance_charge_job_spec.rb
│ │ ├── finalize_all_job_spec.rb
│ │ ├── finalize_job_spec.rb
│ │ ├── generate_pdf_job_spec.rb
│ │ ├── payments
│ │ │ ├── adyen_create_job_spec.rb
│ │ │ ├── create_job_spec.rb
│ │ │ ├── gocardless_create_job_spec.rb
│ │ │ ├── retry_all_job_spec.rb
│ │ │ └── stripe_create_job_spec.rb
│ │ ├── prepaid_credit_job_spec.rb
│ │ ├── provider_taxes
│ │ │ ├── pull_taxes_and_apply_job_spec.rb
│ │ │ └── void_job_spec.rb
│ │ ├── refresh_draft_job_spec.rb
│ │ ├── retry_all_job_spec.rb
│ │ ├── update_all_invoice_grace_period_from_billing_entity_job_spec.rb
│ │ ├── update_fees_payment_status_job_spec.rb
│ │ └── update_grace_period_from_billing_entity_job_spec.rb
│ ├── lifetime_usages
│ │ ├── flag_refresh_from_plan_update_job_spec.rb
│ │ └── recalculate_and_check_job_spec.rb
│ ├── payment_provider_customers
│ │ ├── gocardless_checkout_url_job_spec.rb
│ │ ├── gocardless_create_job_spec.rb
│ │ ├── stripe_checkout_url_job_spec.rb
│ │ ├── stripe_create_job_spec.rb
│ │ └── stripe_sync_funding_instructions_job_spec.rb
│ ├── payment_providers
│ │ ├── adyen
│ │ │ └── handle_event_job_spec.rb
│ │ ├── cancel_payment_authorization_job_spec.rb
│ │ ├── cashfree
│ │ │ └── handle_event_job_spec.rb
│ │ ├── gocardless
│ │ │ └── handle_event_job_spec.rb
│ │ └── stripe
│ │ │ ├── handle_event_job_spec.rb
│ │ │ ├── refresh_webhook_job_spec.rb
│ │ │ └── register_webhook_job_spec.rb
│ ├── payment_receipts
│ │ ├── create_job_spec.rb
│ │ ├── generate_pdf_and_notify_job_spec.rb
│ │ └── generate_pdf_job_spec.rb
│ ├── payment_requests
│ │ └── payments
│ │ │ ├── adyen_create_job_spec.rb
│ │ │ ├── create_job_spec.rb
│ │ │ ├── gocardless_create_job_spec.rb
│ │ │ └── stripe_create_job_spec.rb
│ ├── payments
│ │ ├── manual_create_job_spec.rb
│ │ └── set_payment_method_and_create_receipt_job_spec.rb
│ ├── plans
│ │ ├── destroy_job_spec.rb
│ │ └── update_amount_job_spec.rb
│ ├── segment_identify_job_spec.rb
│ ├── segment_track_job_spec.rb
│ ├── send_webhook_job_spec.rb
│ ├── subscriptions
│ │ ├── flag_refreshed_job_spec.rb
│ │ ├── organization_billing_job_spec.rb
│ │ └── terminate_job_spec.rb
│ ├── taxes
│ │ ├── update_all_eu_taxes_job_spec.rb
│ │ └── update_organization_eu_taxes_job_spec.rb
│ ├── usage_monitoring
│ │ ├── process_organization_subscription_activities_job_spec.rb
│ │ └── process_subscription_activity_job_spec.rb
│ ├── wallet_transactions
│ │ └── create_job_spec.rb
│ └── wallets
│ │ └── refresh_ongoing_balance_job_spec.rb
├── lib
│ ├── cops
│ │ └── service_call_cop_spec.rb
│ ├── lago
│ │ └── adyen
│ │ │ └── params_spec.rb
│ ├── lago_eu_vat
│ │ └── rate_spec.rb
│ ├── lago_http_client
│ │ └── client_spec.rb
│ └── lago_utils
│ │ ├── license_spec.rb
│ │ └── ruby_sandbox_spec.rb
├── mailers
│ ├── api_key_mailer_spec.rb
│ ├── credit_note_mailer_spec.rb
│ ├── data_export_mailer_spec.rb
│ ├── invoice_mailer_spec.rb
│ ├── password_reset_mailer_spec.rb
│ ├── payment_receipt_mailer_spec.rb
│ ├── payment_request_mailer_spec.rb
│ ├── previews
│ │ ├── api_key_mailer_preview.rb
│ │ ├── base_preview_mailer.rb
│ │ ├── data_export_mailer_preview.rb
│ │ ├── payment_receipt_mailer_preview.rb
│ │ ├── payment_request_mailer_preview.rb
│ │ └── webhook_mailer_preview.rb
│ └── webhook_mailer_spec.rb
├── models
│ ├── add_on_spec.rb
│ ├── analytics
│ │ ├── gross_revenue_spec.rb
│ │ ├── invoice_collection_spec.rb
│ │ ├── invoiced_usage_spec.rb
│ │ ├── mrr_spec.rb
│ │ └── overdue_balance_spec.rb
│ ├── api_key_spec.rb
│ ├── applied_add_on_spec.rb
│ ├── applied_coupon_spec.rb
│ ├── applied_invoice_custom_section_spec.rb
│ ├── applied_pricing_unit_spec.rb
│ ├── applied_usage_threshold_spec.rb
│ ├── billable_metric_filter_spec.rb
│ ├── billable_metric_spec.rb
│ ├── billing_entity
│ │ ├── applied_invoice_custom_section_spec.rb
│ │ └── applied_tax_spec.rb
│ ├── billing_entity_spec.rb
│ ├── charge_filter_spec.rb
│ ├── charge_filter_value_spec.rb
│ ├── charge_spec.rb
│ ├── clickhouse
│ │ └── activity_log_spec.rb
│ ├── commitment
│ │ └── applied_tax_spec.rb
│ ├── commitment_spec.rb
│ ├── coupon_spec.rb
│ ├── credit_note
│ │ └── applied_tax_spec.rb
│ ├── credit_note_item_spec.rb
│ ├── credit_note_spec.rb
│ ├── credit_spec.rb
│ ├── customer
│ │ ├── applied_invoice_custom_section_spec.rb
│ │ └── applied_tax_spec.rb
│ ├── customer_spec.rb
│ ├── daily_usage_spec.rb
│ ├── data_export_part_spec.rb
│ ├── data_export_spec.rb
│ ├── deprecation_spec.rb
│ ├── dunning_campaign_spec.rb
│ ├── dunning_campaign_threshold_spec.rb
│ ├── error_detail_spec.rb
│ ├── event_spec.rb
│ ├── events
│ │ └── common_spec.rb
│ ├── fee
│ │ └── applied_tax_spec.rb
│ ├── fee_spec.rb
│ ├── inbound_webhook_spec.rb
│ ├── integration_collection_mappings
│ │ ├── base_collection_mapping_spec.rb
│ │ ├── netsuite_collection_mapping_spec.rb
│ │ └── xero_collection_mapping_spec.rb
│ ├── integration_customers
│ │ ├── base_customer_spec.rb
│ │ ├── hubspot_customer_spec.rb
│ │ └── netsuite_customer_spec.rb
│ ├── integration_item_spec.rb
│ ├── integration_mappings
│ │ ├── base_mapping_spec.rb
│ │ ├── netsuite_mapping_spec.rb
│ │ └── xero_mapping_spec.rb
│ ├── integration_resource_spec.rb
│ ├── integrations
│ │ ├── anrok_integration_spec.rb
│ │ ├── avalara_integration_spec.rb
│ │ ├── base_integration_spec.rb
│ │ ├── hubspot_integration_spec.rb
│ │ ├── netsuite_integration_spec.rb
│ │ ├── okta_integration_spec.rb
│ │ ├── salesforce_integration_spec.rb
│ │ └── xero_integration_spec.rb
│ ├── invite_spec.rb
│ ├── invoice
│ │ └── applied_tax_spec.rb
│ ├── invoice_custom_section_spec.rb
│ ├── invoice_spec.rb
│ ├── invoice_subscription_spec.rb
│ ├── lifetime_usage_spec.rb
│ ├── membership_spec.rb
│ ├── metadata
│ │ ├── customer_metadata_spec.rb
│ │ └── invoice_metadata_spec.rb
│ ├── organization_spec.rb
│ ├── password_reset_spec.rb
│ ├── payment_intent_spec.rb
│ ├── payment_provider_customers
│ │ ├── adyen_customer_spec.rb
│ │ ├── cashfree_customer_spec.rb
│ │ ├── gocardless_customer_spec.rb
│ │ ├── moneyhash_customer_spec.rb
│ │ └── stripe_customer_spec.rb
│ ├── payment_providers
│ │ ├── adyen_provider_spec.rb
│ │ ├── base_provider_spec.rb
│ │ ├── gocardless_provider_spec.rb
│ │ ├── moneyhash_provider_spec.rb
│ │ └── stripe_provider_spec.rb
│ ├── payment_receipt_spec.rb
│ ├── payment_request_spec.rb
│ ├── payment_spec.rb
│ ├── permission_spec.rb
│ ├── plan_spec.rb
│ ├── pricing_unit_spec.rb
│ ├── recurring_transaction_rule_spec.rb
│ ├── subscription_spec.rb
│ ├── tax_spec.rb
│ ├── usage_monitoring
│ │ ├── alert_spec.rb
│ │ ├── billable_metric_current_usage_amount_alert_spec.rb
│ │ ├── billable_metric_current_usage_units_alert_spec.rb
│ │ ├── current_usage_amount_alert_spec.rb
│ │ ├── lifetime_usage_amount_alert_spec.rb
│ │ ├── subscription_activity_spec.rb
│ │ └── triggered_alert_spec.rb
│ ├── usage_threshold_spec.rb
│ ├── user_spec.rb
│ ├── wallet_credit_spec.rb
│ ├── wallet_spec.rb
│ ├── wallet_transaction_spec.rb
│ ├── webhook_endpoint_spec.rb
│ └── webhook_spec.rb
├── organization_id_column_spec.rb
├── queries
│ ├── activity_logs_query_spec.rb
│ ├── add_ons_query_spec.rb
│ ├── applied_coupons_query_spec.rb
│ ├── base_filters_spec.rb
│ ├── billable_metrics_query_spec.rb
│ ├── coupons_query_spec.rb
│ ├── credit_notes_query_spec.rb
│ ├── customers_query_spec.rb
│ ├── dunning_campaigns_query_spec.rb
│ ├── events_query_spec.rb
│ ├── fees_query_spec.rb
│ ├── integration_collection_mappings_query_spec.rb
│ ├── integration_items_query_spec.rb
│ ├── integration_mappings_query_spec.rb
│ ├── invoices_query_spec.rb
│ ├── past_usage_query_spec.rb
│ ├── payment_receipts_query_spec.rb
│ ├── payment_requests_query_spec.rb
│ ├── payments_query_spec.rb
│ ├── plans_query_spec.rb
│ ├── subscriptions_query_spec.rb
│ ├── taxes_query_spec.rb
│ ├── usage_monitoring
│ │ └── alerts_query_spec.rb
│ ├── wallet_transactions_query_spec.rb
│ ├── wallets_query_spec.rb
│ ├── webhook_endpoints_query_spec.rb
│ └── webhooks_query_spec.rb
├── rails_helper.rb
├── requests
│ ├── admin
│ │ ├── base_controller_spec.rb
│ │ ├── invoices_controller_spec.rb
│ │ ├── memberships_controller_spec.rb
│ │ └── organizations_controller_spec.rb
│ ├── api
│ │ ├── base_controller_spec.rb
│ │ └── v1
│ │ │ ├── activity_logs_controller_spec.rb
│ │ │ ├── add_ons_controller_spec.rb
│ │ │ ├── analytics
│ │ │ ├── gross_revenues_controller_spec.rb
│ │ │ ├── invoice_collections_controller_spec.rb
│ │ │ ├── invoiced_usages_controller_spec.rb
│ │ │ ├── mrrs_controller_spec.rb
│ │ │ └── overdue_balances_controller_spec.rb
│ │ │ ├── applied_coupons_controller_spec.rb
│ │ │ ├── billable_metrics_controller_spec.rb
│ │ │ ├── billing_entities_controller_spec.rb
│ │ │ ├── coupons_controller_spec.rb
│ │ │ ├── credit_notes_controller_spec.rb
│ │ │ ├── customers
│ │ │ ├── applied_coupons_controller_spec.rb
│ │ │ └── usage_controller_spec.rb
│ │ │ ├── customers_controller_spec.rb
│ │ │ ├── data_api
│ │ │ └── usages_controller_spec.rb
│ │ │ ├── events_controller_spec.rb
│ │ │ ├── fees_controller_spec.rb
│ │ │ ├── invoices_controller_spec.rb
│ │ │ ├── lifetime_usages_controller_spec.rb
│ │ │ ├── organizations_controller_spec.rb
│ │ │ ├── payment_receipts_controller_spec.rb
│ │ │ ├── payment_requests_controller_spec.rb
│ │ │ ├── payments_controller_spec.rb
│ │ │ ├── plans_controller_spec.rb
│ │ │ ├── subscriptions
│ │ │ └── alerts_controller_spec.rb
│ │ │ ├── subscriptions_controller_spec.rb
│ │ │ ├── taxes_controller_spec.rb
│ │ │ ├── wallet_transactions_controller_spec.rb
│ │ │ ├── wallets_controller_spec.rb
│ │ │ ├── webhook_endpoints_controller_spec.rb
│ │ │ └── webhooks_controller_spec.rb
│ ├── application_controller_spec.rb
│ ├── graphql_controller_spec.rb
│ └── webhooks_controller_spec.rb
├── scenarios
│ ├── billable_metrics
│ │ ├── custom_aggregation_spec.rb
│ │ ├── sum_spec.rb
│ │ ├── unique_count_spec.rb
│ │ └── weighted_sum_spec.rb
│ ├── charge_models
│ │ ├── dynamic_spec.rb
│ │ ├── edit_with_filter_spec.rb
│ │ ├── percentage_spec.rb
│ │ └── prorated_graduated_spec.rb
│ ├── commitments
│ │ └── minimum
│ │ │ ├── in_advance
│ │ │ ├── anniversary
│ │ │ │ ├── monthly_spec.rb
│ │ │ │ ├── quarterly_spec.rb
│ │ │ │ ├── weekly_spec.rb
│ │ │ │ └── yearly_spec.rb
│ │ │ └── calendar
│ │ │ │ ├── monthly_spec.rb
│ │ │ │ ├── quarterly_spec.rb
│ │ │ │ ├── weekly_spec.rb
│ │ │ │ └── yearly_spec.rb
│ │ │ ├── in_advance_spec.rb
│ │ │ ├── in_arrears
│ │ │ ├── anniversary
│ │ │ │ ├── monthly_spec.rb
│ │ │ │ ├── quarterly_spec.rb
│ │ │ │ ├── weekly_spec.rb
│ │ │ │ └── yearly_spec.rb
│ │ │ └── calendar
│ │ │ │ ├── monthly_spec.rb
│ │ │ │ ├── quarterly_spec.rb
│ │ │ │ ├── weekly_spec.rb
│ │ │ │ └── yearly_spec.rb
│ │ │ └── in_arrears_spec.rb
│ ├── coupons_breakdown_spec.rb
│ ├── create_event_spec.rb
│ ├── credit_note_spec.rb
│ ├── customer_usage_spec.rb
│ ├── customers
│ │ ├── create_partner_and_run_billing_spec.rb
│ │ ├── customer_eu_taxes_spec.rb
│ │ └── update_invoice_grace_period_spec.rb
│ ├── daily_usages
│ │ └── fill_history_spec.rb
│ ├── delete_customer_spec.rb
│ ├── delete_plan_spec.rb
│ ├── dunning
│ │ └── dunning_campaign_v1_spec.rb
│ ├── fees
│ │ ├── recurring_fee_downgrade_spec.rb
│ │ ├── recurring_fee_upgrade_spec.rb
│ │ └── recurring_fees_spec.rb
│ ├── invoices
│ │ ├── adjusted_charge_fees_spec.rb
│ │ ├── adjusted_subscription_fees_spec.rb
│ │ ├── advance_charges_dates_spec.rb
│ │ ├── advance_charges_spec.rb
│ │ ├── advance_charges_taxes_spec.rb
│ │ ├── filters_and_grouped_by_spec.rb
│ │ ├── invoice_numbering_spec.rb
│ │ ├── invoice_payments_spec.rb
│ │ ├── invoices_spec.rb
│ │ ├── progressive_billing_spec.rb
│ │ └── recurring_fees_spec.rb
│ ├── lifetime_usages
│ │ └── without_progressive_billing_spec.rb
│ ├── pay_in_advance_charges_spec.rb
│ ├── plans
│ │ └── create_and_update_filters_spec.rb
│ ├── spending_minimum_spec.rb
│ ├── subscriptions
│ │ ├── activation_spec.rb
│ │ ├── billing_boundaries_spec.rb
│ │ ├── billing_spec.rb
│ │ ├── downgrade_spec.rb
│ │ ├── free_trial_billing_spec.rb
│ │ ├── multiple_upgrade_spec.rb
│ │ ├── progressive_billing_enablement_spec.rb
│ │ ├── terminate_ended_spec.rb
│ │ └── upgrade_spec.rb
│ ├── taxes_on_invoice_spec.rb
│ ├── terminate_pay_in_advance_spec.rb
│ ├── usage_monitoring
│ │ └── subscription_alerts_spec.rb
│ └── wallets
│ │ ├── balance_spec.rb
│ │ ├── topup_with_open_invoices_spec.rb
│ │ └── topup_with_rounding_spec.rb
├── serializers
│ ├── error_serializer_spec.rb
│ └── v1
│ │ ├── activity_log_serializer_spec.rb
│ │ ├── add_on_serializer_spec.rb
│ │ ├── analytics
│ │ ├── gross_revenue_serializer_spec.rb
│ │ ├── invoice_collection_serializer_spec.rb
│ │ ├── invoiced_usage_serializer_spec.rb
│ │ ├── mrr_serializer_spec.rb
│ │ └── overdue_balance_serializer_spec.rb
│ │ ├── applied_coupon_serializer_spec.rb
│ │ ├── applied_usage_threshold_serializer_spec.rb
│ │ ├── billable_metric_expression_result_serializer_spec.rb
│ │ ├── billable_metric_filter_serializer_spec.rb
│ │ ├── billable_metric_serializer_spec.rb
│ │ ├── billing_entity_serializer_spec.rb
│ │ ├── charge_filter_serializer_spec.rb
│ │ ├── charge_serializer_spec.rb
│ │ ├── commitment_serializer_spec.rb
│ │ ├── coupon_serializer_spec.rb
│ │ ├── credit_note_serializer_spec.rb
│ │ ├── credit_notes
│ │ ├── applied_tax_serializer_spec.rb
│ │ ├── estimate_serializer_spec.rb
│ │ └── payment_provider_refund_error_serializer_spec.rb
│ │ ├── credit_serializer_spec.rb
│ │ ├── customer_serializer_spec.rb
│ │ ├── customers
│ │ ├── charge_usage_serializer_spec.rb
│ │ ├── metadata_serializer_spec.rb
│ │ ├── past_usage_serializer_spec.rb
│ │ └── usage_serializer_spec.rb
│ │ ├── error_detail_serializer_spec.rb
│ │ ├── errors
│ │ ├── error_serializer_factory_spec.rb
│ │ └── stripe_error_serializer_spec.rb
│ │ ├── event_error_serializer_spec.rb
│ │ ├── event_serializer_spec.rb
│ │ ├── events_validation_errors_serializer_spec.rb
│ │ ├── fee_serializer_spec.rb
│ │ ├── fees
│ │ └── applied_tax_serializer_spec.rb
│ │ ├── integration_customer_serializer_spec.rb
│ │ ├── integrations
│ │ ├── customer_error_serializer_spec.rb
│ │ ├── provider_error_serializer_spec.rb
│ │ └── taxes
│ │ │ ├── customer_error_serializer_spec.rb
│ │ │ └── fee_error_serializer_spec.rb
│ │ ├── invoice_custom_section_serializer_spec.rb
│ │ ├── invoice_serializer_spec.rb
│ │ ├── invoices
│ │ ├── applied_invoice_custom_section_serializer_spec.rb
│ │ ├── applied_tax_serializer_spec.rb
│ │ ├── billing_period_serializer_spec.rb
│ │ ├── metadata_serializer_spec.rb
│ │ └── payment_dispute_lost_serializer_spec.rb
│ │ ├── lifetime_usage_serializer_spec.rb
│ │ ├── organization_serializer_spec.rb
│ │ ├── payment_providers
│ │ ├── customer_checkout_serializer_spec.rb
│ │ ├── customer_error_serializer_spec.rb
│ │ ├── error_serializer_spec.rb
│ │ ├── invoice_payment_error_serializer_spec.rb
│ │ ├── invoice_payment_serializer_spec.rb
│ │ ├── payment_request_payment_error_serializer_spec.rb
│ │ ├── wallet_transaction_payment_error_serializer_spec.rb
│ │ └── wallet_transaction_payment_serializer_spec.rb
│ │ ├── payment_receipt_serializer_spec.rb
│ │ ├── payment_request_serializer_spec.rb
│ │ ├── payment_serializer_spec.rb
│ │ ├── payments
│ │ └── requires_action_serializer_spec.rb
│ │ ├── plan_serializer_spec.rb
│ │ ├── subscription_serializer_spec.rb
│ │ ├── tax_serializer_spec.rb
│ │ ├── usage_monitoring
│ │ ├── alert_serializer_spec.rb
│ │ └── triggered_alert_serializer_spec.rb
│ │ ├── usage_threshold_serializer_spec.rb
│ │ ├── wallet_serializer_spec.rb
│ │ ├── wallet_transaction_serializer_spec.rb
│ │ ├── wallets
│ │ └── recurring_transaction_rule_serializer_spec.rb
│ │ └── webhook_endpoint_serializer_spec.rb
├── services
│ ├── add_ons
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── adjusted_fees
│ │ ├── create_service_spec.rb
│ │ └── destroy_service_spec.rb
│ ├── admin
│ │ └── organizations
│ │ │ └── update_service_spec.rb
│ ├── analytics
│ │ ├── gross_revenues_service_spec.rb
│ │ ├── invoice_collections_service_spec.rb
│ │ ├── invoiced_usages_service_spec.rb
│ │ ├── mrrs_service_spec.rb
│ │ └── overdue_balances_service_spec.rb
│ ├── api_keys
│ │ ├── cache_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── rotate_service_spec.rb
│ │ ├── track_usage_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── applied_coupons
│ │ ├── amount_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── lock_service_spec.rb
│ │ ├── recredit_service_spec.rb
│ │ └── terminate_service_spec.rb
│ ├── applied_pricing_units
│ │ ├── create_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── auth
│ │ ├── google_service_spec.rb
│ │ └── okta
│ │ │ ├── accept_invite_service_spec.rb
│ │ │ ├── authorize_service_spec.rb
│ │ │ └── login_service_spec.rb
│ ├── base_result_spec.rb
│ ├── base_service_spec.rb
│ ├── billable_metric_filters
│ │ ├── create_or_update_batch_service_spec.rb
│ │ └── destroy_all_service_spec.rb
│ ├── billable_metrics
│ │ ├── aggregation_factory_spec.rb
│ │ ├── aggregations
│ │ │ ├── apply_rounding_service_spec.rb
│ │ │ ├── count_service_spec.rb
│ │ │ ├── custom_service_spec.rb
│ │ │ ├── latest_service_spec.rb
│ │ │ ├── max_service_spec.rb
│ │ │ ├── sum_service_spec.rb
│ │ │ ├── unique_count_service_spec.rb
│ │ │ └── weighted_sum_service_spec.rb
│ │ ├── breakdown
│ │ │ ├── sum_service_spec.rb
│ │ │ └── unique_count_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── evaluate_expression_service_spec.rb
│ │ ├── prorated_aggregations
│ │ │ ├── sum_service_spec.rb
│ │ │ └── unique_count_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── billing_entities
│ │ ├── change_eu_tax_management_service_spec.rb
│ │ ├── change_invoice_numbering_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── deselect_invoice_custom_section_service_spec.rb
│ │ ├── resolve_service_spec.rb
│ │ ├── select_invoice_custom_section_service_spec.rb
│ │ ├── taxes
│ │ │ ├── apply_taxes_service_spec.rb
│ │ │ ├── manage_taxes_service_spec.rb
│ │ │ └── remove_taxes_service_spec.rb
│ │ ├── update_applied_dunning_campaign_service_spec.rb
│ │ ├── update_invoice_grace_period_service_spec.rb
│ │ ├── update_invoice_payment_due_date_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── cache_service_spec.rb
│ ├── charge_filters
│ │ ├── create_or_update_batch_service_spec.rb
│ │ ├── event_matching_service_spec.rb
│ │ └── matching_and_ignored_service_spec.rb
│ ├── charges
│ │ ├── amount_details
│ │ │ ├── range_graduated_percentage_service_spec.rb
│ │ │ └── range_graduated_service_spec.rb
│ │ ├── apply_pay_in_advance_charge_model_service_spec.rb
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── build_default_properties_service_spec.rb
│ │ ├── charge_model_factory_spec.rb
│ │ ├── charge_models
│ │ │ ├── custom_service_spec.rb
│ │ │ ├── dynamic_service_spec.rb
│ │ │ ├── graduated_percentage_service_spec.rb
│ │ │ ├── graduated_service_spec.rb
│ │ │ ├── grouped_service_spec.rb
│ │ │ ├── package_service_spec.rb
│ │ │ ├── percentage_service_spec.rb
│ │ │ ├── prorated_graduated_service_spec.rb
│ │ │ ├── standard_service_spec.rb
│ │ │ └── volume_service_spec.rb
│ │ ├── create_children_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_children_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── estimate_instant
│ │ │ ├── percentage_service_spec.rb
│ │ │ └── standard_service_spec.rb
│ │ ├── filter_charge_model_properties_service_spec.rb
│ │ ├── override_service_spec.rb
│ │ ├── pay_in_advance
│ │ │ └── amount_details_calculator_spec.rb
│ │ ├── pay_in_advance_aggregation_service_spec.rb
│ │ ├── update_children_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── validators
│ │ │ ├── graduated_percentage_service_spec.rb
│ │ │ ├── graduated_service_spec.rb
│ │ │ ├── package_service_spec.rb
│ │ │ ├── percentage_service_spec.rb
│ │ │ ├── standard_service_spec.rb
│ │ │ └── volume_service_spec.rb
│ ├── commitments
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── calculate_amount_service_spec.rb
│ │ ├── calculate_prorated_coefficient_service_spec.rb
│ │ ├── dates_service_spec.rb
│ │ ├── minimum
│ │ │ └── calculate_true_up_fee_service_spec.rb
│ │ └── override_service_spec.rb
│ ├── coupons
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── preview_service_spec.rb
│ │ ├── terminate_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── validate_service_spec.rb
│ ├── credit_notes
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── create_from_progressive_billing_invoice_spec.rb
│ │ ├── create_from_termination_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── estimate_service_spec.rb
│ │ ├── generate_service_spec.rb
│ │ ├── provider_taxes
│ │ │ └── report_service_spec.rb
│ │ ├── recredit_service_spec.rb
│ │ ├── refresh_draft_service_spec.rb
│ │ ├── refunds
│ │ │ ├── adyen_service_spec.rb
│ │ │ ├── gocardless_service_spec.rb
│ │ │ └── stripe_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ ├── validate_item_service_spec.rb
│ │ ├── validate_service_spec.rb
│ │ └── void_service_spec.rb
│ ├── credits
│ │ ├── applied_coupon_service_spec.rb
│ │ ├── applied_coupons_service_spec.rb
│ │ ├── applied_prepaid_credit_service_spec.rb
│ │ ├── credit_note_service_spec.rb
│ │ └── progressive_billing_service_spec.rb
│ ├── customer_portal
│ │ ├── customer_update_service_spec.rb
│ │ └── generate_url_service_spec.rb
│ ├── customers
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── eu_auto_taxes_service_spec.rb
│ │ ├── generate_checkout_url_service_spec.rb
│ │ ├── manage_invoice_custom_sections_service_spec.rb
│ │ ├── metadata
│ │ │ └── update_service_spec.rb
│ │ ├── terminate_relations_service_spec.rb
│ │ ├── update_currency_service_spec.rb
│ │ ├── update_invoice_grace_period_service_spec.rb
│ │ ├── update_invoice_payment_due_date_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── upsert_from_api_service_spec.rb
│ ├── daily_usages
│ │ ├── compute_all_service_spec.rb
│ │ ├── compute_diff_service_spec.rb
│ │ ├── compute_service_spec.rb
│ │ ├── fill_from_invoice_service_spec.rb
│ │ └── fill_history_service_spec.rb
│ ├── data_api
│ │ ├── mrrs
│ │ │ └── plans_service_spec.rb
│ │ ├── mrrs_service_spec.rb
│ │ ├── prepaid_credits_service_spec.rb
│ │ ├── revenue_streams
│ │ │ ├── customers_service_spec.rb
│ │ │ └── plans_service_spec.rb
│ │ ├── revenue_streams_service_spec.rb
│ │ ├── usages
│ │ │ ├── aggregated_amounts_service_spec.rb
│ │ │ └── invoiced_service_spec.rb
│ │ └── usages_service_spec.rb
│ ├── data_exports
│ │ ├── combine_parts_service_spec.rb
│ │ ├── create_part_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── csv
│ │ │ ├── credit_note_items_spec.rb
│ │ │ ├── credit_notes_spec.rb
│ │ │ ├── invoice_fees_spec.rb
│ │ │ └── invoices_spec.rb
│ │ ├── export_resources_service_spec.rb
│ │ └── process_part_service_spec.rb
│ ├── dunning_campaigns
│ │ ├── bulk_process_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── process_attempt_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── error_details
│ │ └── create_service_spec.rb
│ ├── events
│ │ ├── calculate_expression_service_spec.rb
│ │ ├── common_factory_spec.rb
│ │ ├── create_batch_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── pay_in_advance_service_spec.rb
│ │ ├── post_process_service_spec.rb
│ │ ├── post_validation_service_spec.rb
│ │ ├── stores
│ │ │ ├── clickhouse_store_spec.rb
│ │ │ └── postgres_store_spec.rb
│ │ └── validate_creation_service_spec.rb
│ ├── fees
│ │ ├── add_on_service_spec.rb
│ │ ├── apply_provider_taxes_service_spec.rb
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── charge_service_spec.rb
│ │ ├── commitments
│ │ │ └── minimum
│ │ │ │ └── create_service_spec.rb
│ │ ├── create_pay_in_advance_service_spec.rb
│ │ ├── create_true_up_service_spec.rb
│ │ ├── estimate_instant
│ │ │ ├── batch_pay_in_advance_service_spec.rb
│ │ │ └── pay_in_advance_service_spec.rb
│ │ ├── estimate_pay_in_advance_service_spec.rb
│ │ ├── init_from_adjusted_charge_fee_service_spec.rb
│ │ ├── one_off_service_spec.rb
│ │ ├── paid_credit_service_spec.rb
│ │ ├── subscription_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── idempotency_records
│ │ ├── create_service_spec.rb
│ │ └── key_service_spec.rb
│ ├── idempotency_spec.rb
│ ├── inbound_webhooks
│ │ ├── create_service_spec.rb
│ │ ├── process_service_spec.rb
│ │ └── validate_payload_service_spec.rb
│ ├── integration_collection_mappings
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── integration_customers
│ │ ├── anrok_service_spec.rb
│ │ ├── avalara_service_spec.rb
│ │ ├── create_or_update_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── factory_spec.rb
│ │ ├── hubspot_service_spec.rb
│ │ ├── netsuite_service_spec.rb
│ │ ├── salesforce_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── xero_service_spec.rb
│ ├── integration_mappings
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── integrations
│ │ ├── aggregator
│ │ │ ├── account_information_service_spec.rb
│ │ │ ├── accounts_service_spec.rb
│ │ │ ├── base_service_spec.rb
│ │ │ ├── companies
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ ├── payloads
│ │ │ │ │ ├── factory_spec.rb
│ │ │ │ │ └── hubspot_spec.rb
│ │ │ │ └── update_service_spec.rb
│ │ │ ├── contacts
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ ├── payloads
│ │ │ │ │ ├── anrok_spec.rb
│ │ │ │ │ ├── avalara_spec.rb
│ │ │ │ │ ├── factory_spec.rb
│ │ │ │ │ ├── hubspot_spec.rb
│ │ │ │ │ ├── netsuite_spec.rb
│ │ │ │ │ └── xero_spec.rb
│ │ │ │ └── update_service_spec.rb
│ │ │ ├── credit_notes
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ └── payloads
│ │ │ │ │ └── factory_spec.rb
│ │ │ ├── custom_object_service_spec.rb
│ │ │ ├── invoices
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ ├── hubspot
│ │ │ │ │ ├── base_service_spec.rb
│ │ │ │ │ ├── create_customer_association_service_spec.rb
│ │ │ │ │ ├── create_service_spec.rb
│ │ │ │ │ └── update_service_spec.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── base_payload_spec.rb
│ │ │ │ │ ├── factory_spec.rb
│ │ │ │ │ ├── hubspot_spec.rb
│ │ │ │ │ ├── netsuite_spec.rb
│ │ │ │ │ └── xero_spec.rb
│ │ │ ├── items_service_spec.rb
│ │ │ ├── payments
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── base_payload_spec.rb
│ │ │ │ │ ├── factory_spec.rb
│ │ │ │ │ └── netsuite_spec.rb
│ │ │ ├── send_restlet_endpoint_service_spec.rb
│ │ │ ├── subscriptions
│ │ │ │ ├── hubspot
│ │ │ │ │ ├── base_service_spec.rb
│ │ │ │ │ ├── create_customer_association_service_spec.rb
│ │ │ │ │ ├── create_service_spec.rb
│ │ │ │ │ └── update_service_spec.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── factory_spec.rb
│ │ │ │ │ └── hubspot_spec.rb
│ │ │ ├── subsidiaries_service_spec.rb
│ │ │ ├── sync_service_spec.rb
│ │ │ └── taxes
│ │ │ │ ├── avalara
│ │ │ │ └── fetch_company_id_service_spec.rb
│ │ │ │ ├── credit_notes
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ └── payloads
│ │ │ │ │ ├── anrok_spec.rb
│ │ │ │ │ └── avalara_spec.rb
│ │ │ │ └── invoices
│ │ │ │ ├── create_draft_service_spec.rb
│ │ │ │ ├── create_service_spec.rb
│ │ │ │ ├── negate_service_spec.rb
│ │ │ │ ├── payloads
│ │ │ │ ├── anrok_spec.rb
│ │ │ │ └── avalara_spec.rb
│ │ │ │ └── void_service_spec.rb
│ │ ├── anrok
│ │ │ ├── create_service_spec.rb
│ │ │ └── update_service_spec.rb
│ │ ├── avalara
│ │ │ ├── create_service_spec.rb
│ │ │ ├── fetch_company_id_service_spec.rb
│ │ │ └── update_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── hubspot
│ │ │ ├── companies
│ │ │ │ └── deploy_properties_service_spec.rb
│ │ │ ├── contacts
│ │ │ │ └── deploy_properties_service_spec.rb
│ │ │ ├── create_service_spec.rb
│ │ │ ├── invoices
│ │ │ │ ├── deploy_object_service_spec.rb
│ │ │ │ └── deploy_properties_service_spec.rb
│ │ │ ├── save_portal_id_service_spec.rb
│ │ │ ├── subscriptions
│ │ │ │ ├── deploy_object_service_spec.rb
│ │ │ │ └── deploy_properties_service_spec.rb
│ │ │ └── update_service_spec.rb
│ │ ├── netsuite
│ │ │ ├── create_service_spec.rb
│ │ │ └── update_service_spec.rb
│ │ ├── okta
│ │ │ ├── create_service_spec.rb
│ │ │ └── update_service_spec.rb
│ │ ├── salesforce
│ │ │ ├── create_service_spec.rb
│ │ │ └── update_service_spec.rb
│ │ └── xero
│ │ │ ├── create_service_spec.rb
│ │ │ └── update_service_spec.rb
│ ├── invites
│ │ ├── accept_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── revoke_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── validate_service_spec.rb
│ ├── invoice_custom_sections
│ │ ├── create_service_spec.rb
│ │ ├── deselect_all_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── funding_instructions_formatter_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── invoices
│ │ ├── add_on_service_spec.rb
│ │ ├── advance_charges_service_spec.rb
│ │ ├── aggregate_amounts_and_taxes_from_fees_spec.rb
│ │ ├── apply_invoice_custom_sections_service_spec.rb
│ │ ├── apply_provider_taxes_service_spec.rb
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── calculate_fees_service_spec.rb
│ │ ├── compute_amounts_from_fees_spec.rb
│ │ ├── compute_taxes_and_totals_service_spec.rb
│ │ ├── create_generating_service_spec.rb
│ │ ├── create_invoice_subscription_service_spec.rb
│ │ ├── create_one_off_service_spec.rb
│ │ ├── create_pay_in_advance_charge_service_spec.rb
│ │ ├── customer_usage_service_spec.rb
│ │ ├── finalize_batch_service_spec.rb
│ │ ├── finalize_open_credit_service_spec.rb
│ │ ├── generate_pdf_service_spec.rb
│ │ ├── lose_dispute_service_spec.rb
│ │ ├── metadata
│ │ │ └── update_service_spec.rb
│ │ ├── paid_credit_service_spec.rb
│ │ ├── payments
│ │ │ ├── adyen_service_spec.rb
│ │ │ ├── cashfree_service_spec.rb
│ │ │ ├── create_service_spec.rb
│ │ │ ├── deliver_error_webhook_service_spec.rb
│ │ │ ├── generate_payment_url_service_spec.rb
│ │ │ ├── gocardless_service_spec.rb
│ │ │ ├── mark_overdue_service_spec.rb
│ │ │ ├── moneyhash_service_spec.rb
│ │ │ ├── payment_providers
│ │ │ │ └── factory_spec.rb
│ │ │ ├── retry_batch_service_spec.rb
│ │ │ ├── retry_service_spec.rb
│ │ │ └── stripe_service_spec.rb
│ │ ├── preview
│ │ │ ├── build_subscription_service_spec.rb
│ │ │ ├── credits_service_spec.rb
│ │ │ ├── find_subscriptions_service_spec.rb
│ │ │ ├── subscription_plan_change_service_spec.rb
│ │ │ ├── subscription_termination_service_spec.rb
│ │ │ └── subscriptions_service_spec.rb
│ │ ├── preview_context_service_spec.rb
│ │ ├── preview_service_spec.rb
│ │ ├── progressive_billing_service_spec.rb
│ │ ├── provider_taxes
│ │ │ ├── pull_taxes_and_apply_service_spec.rb
│ │ │ └── void_service_spec.rb
│ │ ├── refresh_draft_and_finalize_service_spec.rb
│ │ ├── refresh_draft_service_spec.rb
│ │ ├── retry_batch_service_spec.rb
│ │ ├── retry_service_spec.rb
│ │ ├── subscription_service_spec.rb
│ │ ├── sync_salesforce_id_service_spec.rb
│ │ ├── transition_to_final_status_service_spec.rb
│ │ ├── update_all_invoice_grace_period_from_billing_entity_service_spec.rb
│ │ ├── update_grace_period_from_billing_entity_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── void_service_spec.rb
│ ├── lifetime_usages
│ │ ├── calculate_service_spec.rb
│ │ ├── check_thresholds_service_spec.rb
│ │ ├── find_last_and_next_thresholds_service_spec.rb
│ │ ├── flag_refresh_from_invoice_service_spec.rb
│ │ ├── flag_refresh_from_plan_update_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ ├── usage_thresholds
│ │ │ └── check_service_spec.rb
│ │ └── usage_thresholds_completion_service_spec.rb
│ ├── memberships
│ │ ├── create_service_spec.rb
│ │ ├── revoke_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── organizations
│ │ ├── create_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── password_resets
│ │ ├── create_service_spec.rb
│ │ └── reset_service_spec.rb
│ ├── payment_intents
│ │ └── fetch_service_spec.rb
│ ├── payment_provider_customers
│ │ ├── adyen_service_spec.rb
│ │ ├── gocardless_service_spec.rb
│ │ ├── moneyhash_service_spec.rb
│ │ ├── stripe
│ │ │ ├── check_payment_method_service_spec.rb
│ │ │ ├── retrieve_latest_payment_method_service_spec.rb
│ │ │ ├── sync_funding_instructions_service_spec.rb
│ │ │ └── update_payment_method_service_spec.rb
│ │ ├── stripe_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── payment_providers
│ │ ├── adyen
│ │ │ ├── customers
│ │ │ │ └── create_service_spec.rb
│ │ │ ├── handle_event_service_spec.rb
│ │ │ ├── handle_incoming_webhook_service_spec.rb
│ │ │ ├── payments
│ │ │ │ └── create_service_spec.rb
│ │ │ └── webhooks
│ │ │ │ └── chargeback_service_spec.rb
│ │ ├── adyen_service_spec.rb
│ │ ├── cashfree
│ │ │ ├── customers
│ │ │ │ └── create_service_spec.rb
│ │ │ ├── handle_event_service_spec.rb
│ │ │ ├── handle_incoming_webhook_service_spec.rb
│ │ │ ├── payments
│ │ │ │ └── create_service_spec.rb
│ │ │ └── webhooks
│ │ │ │ └── payment_link_event_service_spec.rb
│ │ ├── cashfree_service_spec.rb
│ │ ├── create_customer_factory_spec.rb
│ │ ├── create_payment_factory_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── find_service_spec.rb
│ │ ├── gocardless
│ │ │ ├── customers
│ │ │ │ └── create_service_spec.rb
│ │ │ ├── handle_event_service_spec.rb
│ │ │ ├── handle_incoming_webhook_service_spec.rb
│ │ │ └── payments
│ │ │ │ └── create_service_spec.rb
│ │ ├── gocardless_service_spec.rb
│ │ ├── moneyhash
│ │ │ ├── handle_incoming_webhook_service_spec.rb
│ │ │ ├── payments
│ │ │ │ └── create_service_spec.rb
│ │ │ └── validate_incoming_webhook_service_spec.rb
│ │ ├── moneyhash_service_spec.rb
│ │ ├── stripe
│ │ │ ├── customers
│ │ │ │ └── create_service_spec.rb
│ │ │ ├── handle_event_service_spec.rb
│ │ │ ├── handle_incoming_webhook_service_spec.rb
│ │ │ ├── payments
│ │ │ │ └── create_service_spec.rb
│ │ │ ├── refresh_webhook_service_spec.rb
│ │ │ ├── register_webhook_service_spec.rb
│ │ │ ├── validate_incoming_webhook_service_spec.rb
│ │ │ └── webhooks
│ │ │ │ ├── charge_dispute_closed_service_spec.rb
│ │ │ │ ├── customer_updated_service_spec.rb
│ │ │ │ ├── payment_intent_payment_failed_service_spec.rb
│ │ │ │ ├── payment_intent_succeeded_service_spec.rb
│ │ │ │ └── setup_intent_succeeded_service_spec.rb
│ │ └── stripe_service_spec.rb
│ ├── payment_receipts
│ │ ├── create_service_spec.rb
│ │ └── generate_pdf_service_spec.rb
│ ├── payment_requests
│ │ ├── create_service_spec.rb
│ │ ├── payments
│ │ │ ├── adyen_service_spec.rb
│ │ │ ├── cashfree_service_spec.rb
│ │ │ ├── create_service_spec.rb
│ │ │ ├── deliver_error_webhook_service_spec.rb
│ │ │ ├── generate_payment_url_service_spec.rb
│ │ │ ├── gocardless_service_spec.rb
│ │ │ ├── moneyhash_service_spec.rb
│ │ │ ├── payment_providers
│ │ │ │ └── factory_spec.rb
│ │ │ └── stripe_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── payments
│ │ ├── lose_dispute_service_spec.rb
│ │ ├── manual_create_service_spec.rb
│ │ └── set_payment_method_data_service_spec.rb
│ ├── plans
│ │ ├── apply_taxes_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ ├── override_service_spec.rb
│ │ ├── prepare_destroy_service_spec.rb
│ │ ├── update_amount_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── update_usage_thresholds_service_spec.rb
│ ├── pricing_units
│ │ ├── create_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── subscriptions
│ │ ├── activate_service_spec.rb
│ │ ├── charge_cache_service_spec.rb
│ │ ├── consume_subscription_refreshed_queue_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── dates
│ │ │ ├── monthly_service_spec.rb
│ │ │ ├── quarterly_service_spec.rb
│ │ │ ├── weekly_service_spec.rb
│ │ │ └── yearly_service_spec.rb
│ │ ├── dates_service_spec.rb
│ │ ├── flag_refreshed_service_spec.rb
│ │ ├── free_trial_billing_service_spec.rb
│ │ ├── organization_billing_service_spec.rb
│ │ ├── plan_upgrade_service_spec.rb
│ │ ├── progressive_billed_amount_spec.rb
│ │ ├── terminate_service_spec.rb
│ │ ├── terminated_dates_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ └── validate_service_spec.rb
│ ├── taxes
│ │ ├── auto_generate_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── destroy_service_spec.rb
│ │ └── update_service_spec.rb
│ ├── usage_monitoring
│ │ ├── create_alert_service_spec.rb
│ │ ├── destroy_alert_service_spec.rb
│ │ ├── process_alert_service_spec.rb
│ │ ├── process_all_subscription_activities_service_spec.rb
│ │ ├── process_organization_subscription_activities_service_spec.rb
│ │ ├── process_subscription_activity_service_spec.rb
│ │ ├── track_subscription_activity_service_spec.rb
│ │ └── update_alert_service_spec.rb
│ ├── usage_thresholds
│ │ └── override_service_spec.rb
│ ├── users_service_spec.rb
│ ├── utils
│ │ ├── activity_log_spec.rb
│ │ ├── datetime_spec.rb
│ │ └── pdf_generator_spec.rb
│ ├── validators
│ │ ├── decimal_amount_service_spec.rb
│ │ ├── expiration_date_validator_spec.rb
│ │ └── metadata_validator_spec.rb
│ ├── wallet_transactions
│ │ ├── create_from_params_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── mark_as_failed_service_spec.rb
│ │ ├── payments
│ │ │ └── generate_payment_url_service_spec.rb
│ │ ├── recredit_service_spec.rb
│ │ ├── settle_service_spec.rb
│ │ ├── validate_service_spec.rb
│ │ └── void_service_spec.rb
│ ├── wallets
│ │ ├── apply_paid_credits_service_spec.rb
│ │ ├── balance
│ │ │ ├── decrease_service_spec.rb
│ │ │ ├── increase_service_spec.rb
│ │ │ ├── refresh_ongoing_service_spec.rb
│ │ │ └── update_ongoing_service_spec.rb
│ │ ├── create_interval_wallet_transactions_service_spec.rb
│ │ ├── create_service_spec.rb
│ │ ├── recurring_transaction_rules
│ │ │ ├── create_service_spec.rb
│ │ │ ├── terminate_service_spec.rb
│ │ │ ├── update_service_spec.rb
│ │ │ └── validate_service_spec.rb
│ │ ├── terminate_service_spec.rb
│ │ ├── threshold_top_up_service_spec.rb
│ │ ├── update_service_spec.rb
│ │ ├── validate_limitations_service_spec.rb
│ │ ├── validate_recurring_transaction_rules_service_spec.rb
│ │ └── validate_service_spec.rb
│ ├── webhook_endpoints
│ │ └── update_service_spec.rb
│ └── webhooks
│ │ ├── base_service_spec.rb
│ │ ├── credit_notes
│ │ ├── created_service_spec.rb
│ │ ├── generated_service_spec.rb
│ │ └── payment_provider_refund_failure_service_spec.rb
│ │ ├── customers
│ │ ├── created_service_spec.rb
│ │ ├── updated_service_spec.rb
│ │ └── vies_check_service_spec.rb
│ │ ├── events
│ │ ├── error_service_spec.rb
│ │ └── validation_errors_service_spec.rb
│ │ ├── fees
│ │ └── pay_in_advance_created_service_spec.rb
│ │ ├── integrations
│ │ ├── accounting_customer_created_service_spec.rb
│ │ ├── accounting_customer_error_service_spec.rb
│ │ ├── crm_customer_created_service_spec.rb
│ │ ├── crm_customer_error_service_spec.rb
│ │ ├── provider_error_service_spec.rb
│ │ └── taxes
│ │ │ ├── error_service_spec.rb
│ │ │ └── fee_error_service_spec.rb
│ │ ├── invoices
│ │ ├── add_on_created_service_spec.rb
│ │ ├── created_service_spec.rb
│ │ ├── drafted_service_spec.rb
│ │ ├── generated_service_spec.rb
│ │ ├── one_off_created_service_spec.rb
│ │ ├── paid_credit_added_service_spec.rb
│ │ ├── payment_dispute_lost_service_spec.rb
│ │ ├── payment_overdue_service_spec.rb
│ │ ├── payment_status_updated_service_spec.rb
│ │ ├── resynced_service_spec.rb
│ │ └── voided_service_spec.rb
│ │ ├── notify_failure_service_spec.rb
│ │ ├── payment_providers
│ │ ├── customer_checkout_service_spec.rb
│ │ ├── customer_created_service_spec.rb
│ │ ├── customer_error_service_spec.rb
│ │ ├── error_service_spec.rb
│ │ ├── invoice_payment_failure_service_spec.rb
│ │ ├── payment_request_payment_failure_service_spec.rb
│ │ └── wallet_transaction_payment_failure_service_spec.rb
│ │ ├── payment_receipts
│ │ ├── created_service_spec.rb
│ │ └── generated_service_spec.rb
│ │ ├── payment_requests
│ │ ├── created_service_spec.rb
│ │ └── payment_status_updated_service_spec.rb
│ │ ├── payments
│ │ └── requires_action_service_spec.rb
│ │ ├── retry_service_spec.rb
│ │ ├── send_http_service_spec.rb
│ │ ├── subscriptions
│ │ ├── started_service_spec.rb
│ │ ├── terminated_service_spec.rb
│ │ ├── termination_alert_service_spec.rb
│ │ ├── trial_ended_service_spec.rb
│ │ ├── updated_service_spec.rb
│ │ └── usage_thresholds_reached_service_spec.rb
│ │ ├── usage_monitoring
│ │ └── alert_triggered_service_spec.rb
│ │ ├── wallet_transactions
│ │ ├── created_service_spec.rb
│ │ └── updated_service_spec.rb
│ │ └── wallets
│ │ ├── created_service_spec.rb
│ │ ├── depleted_ongoing_balance_service_spec.rb
│ │ └── terminated_service_spec.rb
├── spec_helper.rb
├── support
│ ├── admin_helper.rb
│ ├── api_helper.rb
│ ├── graphql_helper.rb
│ ├── jobs
│ │ └── mock_stripe_webhook_event_job.rb
│ ├── license_helper.rb
│ ├── matchers
│ │ ├── datetime_matcher.rb
│ │ ├── graphql_field_permissions_matcher.rb
│ │ ├── have_empty_charge_fees.rb
│ │ └── negated_matchers.rb
│ ├── pdf_helper.rb
│ ├── queues_helper.rb
│ ├── scenarios_helper.rb
│ ├── shared_context
│ │ ├── stripe_customer.rb
│ │ ├── time_travel.rb
│ │ └── webhook_tracking.rb
│ ├── shared_examples
│ │ ├── api_requirements.rb
│ │ ├── applied_invoice_custom_sections.rb
│ │ ├── charges
│ │ │ └── pricing_group_keys_validation.rb
│ │ ├── creates_webhook.rb
│ │ ├── graphql_requirements.rb
│ │ ├── integrations.rb
│ │ ├── organization_feature.rb
│ │ └── paper_trail_traceable.rb
│ ├── shoulda_matchers.rb
│ └── stripe_helper.rb
└── views
│ └── helpers
│ ├── fee_display_helper_spec.rb
│ ├── line_break_helper_spec.rb
│ ├── money_helper_spec.rb
│ └── rounding_helper_spec.rb
├── storage
└── .keep
├── tmp
├── .keep
├── pids
│ └── .keep
└── storage
│ └── .keep
└── vendor
└── .keep
/.dockerignore:
--------------------------------------------------------------------------------
1 | /tmp/*
2 | .rsa_private.pem
3 | .rsa_public.pem
--------------------------------------------------------------------------------
/.env.dist:
--------------------------------------------------------------------------------
1 | DATABASE_URL=postgresql://lago:changeme@localhost:5432/lago_test
2 |
--------------------------------------------------------------------------------
/.git-blame-ignore-revs:
--------------------------------------------------------------------------------
1 | # Enable TrailingCommaInHashLiteral rubocop rule for all files
2 | 3803519f622313a50def9b5261dfce899bdaf12d
3 | f83dbe1f847414c927273523b6cf60f3a881a9f1
4 | 747a2feea6530ef298722f464e47855507c21886
5 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files.
2 |
3 | # Mark the database schema as having been generated.
4 | db/schema.rb linguist-generated
5 | schema.json linguist-generated
6 | schema.graphql linguist-generated
7 |
8 | # Mark any vendored files as having been vendored.
9 | vendor/* linguist-vendored
10 |
--------------------------------------------------------------------------------
/.github/ISSUE_TEMPLATE/config.yml:
--------------------------------------------------------------------------------
1 | blank_issues_enabled: false
2 | contact_links:
3 | - name: Lago Community
4 | url: https://www.getlago.com/slack
5 | about: Join us on Slack to get answers to your questions and submit new feature requests.
6 |
--------------------------------------------------------------------------------
/.irbrc:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | IRB.conf[:USE_AUTOCOMPLETE] = false
4 |
--------------------------------------------------------------------------------
/.rspec:
--------------------------------------------------------------------------------
1 | --require spec_helper
2 | --format Fuubar
3 | --color
4 |
--------------------------------------------------------------------------------
/.ruby-version:
--------------------------------------------------------------------------------
1 | 3.4.4
2 |
--------------------------------------------------------------------------------
/.tool-versions:
--------------------------------------------------------------------------------
1 | ruby 3.4.4
2 |
--------------------------------------------------------------------------------
/PULL_REQUEST_TEMPLATE.md:
--------------------------------------------------------------------------------
1 | ## Roadmap Task
2 |
3 | 👉 https://getlago.canny.io/feature-requests/p/{{FEATURE_SLUG}}
4 |
5 | ## Context
6 |
7 | Include relevant motivation and context.
8 |
9 | ## Description
10 |
11 | Describe your changes in detail.
12 |
13 | List any dependencies that are required.
14 |
--------------------------------------------------------------------------------
/app/assets/config/manifest.js:
--------------------------------------------------------------------------------
1 | //= link graphiql/rails/application.css
2 | //= link graphiql/rails/application.js
3 |
--------------------------------------------------------------------------------
/app/consumers/application_consumer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Application consumer from which all Karafka consumers should inherit
4 | # You can rename it if it would conflict with your current code base (in case you're integrating
5 | # Karafka with other frameworks)
6 | class ApplicationConsumer < Karafka::BaseConsumer
7 | end
8 |
--------------------------------------------------------------------------------
/app/consumers/events_charged_in_advance_consumer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class EventsChargedInAdvanceConsumer < ApplicationConsumer
4 | def consume
5 | messages.each do |message|
6 | Events::PayInAdvanceJob.perform_later(message.payload)
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/controllers/api/v1/data_api/base_controller.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Api
4 | module V1
5 | module DataApi
6 | class BaseController < Api::BaseController
7 | private
8 |
9 | def resource_name
10 | "analytic"
11 | end
12 | end
13 | end
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/controllers/concerns/common.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Common
4 | extend ActiveSupport::Concern
5 |
6 | private
7 |
8 | def valid_date?(date)
9 | return false unless date
10 |
11 | parsed_date = Date._strptime(date)
12 |
13 | return false unless parsed_date
14 |
15 | true
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/app/graphql/extensions/field_authorization_extension.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Extensions
4 | class FieldAuthorizationExtension < GraphQL::Schema::FieldExtension
5 | def resolve(object:, arguments:, context:)
6 | super if field.permissions.any? { |p| context.dig(:permissions, p) }
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/graphql/resolvers/base_resolver.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Resolvers
4 | class BaseResolver < GraphQL::Schema::Resolver
5 | include ExecutionErrorResponder
6 | include CanRequirePermissions
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/graphql/resolvers/version_resolver.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Resolvers
4 | class VersionResolver < Resolvers::BaseResolver
5 | description "Retrieve the version of the application"
6 |
7 | type Types::Utils::CurrentVersion, null: false
8 |
9 | def resolve
10 | LAGO_VERSION
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/adjusted_fees/adjusted_fee_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module AdjustedFees
5 | class AdjustedFeeTypeEnum < Types::BaseEnum
6 | AdjustedFee::ADJUSTED_FEE_TYPES.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/api_keys/sanitized_object.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module ApiKeys
5 | class SanitizedObject < Object
6 | graphql_name "SanitizedApiKey"
7 |
8 | def value
9 | "••••••••" + object.value.last(3)
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/auth/google/auth_url.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Auth
5 | module Google
6 | class AuthUrl < Types::BaseObject
7 | field :url, String, null: false
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/auth/okta/authorize.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Auth
5 | module Okta
6 | class Authorize < Types::BaseObject
7 | field :url, String, null: false
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/base_connection.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class BaseConnection < Types::BaseObject
5 | # add `nodes` and `pageInfo` fields, as well as `edge_type(...)` and `node_nullable(...)` overrides
6 | include GraphQL::Types::Relay::ConnectionBehaviors
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/graphql/types/base_edge.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class BaseEdge < Types::BaseObject
5 | # add `node` and `cursor` fields, as well as `node_type(...)` override
6 | include GraphQL::Types::Relay::EdgeBehaviors
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/graphql/types/base_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class BaseEnum < GraphQL::Schema::Enum
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/graphql/types/base_interface.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module BaseInterface
5 | include GraphQL::Schema::Interface
6 | edge_type_class(Types::BaseEdge)
7 | connection_type_class(Types::BaseConnection)
8 |
9 | field_class Types::BaseField
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/base_object.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class BaseObject < GraphQL::Schema::Object
5 | edge_type_class(Types::BaseEdge)
6 | connection_type_class(Types::BaseConnection)
7 | field_class Types::BaseField
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/graphql/types/base_scalar.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class BaseScalar < GraphQL::Schema::Scalar
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/app/graphql/types/base_union.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class BaseUnion < GraphQL::Schema::Union
5 | extend GraphqlPagination::CollectionType
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/graphql/types/billable_metrics/aggregation_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module BillableMetrics
5 | class AggregationTypeEnum < Types::BaseEnum
6 | BillableMetric::AGGREGATION_TYPES.keys.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/billable_metrics/rounding_function_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module BillableMetrics
5 | class RoundingFunctionEnum < Types::BaseEnum
6 | BillableMetric::ROUNDING_FUNCTIONS.values.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/billable_metrics/weighted_interval_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module BillableMetrics
5 | class WeightedIntervalEnum < Types::BaseEnum
6 | BillableMetric::WEIGHTED_INTERVAL.values.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/charges/charge_model_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Charges
5 | class ChargeModelEnum < Types::BaseEnum
6 | Charge::CHARGE_MODELS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/charges/regroup_paid_fees_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Charges
5 | class RegroupPaidFeesEnum < Types::BaseEnum
6 | Charge::REGROUPING_PAID_FEES_OPTIONS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/commitments/commitment_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Commitments
5 | class CommitmentTypeEnum < Types::BaseEnum
6 | Commitment::COMMITMENT_TYPES.keys.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/country_code_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class CountryCodeEnum < Types::BaseEnum
5 | graphql_name "CountryCode"
6 |
7 | ISO3166::Country.all.each do |country| # rubocop:disable Rails/FindEach
8 | value country.alpha2, country.iso_short_name
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/coupons/coupon_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Coupons
5 | class CouponTypeEnum < Types::BaseEnum
6 | Coupon::COUPON_TYPES.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/coupons/expiration_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Coupons
5 | class ExpirationEnum < Types::BaseEnum
6 | graphql_name "CouponExpiration"
7 |
8 | Coupon::EXPIRATION_TYPES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/coupons/frequency_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Coupons
5 | class FrequencyEnum < Types::BaseEnum
6 | graphql_name "CouponFrequency"
7 |
8 | Coupon::FREQUENCIES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/coupons/limitation_input.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Coupons
5 | class LimitationInput < BaseInputObject
6 | argument :billable_metric_ids, [ID], required: false
7 | argument :plan_ids, [ID], required: false
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/graphql/types/coupons/status_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Coupons
5 | class StatusEnum < Types::BaseEnum
6 | graphql_name "CouponStatusEnum"
7 |
8 | Coupon::STATUSES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/coupons/update_input.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Coupons
5 | class UpdateInput < Types::Coupons::CreateInput
6 | graphql_name "UpdateCouponInput"
7 |
8 | argument :id, String, required: true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/credit_notes/reason_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module CreditNotes
5 | class ReasonTypeEnum < Types::BaseEnum
6 | graphql_name "CreditNoteReasonEnum"
7 |
8 | CreditNote::REASON.each do |reason|
9 | value reason
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/currency_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class CurrencyEnum < Types::BaseEnum
5 | Currencies::ACCEPTED_CURRENCIES.each do |code, description|
6 | value code, description
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/graphql/types/customers/account_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Customers
5 | class AccountTypeEnum < Types::BaseEnum
6 | graphql_name "CustomerAccountTypeEnum"
7 |
8 | Customer::ACCOUNT_TYPES.keys.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/customers/billing_configuration.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Customers
5 | class BillingConfiguration < Types::BaseObject
6 | graphql_name "CustomerBillingConfiguration"
7 |
8 | field :document_locale, String
9 | field :id, ID, null: false
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/graphql/types/customers/customer_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Customers
5 | class CustomerTypeEnum < Types::BaseEnum
6 | Customer::CUSTOMER_TYPES.keys.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/customers/finalize_zero_amount_invoice_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Customers
5 | class FinalizeZeroAmountInvoiceEnum < BaseEnum
6 | Customer::FINALIZE_ZERO_AMOUNT_INVOICE_OPTIONS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/data_api/revenue_streams/order_by_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module DataApi
5 | module RevenueStreams
6 | class OrderByEnum < Types::BaseEnum
7 | value :gross_revenue_amount_cents
8 | value :net_revenue_amount_cents
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/graphql/types/data_api/time_granularity_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module DataApi
5 | class TimeGranularityEnum < Types::BaseEnum
6 | value :daily
7 | value :weekly
8 | value :monthly
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/data_exports/format_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module DataExports
5 | class FormatTypeEnum < Types::BaseEnum
6 | graphql_name "DataExportFormatTypeEnum"
7 |
8 | DataExport::EXPORT_FORMATS.each do |format|
9 | value format
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/data_exports/object.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module DataExports
5 | class Object < Types::BaseObject
6 | graphql_name "DataExport"
7 |
8 | field :id, ID, null: false
9 | field :status, Types::DataExports::StatusEnum, null: false
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/graphql/types/data_exports/status_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module DataExports
5 | class StatusEnum < Types::BaseEnum
6 | graphql_name "DataExportStatusEnum"
7 |
8 | DataExport::STATUSES.each do |status|
9 | value status
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/error_details/error_codes_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module ErrorDetails
5 | class ErrorCodesEnum < Types::BaseEnum
6 | ErrorDetail::ERROR_CODES.keys.each do |code|
7 | value code
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/fees/types_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Fees
5 | class TypesEnum < Types::BaseEnum
6 | graphql_name "FeeTypesEnum"
7 |
8 | Fee::FEE_TYPES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/integration_items/item_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module IntegrationItems
5 | class ItemTypeEnum < Types::BaseEnum
6 | graphql_name "IntegrationItemTypeEnum"
7 |
8 | IntegrationItem::ITEM_TYPES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/integration_mappings/mappable_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module IntegrationMappings
5 | class MappableTypeEnum < Types::BaseEnum
6 | ::IntegrationMappings::BaseMapping::MAPPABLE_TYPES.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/integrations/integration_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Integrations
5 | class IntegrationTypeEnum < Types::BaseEnum
6 | Organization::INTEGRATIONS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/integrations/premium_integration_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Integrations
5 | class PremiumIntegrationTypeEnum < Types::BaseEnum
6 | Organization::PREMIUM_INTEGRATIONS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/integrations/sync_credit_note_input.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Integrations
5 | class SyncCreditNoteInput < Types::BaseInputObject
6 | graphql_name "SyncIntegrationCreditNoteInput"
7 |
8 | argument :credit_note_id, ID, required: true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/integrations/sync_hubspot_invoice_input.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Integrations
5 | class SyncHubspotInvoiceInput < Types::BaseInputObject
6 | graphql_name "SyncHubspotIntegrationInvoiceInput"
7 |
8 | argument :invoice_id, ID, required: true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/integrations/sync_invoice_input.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Integrations
5 | class SyncInvoiceInput < Types::BaseInputObject
6 | graphql_name "SyncIntegrationInvoiceInput"
7 |
8 | argument :invoice_id, ID, required: true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/invites/status_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Invites
5 | class StatusTypeEnum < Types::BaseEnum
6 | graphql_name "InviteStatusTypeEnum"
7 |
8 | Invite::INVITE_STATUS.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/invoices/invoice_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Invoices
5 | class InvoiceTypeEnum < Types::BaseEnum
6 | Invoice::INVOICE_TYPES.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/invoices/status_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Invoices
5 | class StatusTypeEnum < Types::BaseEnum
6 | graphql_name "InvoiceStatusTypeEnum"
7 |
8 | Invoice::STATUS.keys.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/invoices/tax_status_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Invoices
5 | class TaxStatusTypeEnum < Types::BaseEnum
6 | graphql_name "InvoiceTaxStatusTypeEnum"
7 |
8 | Invoice::TAX_STATUSES.keys.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/memberships/role_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Memberships
5 | class RoleEnum < Types::BaseEnum
6 | graphql_name "MembershipRole"
7 |
8 | Membership::ROLES.keys.each do |role|
9 | value role
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/memberships/status_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Memberships
5 | class StatusEnum < Types::BaseEnum
6 | graphql_name "MembershipStatus"
7 |
8 | Membership::STATUSES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/node_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module NodeType
5 | include Types::BaseInterface
6 | # Add the `id` field
7 | include GraphQL::Types::Relay::NodeBehaviors
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/graphql/types/obfuscated_string_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | class ObfuscatedStringType < GraphQL::Schema::Scalar
5 | def self.coerce_result(value, _ctx)
6 | return nil unless value
7 |
8 | "#{"•" * 8}…#{value.to_s[-3..]}"
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/payloads/login_user_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Payloads
5 | class LoginUserType < Types::BaseObject
6 | field :token, String, null: false
7 | field :user, Types::UserType, null: false
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/graphql/types/payment_providers/provider_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module PaymentProviders
5 | class ProviderTypeEnum < Types::BaseEnum
6 | Customer::PAYMENT_PROVIDERS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/payments/payable_payment_status_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Payments
5 | class PayablePaymentStatusEnum < Types::BaseEnum
6 | Payment::PAYABLE_PAYMENT_STATUS.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/payments/payment_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Payments
5 | class PaymentTypeEnum < Types::BaseEnum
6 | Payment::PAYMENT_TYPES.keys.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/plans/interval_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Plans
5 | class IntervalEnum < Types::BaseEnum
6 | graphql_name "PlanInterval"
7 |
8 | Plan::INTERVALS.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/subscriptions/billing_time_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Subscriptions
5 | class BillingTimeEnum < Types::BaseEnum
6 | Subscription::BILLING_TIME.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/subscriptions/next_subscription_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Subscriptions
5 | class NextSubscriptionTypeEnum < Types::BaseEnum
6 | value "upgrade"
7 | value "downgrade"
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/graphql/types/subscriptions/status_type_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Subscriptions
5 | class StatusTypeEnum < Types::BaseEnum
6 | Subscription::STATUSES.each do |type|
7 | value type
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/utils/current_version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Utils
5 | class CurrentVersion < Types::BaseObject
6 | field :github_url, String, null: false
7 | field :number, String, null: false
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/graphql/types/wallets/applies_to.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Wallets
5 | class AppliesTo < Types::BaseObject
6 | graphql_name "WalletAppliesTo"
7 |
8 | field :fee_types, [Types::Fees::TypesEnum], null: true, method: :allowed_fee_types
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/graphql/types/wallets/applies_to_input.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Wallets
5 | class AppliesToInput < BaseInputObject
6 | argument :fee_types, [Types::Fees::TypesEnum], required: false
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/graphql/types/wallets/status_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Wallets
5 | class StatusEnum < Types::BaseEnum
6 | graphql_name "WalletStatusEnum"
7 |
8 | Wallet::STATUSES.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/graphql/types/webhooks/status_enum.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Types
4 | module Webhooks
5 | class StatusEnum < Types::BaseEnum
6 | graphql_name "WebhookStatusEnum"
7 |
8 | Webhook::STATUS.each do |type|
9 | value type
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/jobs/application_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ApplicationJob < ActiveJob::Base
4 | sidekiq_options retry: 0
5 | end
6 |
--------------------------------------------------------------------------------
/app/jobs/charges/create_children_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Charges
4 | class CreateChildrenJob < ApplicationJob
5 | queue_as "default"
6 |
7 | def perform(charge:, payload:)
8 | Charges::CreateChildrenService.call!(charge:, payload:)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/charges/destroy_children_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Charges
4 | class DestroyChildrenJob < ApplicationJob
5 | queue_as :default
6 |
7 | def perform(charge_id)
8 | charge = Charge.with_discarded.find_by(id: charge_id)
9 | Charges::DestroyChildrenService.call!(charge)
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/jobs/clock/activate_subscriptions_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class ActivateSubscriptionsJob < ClockJob
5 | unique :until_executed, on_conflict: :log
6 |
7 | def perform
8 | Subscriptions::ActivateService.new(timestamp: Time.current.to_i).activate_all_pending
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/clock/compute_all_daily_usages_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class ComputeAllDailyUsagesJob < ClockJob
5 | def perform
6 | DailyUsages::ComputeAllService.call(timestamp: Time.current)
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/clock/consume_subscription_refreshed_queue_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Clock::ConsumeSubscriptionRefreshedQueueJob < ClockJob
4 | unique :until_executed, on_conflict: :log
5 |
6 | def perform
7 | Subscriptions::ConsumeSubscriptionRefreshedQueueService.call!
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/clock/create_interval_wallet_transactions_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class CreateIntervalWalletTransactionsJob < ClockJob
5 | def perform
6 | Wallets::CreateIntervalWalletTransactionsService.call
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/clock/free_trial_subscriptions_biller_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class FreeTrialSubscriptionsBillerJob < ClockJob
5 | def perform
6 | Subscriptions::FreeTrialBillingService.call
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/clock/inbound_webhooks_cleanup_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class InboundWebhooksCleanupJob < ClockJob
5 | def perform
6 | InboundWebhook.where("updated_at < ?", 90.days.ago).destroy_all
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/clock/inbound_webhooks_retry_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class InboundWebhooksRetryJob < ClockJob
5 | def perform
6 | InboundWebhook.retriable.find_each do |inbound_webhook|
7 | InboundWebhooks::ProcessJob.perform_later(inbound_webhook:)
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/clock/subscriptions_biller_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class SubscriptionsBillerJob < ClockJob
5 | def perform
6 | Organization.find_each do |organization|
7 | Subscriptions::OrganizationBillingJob.perform_later(organization:)
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/clock/terminate_coupons_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class TerminateCouponsJob < ClockJob
5 | def perform
6 | Coupons::TerminateService.terminate_all_expired
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/clock/terminate_wallets_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class TerminateWalletsJob < ClockJob
5 | def perform
6 | Wallet.active.expired.find_each do |wallet|
7 | Wallets::TerminateService.call(wallet:)
8 | end
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/clock/webhooks_cleanup_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clock
4 | class WebhooksCleanupJob < ClockJob
5 | def perform
6 | Webhook.where("updated_at < ?", 90.days.ago).destroy_all
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/jobs/credit_notes/generate_pdf_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module CreditNotes
4 | class GeneratePdfJob < ApplicationJob
5 | queue_as "invoices"
6 |
7 | def perform(credit_note)
8 | result = CreditNotes::GenerateService.call(credit_note:, context: "api")
9 | result.raise_if_error!
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/jobs/data_exports/process_part_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module DataExports
4 | class ProcessPartJob < ApplicationJob
5 | queue_as :default
6 |
7 | def perform(data_export_part)
8 | ProcessPartService.call(data_export_part:).raise_if_error!
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/dunning_campaigns/bulk_process_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module DunningCampaigns
4 | class BulkProcessJob < ApplicationJob
5 | queue_as :default
6 |
7 | def perform
8 | return unless License.premium?
9 |
10 | DunningCampaigns::BulkProcessService.call.raise_if_error!
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/jobs/inbound_webhooks/process_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module InboundWebhooks
4 | class ProcessJob < ApplicationJob
5 | queue_as :default
6 |
7 | def perform(inbound_webhook:)
8 | InboundWebhooks::ProcessService.call!(inbound_webhook:)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/invoices/update_fees_payment_status_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Invoices
4 | class UpdateFeesPaymentStatusJob < ApplicationJob
5 | queue_as "invoices"
6 |
7 | def perform(invoice)
8 | invoice.fees.update!(payment_status: invoice.payment_status)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/lifetime_usages/flag_refresh_from_plan_update_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module LifetimeUsages
4 | class FlagRefreshFromPlanUpdateJob < ApplicationJob
5 | queue_as :default
6 |
7 | def perform(plan)
8 | LifetimeUsages::FlagRefreshFromPlanUpdateService.call(plan:)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/payment_receipts/create_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module PaymentReceipts
4 | class CreateJob < ApplicationJob
5 | queue_as :low_priority
6 |
7 | def perform(payment)
8 | PaymentReceipts::CreateService.call!(payment:)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/subscriptions/flag_refreshed_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Subscriptions
4 | class FlagRefreshedJob < ApplicationJob
5 | queue_as :events
6 |
7 | def perform(subscription_id)
8 | Subscriptions::FlagRefreshedService.call!(subscription_id)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/jobs/taxes/update_organization_eu_taxes_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Taxes
4 | class UpdateOrganizationEuTaxesJob < ApplicationJob
5 | queue_as "default"
6 |
7 | def perform(organization)
8 | Taxes::AutoGenerateService.call!(organization:)
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/models/application_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ApplicationRecord < ActiveRecord::Base
4 | primary_abstract_class
5 |
6 | # Avoid raising ActiveRecord::PreparedStatementCacheExpired
7 | # from transactions when a migration is adding a new column
8 | self.ignored_columns = [:__fake_column__]
9 | end
10 |
--------------------------------------------------------------------------------
/app/models/clickhouse/base_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Clickhouse
4 | class BaseRecord < ApplicationRecord
5 | self.abstract_class = true
6 | self.ignored_columns = [] # Override ApplicationRecord settings
7 |
8 | connects_to database: {writing: :clickhouse, reading: :clickhouse}
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/app/models/concerns/ransack_uuid_search.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module RansackUuidSearch
4 | extend ActiveSupport::Concern
5 |
6 | included do
7 | ransacker :id do
8 | Arel.sql("\"#{table_name}\".\"id\"::varchar")
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/app/models/events_record.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class EventsRecord < ApplicationRecord
4 | self.abstract_class = true
5 |
6 | connects_to database: {writing: :events, reading: :events}
7 | end
8 |
--------------------------------------------------------------------------------
/app/models/subscription_usage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | SubscriptionUsage = Struct.new(
4 | :from_datetime,
5 | :to_datetime,
6 | :issuing_date,
7 | :currency,
8 | :amount_cents,
9 | :total_amount_cents,
10 | :taxes_amount_cents,
11 | :fees
12 | )
13 |
--------------------------------------------------------------------------------
/app/models/usage_monitoring.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module UsageMonitoring
4 | def self.table_name_prefix
5 | "usage_monitoring_"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/serializers/error_serializer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ErrorSerializer
4 | attr_reader :error
5 |
6 | def initialize(error)
7 | @error = error
8 | end
9 |
10 | def serialize
11 | {
12 | message: error.message
13 | }
14 | end
15 | end
16 |
--------------------------------------------------------------------------------
/app/serializers/v1/billable_metric_expression_result_serializer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module V1
4 | class BillableMetricExpressionResultSerializer < ModelSerializer
5 | def serialize
6 | {value: model.evaluation_result}
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/app/serializers/v1/billable_metric_filter_serializer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module V1
4 | class BillableMetricFilterSerializer < ModelSerializer
5 | def serialize
6 | {
7 | key: model.key,
8 | values: model.values.sort
9 | }
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/serializers/v1/error_detail_serializer.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module V1
4 | class ErrorDetailSerializer < ModelSerializer
5 | def serialize
6 | {
7 | lago_id: model.id,
8 | error_code: model.error_code,
9 | details: model.details
10 | }
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/services/analytics/gross_revenues_service.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Analytics
4 | class GrossRevenuesService < BaseService
5 | def call
6 | @records = ::Analytics::GrossRevenue.find_all_by(organization.id, **filters)
7 |
8 | result.records = records
9 | result
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/services/analytics/overdue_balances_service.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Analytics
4 | class OverdueBalancesService < BaseService
5 | def call
6 | @records = ::Analytics::OverdueBalance.find_all_by(organization.id, **filters)
7 |
8 | result.records = records
9 | result
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/services/billable_metrics/breakdown/item.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module BillableMetrics
4 | module Breakdown
5 | Item = Data.define(:date, :action, :amount, :duration, :total_duration)
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/services/commitments/minimum/in_advance/dates_service.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Commitments
4 | module Minimum
5 | module InAdvance
6 | class DatesService < Commitments::DatesService
7 | def current_usage
8 | true
9 | end
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/services/integrations/aggregator/contacts/payloads/xero.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Integrations
4 | module Aggregator
5 | module Contacts
6 | module Payloads
7 | class Xero < BasePayload
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/services/integrations/aggregator/credit_notes/payloads/anrok.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Integrations
4 | module Aggregator
5 | module CreditNotes
6 | module Payloads
7 | class Anrok < BasePayload
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/services/integrations/aggregator/credit_notes/payloads/xero.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Integrations
4 | module Aggregator
5 | module CreditNotes
6 | module Payloads
7 | class Xero < BasePayload
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/services/integrations/aggregator/payments/payloads/xero.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Integrations
4 | module Aggregator
5 | module Payments
6 | module Payloads
7 | class Xero < BasePayload
8 | end
9 | end
10 | end
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/app/services/utils/money_with_precision.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Utils
4 | class MoneyWithPrecision < Money
5 | self.default_infinite_precision = true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/app/services/webhooks/integrations/crm_customer_created_service.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module Webhooks
4 | module Integrations
5 | class CrmCustomerCreatedService < CustomerCreatedService
6 | private
7 |
8 | def webhook_type
9 | "customer.crm_provider_created"
10 | end
11 | end
12 | end
13 | end
14 |
--------------------------------------------------------------------------------
/app/views/helpers/line_break_helper.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class LineBreakHelper
4 | def self.break_lines(text)
5 | escaped_text = ERB::Util.html_escape(text.to_s)
6 | escaped_text.split("\n").reject(&:blank?).join("
").html_safe # rubocop:disable Rails/OutputSafety
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/app/views/templates/credit_notes/_powered_by_logo.slim:
--------------------------------------------------------------------------------
1 | - unless organization.remove_branding_watermark_enabled?
2 | .powered-by
3 | span.body-2
4 | | #{I18n.t('credit_note.powered_by')}
5 | img src="#{::SlimHelper::PDF_LOGO_FILENAME}" alt="Lago Logo"
6 |
--------------------------------------------------------------------------------
/app/views/templates/invoices/v4/_powered_by_logo.slim:
--------------------------------------------------------------------------------
1 | - unless organization.remove_branding_watermark_enabled?
2 | .powered-by
3 | span.body-2
4 | | #{I18n.t('invoice.powered_by')}
5 | img src="#{::SlimHelper::PDF_LOGO_FILENAME}" alt="Lago Logo"
6 |
--------------------------------------------------------------------------------
/app/views/templates/payment_receipts/v1/_powered_by_logo.slim:
--------------------------------------------------------------------------------
1 | - unless organization.remove_branding_watermark_enabled?
2 | .powered-by
3 | span.body-2
4 | | #{I18n.t('invoice.powered_by')}
5 | img src="#{::SlimHelper::PDF_LOGO_FILENAME}" alt="Lago Logo"
6 |
--------------------------------------------------------------------------------
/bin/rails:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | APP_PATH = File.expand_path("../config/application", __dir__)
3 | require_relative "../config/boot"
4 | require "rails/commands"
5 |
--------------------------------------------------------------------------------
/bin/rake:
--------------------------------------------------------------------------------
1 | #!/usr/bin/env ruby
2 | require_relative "../config/boot"
3 | require "rake"
4 | Rake.application.run
5 |
--------------------------------------------------------------------------------
/config.ru:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # This file is used by Rack-based servers to start the application.
4 |
5 | require_relative "config/environment"
6 |
7 | run Rails.application
8 | Rails.application.load_server
9 |
--------------------------------------------------------------------------------
/config/boot.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)
4 |
5 | require "bundler/setup" # Set up gems listed in the Gemfile.
6 | require "bootsnap/setup" # Speed up boot time by caching expensive operations.
7 |
--------------------------------------------------------------------------------
/config/environment.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | # Load the Rails application.
4 | require_relative "application"
5 |
6 | # Initialize the Rails application.
7 | Rails.application.initialize!
8 |
--------------------------------------------------------------------------------
/config/initializers/aasm.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | AASM::Configuration.hide_warnings = true
4 |
--------------------------------------------------------------------------------
/config/initializers/graphiql.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | GraphiQL::Rails.config.header_editor_enabled = true if Rails.env.development?
4 |
--------------------------------------------------------------------------------
/config/initializers/license.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "lago_utils"
4 |
5 | License = LagoUtils::License.new(Rails.application.config.license_url)
6 |
7 | License.verify unless Rails.env.test?
8 |
--------------------------------------------------------------------------------
/config/initializers/money.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | MoneyRails.configure do |config|
4 | config.default_currency = :eur
5 | config.locale_backend = :i18n
6 | config.rounding_mode = BigDecimal::ROUND_HALF_UP
7 | end
8 |
--------------------------------------------------------------------------------
/config/initializers/open_telemetry.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "opentelemetry/sdk"
4 | require "opentelemetry/instrumentation/all"
5 |
6 | OpenTelemetry::SDK.configure(&:use_all) if ENV["OTEL_EXPORTER"].present?
7 |
8 | LagoTracer = OpenTelemetry.tracer_provider.tracer("lago")
9 |
--------------------------------------------------------------------------------
/config/initializers/paper_trail.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | PaperTrail.config.version_limit = 5
4 | PaperTrail.serializer = PaperTrail::Serializers::JSON
5 |
--------------------------------------------------------------------------------
/config/initializers/version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | LAGO_VERSION = LagoUtils::Version.call(default: Rails.env)
4 |
--------------------------------------------------------------------------------
/config/initializers/zeitwerk.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Rails.autoloaders.main.ignore(
4 | "lib/generators"
5 | )
6 |
--------------------------------------------------------------------------------
/config/locales/de/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | de:
3 | commitment:
4 | minimum:
5 | name: Mindestverpflichtung
6 |
--------------------------------------------------------------------------------
/config/locales/de/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | de:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: Maximum number of webhook endpoints was reached
10 |
--------------------------------------------------------------------------------
/config/locales/en/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | en:
3 | commitment:
4 | minimum:
5 | name: Minimum commitment
6 |
--------------------------------------------------------------------------------
/config/locales/en/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | en:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: Maximum number of webhook endpoints was reached
10 |
--------------------------------------------------------------------------------
/config/locales/es/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | es:
3 | commitment:
4 | minimum:
5 | name: Compromiso mínimo
6 |
--------------------------------------------------------------------------------
/config/locales/es/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | es:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: Maximum number of webhook endpoints was reached
10 |
--------------------------------------------------------------------------------
/config/locales/fr/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | fr:
3 | commitment:
4 | minimum:
5 | name: Engagement minimum
6 |
--------------------------------------------------------------------------------
/config/locales/fr/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | fr:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: Maximum number of webhook endpoints was reached
10 |
--------------------------------------------------------------------------------
/config/locales/it/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | it:
3 | commitment:
4 | minimum:
5 | name: Impegno minimo
6 |
--------------------------------------------------------------------------------
/config/locales/it/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | it:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: È stato raggiunto il numero massimo di endpoint webhook
10 |
--------------------------------------------------------------------------------
/config/locales/nb/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | nb:
3 | commitment:
4 | minimum:
5 | name: Norge Minimumsforpliktelse
6 |
--------------------------------------------------------------------------------
/config/locales/nb/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | nb:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: Maximum number of webhook endpoints was reached
10 |
--------------------------------------------------------------------------------
/config/locales/sv/commitment.yml:
--------------------------------------------------------------------------------
1 | ---
2 | sv:
3 | commitment:
4 | minimum:
5 | name: Sverige Minsta åtagande
6 |
--------------------------------------------------------------------------------
/config/locales/sv/webhook_endpoint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | sv:
3 | activerecord:
4 | errors:
5 | models:
6 | webhook_endpoint:
7 | attributes:
8 | base:
9 | exceeded_limit: Maximum number of webhook endpoints was reached
10 |
--------------------------------------------------------------------------------
/config/sidekiq/sidekiq_billing.yml:
--------------------------------------------------------------------------------
1 | concurrency: 10
2 | timeout: 25
3 | retry: 1
4 | queues:
5 | - billing
6 |
7 | production:
8 | concurrency: <%= ENV.fetch('SIDEKIQ_CONCURRENCY', 5) %>
9 | staging:
10 | concurrency: 10
11 |
--------------------------------------------------------------------------------
/config/sidekiq/sidekiq_clock.yml:
--------------------------------------------------------------------------------
1 | concurrency: 10
2 | timeout: 25
3 | retry: 1
4 | queues:
5 | - clock_worker
6 |
7 | production:
8 | concurrency: <%= ENV.fetch('SIDEKIQ_CONCURRENCY', 5) %>
9 | staging:
10 | concurrency: 10
11 |
--------------------------------------------------------------------------------
/config/sidekiq/sidekiq_events.yml:
--------------------------------------------------------------------------------
1 | concurrency: 10
2 | timeout: 25
3 | retry: 1
4 | queues:
5 | - events
6 |
7 | production:
8 | concurrency: <%= ENV.fetch('SIDEKIQ_CONCURRENCY', 10) %>
9 | staging:
10 | concurrency: 10
11 |
--------------------------------------------------------------------------------
/config/sidekiq/sidekiq_payments.yml:
--------------------------------------------------------------------------------
1 | concurrency: 10
2 | timeout: 25
3 | retry: 1
4 | queues:
5 | - payments
6 |
7 | production:
8 | concurrency: <%= ENV.fetch('SIDEKIQ_CONCURRENCY', 10) %>
9 | staging:
10 | concurrency: 10
11 |
--------------------------------------------------------------------------------
/config/sidekiq/sidekiq_pdfs.yml:
--------------------------------------------------------------------------------
1 | concurrency: 10
2 | timeout: 25
3 | retry: 1
4 | queues:
5 | - pdfs
6 |
7 | production:
8 | concurrency: <%= ENV.fetch('SIDEKIQ_CONCURRENCY', 10) %>
9 | staging:
10 | concurrency: 10
11 |
--------------------------------------------------------------------------------
/config/sidekiq/sidekiq_webhook.yml:
--------------------------------------------------------------------------------
1 | concurrency: 10
2 | timeout: 25
3 | retry: 1
4 | queues:
5 | - webhook_worker
6 |
7 | production:
8 | concurrency: <%= ENV.fetch('SIDEKIQ_CONCURRENCY', 10) %>
9 | staging:
10 | concurrency: 10
11 |
--------------------------------------------------------------------------------
/config/versions.yml:
--------------------------------------------------------------------------------
1 | versions:
2 | - version: 1.5.0
3 | migrations: []
4 | - version: 1.5.1
5 | migrations: []
6 | - version: 1.6.0
7 | migrations: []
8 | - version: 1.6.1
9 | migrations:
10 | - 20240603095841
11 | - 20240628083830
12 | - version: 1.7.0
13 | migrations: []
14 |
--------------------------------------------------------------------------------
/db/migrate/20220530091046_add_metadata_to_events.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddMetadataToEvents < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :events, :metadata, :jsonb, null: false, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220601150058_add_add_on_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAddOnToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :fees, :applied_add_on, type: :uuid, foreign_key: true, index: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20220602145819_add_bill_charges_monthly_to_plans.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddBillChargesMonthlyToPlans < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :plans, :bill_charges_monthly, :boolean
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220607082458_add_charges_from_date_on_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddChargesFromDateOnInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :charges_from_date, :date
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220610143942_add_payment_provider_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPaymentProviderToCustomers < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :customers, :payment_provider, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220613130634_add_invoice_type_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceTypeToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :invoice_type, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220614110841_add_status_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddStatusToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :status, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220629133308_add_file_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFileToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :file, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220704145333_fill_event_timestamps.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class FillEventTimestamps < ActiveRecord::Migration[7.0]
4 | def change
5 | # NOTE: kept here for legacy reasons
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220705155228_add_unaccent_extension.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUnaccentExtension < ActiveRecord::Migration[7.0]
4 | def up
5 | safety_assured { execute "CREATE EXTENSION IF NOT EXISTS unaccent" }
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220718124337_add_name_to_subscriptions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNameToSubscriptions < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :subscriptions, :name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220727161448_add_customer_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCustomerToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :invoices, :customer, type: :uuid, foreign_key: true, index: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20220729055309_add_properties_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPropertiesToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :properties, :jsonb, null: false, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220801101144_add_consumed_amount_to_wallets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddConsumedAmountToWallets < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :wallets, :consumed_amount, :decimal, default: 0, precision: 5
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220809083243_fill_customer_id_on_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class FillCustomerIdOnInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20220811155332_refresh_stripe_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RefreshStripeWebhooks < ActiveRecord::Migration[7.0]
4 | def change
5 | LagoApi::Application.load_tasks
6 | Rake::Task["stripe:refresh_registered_webhooks"].invoke
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20220816120137_update_properties_on_percentage_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdatePropertiesOnPercentageCharges < ActiveRecord::Migration[7.0]
4 | def change
5 | LagoApi::Application.load_tasks
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220817092945_remove_invoice_from_wallet_transaction.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveInvoiceFromWalletTransaction < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | remove_reference :wallet_transactions, :invoice, index: true, foreign_key: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20220818141616_add_events_count_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEventsCountToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :events_count, :integer
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220824113131_rename_customer_id_to_external_id_on_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameCustomerIdToExternalIdOnCustomers < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_column :customers, :customer_id, :external_id
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20220825051923_add_wallet_transaction_to_invoice.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddWalletTransactionToInvoice < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :wallet_transactions, :invoice, type: :uuid, null: true, index: true, foreign_key: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20220831113537_update_fee_type.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateFeeType < ActiveRecord::Migration[7.0]
4 | def change
5 | end
6 | end
7 |
--------------------------------------------------------------------------------
/db/migrate/20220915092730_add_currency_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCurrencyToCustomers < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :customers, :currency, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20220916131538_add_parent_id_on_plans.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddParentIdOnPlans < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :plans, :parent, type: :uuid, null: true, index: true, foreign_key: {to_table: :plans}
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20221010083509_rename_credit_credit_note.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameCreditCreditNote < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_column :credits, :credit_notes_id, :credit_note_id
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20221021135428_add_properties_to_persisted_events.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPropertiesToPersistedEvents < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :persisted_events, :properties, :jsonb, null: false, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221028091920_add_group_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGroupIdToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :fees, :group, type: :uuid, null: true, foreign_key: true, index: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20221031141549_add_voided_at_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddVoidedAtToCreditNotes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credit_notes, :voided_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221031144907_add_description_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDescriptionToCreditNotes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credit_notes, :description, :text
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221114102649_fill_sync_with_provider_field.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class FillSyncWithProviderField < ActiveRecord::Migration[7.0]
4 | def change
5 | # NOTE: kept for backward compatibility
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221115155550_add_timezone_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTimezoneToOrganizations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :organizations, :timezone, :string, null: false, default: "UTC"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221115160325_add_timezone_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTimezoneToCustomers < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :customers, :timezone, :string, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221118084547_add_refunded_at_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRefundedAtToCreditNotes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credit_notes, :refunded_at, :datetime, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221118093903_fill_frequency_duration_remaining_field.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class FillFrequencyDurationRemainingField < ActiveRecord::Migration[7.0]
4 | def change
5 | LagoApi::Application.load_tasks
6 | Rake::Task["applied_coupons:populate_frequency_duration_remaining"].invoke
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20221205112007_add_reusable_to_coupons.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddReusableToCoupons < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :coupons, :reusable, :boolean, default: true, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20221208140608_add_timezone_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTimezoneToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :timezone, :string, null: false, default: "UTC"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230105094302_add_nullable_to_fee_id_on_credit_note_items.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNullableToFeeIdOnCreditNoteItems < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_null :credit_note_items, :fee_id, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230109095957_add_status_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddStatusToCreditNotes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credit_notes, :status, :integer, null: false, default: 1
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230127140904_add_pending_deletion_to_plans.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPendingDeletionToPlans < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :plans, :pending_deletion, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230203132157_add_deleted_at_to_coupon_plans.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDeletedAtToCouponPlans < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :coupon_plans, :deleted_at, :datetime
6 | safety_assured do
7 | add_index :coupon_plans, :deleted_at
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20230227145104_add_instant_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInstantToCharges < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :charges, :instant, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230307131524_add_instant_event_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInstantEventIdToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :instant_event_id, :uuid
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230313145506_add_email_settings_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEmailSettingsToOrganizations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :organizations, :email_settings, :string, array: true, default: [], null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230327134418_remove_payment_provider_null_constraint_on_refunds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemovePaymentProviderNullConstraintOnRefunds < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_null :refunds, :payment_provider_id, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230411083336_add_min_amount_cents_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddMinAmountCentsToCharges < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :charges, :min_amount_cents, :bigint, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230411085545_fix_wallet_consumed_amount_currency_naming.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class FixWalletConsumedAmountCurrencyNaming < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_column(:wallets, :consumed_amount_currenty, :consumed_amount_currency)
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230419123538_add_true_up_fee_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTrueUpFeeIdToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :fees, :true_up_fee, type: :uuid, null: true, index: true, foreign_key: {to_table: :fees}
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230421094757_add_before_vat_to_credits.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddBeforeVatToCredits < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credits, :before_vat, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230424091446_add_coupons_adjustment_amount_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCouponsAdjustmentAmountToCreditNotes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credit_notes, :coupons_adjustment_amount_cents, :bigint, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230424210224_rename_true_up_fee_id_on_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameTrueUpFeeIdOnFees < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_column :fees, :true_up_fee_id, :true_up_parent_fee_id
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230425130239_change_default_invoice_version.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeDefaultInvoiceVersion < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_default :invoices, :version_number, from: 2, to: 3
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230511124419_rename_customers_tax_rates_to_applied_tax_rates.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameCustomersTaxRatesToAppliedTaxRates < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_table :customers_tax_rates, :applied_tax_rates
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230529093955_rename_applied_taxes_to_customers_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameAppliedTaxesToCustomersTaxes < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_table :applied_taxes, :customers_taxes
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230606085050_add_recurring_to_billable_metrics.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRecurringToBillableMetrics < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :billable_metrics, :recurring, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230606164458_add_tax_identification_number.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTaxIdentificationNumber < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :customers, :tax_identification_number, :string, null: true
6 | add_column :organizations, :tax_identification_number, :string, null: true
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20230608085013_remove_properties_from_invoice_subscriptions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemovePropertiesFromInvoiceSubscriptions < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | remove_column :invoice_subscriptions, :properties, :jsonb
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230615183805_add_event_refrence_to_quantified_events.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEventRefrenceToQuantifiedEvents < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :events, :quantified_event, type: :uuid, index: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230619101701_add_base_amount_cents_to_credit_notes_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddBaseAmountCentsToCreditNotesAppliedTaxes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :credit_notes_taxes, :base_amount_cents, :bigint, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230620211201_add_unique_index_to_webhook_urls.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUniqueIndexToWebhookUrls < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_index :webhook_endpoints, [:webhook_url, :organization_id], unique: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230627080605_add_prorated_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddProratedToCharges < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :charges, :prorated, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230629100018_add_description_to_coupon.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDescriptionToCoupon < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :coupons, :description, :text, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230713122526_rename_credit_before_vat.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameCreditBeforeVat < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | rename_column :credits, :before_vat, :before_taxes
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230720204311_add_signature_to_webhook_endpoints.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddSignatureToWebhookEndpoints < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :webhook_endpoints, :signature_algo, :integer, default: 0, null: false # 0 is JWT
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230726171737_add_payment_due_date_to_invoice.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPaymentDueDateToInvoice < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :payment_due_date, :date
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230816091053_add_external_salesforce_id_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddExternalSalesforceIdToCustomers < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :customers, :external_salesforce_id, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230821135235_add_unique_constraint_to_group_properties.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUniqueConstraintToGroupProperties < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_index :group_properties, %i[charge_id group_id], unique: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230828085627_add_ending_at_to_subscriptions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEndingAtToSubscriptions < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :subscriptions, :ending_at, :datetime, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230907064335_add_invoice_display_name_to_plans.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceDisplayNameToPlans < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :plans, :invoice_display_name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230912082000_add_invoice_display_name_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceDisplayNameToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :invoice_display_name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230912082057_add_invoice_value_to_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceValueToGroups < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :groups, :invoice_value, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230912082112_add_invoice_display_name_to_add_ons.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceDisplayNameToAddOns < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :add_ons, :invoice_display_name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230913123123_add_invoice_display_name_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceDisplayNameToCharges < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :charges, :invoice_display_name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20230915120854_remove_events_foreign_keys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveEventsForeignKeys < ActiveRecord::Migration[7.0]
4 | def change
5 | remove_foreign_key :events, :customers
6 | remove_foreign_key :events, :organizations
7 | remove_foreign_key :events, :subscriptions
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20230920083133_add_gin_index_to_events.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGinIndexToEvents < ActiveRecord::Migration[7.0]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_index(:events, :properties, using: "gin", opclass: :jsonb_path_ops, algorithm: :concurrently)
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20231001070407_add_voided_at_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddVoidedAtToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :voided_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231101080314_add_default_currency_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDefaultCurrencyToOrganizations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :organizations, :default_currency, :string, null: false, default: "USD"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231109141829_create_last_hour_events_mv.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateLastHourEventsMv < ActiveRecord::Migration[7.0]
4 | def change
5 | create_view :last_hour_events_mv, materialized: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231114092154_add_amount_details_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAmountDetailsToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :amount_details, :jsonb, null: false, default: "{}"
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231128092231_update_default_amount_details_on_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateDefaultAmountDetailsOnFees < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_default :fees, :amount_details, from: "{}", to: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231129145100_add_eu_tax_management_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEuTaxManagementToOrganizations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :organizations, :eu_tax_management, :boolean, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231130085817_change_default_invoice_version_to_v4.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeDefaultInvoiceVersionToV4 < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_default :invoices, :version_number, from: 3, to: 4
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231204151512_add_auto_generated_to_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAutoGeneratedToTaxes < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :taxes, :auto_generated, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231207095229_add_clickhouse_flag_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddClickhouseFlagToOrganizations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :organizations, :clickhouse_aggregation, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20231214103653_add_unique_index_on_invoice_sequential_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUniqueIndexOnInvoiceSequentialId < ActiveRecord::Migration[7.0]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_index(:invoices, %i[customer_id sequential_id], unique: true, algorithm: :concurrently)
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20231219121735_update_last_hour_events_mv_to_version2.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateLastHourEventsMvToVersion2 < ActiveRecord::Migration[7.0]
4 | def change
5 | drop_view :last_hour_events_mv, materialized: true
6 | create_view :last_hour_events_mv, materialized: true, version: 2
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20240103125624_add_group_id_to_adjusted_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGroupIdToAdjustedFees < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_reference :adjusted_fees, :group, type: :uuid, null: true, index: true, foreign_key: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240104152816_add_ready_to_be_refreshed_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddReadyToBeRefreshedToInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :ready_to_be_refreshed, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240112091706_add_charge_filter_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddChargeFilterIdToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :charge_filter_id, :uuid, null: true
6 | safety_assured do
7 | add_index :fees, :charge_filter_id
8 | end
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20240115130517_add_credits_auto_refreshed_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCreditsAutoRefreshedToOrganizations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :organizations, :credits_auto_refreshed, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240118140703_add_grouped_by_to_cached_aggregations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGroupedByToCachedAggregations < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :cached_aggregations, :grouped_by, :string, array: true, null: false, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240118141022_add_grouped_by_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGroupedByToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :grouped_by, :string, array: true, null: false, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240125080718_add_grouped_by_to_adjusted_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGroupedByToAdjustedFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :adjusted_fees, :grouped_by, :jsonb, null: false, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240129155938_add_grouped_by_to_quantified_events.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddGroupedByToQuantifiedEvents < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :quantified_events, :grouped_by, :jsonb, null: false, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240227161430_add_invoice_display_name_to_charge_filters.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoiceDisplayNameToChargeFilters < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :charge_filters, :invoice_display_name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240305093058_update_last_hour_events_mv_to_version3.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateLastHourEventsMvToVersion3 < ActiveRecord::Migration[7.0]
4 | def change
5 | drop_view :last_hour_events_mv, materialized: true
6 | create_view :last_hour_events_mv, materialized: true, version: 3
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20240308104003_rollback_post_validation_view.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RollbackPostValidationView < ActiveRecord::Migration[7.0]
4 | def change
5 | drop_view :last_hour_events_mv, materialized: true
6 | create_view :last_hour_events_mv, materialized: true, version: 2
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20240311091817_add_index_on_last_hour_events_mv.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddIndexOnLastHourEventsMv < ActiveRecord::Migration[7.0]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | safety_assured do
8 | add_index :last_hour_events_mv, :organization_id, if_not_exists: true
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20240312141641_add_new_index_to_groups.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNewIndexToGroups < ActiveRecord::Migration[7.0]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | safety_assured do
8 | add_index :groups, %w[billable_metric_id parent_group_id]
9 | end
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20240328075919_add_trial_ended_at_to_subscriptions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddTrialEndedAtToSubscriptions < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :subscriptions, :trial_ended_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240404123257_add_skip_charges_bool_in_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddSkipChargesBoolInInvoices < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invoices, :skip_charges, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240415122310_add_custom_aggregator_to_billable_metrics.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddCustomAggregatorToBillableMetrics < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :billable_metrics, :custom_aggregator, :text
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240424124802_add_depleted_ongoing_balance_to_wallets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDepletedOngoingBalanceToWallets < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :wallets, :depleted_ongoing_balance, :boolean, null: false, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240425131701_update_cached_aggregations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateCachedAggregations < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_null :cached_aggregations, :event_id, true # rubocop:disable Rails/BulkChangeTable
6 | add_column :cached_aggregations, :current_amount, :decimal
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20240426143059_add_integration_item_uniqueness_index.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddIntegrationItemUniquenessIndex < ActiveRecord::Migration[7.0]
4 | def change
5 | safety_assured do
6 | add_index :integration_items, [:external_id, :integration_id], unique: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240430100120_add_role_to_invite.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRoleToInvite < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :invites, :role, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240522105942_add_resource_type_to_integration_resources.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddResourceTypeToIntegrationResources < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :integration_resources, :resource_type, :integer, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240604141208_change_integration_customer_external_id_nullable_option.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeIntegrationCustomerExternalIdNullableOption < ActiveRecord::Migration[7.0]
4 | def change
5 | change_column_null :integration_customers, :external_customer_id, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240607095208_add_event_transaction_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEventTransactionIdToFees < ActiveRecord::Migration[7.0]
4 | def change
5 | add_column :fees, :pay_in_advance_event_transaction_id, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240628083830_remove_user_id_from_data_exports.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveUserIdFromDataExports < ActiveRecord::Migration[7.1]
4 | def change
5 | safety_assured do
6 | remove_reference :data_exports, :user, null: false, foreign_key: true, type: :uuid
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240701083355_create_billable_metrics_grouped_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateBillableMetricsGroupedCharges < ActiveRecord::Migration[7.1]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | create_view :billable_metrics_grouped_charges
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240701184757_add_deleted_at_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDeletedAtToFees < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :fees, :deleted_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240702081109_add_regroup_paid_fees_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRegroupPaidFeesToCharges < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :charges, :regroup_paid_fees, :integer, default: nil
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240703061352_add_lago_version_to_versions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLagoVersionToVersions < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :versions, :lago_version, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240706204557_remove_data_exports_resource_query_null_constraint.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveDataExportsResourceQueryNullConstraint < ActiveRecord::Migration[7.1]
4 | def change
5 | change_column_null :data_exports, :resource_query, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240708081356_update_last_hour_events_mv_v04.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateLastHourEventsMvV04 < ActiveRecord::Migration[7.1]
4 | def change
5 | drop_view :last_hour_events_mv, materialized: true
6 | create_view :last_hour_events_mv, materialized: true, version: 4
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20240711091155_add_fee_deleted_at_index.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFeeDeletedAtIndex < ActiveRecord::Migration[7.1]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_index :fees, :deleted_at, algorithm: :concurrently, if_not_exists: true
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240711094255_add_invoice_payment_overdue_index.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddInvoicePaymentOverdueIndex < ActiveRecord::Migration[7.1]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_index :invoices, :payment_overdue, algorithm: :concurrently, if_not_exists: true
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240718080929_update_billable_metrics_grouped_charges_to_version_3.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class UpdateBillableMetricsGroupedChargesToVersion3 < ActiveRecord::Migration[7.1]
4 | def change
5 | drop_view :billable_metrics_grouped_charges
6 | create_view :billable_metrics_grouped_charges, version: 3
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20240722201341_add_index_to_invoices_status.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddIndexToInvoicesStatus < ActiveRecord::Migration[7.1]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_index :invoices, :status,
8 | algorithm: :concurrently,
9 | if_not_exists: true
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/db/migrate/20240729134020_add_index_on_payable_group_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddIndexOnPayableGroupId < ActiveRecord::Migration[7.1]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_index :invoices, :payable_group_id, algorithm: :concurrently, if_not_exists: true
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240807072052_rename_progressive_billing_tresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RenameProgressiveBillingTresholds < ActiveRecord::Migration[7.1]
4 | def change
5 | safety_assured do
6 | rename_table :progressive_billing_tresholds, :usage_tresholds
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240807100609_add_metadata_to_wallet_transactions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddMetadataToWalletTransactions < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :wallet_transactions, :metadata, :jsonb, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240808085506_add_metadata_to_recurring_transaction_rules.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddMetadataToRecurringTransactionRules < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :recurring_transaction_rules, :transaction_metadata, :jsonb, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240813095718_add_usage_threshold_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_String_literal: true
2 |
3 | class AddUsageThresholdIdToFees < ActiveRecord::Migration[7.1]
4 | def change
5 | safety_assured do
6 | add_reference :fees, :usage_threshold, type: :uuid, foreign_key: true, index: true
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20240816075711_add_negative_amount_cents_to_invoice.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNegativeAmountCentsToInvoice < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :invoices, :negative_amount_cents, :bigint, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240820125840_add_progressive_billing_credit_amount_cents_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddProgressiveBillingCreditAmountCentsToInvoices < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :invoices, :progressive_billing_credit_amount_cents, :bigint, default: 0, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240821172352_add_finalize_zero_amount_invoice_to_organizations.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFinalizeZeroAmountInvoiceToOrganizations < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :organizations, :finalize_zero_amount_invoice, :boolean, default: true, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240821174724_add_finalize_zero_amount_invoice_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFinalizeZeroAmountInvoiceToCustomers < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :customers, :finalize_zero_amount_invoice, :integer, default: 0, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240822080031_add_historical_usage_to_lifetime_usage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddHistoricalUsageToLifetimeUsage < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :lifetime_usages, :historical_usage_amount_cents, :bigint, default: 0, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240822082727_remove_usage_threshold_relation_from_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveUsageThresholdRelationFromFees < ActiveRecord::Migration[7.1]
4 | def up
5 | safety_assured do
6 | remove_column :fees, :usage_threshold_id
7 | end
8 | end
9 |
10 | def down
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/db/migrate/20240910093646_change_tax_id_null_on_credit_note_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeTaxIdNullOnCreditNoteAppliedTaxes < ActiveRecord::Migration[7.1]
4 | def change
5 | change_column_null :credit_notes_taxes, :tax_id, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20240917144243_add_precise_total_amount_cents_to_event.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPreciseTotalAmountCentsToEvent < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :events, :precise_total_amount_cents, :decimal, precision: 40, scale: 15
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241008080209_add_lock_version_to_wallets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLockVersionToWallets < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :wallets, :lock_version, :integer, default: 0, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241011123148_add_foreign_key_constraint_to_credit_note_id_at_wallet_transaction.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddForeignKeyConstraintToCreditNoteIdAtWalletTransaction < ActiveRecord::Migration[7.1]
4 | def change
5 | add_foreign_key :wallet_transactions, :credit_notes, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241011123621_change_validate_on_foreign_key_from_wallet_transaction_to_credit_note.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeValidateOnForeignKeyFromWalletTransactionToCreditNote < ActiveRecord::Migration[7.1]
4 | def change
5 | validate_foreign_key :wallet_transactions, :credit_notes
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241014000100_add_provider_payment_data_to_payments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddProviderPaymentDataToPayments < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :payments, :provider_payment_data, :jsonb, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241017082601_add_expression_to_billable_metric.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddExpressionToBillableMetric < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :billable_metrics, :expression, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241025081408_add_refreshed_at_to_daily_usage.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddRefreshedAtToDailyUsage < ActiveRecord::Migration[7.1]
4 | def change
5 | safety_assured do
6 | add_column :daily_usages, :refreshed_at, :datetime, null: false # rubocop:disable Rails/NotNullColumn
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20241031095225_add_expires_at_to_api_keys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddExpiresAtToApiKeys < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :api_keys, :expires_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241101151559_add_last_used_at_to_api_keys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLastUsedAtToApiKeys < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :api_keys, :last_used_at, :datetime
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241106104515_remove_not_null_constraint_from_email_in_payment_requests.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveNotNullConstraintFromEmailInPaymentRequests < ActiveRecord::Migration[7.1]
4 | def change
5 | change_column_null :payment_requests, :email, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241107093418_add_name_to_api_keys.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddNameToApiKeys < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :api_keys, :name, :string
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241108103702_add_usage_diff_to_daily_usages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUsageDiffToDailyUsages < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :daily_usages, :usage_diff, :jsonb, default: "{}", null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241119114948_add_dunning_campaign_completed_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddDunningCampaignCompletedToCustomers < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :customers, :dunning_campaign_completed, :boolean, default: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241122104537_add_organization_id_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToFees < ActiveRecord::Migration[7.1]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :fees, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20241122105133_add_organization_id_fk_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToFees < ActiveRecord::Migration[7.1]
4 | def change
5 | add_foreign_key :fees, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241122105327_validate_fees_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateFeesOrganizationsForeignKey < ActiveRecord::Migration[7.1]
4 | def change
5 | validate_foreign_key :fees, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241122141158_add_skip_invoice_custom_sections_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddSkipInvoiceCustomSectionsToCustomers < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :customers, :skip_invoice_custom_sections, :boolean, default: false, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241213142739_change_null_payment_provider_payment_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ChangeNullPaymentProviderPaymentId < ActiveRecord::Migration[7.1]
4 | def change
5 | change_column_null :payments, :provider_payment_id, true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241219122151_add_processing_at_to_inbound_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddProcessingAtToInboundWebhooks < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :inbound_webhooks, :processing_at, :timestamp, precision: nil
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20241219145642_add_usage_date_to_daily_usages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddUsageDateToDailyUsages < ActiveRecord::Migration[7.1]
4 | def change
5 | safety_assured do
6 | add_column :daily_usages, :usage_date, :date
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250207094842_add_applied_grace_period_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAppliedGracePeriodToInvoices < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :invoices, :applied_grace_period, :integer
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250220180113_add_payment_receipt_counter_to_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPaymentReceiptCounterToCustomers < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :customers, :payment_receipt_counter, :bigint, default: 0, null: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250220223944_add_provider_payment_method_data_to_payments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddProviderPaymentMethodDataToPayments < ActiveRecord::Migration[7.1]
4 | def change
5 | add_column :payments, :provider_payment_method_data, :jsonb, null: false, default: {}
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250227091909_remove_is_default_from_billing_entity.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class RemoveIsDefaultFromBillingEntity < ActiveRecord::Migration[7.1]
4 | def change
5 | safety_assured do
6 | remove_column :billing_entities, :is_default, :boolean, default: false, null: false
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250318093216_add_failed_at_to_wallet_transactions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFailedAtToWalletTransactions < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 | def change
6 | add_column :wallet_transactions, :failed_at, :datetime
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20250324122757_add_email_bcc_to_dunning_campaign.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddEmailBccToDunningCampaign < ActiveRecord::Migration[7.2]
4 | def change
5 | add_column :dunning_campaigns, :bcc_emails, :string, array: true, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250324125056_add_provider_payment_method_id_to_payments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddProviderPaymentMethodIdToPayments < ActiveRecord::Migration[7.2]
4 | def change
5 | add_column :payments, :provider_payment_method_id, :string, null: true
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250402150920_add_billing_entity_id_not_null_check_constraint.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddBillingEntityIdNotNullCheckConstraint < ActiveRecord::Migration[7.2]
4 | def change
5 | add_check_constraint :invoices, "billing_entity_id IS NOT NULL", name: "invoices_billing_entity_id_null", validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250402152100_add_billing_entity_id_not_null_check_constraint_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddBillingEntityIdNotNullCheckConstraintToFees < ActiveRecord::Migration[7.2]
4 | def change
5 | add_check_constraint :fees, "billing_entity_id IS NOT NULL", name: "fees_billing_entity_id_null", validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250403093628_ensure_organization_last_invoice_got_organization_sequential_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class EnsureOrganizationLastInvoiceGotOrganizationSequentialId < ActiveRecord::Migration[7.2]
4 | def change
5 | DatabaseMigrations::FixInvoicesOrganizationSequentialIdJob.perform_later
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250409100421_add_finalized_at_timestamp_to_invoices.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddFinalizedAtTimestampToInvoices < ActiveRecord::Migration[7.2]
4 | def change
5 | add_column :invoices, :finalized_at, :timestamp
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250409140652_add_organization_id_not_null_check_constraint_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdNotNullCheckConstraintToFees < ActiveRecord::Migration[7.2]
4 | def change
5 | add_check_constraint :fees, "organization_id IS NOT NULL", name: "fees_organization_id_null", validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250411074202_drop_index_events_on_subscription_id.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class DropIndexEventsOnSubscriptionId < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def up
7 | remove_index :events, name: :index_events_on_subscription_id, algorithm: :concurrently, if_exists: true
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250414122643_drop_cached_aggregation_timestamp_lookup.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class DropCachedAggregationTimestampLookup < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def up
7 | remove_index :cached_aggregations, name: :index_timestamp_lookup
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250415143607_enqueue_update_all_eu_taxes_job.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class EnqueueUpdateAllEuTaxesJob < ActiveRecord::Migration[7.1]
4 | def up
5 | Taxes::UpdateAllEuTaxesJob.perform_later
6 | end
7 |
8 | def down
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/db/migrate/20250424135624_add_organization_id_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToCharges < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :charges, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250424140359_add_organization_id_fk_to_charges.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCharges < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :charges, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250424140537_validate_charges_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateChargesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :charges, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425102306_add_organization_to_add_ons_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationToAddOnsTaxes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :add_ons_taxes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250425102447_add_organization_id_fk_to_add_ons_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToAddOnsTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :add_ons_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425102555_validates_add_ons_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidatesAddOnsTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :add_ons_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425122510_add_organization_id_to_subscriptions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToSubscriptions < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :subscriptions, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250425122641_add_organization_id_fk_to_subscription.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToSubscription < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :subscriptions, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425122705_validate_subscriptions_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateSubscriptionsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :subscriptions, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425123733_add_organization_id_to_adjusted_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToAdjustedFees < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 | def change
6 | add_reference :adjusted_fees, :organization, type: :uuid, index: {algorithm: :concurrently}
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/db/migrate/20250425124100_add_organization_id_fk_to_adjusted_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToAdjustedFees < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :adjusted_fees, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425124305_validate_adjusted_fees_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateAdjustedFeesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :adjusted_fees, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425124804_add_organization_id_to_wallets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToWallets < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :wallets, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250425124826_add_organization_id_fk_to_wallets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToWallets < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :wallets, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425124942_validate_wallets_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateWalletsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :wallets, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425130345_add_organization_id_fk_to_wallet_transactions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToWalletTransactions < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :wallet_transactions, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425130412_validate_wallets_transactions_organization_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateWalletsTransactionsOrganizationForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :wallet_transactions, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425132247_add_organization_id_to_applied_coupons.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToAppliedCoupons < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :applied_coupons, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250425132724_add_organization_id_to_payments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToPayments < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :payments, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250425132757_add_organization_id_fk_to_paymants.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToPaymants < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :payments, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425132821_validate_payments_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidatePaymentsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :payments, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425134826_add_organization_id_fk_to_applied_coupons.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToAppliedCoupons < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :applied_coupons, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250425134911_validate_applied_coupons_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateAppliedCouponsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :applied_coupons, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428111042_ensure_organization_last_invoice_got_organization_sequential_id_retry.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class EnsureOrganizationLastInvoiceGotOrganizationSequentialIdRetry < ActiveRecord::Migration[7.2]
4 | def change
5 | DatabaseMigrations::FixInvoicesOrganizationSequentialIdJob.perform_later
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428130107_add_organization_id_to_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToWebhooks < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :webhooks, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250428130129_add_organization_id_fk_to_webhooks.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToWebhooks < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :webhooks, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428130148_validate_webhooks_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateWebhooksOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :webhooks, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428140111_add_organization_id_to_usage_thresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToUsageThresholds < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :usage_thresholds, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250428140126_add_organization_id_fk_to_usage_thresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToUsageThresholds < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :usage_thresholds, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428140148_validate_usage_thresholds_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateUsageThresholdsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :usage_thresholds, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428154444_add_organization_id_to_plans_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToPlansTaxes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :plans_taxes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250428154500_add_organization_id_fk_to_plans_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToPlansTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :plans_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250428154519_validate_plans_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidatePlansTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :plans_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250429100150_add_organization_id_fk_to_invoice_subscriptions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToInvoiceSubscriptions < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :invoice_subscriptions, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250429100151_validate_invoice_subscriptions_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateInvoiceSubscriptionsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :invoice_subscriptions, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250429100153_add_organization_id_fk_to_payment_provider_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToPaymentProviderCustomers < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :payment_provider_customers, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250429100154_validate_payment_provider_customers_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidatePaymentProviderCustomersOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :payment_provider_customers, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250429150114_add_organization_id_to_invoices_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToInvoicesTaxes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :invoices_taxes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250429150128_add_organization_id_fk_to_invoices_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToInvoicesTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :invoices_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250429150146_validate_invoices_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateInvoicesTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :invoices_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505125335_add_organization_id_fk_to_idempotency_records.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToIdempotencyRecords < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :idempotency_records, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505125354_validate_idempotency_records_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateIdempotencyRecordsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :idempotency_records, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505135819_add_organization_id_to_charge_filters.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToChargeFilters < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :charge_filters, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250505135820_add_organization_id_fk_to_charge_filters.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToChargeFilters < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :charge_filters, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505135821_validate_charge_filters_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateChargeFiltersOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :charge_filters, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505140926_add_organization_id_to_charges_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToChargesTaxes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :charges_taxes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250505140927_add_organization_id_fk_to_charges_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToChargesTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :charges_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505140928_validate_charges_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateChargesTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :charges_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505142219_add_organization_id_to_credits.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToCredits < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :credits, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250505142220_add_organization_id_fk_to_credits.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCredits < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :credits, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505142221_validate_credits_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCreditsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :credits, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505161357_add_organization_id_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToCreditNotes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :credit_notes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250505161358_add_organization_id_fk_to_credit_notes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCreditNotes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :credit_notes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250505161359_validate_credit_notes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCreditNotesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :credit_notes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506084021_add_organization_id_fk_to_applied_invoice_custom_sections.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToAppliedInvoiceCustomSections < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :applied_invoice_custom_sections, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506084022_validate_applied_invoice_custom_sections_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateAppliedInvoiceCustomSectionsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :applied_invoice_custom_sections, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506084828_add_organization_id_fk_to_applied_usage_thresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToAppliedUsageThresholds < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :applied_usage_thresholds, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506084829_validate_applied_usage_thresholds_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateAppliedUsageThresholdsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :applied_usage_thresholds, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506085759_add_organization_id_fk_to_customer_metadata.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCustomerMetadata < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :customer_metadata, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506085760_validate_customer_metadata_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCustomerMetadataOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :customer_metadata, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506115438_add_organization_id_fk_to_billable_metric_filters.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToBillableMetricFilters < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :billable_metric_filters, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506115439_validate_billable_metric_filters_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateBillableMetricFiltersOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :billable_metric_filters, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506121530_add_organization_id_to_fees_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToFeesTaxes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :fees_taxes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250506121531_add_organization_id_fk_to_fees_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToFeesTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :fees_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506121532_validate_fees_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateFeesTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :fees_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506144001_add_organization_id_fk_to_invoices_payment_requests.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToInvoicesPaymentRequests < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :invoices_payment_requests, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506144002_validate_invoices_payment_requests_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateInvoicesPaymentRequestsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :invoices_payment_requests, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506145849_add_organization_id_to_invoice_metadata.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToInvoiceMetadata < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :invoice_metadata, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250506145850_add_organization_id_fk_to_invoice_metadata.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToInvoiceMetadata < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :invoice_metadata, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250506145851_validate_invoice_metadata_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateInvoiceMetadataOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :invoice_metadata, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512081332_add_lock_version_to_wallet_transactions.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddLockVersionToWalletTransactions < ActiveRecord::Migration[8.0]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_column :wallet_transactions, :lock_version, :integer, default: 0, null: false
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250512122607_add_organization_id_fk_to_billing_entities_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToBillingEntitiesTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :billing_entities_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512122608_validate_billing_entities_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateBillingEntitiesTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :billing_entities_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512123540_add_organization_id_fk_to_credit_notes_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCreditNotesTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :credit_notes_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512123541_validate_credit_notes_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCreditNotesTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :credit_notes_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512130614_add_organization_id_to_customers_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToCustomersTaxes < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :customers_taxes, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250512130615_add_organization_id_fk_to_customers_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCustomersTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :customers_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512130616_validate_customers_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCustomersTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :customers_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512142913_add_organization_id_fk_to_data_export_parts.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToDataExportParts < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :data_export_parts, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512142914_validate_data_export_parts_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateDataExportPartsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :data_export_parts, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512144219_add_organization_id_fk_to_dunning_campaign_thresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToDunningCampaignThresholds < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :dunning_campaign_thresholds, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512144220_validate_dunning_campaign_thresholds_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateDunningCampaignThresholdsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :dunning_campaign_thresholds, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512151246_add_organization_id_to_coupon_targets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToCouponTargets < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :coupon_targets, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250512151247_add_organization_id_fk_to_coupon_targets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCouponTargets < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :coupon_targets, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250512151248_validate_coupon_targets_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCouponTargetsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :coupon_targets, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513132423_add_organization_id_to_commitments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToCommitments < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :commitments, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250513132424_add_organization_id_fk_to_commitments.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCommitments < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :commitments, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513132425_validate_commitments_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCommitmentsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :commitments, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513144353_add_organization_id_fk_to_commitments_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCommitmentsTaxes < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :commitments_taxes, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513144354_validate_commitments_taxes_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCommitmentsTaxesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :commitments_taxes, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513151259_add_organization_id_fk_to_credit_note_items.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToCreditNoteItems < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :credit_note_items, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513151260_validate_credit_note_items_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateCreditNoteItemsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :credit_note_items, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513152806_add_organization_id_fk_to_integration_resources.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToIntegrationResources < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :integration_resources, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513152807_validate_integration_resources_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateIntegrationResourcesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :integration_resources, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513153629_add_organization_id_fk_to_integration_customers.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToIntegrationCustomers < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :integration_customers, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250513153630_validate_integration_customers_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateIntegrationCustomersOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :integration_customers, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250516095314_add_organization_id_fk_to_integration_items.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToIntegrationItems < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :integration_items, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250516095315_validate_integration_items_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateIntegrationItemsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :integration_items, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250516100025_add_organization_id_fk_to_integration_mappings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToIntegrationMappings < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :integration_mappings, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250516100026_validate_integration_mappings_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateIntegrationMappingsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :integration_mappings, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250516115756_add_organization_id_fk_to_charge_filter_values.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToChargeFilterValues < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :charge_filter_values, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250516115757_validate_charge_filter_values_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateChargeFilterValuesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :charge_filter_values, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250519084648_add_organization_id_fk_to_recurring_transaction_rules.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToRecurringTransactionRules < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :recurring_transaction_rules, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250519084649_validate_recurring_transaction_rules_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateRecurringTransactionRulesOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :recurring_transaction_rules, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250519085910_add_organization_id_fk_to_integration_collection_mappings.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToIntegrationCollectionMappings < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :integration_collection_mappings, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250519085911_validate_integration_collection_mappings_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateIntegrationCollectionMappingsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :integration_collection_mappings, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250519092051_add_organization_id_to_refunds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdToRefunds < ActiveRecord::Migration[7.2]
4 | disable_ddl_transaction!
5 |
6 | def change
7 | add_reference :refunds, :organization, type: :uuid, index: {algorithm: :concurrently}
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/db/migrate/20250519092052_add_organization_id_fk_to_refunds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkToRefunds < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :refunds, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250519092053_validate_refunds_organizations_foreign_key.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class ValidateRefundsOrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :refunds, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250522134155_create_exports_daily_usages.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateExportsDailyUsages < ActiveRecord::Migration[8.0]
4 | def change
5 | create_view :exports_daily_usages
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250526111147_add_allowed_fee_types_to_wallets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddAllowedFeeTypesToWallets < ActiveRecord::Migration[8.0]
4 | def change
5 | add_column :wallets, :allowed_fee_types, :string, array: true, null: false, default: []
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250530112903_add_precise_credit_notes_amount_cents_to_fees.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddPreciseCreditNotesAmountCentsToFees < ActiveRecord::Migration[8.0]
4 | def change
5 | add_column :fees, :precise_credit_notes_amount_cents, :decimal, precision: 30, scale: 5, null: false, default: 0
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/migrate/20250602145535_create_flat_filters.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CreateFlatFilters < ActiveRecord::Migration[8.0]
4 | def change
5 | create_view :flat_filters
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/db/seeds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | Dir[Rails.root.join("db/seeds/*.rb")].sort.each do |seed|
4 | load seed
5 | end
6 |
--------------------------------------------------------------------------------
/db/views/exports_taxes_v01.sql:
--------------------------------------------------------------------------------
1 | SELECT
2 | tx.organization_id,
3 | tx.id AS lago_id,
4 | tx.name,
5 | tx.code,
6 | tx.rate,
7 | tx.description,
8 | tx.applied_to_organization,
9 | tx.created_at,
10 | tx.updated_at
11 | FROM taxes AS tx;
12 |
--------------------------------------------------------------------------------
/lib/current_context.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class CurrentContext < ActiveSupport::CurrentAttributes
4 | attribute :membership, :source, :email, :api_key_id
5 | end
6 |
--------------------------------------------------------------------------------
/lib/generators/organization_id_generator/templates/add_organization_id_fk_migration.rb.erb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class AddOrganizationIdFkTo<%= class_name %> < ActiveRecord::Migration[7.2]
4 | def change
5 | add_foreign_key :<%= file_name %>, :organizations, validate: false
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/lib/generators/organization_id_generator/templates/validate_organization_foreign_key_migration.rb.erb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | class Validate<%= class_name %>OrganizationsForeignKey < ActiveRecord::Migration[7.2]
4 | def change
5 | validate_foreign_key :<%= file_name %>, :organizations
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/lib/lago_eu_vat/lago_eu_vat.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "json"
4 |
5 | require "lago_eu_vat/rate"
6 |
7 | module LagoEuVat; end
8 |
--------------------------------------------------------------------------------
/lib/lago_http_client/lago_http_client.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "net/http"
4 | require "json"
5 |
6 | require "lago_http_client/client"
7 | require "lago_http_client/http_error"
8 |
9 | module LagoHttpClient; end
10 |
--------------------------------------------------------------------------------
/lib/lago_utils/lago_utils.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | require "lago_http_client"
4 | require "lago_utils/license"
5 | require "lago_utils/version"
6 |
7 | module LagoUtils; end
8 |
--------------------------------------------------------------------------------
/lib/lago_utils/lago_utils/ruby_sandbox.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | module LagoUtils
4 | module RubySandbox
5 | def self.run(code)
6 | LagoUtils::RubySandbox::Runner.new(code).run
7 | end
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/lib/tasks/annotate_rb.rake:
--------------------------------------------------------------------------------
1 | # This rake task was added by annotate_rb gem.
2 |
3 | # Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
4 | if (Rails.env.development? || Rails.env.test?) && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
5 | require "annotate_rb"
6 |
7 | AnnotateRb::Core.load_rake_tasks
8 | end
9 |
--------------------------------------------------------------------------------
/lib/tasks/customers.rake:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | namespace :customers do
4 | desc "Generate Slug for Customers"
5 | task generate_slug: :environment do
6 | Customer.unscoped.order(:created_at).find_each(&:save)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/log/.keep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/log/.keep
--------------------------------------------------------------------------------
/public/assets/images/lago-logo-email.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/public/assets/images/lago-logo-email.png
--------------------------------------------------------------------------------
/public/assets/images/lago-logo-invoice.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/public/assets/images/lago-logo-invoice.png
--------------------------------------------------------------------------------
/public/robots.txt:
--------------------------------------------------------------------------------
1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2 |
--------------------------------------------------------------------------------
/scripts/generate.version.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | cd $LAGO_PATH/api
4 |
5 | VERSION=`git tag --points-at HEAD | tail -1`
6 |
7 | if [ "${#VERSION}" -eq "0" ]; then
8 | VERSION=`git rev-parse HEAD`
9 | fi
10 |
11 | echo "Current version: ${VERSION}"
12 |
13 | echo $VERSION > $LAGO_PATH/api/LAGO_VERSION
14 |
--------------------------------------------------------------------------------
/scripts/karafka.web.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [ -v LAGO_KARAFKA_WEB ] && [ "$LAGO_KARAFKA_WEB" == "true" ]
4 | then
5 | karafka-web migrate --replication-factor=1
6 | fi
7 |
--------------------------------------------------------------------------------
/scripts/migrate.dev.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | bundle install
4 | bundle exec rails db:migrate
5 |
--------------------------------------------------------------------------------
/scripts/start.api.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | rm -f ./tmp/pids/server.pid
4 | exec bundle exec rails s -b ::
5 |
--------------------------------------------------------------------------------
/scripts/start.billing.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq_billing.yml
4 |
--------------------------------------------------------------------------------
/scripts/start.clock.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec clockwork ./clock.rb
4 |
--------------------------------------------------------------------------------
/scripts/start.clock.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq_clock.yml
--------------------------------------------------------------------------------
/scripts/start.dev.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ./scripts/generate.rsa.sh
4 | ./scripts/karafka.web.sh
5 |
6 | rm -f ./tmp/pids/server.pid
7 | bundle install
8 |
9 | rake db:prepare
10 | bundle exec rails signup:seed_organization
11 | rails s -b 0.0.0.0
12 |
--------------------------------------------------------------------------------
/scripts/start.events.consumer.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec karafka server
4 |
--------------------------------------------------------------------------------
/scripts/start.events.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq_events.yml
4 |
--------------------------------------------------------------------------------
/scripts/start.payments.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq_payments.yml
4 |
--------------------------------------------------------------------------------
/scripts/start.pdfs.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq_pdfs.yml
4 |
--------------------------------------------------------------------------------
/scripts/start.webhook.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq_webhook.yml
4 |
--------------------------------------------------------------------------------
/scripts/start.worker.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | exec bundle exec sidekiq -C config/sidekiq/sidekiq.yml
4 |
--------------------------------------------------------------------------------
/spec/factories/add_on_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :add_on_applied_tax, class: "AddOn::AppliedTax" do
5 | add_on
6 | tax
7 | organization { add_on&.organization || tax&.organization || association(:organization) }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/applied_add_ons.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :applied_add_on do
5 | customer
6 | add_on
7 |
8 | amount_cents { 200 }
9 | amount_currency { "EUR" }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/factories/applied_pricing_units.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :applied_pricing_unit do
5 | pricing_unit
6 | pricing_unitable { association(:standard_charge) }
7 | organization
8 | conversion_rate { rand(1.0..10.0) }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/spec/factories/billing_entity_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :billing_entity_applied_tax, class: "BillingEntity::AppliedTax" do
5 | billing_entity
6 | tax
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/factories/charge_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :charge_applied_tax, class: "Charge::AppliedTax" do
5 | charge
6 | tax
7 | organization { charge&.organization || tax&.organization || association(:organization) }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/commitment_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :commitment_applied_tax, class: "Commitment::AppliedTax" do
5 | commitment
6 | tax
7 | organization { commitment&.organization || tax&.organization || association(:organization) }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/common.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | sequence(:future_date) { rand(1..(10**7)).seconds.from_now }
5 | sequence(:past_date) { rand(1..(10**7)).seconds.ago }
6 | end
7 |
--------------------------------------------------------------------------------
/spec/factories/customer_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :customer_applied_tax, class: "Customer::AppliedTax" do
5 | customer
6 | tax
7 | organization { customer&.organization || tax&.organization || association(:organization) }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/data_export_parts.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :data_export_part do
5 | data_export
6 | organization { data_export&.organization || association(:organization) }
7 |
8 | index { 0 }
9 | object_ids { [] }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/factories/dunning_campaign_thresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :dunning_campaign_threshold do
5 | dunning_campaign
6 | organization { dunning_campaign&.organization || association(:organization) }
7 |
8 | currency { "USD" }
9 | amount_cents { 1000 }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/factories/error_details.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :error_detail do
5 | organization
6 | association :owner, factory: %i[invoice].sample
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/factories/idempotency_records.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :idempotency_record do
5 | organization
6 | idempotency_key { SecureRandom.uuid }
7 | resource { nil }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/images/big_sized_logo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/spec/factories/images/big_sized_logo.jpg
--------------------------------------------------------------------------------
/spec/factories/images/logo.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/spec/factories/images/logo.gif
--------------------------------------------------------------------------------
/spec/factories/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/spec/factories/images/logo.png
--------------------------------------------------------------------------------
/spec/factories/invites.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :invite do
5 | organization
6 |
7 | status { "pending" }
8 | email { Faker::Internet.email }
9 | token { SecureRandom.hex(20) }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/factories/invoice_metadata.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :invoice_metadata, class: "Metadata::InvoiceMetadata" do
5 | invoice
6 | organization { invoice&.organization || association(:organization) }
7 |
8 | key { Faker::Commerce.color }
9 | value { rand(100) }
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/spec/factories/memberships.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :membership do
5 | user
6 | organization
7 | role { "admin" }
8 |
9 | trait :revoked do
10 | status { :revoked }
11 | revoked_at { Time.current }
12 | end
13 | end
14 | end
15 |
--------------------------------------------------------------------------------
/spec/factories/password_resets.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :password_reset do
5 | user
6 |
7 | token { SecureRandom.hex(20) }
8 | expire_at { Time.current + 30.minutes }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/spec/factories/payment_receipts.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :payment_receipt do
5 | number { Faker::Alphanumeric.alphanumeric(number: 12) }
6 | payment
7 | organization
8 | billing_entity { organization&.default_billing_entity || association(:billing_entity) }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/spec/factories/plan_applied_taxes.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :plan_applied_tax, class: "Plan::AppliedTax" do
5 | plan
6 | tax
7 | organization { plan&.organization || tax&.organization || association(:organization) }
8 | end
9 | end
10 |
--------------------------------------------------------------------------------
/spec/factories/usage_monitoring/alert_thresholds.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :alert_threshold, class: "UsageMonitoring::AlertThreshold" do
5 | alert
6 | organization { alert.organization }
7 | code { "warn" }
8 | value { rand(40..500) * 100 }
9 | end
10 | end
11 |
--------------------------------------------------------------------------------
/spec/factories/users.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :user do
5 | email { Faker::Internet.email }
6 | password { "ILoveLago" }
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/factories/utils.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | trait :deleted do
5 | deleted_at { Time.current }
6 | end
7 | end
8 |
--------------------------------------------------------------------------------
/spec/factories/webhook_endpoints.rb:
--------------------------------------------------------------------------------
1 | # frozen_string_literal: true
2 |
3 | FactoryBot.define do
4 | factory :webhook_endpoint do
5 | organization
6 | webhook_url { Faker::Internet.url }
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/spec/fixtures/blank.pdf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/getlago/lago-api/46bd3744c9b457fa49c6198cbbf0ec5690837e66/spec/fixtures/blank.pdf
--------------------------------------------------------------------------------
/spec/fixtures/integration_aggregator/bad_gateway_error.html:
--------------------------------------------------------------------------------
1 |
2 |