mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
Merge remote-tracking branch 'upstream/main' into teller-p2-service
This commit is contained in:
commit
823eab2c11
10 changed files with 40 additions and 16 deletions
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
1
.github/ISSUE_TEMPLATE/bug_report.md
vendored
|
@ -4,6 +4,7 @@ about: Create a report to help us improve
|
|||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
|
|
|
@ -1,12 +1,13 @@
|
|||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
name: Feature request or improvement
|
||||
about: Suggest a new feature or improvement
|
||||
title: ''
|
||||
labels: ''
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
**Is your request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
|
@ -57,13 +57,14 @@ Then run the following yarn commands:
|
|||
|
||||
```
|
||||
yarn install
|
||||
yarn run dev:services
|
||||
yarn run dev:services:all
|
||||
yarn prisma:migrate:dev
|
||||
yarn prisma:seed
|
||||
yarn dev
|
||||
```
|
||||
|
||||
## Contributing
|
||||
|
||||
To contribute, please see our [contribution guide](https://github.com/maybe-finance/maybe/blob/main/CONTRIBUTING.md).
|
||||
|
||||
## High-priority issues
|
||||
|
@ -91,9 +92,9 @@ To pull market data in (for investments), you'll need a Polygon.io API key. You
|
|||
- [Handling money](https://github.com/maybe-finance/maybe/wiki/Handling-Money)
|
||||
- [REST API](https://github.com/maybe-finance/maybe/wiki/REST-API)
|
||||
|
||||
|
||||
## Repo Activity
|
||||

|
||||
|
||||

|
||||
|
||||
## Credits
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ServerClient } from 'postmark'
|
||||
import env from '../../env'
|
||||
|
||||
const postmark = new ServerClient(env.NX_POSTMARK_API_TOKEN)
|
||||
const postmark = env.NX_POSTMARK_API_TOKEN ? new ServerClient(env.NX_POSTMARK_API_TOKEN) : undefined
|
||||
|
||||
export default postmark
|
||||
|
|
|
@ -75,7 +75,7 @@ const envSchema = z.object({
|
|||
|
||||
NX_POSTMARK_FROM_ADDRESS: z.string().default('account@maybe.co'),
|
||||
NX_POSTMARK_REPLY_TO_ADDRESS: z.string().default('support@maybe.co'),
|
||||
NX_POSTMARK_API_TOKEN: z.string().default('REPLACE_THIS'),
|
||||
NX_POSTMARK_API_TOKEN: z.string().optional(),
|
||||
})
|
||||
|
||||
const env = envSchema.parse(process.env)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import { ServerClient } from 'postmark'
|
||||
import env from '../../env'
|
||||
|
||||
const postmark = new ServerClient(env.NX_POSTMARK_API_TOKEN)
|
||||
const postmark = env.NX_POSTMARK_API_TOKEN ? new ServerClient(env.NX_POSTMARK_API_TOKEN) : undefined
|
||||
|
||||
export default postmark
|
||||
|
|
|
@ -29,7 +29,7 @@ const envSchema = z.object({
|
|||
|
||||
NX_POSTMARK_FROM_ADDRESS: z.string().default('account@maybe.co'),
|
||||
NX_POSTMARK_REPLY_TO_ADDRESS: z.string().default('support@maybe.co'),
|
||||
NX_POSTMARK_API_TOKEN: z.string().default('REPLACE_THIS'),
|
||||
NX_POSTMARK_API_TOKEN: z.string().optional(),
|
||||
NX_STRIPE_SECRET_KEY: z.string().default('sk_test_REPLACE_THIS'),
|
||||
|
||||
NX_CDN_PRIVATE_BUCKET: z.string().default('REPLACE_THIS'),
|
||||
|
|
|
@ -144,6 +144,7 @@ function ProfileForm({ title, onSubmit, defaultValues }: ProfileViewProps) {
|
|||
<DatePicker
|
||||
popperPlacement="bottom"
|
||||
className="mt-2"
|
||||
minCalendarDate={DateTime.now().minus({ years: 100 }).toISODate()}
|
||||
error={error?.message}
|
||||
{...field}
|
||||
/>
|
||||
|
|
|
@ -22,7 +22,7 @@ export interface IEmailService {
|
|||
export class EmailService implements IEmailService {
|
||||
constructor(
|
||||
private readonly logger: Logger,
|
||||
private readonly postmark: PostmarkServerClient,
|
||||
private readonly postmark: PostmarkServerClient | undefined,
|
||||
private readonly defaultAddresses: { from: string; replyTo?: string }
|
||||
) {}
|
||||
|
||||
|
@ -85,6 +85,11 @@ export class EmailService implements IEmailService {
|
|||
message.TemplateModel
|
||||
)
|
||||
|
||||
if (!this.postmark) {
|
||||
this.logger.info('Postmark API key not provided, skipping email send')
|
||||
return undefined as unknown as MessageSendingResponse
|
||||
}
|
||||
|
||||
return await this.postmark.sendEmailWithTemplate(message)
|
||||
}
|
||||
|
||||
|
@ -94,6 +99,11 @@ export class EmailService implements IEmailService {
|
|||
{ text: message.TextBody, html: message.HtmlBody }
|
||||
)
|
||||
|
||||
if (!this.postmark) {
|
||||
this.logger.info('Postmark API key not provided, skipping email send')
|
||||
return undefined as unknown as MessageSendingResponse
|
||||
}
|
||||
|
||||
return await this.postmark.sendEmail(message)
|
||||
}
|
||||
|
||||
|
@ -108,9 +118,13 @@ export class EmailService implements IEmailService {
|
|||
|
||||
return (
|
||||
await Promise.all(
|
||||
chunk(messages, 500).map((chunk) =>
|
||||
this.postmark.sendEmailBatchWithTemplates(chunk)
|
||||
)
|
||||
chunk(messages, 500).map((chunk) => {
|
||||
if (!this.postmark) {
|
||||
this.logger.info('Postmark API key not provided, skipping email send')
|
||||
return [] as MessageSendingResponse[]
|
||||
}
|
||||
return this.postmark.sendEmailBatchWithTemplates(chunk)
|
||||
})
|
||||
)
|
||||
).flat()
|
||||
}
|
||||
|
@ -124,7 +138,13 @@ export class EmailService implements IEmailService {
|
|||
|
||||
return (
|
||||
await Promise.all(
|
||||
chunk(messages, 500).map((chunk) => this.postmark.sendEmailBatch(chunk))
|
||||
chunk(messages, 500).map((chunk) => {
|
||||
if (!this.postmark) {
|
||||
this.logger.info('Postmark API key not provided, skipping email send')
|
||||
return [] as MessageSendingResponse[]
|
||||
}
|
||||
return this.postmark.sendEmailBatch(chunk)
|
||||
})
|
||||
)
|
||||
).flat()
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
"scripts": {
|
||||
"dev": "nx run-many --target serve --projects=client,server,workers --parallel --host 0.0.0.0 --nx-bail=true --maxParallel=100",
|
||||
"dev:services": "COMPOSE_PROFILES=services docker-compose up -d",
|
||||
"dev:services:all": "COMPOSE_PROFILES=services,ngrok,stripe docker-compose up",
|
||||
"dev:services:all": "COMPOSE_PROFILES=services,ngrok docker-compose up -d",
|
||||
"dev:workers:test": "nx test workers --skip-nx-cache --runInBand",
|
||||
"dev:server:test": "nx test server --skip-nx-cache --runInBand",
|
||||
"dev:test:unit": "yarn dev:ci:test --testPathPattern='^(?!.*integration).*$' --verbose --skip-nx-cache",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue