Closed jonathanfallon closed 2 months ago
This update enhances various parts of the codebase, prominently introducing null checks for improved robustness, reordering imports for better readability, and refining error handling for clarity. Key changes include adjustments to the pdfDoc
initialization, enhanced error messaging in the S3StorageProvider
, revisions of property names for consistency, and new import statements alongside some refactored method signatures.
Files and Changes Grouped | Summary |
---|---|
api/src/pdc/providers/pdfcert/PdfCertProvider.ts , .../PdfCertProviderInterfaceResolver.ts |
Added Buffer import, handled null checks, and adjusted document properties. |
api/src/pdc/providers/storage/S3StorageProvider.ts |
Improved error messages and minor logging adjustments. |
.../helpers/buckets.ts |
Reordered import statements for clarity. |
.../apdf/actions/ListAction.ts |
Reordered imports, added null checks, and enhanced error handling. |
.../apdf/providers/StorageRepositoryProvider.ts |
Updated filter and mapping functions to use new property names (Size to size , Key to key ). |
.../operator/providers/OperatorPgRepositoryProvider.ts |
Added Buffer import, reorganized existing imports. |
.../user/commands/SeedUsersCommand.ts |
Introduced Options interface, switched environmental variables access to Deno.env.get , and refined SQL query logic with conflict handling. |
sequenceDiagram
participant User
participant PdfCertProvider
participant S3StorageProvider
participant StorageRepositoryProvider
participant Database
User->>PdfCertProvider: Request to create PDF Certificate
PdfCertProvider->>PdfCertProvider: Check for pdfDoc null
alt pdfDoc is null
PdfCertProvider->>User: Return error message
else pdfDoc is not null
PdfCertProvider->>S3StorageProvider: Create bucket client
S3StorageProvider->>S3StorageProvider: Validate client creation
alt Client creation fails
S3StorageProvider->>PdfCertProvider: Return specific error message
PdfCertProvider->>User: Return error
else Client creation successful
S3StorageProvider->>StorageRepositoryProvider: List objects in bucket
StorageRepositoryProvider->>Database: Query objects
Database->>StorageRepositoryProvider: Return object list (mapped to 'size' and 'key')
StorageRepositoryProvider->>S3StorageProvider: Return object list
S3StorageProvider->>PdfCertProvider: Return object list
PdfCertProvider->>User: Return success
end
end
A Rabbit's Tune for Code Improvements
In the forest of code, where changes roam free, 🐰
Null checks and new routes, our path to decree.
Imports realigned, like stars in the night, ✨
Enhanced error text, for clarity and light.
With each tiny tweak, our system's more grand,
A codebase that’s now, more fit for the land. 🌟
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
fix APDF listing and Certificate creation
Summary by CodeRabbit
Bug Fixes
Refactor
StorageRepositoryProvider
class.Chores
Buffer
andprocess
.New Features
Options
interface to theSeedUsersCommand
for more robust option handling.SeedUsersCommand
with anON CONFLICT
clause and added warning messages for specific conditions.