Skip to content

O3-5205: Throw an error if stock item or billable service cannot be found when setting a bill line item#56

Open
NethmiRodrigo wants to merge 2 commits intomainfrom
fix/O3-5205
Open

O3-5205: Throw an error if stock item or billable service cannot be found when setting a bill line item#56
NethmiRodrigo wants to merge 2 commits intomainfrom
fix/O3-5205

Conversation

@NethmiRodrigo
Copy link
Contributor

Currently, you could create a bill with line items where the billableService or the item is set to bogus values. This fix makes it so that an error is thrown if a billable service or stock item cannot be found with a given uuid

@wikumChamith
Copy link
Member

Currently, you could create a bill with line items where the billableService or the item is set to bogus values. This fix makes it so that an error is thrown if a billable service or stock item cannot be found with a given uuid

Shouldn't this be done on the service layer?

@dkayiwa
Copy link
Member

dkayiwa commented Nov 11, 2025

Does the database layer have the corresponding foreign key requirements?

@NethmiRodrigo
Copy link
Contributor Author

Does the database layer have the corresponding foreign key requirements?

@dkayiwa Yes, the database layer has foreign keys, but the column is nullable. So there is a bug where when the stock item or billable service cannot be found, a null value gets saved to the database, so an exception from the database layer never gets thrown.

@wikumChamith
Copy link
Member

Does the database layer have the corresponding foreign key requirements?

@dkayiwa Yes, the database layer has foreign keys, but the column is nullable. So there is a bug where when the stock item or billable service cannot be found, a null value gets saved to the database, so an exception from the database layer never gets thrown.

What if we set nullable to 'false'??

@VeronicaMuthee
Copy link

@wikumChamith needs to discuss this with @NethmiRodrigo and finalize.

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.

4 participants