-
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.
- Loading branch information
Showing
16 changed files
with
988 additions
and
0 deletions.
There are no files selected for viewing
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,24 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.fag</groupId> | ||
<artifactId>bakingapp</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.postgresql</groupId> | ||
<artifactId>postgresql</artifactId> | ||
<version>42.7.4</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
</project> |
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,56 @@ | ||
package com.fag; | ||
|
||
import com.fag.domain.dto.LoginDTO; | ||
import com.fag.domain.dto.UserAccountDTO; | ||
import com.fag.domain.repositories.IUserInterFace; | ||
import com.fag.infra.celcoin.CelcoinBassRepositorory; | ||
import com.fag.infra.console.ConsoleUserInterface; | ||
import com.fag.infra.pg.PgSupabase; | ||
import com.fag.infra.pg.PostgresConnection; | ||
import com.fag.infra.swing.SwingUserInterface; | ||
import com.fag.infra.testdb.UserTestDb; | ||
import com.fag.services.BankingService; | ||
|
||
public class Main { | ||
public static void main(String[] args) throws Exception { | ||
SwingUserInterface swingUserInterface = new SwingUserInterface(); | ||
ConsoleUserInterface consoleUserInterface = new ConsoleUserInterface(); | ||
CelcoinBassRepositorory celcoinBassRepositorory = new CelcoinBassRepositorory(); | ||
UserTestDb userTestDb = new UserTestDb(); | ||
PgSupabase pg = new PgSupabase(); | ||
|
||
BankingService bankingApp = new BankingService(consoleUserInterface, pg, celcoinBassRepositorory); | ||
|
||
while (true) { | ||
|
||
Integer escolha = bankingApp.apresentarMeuInicial(); | ||
|
||
switch (escolha) { | ||
case 1: | ||
LoginDTO loginDTO = bankingApp.geLoginDTO(); | ||
UserAccountDTO user = bankingApp.findUser(loginDTO); | ||
if (user != null) { | ||
bankingApp.login(user); | ||
} | ||
break; | ||
case 2: | ||
UserAccountDTO userAccountDTO = bankingApp.gUserAccountDTO(); | ||
|
||
System.out.println(userAccountDTO.toString()); | ||
|
||
bankingApp.createUser(userAccountDTO); | ||
|
||
bankingApp.login(userAccountDTO); | ||
break; | ||
case 3: | ||
bankingApp.exitMensagem(); | ||
return; | ||
|
||
default: | ||
break; | ||
} | ||
} | ||
|
||
} | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
src/segundob/bankingapp/src/main/java/com/fag/domain/dto/BankslipDTO.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,25 @@ | ||
package com.fag.domain.dto; | ||
|
||
public class BankslipDTO { | ||
|
||
private String barcode; | ||
|
||
private String transactionId; | ||
|
||
public String getBarcode() { | ||
return barcode; | ||
} | ||
|
||
public void setBarcode(String barcode) { | ||
this.barcode = barcode; | ||
} | ||
|
||
public String getTransactionId() { | ||
return transactionId; | ||
} | ||
|
||
public void setTransactionId(String transactionId) { | ||
this.transactionId = transactionId; | ||
} | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
src/segundob/bankingapp/src/main/java/com/fag/domain/dto/LoginDTO.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,23 @@ | ||
package com.fag.domain.dto; | ||
|
||
public class LoginDTO { | ||
private String document; | ||
private String passaword; | ||
|
||
public String getDocument() { | ||
return document; | ||
} | ||
|
||
public void setDocument(String document) { | ||
this.document = document; | ||
} | ||
|
||
public String getPassaword() { | ||
return passaword; | ||
} | ||
|
||
public void setPassaword(String passaword) { | ||
this.passaword = passaword; | ||
} | ||
|
||
} |
86 changes: 86 additions & 0 deletions
86
src/segundob/bankingapp/src/main/java/com/fag/domain/dto/UserAccountDTO.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,86 @@ | ||
package com.fag.domain.dto; | ||
|
||
import java.time.LocalDateTime; | ||
|
||
public class UserAccountDTO { | ||
private String id; | ||
private String document; | ||
private String name; | ||
private String email; | ||
private String accountNumber; | ||
private LocalDateTime createdAt; | ||
private LocalDateTime disableAt; | ||
private String password; | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
|
||
public String getDocument() { | ||
return document; | ||
} | ||
|
||
public void setDocument(String document) { | ||
this.document = document; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public String getEmail() { | ||
return email; | ||
} | ||
|
||
public void setEmail(String email) { | ||
this.email = email; | ||
} | ||
|
||
public String getAccountNumber() { | ||
return accountNumber; | ||
} | ||
|
||
public void setAccountNumber(String accountNumber) { | ||
this.accountNumber = accountNumber; | ||
} | ||
|
||
public LocalDateTime getCreatedAt() { | ||
return createdAt; | ||
} | ||
|
||
public void setCreatedAt(LocalDateTime createdAt) { | ||
this.createdAt = createdAt; | ||
} | ||
|
||
public LocalDateTime getDisableAt() { | ||
return disableAt; | ||
} | ||
|
||
public void setDisableAt(LocalDateTime disableAt) { | ||
this.disableAt = disableAt; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "UserAccountDTO [id=" + id + ", document=" + document + ", name=" + name + ", email=" + email | ||
+ ", accountNumber=" + accountNumber + ", createdAt=" + createdAt + ", disableAt=" + disableAt | ||
+ ", password=" + password + "]"; | ||
} | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/segundob/bankingapp/src/main/java/com/fag/domain/repositories/IBassRepository.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,11 @@ | ||
package com.fag.domain.repositories; | ||
|
||
import com.fag.domain.dto.BankslipDTO; | ||
|
||
public interface IBassRepository { | ||
public abstract String consultarBoleto(String linhaDigitada) throws Exception; | ||
|
||
public abstract String gerarQRCode(Double dadosPix) throws Exception; | ||
|
||
public abstract String pagarBoleto(BankslipDTO dadosBoletoConsultado) throws Exception; | ||
} |
30 changes: 30 additions & 0 deletions
30
src/segundob/bankingapp/src/main/java/com/fag/domain/repositories/IUserInterFace.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,30 @@ | ||
package com.fag.domain.repositories; | ||
|
||
import com.fag.domain.dto.BankslipDTO; | ||
import com.fag.domain.dto.LoginDTO; | ||
import com.fag.domain.dto.UserAccountDTO; | ||
|
||
public interface IUserInterFace { | ||
public abstract Integer showInitialScreenMenu(); | ||
|
||
public abstract LoginDTO getLoginData(); | ||
|
||
public abstract UserAccountDTO getUserAccountDTO(); | ||
|
||
public abstract Integer showHomeMenu(String userName); | ||
|
||
public abstract void showErrorMenssagem(String msg); | ||
|
||
public abstract void showExitMessage(); | ||
|
||
public abstract String getBarcode(); | ||
|
||
public abstract BankslipDTO getPaymentBankslipInfo(); | ||
|
||
public abstract void showBankslipInfo(String data); | ||
|
||
public abstract Double getPixData(); | ||
|
||
public abstract void showPixData(String data); | ||
|
||
} |
11 changes: 11 additions & 0 deletions
11
src/segundob/bankingapp/src/main/java/com/fag/domain/repositories/IUserRepository.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,11 @@ | ||
package com.fag.domain.repositories; | ||
|
||
import com.fag.domain.dto.UserAccountDTO; | ||
|
||
public interface IUserRepository { | ||
|
||
UserAccountDTO createUser(UserAccountDTO dto); | ||
|
||
UserAccountDTO findUserBy(String document); | ||
|
||
} |
Oops, something went wrong.