Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend Copy Portfolio Routes #44

Merged
merged 16 commits into from
Apr 18, 2024
Merged

Backend Copy Portfolio Routes #44

merged 16 commits into from
Apr 18, 2024

Conversation

capture120
Copy link
Contributor

Description

Adds routes for copying a portfolio.
Adds dummy data for portfolios and positions.
Adds separate GetPortfolio Route for convenience.

How Has This Been Tested?

copy route updates data in db

Checklist

  • I have performed a self-review of my code
  • I have reached out to another developer to review my code
  • I have commented my code, particularly in hard-to-understand areas
  • New and existing unit tests pass locally with my changes

@capture120 capture120 requested a review from leoRysing as a code owner April 12, 2024 14:16
@leoRysing leoRysing force-pushed the nj-be-copy branch 2 times, most recently from d021bbe to 19d02bc Compare April 12, 2024 19:46
}

// CopyPortfolio copies the positions from the target portfolio into the current user's portfolio.
func (os *PortfolioService) CopyPortfolio(currentUserPortfolio models.UserPortfolio, targetPortfolio models.UserPortfolio) (models.UserPortfolio, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we copying the portfolio to the e-trade account?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this just has routes to copy portfolios in our own db for now. ETrade endpoints are not working so I'm looking into fixing that + how to make trade orders for securities with the api

@@ -18,8 +17,10 @@ const APIEnv = "apisb" // "apisb" = SANDBOX, "api" = PROD

var oauthClient = oauth.Client{
Credentials: oauth.Credentials{
Token: os.Getenv("OAUTH_KEY"),
Secret: os.Getenv("OAUTH_SECRET"),
// Token: os.Getenv("OAUTH_KEY"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reasoning for removing this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

forgot to change that, will fix later tn

@aniamisiorek aniamisiorek merged commit 0059f37 into main Apr 18, 2024
5 checks passed
@aniamisiorek aniamisiorek deleted the nj-be-copy branch April 18, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants