perryraskin / raskfin

I needed an ultra custom personal finance tool, so I'm making one
https://raskfin.vercel.app
GNU General Public License v3.0
9 stars 0 forks source link

Sweep: Bank Connection Screen #6

Open perryraskin opened 1 year ago

perryraskin commented 1 year ago

Details

Checklist - [X] `pages/bank-connection.tsx` ✅ Commit [`e543691`](https://github.com/perryraskin/raskfin/commit/e543691625f69b176ca010fa1757d324bac5d036)
• Create a new page named 'bank-connection.tsx' in the 'pages' directory. • In this page, create a form that asks for the user's bank details. • Handle the form submission and make a request to the Teller API to connect the bank account. • Handle the response from the Teller API. If the connection is successful, redirect the user to a success page. If the connection fails, display an error message to the user.
Sandbox Execution Logs
trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 23 typescript files)
  git-diff-check (62 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 23 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (63 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt pages/bank-connection.tsx 2/3 ✅

 ✔ Formatted pages/bank-connection.tsx
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix pages/bank-connection.tsx 3/3 ❌ (`1`)

  FAILURES  
 eslint  pages/bank-connection.tsx  .trunk/out/QVaS8.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `yarn install`
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
- [X] `prisma/schema.prisma` ✅ Commit [`9d3ccff`](https://github.com/perryraskin/raskfin/commit/9d3ccffac1f7bf29a3cdb96c004456bb810cece5)
• Add a new field in the 'accounts' model to store the connected bank account information. This field should be nullable as not all users will connect their bank accounts.
Sandbox Execution Logs
trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 22 typescript files)
  git-diff-check (61 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 22 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (62 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt prisma/schema.prisma 2/3 ✅

Found no applicable linters for the requested path
trunk check --fix prisma/schema.prisma 3/3 ✅

Checked 1 file
✔ No issues
- [X] `lib/teller.ts` ✅ Commit [`4c822f9`](https://github.com/perryraskin/raskfin/commit/4c822f9f5dcd0d61758f04b61c3f1aa193725cf1)
• Create a new file named 'teller.ts' in the 'lib' directory. • In this file, write functions to interact with the Teller API. These functions will be used to connect the bank account and handle the API responses.
Sandbox Execution Logs
trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 23 typescript files)
  git-diff-check (62 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 23 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (63 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt lib/teller.ts 2/3 ✅

 ✔ Formatted lib/teller.ts
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix lib/teller.ts 3/3 ❌ (`1`)

  FAILURES  
 eslint  lib/teller.ts  .trunk/out/zm9gl.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `yarn install`
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure
- [X] `middleware.ts` ✅ Commit [`478c61a`](https://github.com/perryraskin/raskfin/commit/478c61a960680548d5c9a9beb7313dd59bdf46ce)
• Add the '/bank-connection' path to the 'publicPaths' array. This will allow users to access the bank connection page without being signed in.
Sandbox Execution Logs
trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 22 typescript files)
  git-diff-check (61 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 22 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (62 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt middleware.ts 2/3 ✅

 ✔ Formatted middleware.ts
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix middleware.ts 3/3 ❌ (`1`)

  FAILURES  
 eslint  middleware.ts  .trunk/out/2lRST.yaml
 eslint  middleware.ts  .trunk/out/ufwXW.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `yarn install`     
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures
sweep-ai[bot] commented 1 year ago

Here's the PR! https://github.com/perryraskin/raskfin/pull/10.

⚡ Sweep Free Trial: I used GPT-4 to create this ticket. You have 3 GPT-4 tickets left for the month and 2 for the day. For more GPT-4 tickets, visit our payment portal. To retrigger Sweep, edit the issue.


Step 1: 📍 Planning

I found the following snippets in your repository. I will now analyze these snippets and come up with a plan.

Some code snippets I looked at (click to expand). If some file is missing from here, you can mention the path in the ticket description. https://github.com/perryraskin/raskfin/blob/4e9ac483862a92cdb32060d6d38fe0240ecf000b/middleware.ts#L1-L31 https://github.com/perryraskin/raskfin/blob/4e9ac483862a92cdb32060d6d38fe0240ecf000b/prisma/schema.prisma#L1-L61 https://github.com/perryraskin/raskfin/blob/4e9ac483862a92cdb32060d6d38fe0240ecf000b/pages/index-old.tsx#L1-L102

Step 2: ⌨️ Coding

trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 23 typescript files)
  git-diff-check (62 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 23 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (63 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt pages/bank-connection.tsx 2/3 ✅

 ✔ Formatted pages/bank-connection.tsx
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix pages/bank-connection.tsx 3/3 ❌ (`1`)

  FAILURES  
 eslint  pages/bank-connection.tsx  .trunk/out/QVaS8.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `yarn install`
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure

trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 22 typescript files)
  git-diff-check (61 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 22 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (62 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt prisma/schema.prisma 2/3 ✅

Found no applicable linters for the requested path
trunk check --fix prisma/schema.prisma 3/3 ✅

Checked 1 file
✔ No issues

trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 23 typescript files)
  git-diff-check (62 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 23 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (63 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt lib/teller.ts 2/3 ✅

 ✔ Formatted lib/teller.ts
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix lib/teller.ts 3/3 ❌ (`1`)

  FAILURES  
 eslint  lib/teller.ts  .trunk/out/zm9gl.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `yarn install`
 A tool failed to run. You can open the details yaml file for more information.
Checked 1 file
✖ No issues, 1 failure

trunk init 1/3 ✅
⡿ Downloading Trunk 1.15.0...
⡿ Downloading Trunk 1.15.0...
⢿ Downloading Trunk 1.15.0...
⣻ Downloading Trunk 1.15.0...
⣽ Downloading Trunk 1.15.0...
⣾ Downloading Trunk 1.15.0...
⣷ Downloading Trunk 1.15.0...
⣯ Downloading Trunk 1.15.0...
✔ Downloading Trunk 1.15.0... done
⡿ Verifying Trunk sha256...
✔ Verifying Trunk sha256... done
⡿ Unpacking Trunk...
✔ Unpacking Trunk... done

✔ 11 linters were enabled (.trunk/trunk.yaml)
  checkov 2.4.9 (4 json, 5 yaml files)
  eslint 8.49.0 (4 javascript, 22 typescript files)
  git-diff-check (61 files)
  markdownlint 0.36.0 (1 markdown file) (created .markdownlint.yaml)
  osv-scanner 1.4.0 (1 lockfile file)
  oxipng 8.0.0 (2 png files)
  prettier 3.0.3 (3 css, 4 javascript, 4 json, 1 markdown, 22 typescript, 5 yaml files)
  svgo 3.0.2 (14 svg files) (created svgo.config.js)
  trivy 0.45.0 (1 lockfile, 5 yaml files)
  trufflehog 3.55.1 (62 files)
  yamllint 1.32.0 (5 yaml files) (created .yamllint.yaml)
Next Steps
 1. Read documentation
    Our documentation can be found at https://docs.trunk.io
 2. Get help and give feedback
    Join the Trunk community at https://slack.trunk.io
trunk fmt middleware.ts 2/3 ✅

 ✔ Formatted middleware.ts
Re-checking autofixed files...

Checked 1 file
✔ No issues
trunk check --fix middleware.ts 3/3 ❌ (`1`)

  FAILURES  
 eslint  middleware.ts  .trunk/out/2lRST.yaml
 eslint  middleware.ts  .trunk/out/ufwXW.yaml
  NOTICES  
 [suggestion] Eslint could not resolve dependencies; try running `yarn install`     
 Some tools failed to run. You can open the details yaml files for more information.
Checked 1 file
✖ No issues, 2 failures


Step 3: 🔁 Code Review

I have finished reviewing the code for completeness. I did not find errors for sweep/bank-connection-screen.

.


🎉 Latest improvements to Sweep:


💡 To recreate the pull request edit the issue title or description. To tweak the pull request, leave a comment on the pull request. Join Our Discord