Closed Yoronex closed 3 months ago
Commit: 58e9b22 Base: develop@8caa21e
Type | Base | This PR |
---|---|---|
Total Statements Coverage | 89.56% | 89.23% (-0.33%) |
Total Branches Coverage | 86.3% | 86.23% (-0.07%) |
Total Functions Coverage | 90.7% | 90.36% (-0.34%) |
Total Lines Coverage | 89.53% | 89.19% (-0.34%) |
File | Statements | Branches | Functions | Lines |
---|
@JustSamuel do you perhaps have any idea why an InvoiceService
test case is suddenly failing due to a type error during runtime? I have not changed anything around invoices?
In general, I think this should still work with the refactor, but now you would simply add a param to the getOptions of each service where you specify if deleted are allowed or not.
:tada: This PR is included in version 0.2.0 :tada:
The release is available on GitHub release
Your semantic-release bot :package::rocket:
Adds endpoints for deleting products, containers and points of sale.
Description
The three aforementioned entities could not be deleted from the database, because that would invalidate the data, as transactions have a reference to their point of sale, container and product. To solve this, products, containers and points of sale are soft deleted under the hood. When they are soft deleted, they will never be returned in any endpoint except in the context of transactions. Soft deleted products, containers and points of sale can also not be used as correlated entities or within transactions.
When soft deleting, the entity corresponding entity is only marked as soft deleted. However, due to the aforementioned restrictions, it will never be shown again (even though a soft deleted product might still be included in a container). However, when a container is updated, it cannot be included any more.
Note that the seeder now also includes these soft deleted products, containers and points of sale.
Related issues/external references
https://github.com/GEWIS/sudosos-backend/issues/20
Types of changes