add payment file entity & api#147
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds first-class “payment file” support to the MAS.Payments API by introducing a PaymentFile entity with persistence, CQRS commands/queries, and HTTP endpoints for upload/download/list/delete.
Changes:
- Add
PaymentFileEF model + DB migration (table, constraints, 1:1 links to Payment or PaymentGroup). - Add queries to list files and fetch a single file payload.
- Add commands + API controller endpoints to upload and delete files (single and bulk).
Reviewed changes
Copilot reviewed 18 out of 19 changed files in this pull request and generated 8 comments.
Show a summary per file
| File | Description |
|---|---|
| Queries/PaymentFiles/GetPaymentFiles/GetPaymentFilesResponse.cs | DTO for listing uploaded files and their linkage metadata. |
| Queries/PaymentFiles/GetPaymentFiles/GetPaymentFilesQueryHandler.cs | Query handler to return file list ordered by upload time. |
| Queries/PaymentFiles/GetPaymentFiles/GetPaymentFilesQuery.cs | Query contract for listing payment files. |
| Queries/PaymentFiles/GetPaymentFile/GetPaymentFileResponse.cs | DTO for returning a file payload (name/type/data). |
| Queries/PaymentFiles/GetPaymentFile/GetPaymentFileQueryHandler.cs | Query handler to fetch a single file by id. |
| Queries/PaymentFiles/GetPaymentFile/GetPaymentFileQuery.cs | Query contract for fetching a single file. |
| Models/DeleteRecordsRequest.cs | Request model for bulk delete. |
| Migrations/DataBaseContextModelSnapshot.cs | EF snapshot updated to include PaymentFile entity mapping/constraints. |
| Migrations/20260321171303_AddPaymentFile.cs | Migration creating PaymentFile table, constraints, and indexes. |
| Migrations/20260321171303_AddPaymentFile.Designer.cs | EF designer output for the migration target model. |
| DataBase/Models/PaymentFile.cs | New PaymentFile entity (binary payload + FK to Payment/PaymentGroup). |
| DataBase/DataBaseContext.cs | Registers DbSet<PaymentFile> and configures relationships/indexes/check constraint. |
| Controllers/PaymentFileApiController.cs | New API endpoints for upload, download/view, list, and delete. |
| Commands/PaymentFile/UploadPaymentFile/UploadPaymentFileCommandHandler.cs | Validates linkage rules and creates PaymentFile records. |
| Commands/PaymentFile/UploadPaymentFile/UploadPaymentFileCommand.cs | Command contract for uploading file content. |
| Commands/PaymentFile/DeletePaymentFiles/DeletePaymentFilesCommandHandler.cs | Bulk delete handler by id list. |
| Commands/PaymentFile/DeletePaymentFiles/DeletePaymentFilesCommand.cs | Command contract for bulk deletion. |
| Commands/PaymentFile/DeletePaymentFile/DeletePaymentFileCommandHandler.cs | Single delete handler by id. |
| Commands/PaymentFile/DeletePaymentFile/DeletePaymentFileCommand.cs | Command contract for single deletion. |
Files not reviewed (1)
- Migrations/20260321171303_AddPaymentFile.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
….api into feature/attach_file
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 18 out of 19 changed files in this pull request and generated 5 comments.
Files not reviewed (1)
- Migrations/20260321171303_AddPaymentFile.Designer.cs: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.