Skip to content

Handle merging invoices when merging organizations #561

@allanlasser

Description

@allanlasser

When adding invoices #462, we didn't handle the case of merging organizations: reassigning invoice relationships from one organization to another. While there is a test for this, it simply asserts that a foreign-key count is updated without additional context that this signals an unhandled relationship migration.

This hasn't yet been an issue since Org merges are infrequent, but it has the potential to bite us.

We'll resolve this by:

  1. Adding comments to explain why the foreign key test fails, and how to fix it
  2. Adding explicit tests for merging invoices with merged orgs

For bonus points, we could increase test coverage for the other 14 foreign key relationships that are impacted by a merge operation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions