Skip to content

feat(multientities): Update Invoice custom sections services #3742

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

Merged
merged 21 commits into from
May 29, 2025

Conversation

ancorcruz
Copy link
Contributor

@ancorcruz ancorcruz commented May 27, 2025

Roadmap Task

👉 https://getlago.canny.io/feature-requests/p/support-billing-from-multiple-entities

Context

Users who invoice the same products across multiple entities face the challenge of managing separate Lago organizations.

This requires duplicating all billable metrics, plans, and setup, while also implementing additional logic to handle two different API keys and ensure the correct one is used for each affiliated entity. This process adds complexity and overhead to their billing operations.

Description

This change updates all services related to invoice custom sections in order to work with the new "applied" invoice custom sections relationships and replaces the application/selection of invoice custom section from organization level to billing entities.

ancorcruz added 6 commits May 27, 2025 14:20
create records in the new table from the old selections table.
create records in the new table from the old selections table.
... to billing entities scope, as invoice custom sections are not
applied to billing entities instead of organizaitons
to call the right services and use the new relationships
@ancorcruz ancorcruz self-assigned this May 27, 2025
ancorcruz added 15 commits May 27, 2025 15:38
it is needed to migrate data... we will remove it later.
in replacement of "selected_for_organization"
also fixes the invoice custom sections resolver, just return
organization manually created section and order by name as the applied
to organization is deprecated and will be removed soon it is not
releavant to order by this field anymore.
@ancorcruz ancorcruz marked this pull request as ready for review May 28, 2025 10:26
@ancorcruz ancorcruz requested a review from annvelents May 28, 2025 10:26
@ancorcruz
Copy link
Contributor Author

giphy

Copy link
Contributor

@annvelents annvelents left a comment

Choose a reason for hiding this comment

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

🧠 👏
That's awesome!
And a lot of work!!!!
wow!!!!

Looks amazing, left couple comments

@ancorcruz ancorcruz merged commit 4680d4d into main May 29, 2025
14 checks passed
@ancorcruz ancorcruz deleted the feat/multientities/invoice_custom_sections_serv branch May 29, 2025 09:30
diegocharles pushed a commit that referenced this pull request Jun 2, 2025
## Roadmap Task

👉
https://getlago.canny.io/feature-requests/p/support-billing-from-multiple-entities

## Context

Users who invoice the same products across multiple entities face the
challenge of managing separate Lago organizations.

This requires duplicating all billable metrics, plans, and setup, while
also implementing additional logic to handle two different API keys and
ensure the correct one is used for each affiliated entity. This process
adds complexity and overhead to their billing operations.

## Description

This change updates all services related to invoice custom sections in
order to work with the new "applied" invoice custom sections
relationships and replaces the application/selection of invoice custom
section from organization level to billing entities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants