Skip to content

Commit

Permalink
Merge pull request #16 from ucmo-cs/feat/ids
Browse files Browse the repository at this point in the history
feat: renamed acctId and LoanId fields to "id" for consistency
  • Loading branch information
michaelharlow authored Oct 23, 2024
2 parents 112856e + a72be24 commit df15efb
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions src/main/frontend/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ function App() {
</TableHeader>
<TableBody>
{accounts.map((account) => (
<TableRow key={account.acctId} onClick={() => {navigate(`/account/${account.acctId}`)}} className={"cursor-pointer"}>
<TableCell>{account.acctId}</TableCell>
<TableRow key={account.id} onClick={() => {navigate(`/account/${account.id}`)}} className={"cursor-pointer"}>
<TableCell>{account.id}</TableCell>
<TableCell>{account.userType}</TableCell>
<TableCell>{account.username}</TableCell>
<TableCell>{account.password}</TableCell>
Expand Down
2 changes: 1 addition & 1 deletion src/main/frontend/src/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// <reference types="vite/client" />

interface Account {
acctId: number;
id: number;
userType: number;
username: string;
password: string;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/avengers/example/domain/Account.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Account
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private long acctId;
private long id; // primary key for the account table (renamed for compatibility).
private int userType;
private String username;
private String password;
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/avengers/example/domain/Loan.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class Loan
{
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long loanId;
private Long id; // primary key for the loan table (renamed for compatibility).
private double originAmount;
private long interestRate;

Expand All @@ -26,14 +26,14 @@ public Loan(double originAmount, long interestRate)
this.interestRate = interestRate;
}

public void setLoanId(Long loanId)
public void setId(Long loanId)
{
this.loanId = loanId;
this.id = loanId;
}

public Long getLoanId()
public Long getId()
{
return loanId;
return id;
}

public void setOriginAmount(double originAmount)
Expand Down

0 comments on commit df15efb

Please sign in to comment.