feat(sep12): implement StorageProvider interface, S3 implementation, …#673
Open
teslims2 wants to merge 2 commits into
Open
feat(sep12): implement StorageProvider interface, S3 implementation, …#673teslims2 wants to merge 2 commits into
teslims2 wants to merge 2 commits into
Conversation
…upload-url endpoint, and CI migration check - Add StorageProvider interface (closes ceejaylaboratory#543) - Install @aws-sdk/client-s3 and @aws-sdk/s3-request-presigner; implement S3StorageProvider (closes ceejaylaboratory#544) - Add POST /sep12/customer/upload-url route and controller; add UploadRecord Prisma model with migration (closes ceejaylaboratory#548) - Add Prisma migrate status dry-run check step in CI workflow (closes ceejaylaboratory#540)
|
@teslims2 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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.
Certainly! Here's the updated PR with the #544 implementation details included.
Implement SEP-12 Storage Abstraction, AWS S3 Upload Support, Upload URL Endpoint, and CI Migration Validation
Description
This PR introduces the storage infrastructure required for SEP-12 customer document uploads. It adds a storage abstraction layer, implements an AWS S3-backed storage provider with presigned upload URLs, creates the upload URL endpoint and persistence model, and strengthens CI by validating Prisma migrations before deployment.
Type of Change
Related Issues
Closes #540
Closes #543
Closes #544
Closes #548
Changes Made
#543 — Create StorageProvider Interface
Created
backend/src/services/storage/storage-provider.interface.ts.Added the
StorageProviderinterface defining:generatePresignedPutUrl(key, contentType, expires)objectExists(key)Exported the interface for dependency injection and future storage implementations.
#544 — Implement AWS S3 StorageProvider
Installed:
@aws-sdk/client-s3@aws-sdk/s3-request-presignerCreated
S3StorageProviderimplementing theStorageProviderinterface.Integrated the AWS S3 client to generate secure presigned PUT URLs for direct client uploads.
Implemented
objectExists()to verify uploaded objects within the configured S3 bucket.Designed the implementation to allow future storage providers (e.g., MinIO or Google Cloud Storage) to be swapped in without changing controller logic.
#548 — Implement POST
/sep12/customer/upload-urlAdded a new controller and route for
POST /sep12/customer/upload-url.Uses the configured
StorageProviderto generate a presigned upload URL.Creates an
UploadRecorddatabase entry withPENDINGstatus before upload.Returns HTTP 200 with:
Added the
UploadRecordPrisma model and corresponding database migration.#540 — Prisma Migration Validation in CI
Testing
Documentation
Breaking Changes
Checklist
Additional Context
This PR establishes the storage foundation for SEP-12 customer document uploads by introducing a provider abstraction, a production-ready AWS S3 implementation, upload tracking through the database, and automated migration validation in CI. The storage interface also enables future support for alternative object storage providers with minimal application changes.