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

Wells-fargo-task-2 #66

Open
wants to merge 7 commits into
base: flow
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/main/java/com/wellsfargo/counselor/entity/Client.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@Entity
public class Client {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String name;

@ManyToOne
@JoinColumn(name = "financial_advisor_id")
private FinancialAdvisor financialAdvisor;

@OneToMany(mappedBy = "client")
private List<Portfolio> portfolios;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
public class FinancialAdvisor {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String name;

@OneToMany(mappedBy = "financialAdvisor")
private List<Client> clients;
}
14 changes: 14 additions & 0 deletions src/main/java/com/wellsfargo/counselor/entity/Portfolio.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@Entity
public class Portfolio {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@ManyToOne
@JoinColumn(name = "client_id")
private Client client;

@OneToMany(mappedBy = "portfolio")
private List<Security> securities;
}
21 changes: 21 additions & 0 deletions src/main/java/com/wellsfargo/counselor/entity/Security.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@Entity
public class Security {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

private String name;
private String category;

@Column(name = "purchase_date")
private LocalDate purchaseDate;

@Column(name = "purchase_price")
private BigDecimal purchasePrice;
private Integer quantity;

@ManyToOne
@JoinColumn(name = "portfolio_id")
private Portfolio portfolio;
}