-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
S3 Upload Files CampaignApplication (#658)
* Merge branch 'prod-s3-task' into prod * updated campaingApplicationFile model * Merge branch 'prod-s3task-copy' into task-s3 * remove console.log * fix .env and mocks * increase files limit to 30 MB
- Loading branch information
Showing
16 changed files
with
234 additions
and
46 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,6 +70,10 @@ SENDGRID_API_KEY=sendgrid-key | |
SENDGRID_SENDER_EMAIL=[email protected] | ||
SENDGRID_INTERNAL_EMAIL=[email protected] | ||
SENDGRID_CONTACTS_URL=/v3/marketing/contacts | ||
MARKETING_LIST_ID=6add1a52-f74e-4c14-af56-ec7e1d2318f0 | ||
SENDGRID_SENDER_ID= | ||
## if marketing notifications should be active --> true/false -> defaults to false | ||
SEND_MARKETING_NOTIFICATIONS= | ||
|
||
## Stripe ## | ||
############ | ||
|
@@ -95,10 +99,11 @@ IRIS_USER_HASH= | |
BANK_BIC=UNCRBGSF | ||
PLATFORM_IBAN= | ||
IMPORT_TRX_TASK_INTERVAL_MINUTES=60 | ||
#which hour of the day to run the check for consent | ||
CHECK_IRIS_CONSENT_TASK_HOUR=10 | ||
BILLING_ADMIN_MAIL=[email protected] | ||
CAMPAIGN_ADMIN_MAIL= | ||
CAMPAIGN_ADMIN_MAIL=responsible for campaign management | ||
|
||
## Cache ## | ||
############## | ||
CACHE_TTL=60000 | ||
CACHE_TTL=30000 |
This file contains 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
This file contains 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
54 changes: 54 additions & 0 deletions
54
apps/api/src/campaign-application/__mocks__/campaing-application-file-mocks.ts
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
import { Readable } from 'stream' | ||
import { CampaignApplicationFileRole } from '@prisma/client' | ||
import { CreateCampaignApplicationFileDto } from '../dto/create-campaignApplication-file.dto' | ||
|
||
export const mockCampaignApplicationFileFn = () => ({ | ||
id: 'mockCampaignApplicationFileId', | ||
filename: 'test.pdf', | ||
mimetype: 'application/pdf', | ||
campaignApplicationId: 'mockCampaignApplicationId', | ||
personId: 'mockPersonId', | ||
role: CampaignApplicationFileRole.document, | ||
}) | ||
|
||
export const mockCampaignApplicationUploadFileFn = () => ({ | ||
bucketName: 'campaignapplication-files', | ||
...mockCampaignApplicationFileFn(), | ||
campaignApplicationId: 'mockCampaignApplicationId', | ||
personId: 'mockPersonId', | ||
}) | ||
|
||
export const mockCampaignApplicationFilesFn = (): Express.Multer.File[] => [ | ||
{ | ||
fieldname: 'resume', | ||
originalname: 'john_doe_resume.pdf', | ||
encoding: '7bit', | ||
mimetype: 'application/pdf', | ||
size: 102400, | ||
stream: new Readable(), | ||
destination: '/uploads/resumes', | ||
filename: 'john_doe_resume_1234.pdf', | ||
path: '/uploads/resumes/john_doe_resume_1234.pdf', | ||
buffer: Buffer.from(''), | ||
}, | ||
{ | ||
fieldname: 'cover_letter', | ||
originalname: 'john_doe_cover_letter.pdf', | ||
encoding: '7bit', | ||
mimetype: 'application/pdf', | ||
size: 51200, | ||
stream: new Readable(), | ||
destination: '/uploads/cover_letters', | ||
filename: 'john_doe_cover_letter_1234.pdf', | ||
path: '/uploads/cover_letters/john_doe_cover_letter_1234.pdf', | ||
buffer: Buffer.from(''), | ||
}, | ||
] | ||
|
||
export const mockFileDtoFn = (): CreateCampaignApplicationFileDto => ({ | ||
filename: 'Test Filename', | ||
mimetype: 'Test mimetype', | ||
campaignApplicationId: 'Test CampaignApplicationId', | ||
personId: 'Test PersonId', | ||
role: CampaignApplicationFileRole.document, | ||
}) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.