Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poc multientities - 1 #3130

Draft
wants to merge 17 commits into
base: main
Choose a base branch
from
Draft

Poc multientities - 1 #3130

wants to merge 17 commits into from

Conversation

annvelents
Copy link
Contributor

Roadmap Task

👉 https://getlago.canny.io/feature-requests/p/{{FEATURE_SLUG}}

Context

Include relevant motivation and context.

Description

Describe your changes in detail.

List any dependencies that are required.

@annvelents annvelents changed the title Poc multientities Poc multientities - 1 Feb 4, 2025
@@ -18,7 +18,7 @@ class Create < BaseMutation
def resolve(**args)
result = ::Customers::CreateService
.new(context[:current_user])
.create(**args.merge(organization_id: current_organization.id))
.create(**args.merge(organization_id: current_organization.id, billing_entity_id: current_organization.billing_entities.first.id))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hack to create customers assigned to the default billing entity (without changes on the FE, so we can release DB changes before actual changes)
only Premium — Pro and Premium — Enterprise will have more than one entity

@@ -27,6 +27,10 @@ def query(organization_id, **args)
and_currency_sql = sanitize_sql(['AND currency = :currency', args[:currency].upcase])
end

if args[:billing_entity_id].present?
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's not sent, we will simply retrieve all credit notes for the organization

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant