[SSF 163] - Fix Donation Creation Bug and Improve API Design#128
[SSF 163] - Fix Donation Creation Bug and Improve API Design#128dburkhart07 wants to merge 17 commits intomainfrom
Conversation
apps/backend/src/donationItems/dtos/create-donation-items.dto.ts
Outdated
Show resolved
Hide resolved
apps/backend/src/donationItems/dtos/create-donation-items.dto.ts
Outdated
Show resolved
Hide resolved
Juwang110
left a comment
There was a problem hiding this comment.
Besides two small nits looks great to me!
sam-schu
left a comment
There was a problem hiding this comment.
Can we use the transaction naming convention we previously discussed?
sam-schu
left a comment
There was a problem hiding this comment.
Bumping the transaction naming convention - we should have transactionManager, transactionRepo, etc.
|
|
||
| @IsInt() | ||
| @Min(1) | ||
| quantity!: number; |
There was a problem hiding this comment.
Just checking - some of these fields used to have @Transforms, I don't see why we would need those but do you know why they used to be there? (the frontend is passing the numeric values as numbers, not strings, right?)
There was a problem hiding this comment.
correct! i think that may have been added when there was a different bug with the backend, but we never needed them in the first place.
ℹ️ Issue
Closes #163
📝 Description
For this PR, I removed the usage of creating multiple donation items, in favor of keeping it all in one spot: the donation service's create endpoint. This now creates all of it in one spot, allowing us to easily verify the creation of donations and donation items all in one transaction. This required minimal frontend changes to properly format and make work. I also removed any usage of reservedQuantity, having that value only be used on creation time of donation items.
I also wrote tests for the create service function, as well as all new tests for the donation item's service.
✔️ Verification