forked from ADORSYS-GIS/e2e-banking-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ADORSYS-GIS#3 implement model classes following MVC pattern for…
… Spring Boot backend (ADORSYS-GIS#73) * implement model classes following MVC pattern for Spring Boot backend * Refactor model classes and annotations based on requirements
- Loading branch information
Showing
7 changed files
with
185 additions
and
0 deletions.
There are no files selected for viewing
9 changes: 9 additions & 0 deletions
9
...y-backend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/CheckBalance.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
|
||
|
||
import jakarta.persistence.Entity; | ||
|
||
@Entity | ||
public class CheckBalance extends Procedure { | ||
|
||
} |
59 changes: 59 additions & 0 deletions
59
...-pay-backend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/Procedure.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
|
||
@Entity | ||
public abstract class Procedure { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private int id; | ||
public ProcedureStatus status = ProcedureStatus.WAITING; | ||
private String phoneNumber; | ||
|
||
|
||
public void markAsDone() { | ||
status = ProcedureStatus.DONE; | ||
} | ||
|
||
public void markAsError() { | ||
status = ProcedureStatus.ERROR; | ||
} | ||
|
||
public boolean isDone() { | ||
return status == ProcedureStatus.DONE; | ||
} | ||
|
||
public boolean isError() { | ||
return status == ProcedureStatus.ERROR; | ||
} | ||
|
||
public boolean isWaiting() { | ||
return status == ProcedureStatus.WAITING; | ||
} | ||
|
||
public int getId() { | ||
return id; | ||
} | ||
|
||
public void setId(int id) { | ||
this.id = id; | ||
} | ||
|
||
public ProcedureStatus getStatus() { | ||
return status; | ||
} | ||
|
||
public void setStatus(ProcedureStatus status) { | ||
this.status = status; | ||
} | ||
|
||
public String getPhoneNumber() { | ||
return phoneNumber; | ||
} | ||
|
||
public void setPhoneNumber(String phoneNumber) { | ||
this.phoneNumber = phoneNumber; | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...ackend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/ProcedureStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
|
||
public enum ProcedureStatus { | ||
|
||
DONE, | ||
WAITING, | ||
ERROR | ||
} |
6 changes: 6 additions & 0 deletions
6
...-backend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/ProcedureType.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
|
||
public enum ProcedureType { | ||
Transaction, | ||
CheckBalance | ||
} |
38 changes: 38 additions & 0 deletions
38
...ay-backend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/Transaction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
|
||
@Entity | ||
public class Transaction extends Procedure { | ||
private String receiverPhoneNumber; | ||
private Double amount; | ||
private String currency; | ||
|
||
{ | ||
currency = "XAF"; | ||
} | ||
|
||
public String getReceiverPhoneNumber() { | ||
return receiverPhoneNumber; | ||
} | ||
|
||
public void setReceiverPhoneNumber(String receiverPhoneNumber) { | ||
this.receiverPhoneNumber = receiverPhoneNumber; | ||
} | ||
|
||
public Double getAmount() { | ||
return amount; | ||
} | ||
|
||
public void setAmount(Double amount) { | ||
this.amount = amount; | ||
} | ||
|
||
public String getCurrency() { | ||
return currency; | ||
} | ||
|
||
public void setCurrency(String currency) { | ||
this.currency = currency; | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
power-pay-backend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/User.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
import jakarta.persistence.GeneratedValue; | ||
import jakarta.persistence.GenerationType; | ||
import jakarta.persistence.Id; | ||
|
||
@Entity | ||
public class User { | ||
@Id | ||
@GeneratedValue(strategy = GenerationType.IDENTITY) | ||
private String phoneNumber; | ||
private String pin; | ||
private String userName; | ||
|
||
public String getPhoneNumber() { | ||
return phoneNumber; | ||
} | ||
|
||
public void setPhoneNumber(String phoneNumber) { | ||
this.phoneNumber = phoneNumber; | ||
} | ||
|
||
public String getPin() { | ||
return pin; | ||
} | ||
|
||
public void setPin(String pin) { | ||
this.pin = pin; | ||
} | ||
|
||
public String getUserName() { | ||
return userName; | ||
} | ||
|
||
public void setUserName(String userName) { | ||
this.userName = userName; | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
...ckend/src/main/java/com/adorsys/gis/powerpay/powerpaybackend/domain/UserRegistration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.adorsys.gis.powerpay.powerpaybackend.domain; | ||
|
||
import jakarta.persistence.Entity; | ||
|
||
@Entity | ||
public class UserRegistration extends Procedure{ | ||
private String opt; | ||
private String userName; | ||
|
||
public String getOpt() { | ||
return opt; | ||
} | ||
|
||
public void setOpt(String opt) { | ||
this.opt = opt; | ||
} | ||
|
||
public String getUserName() { | ||
return userName; | ||
} | ||
|
||
public void setUserName(String userName) { | ||
this.userName = userName; | ||
} | ||
} | ||
|