Protected ReadonlydbProtected ReadonlydbProtected Readonlys3Protected Readonlys3Protected Readonlys3Uploads a given file to S3 and creates a transaction metadata file record for it.
The ID of the customer.
A promise that resolves to the created transaction metadata file record.
Create a new transaction metadata file record in the database linked to an S3 object. This method first checks if the S3 object exists before creating the record. If the S3 object does not exist, an error is thrown.
The ID of the logged in customer.
A promise that resolves to the created transaction metadata file record.
Copy file object from Staging S3 bucket to Transaction files S3 bucket. Create a new transaction metadata file record in the database linked to the S3 file object. This method first checks if the S3 object exists before creating the record. If the S3 object does not exist, an error is thrown.
The ID of the logged in customer.
A promise that resolves to the created transaction metadata file record.
Get a pre-signed URL that can be used to upload a file to S3. The URL is short-lived (2mins) and can be used to upload a file with the specified file name, type, and size.
The ID of the logged in customer.
A promise that resolves to an object containing the signed URL and S3 Object key.
This class provides two mechanisms for uploading files:
1. Direct Upload: Use
createWithFileUploadto directly upload a file stream. This method handles the upload to S3 and creates the corresponding database record.2. Pre-signed URL Upload: Use
getSignedUrlForUploadto generate a pre-signed URL. This URL can then be used by a client (e.g., a browser) to upload the file directly to S3. After the client uploads the file, usecreateWithS3ObjectKeyto create the corresponding database record. Make sure to validate that the upload was successful.