-
Notifications
You must be signed in to change notification settings - Fork 0
Salvar informacoes essenciais do usuario #3
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
Merged
victorYghor
merged 64 commits into
develop
from
salvar-informacoes-essenciais-do-usuario
Jun 5, 2025
Merged
Changes from all commits
Commits
Show all changes
64 commits
Select commit
Hold shift + click to select a range
3149862
feat: adicionar enum UserStatus
ronaldo-ribeirof 3cd6a18
feat: criei um repositório para Attendance (atendimentos)
ronaldo-ribeirof 75375d9
feat: adicionei endpoints REST para atendimentos
ronaldo-ribeirof 24257f3
feat: criei serviço para gerenciamento de status
ronaldo-ribeirof 9721f39
feat: adicionei endpoints para alteração manual de status
ronaldo-ribeirof 6e05e21
feat: adicionei campo status em CommitteeMember
ronaldo-ribeirof d4969f4
feat: adicionei campo status em Monitor
ronaldo-ribeirof 771b219
feat: adicionei a busca de membros por status
ronaldo-ribeirof 1f78283
feat: adicionei a busca de monitores por status
ronaldo-ribeirof 1b0d839
feat: adicionei início e fim de atendimentos
ronaldo-ribeirof 7b6c691
Apaguei os controllers desnecessários
ronaldo-ribeirof a809189
Ajustei comentários
ronaldo-ribeirof 393628d
Merge branch 'main' into status-monitor-e-membrocomissao
ronaldo-ribeirof 77a0623
Emanuel me ajudou na documentação
ronaldo-ribeirof 2c6c88c
Adicionei a atualização de status
ronaldo-ribeirof d144ffb
Implementação da lógica inicial de status
ronaldo-ribeirof 930c6be
Criamos um arquivo para o service do whatsapp
ronaldo-ribeirof f7b41b5
feat: Add a check logic on the "FirstContactService.kt". Its checks i…
ronaldo-ribeirof 5b391bb
refact: The entity now gets the Attendant Class instead of the User C…
ronaldo-ribeirof 07c32bf
Changes by victor-yghor
ronaldo-ribeirof 77b5816
feat: The entity Attendant was created.
ronaldo-ribeirof c1d8718
refact: Now the Attendance entity gets the Attendant Class instead of…
ronaldo-ribeirof 452d37e
Changes by victor-yghor
ronaldo-ribeirof 7f48451
Changes by victor-yghor
ronaldo-ribeirof 5fb13e9
Update AttendanceService.kt
ronaldo-ribeirof b793694
Delete UserStatusService.kt
ronaldo-ribeirof de3c265
Update name
ronaldo-ribeirof aaf50bf
Update FirstContactService.kt
ronaldo-ribeirof 344294d
[feat] botpcd >> Add support to send mensage with whatsappService
yet1dev 627f738
Merge branch 'develop' into status-monitor-e-membrocomissao
victorYghor 4b46f45
put the cucumber testes to change status
victorYghor 00e4210
Fix problem with the indentation of changeStatus.feature
victorYghor bca45d7
change the changeStatus cenário
victorYghor 49bcd96
work: Add part of button creation in whatsapp-service
yet1dev 6cdd26c
WIP start the register logic
victorYghor 5379ff5
Merge branch 'whatsapp-service' into salvar-informacoes-essenciais-do…
victorYghor 930581e
Fix the WhatsappService.kt
victorYghor 6c10b75
Send a list of disabilities to the user
victorYghor 4936f23
try to send message to the user
victorYghor 2717032
Fix problem sending messages
victorYghor 63528e3
Send Whatsapp message
victorYghor 4764b83
Merge branch 'status-monitor-e-membrocomissao' into salvar-informacoe…
victorYghor 2a968dc
Put the registerPCD.feature
victorYghor 0ceb347
Refactor the registerPCD.feature for not sending buttons
victorYghor b3d9be7
Fix problem and send a message
victorYghor dbdfd92
put the mocks files
victorYghor 3e46508
Write the first feature test
victorYghor c46285b
Harded code the text
victorYghor b6fc87e
Improve the steps definitions
victorYghor 92f2839
WIP only instanciate the MessageExchangeRepository.kt in the test con…
victorYghor f8b1420
WIP remove the test profile
victorYghor 60281be
WIP create the service and the FirstContactService.kt
victorYghor a0fe253
feat: Add support to acessibility tasks
victorYghor 6bbeed8
feat: Add functino to create options list in whatsapp service
victorYghor cf39309
WIP improve the features
victorYghor 365bfb4
WIP improve the tests
victorYghor 550ca12
WIP Working in testes cenarios
victorYghor b8858df
Create the message repository
victorYghor 3708302
try to fix tests
victorYghor 7ca3adc
try to fix tests
victorYghor 5683e5a
WIP testes
victorYghor 18203be
WIP tests
victorYghor b3abcc9
Fix testes
victorYghor 73d30c2
remove the tests
victorYghor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
19 changes: 19 additions & 0 deletions
19
src/main/kotlin/ufrpe/sbpc/botpcd/controller/GlobalExceptionHandler.kt
This file contains hidden or 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,19 @@ | ||
| package ufrpe.sbpc.botpcd.controller | ||
|
|
||
| import org.slf4j.LoggerFactory | ||
| import org.springframework.http.HttpStatus | ||
| import org.springframework.http.ResponseEntity | ||
| import org.springframework.web.bind.annotation.ControllerAdvice | ||
| import org.springframework.web.bind.annotation.ExceptionHandler | ||
| import org.slf4j.Logger | ||
|
|
||
| @ControllerAdvice | ||
| class GlobalExceptionHandler { | ||
| val logger: Logger = LoggerFactory.getLogger(WhatsappWebhookController::class.java) | ||
|
|
||
| @ExceptionHandler(RuntimeException::class) | ||
| fun runtimeExceptionHandler(runtimeException: RuntimeException): ResponseEntity<Map<String, String>> { | ||
| logger.error("Erro inesperado ao chamar a API", runtimeException) | ||
| return ResponseEntity(mapOf("message" to "Some error ocorrer calling the API"), HttpStatus.INTERNAL_SERVER_ERROR) | ||
| } | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,16 @@ | ||
| package ufrpe.sbpc.botpcd.entity | ||
|
|
||
| import jakarta.persistence.Entity | ||
| import jakarta.persistence.EnumType | ||
| import jakarta.persistence.Enumerated | ||
| import jakarta.persistence.Table | ||
| import jakarta.validation.constraints.NotEmpty | ||
|
|
||
| @Entity | ||
| @Table(name = "tb_attendant") | ||
| abstract class Attendant( | ||
| name: String, | ||
| phoneNumber: String, | ||
| @Enumerated(EnumType.STRING) | ||
| var status: UserStatus = UserStatus.AVAILABLE | ||
| ) : User(name = name, phoneNumber = phoneNumber) |
This file contains hidden or 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
This file contains hidden or 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
23 changes: 23 additions & 0 deletions
23
src/main/kotlin/ufrpe/sbpc/botpcd/entity/MessageExchange.kt
This file contains hidden or 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 ufrpe.sbpc.botpcd.entity | ||
|
|
||
| import jakarta.persistence.Column | ||
| import jakarta.persistence.Entity | ||
| import jakarta.persistence.GeneratedValue | ||
| import jakarta.persistence.GenerationType | ||
| import jakarta.persistence.Id | ||
| import org.hibernate.annotations.CreationTimestamp | ||
| import java.time.LocalDateTime | ||
|
|
||
| @Entity | ||
| class MessageExchange( | ||
| @Id | ||
| @GeneratedValue(strategy = GenerationType.IDENTITY) | ||
| var id: Long? = null, | ||
| var fromPhoneNumber: String, | ||
| var toPhoneNumber: String, | ||
| @Column(columnDefinition = "TEXT") | ||
| var message: String | ||
| ) { | ||
| @CreationTimestamp | ||
| var createAt: LocalDateTime? = null | ||
| } |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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 ufrpe.sbpc.botpcd.entity | ||
|
|
||
| import jakarta.persistence.Entity | ||
| import jakarta.persistence.EnumType | ||
| import jakarta.persistence.Enumerated | ||
| import jakarta.persistence.GeneratedValue | ||
| import jakarta.persistence.GenerationType | ||
| import jakarta.persistence.Id | ||
| import jakarta.persistence.JoinColumn | ||
| import jakarta.persistence.ManyToOne | ||
| import jakarta.persistence.Table | ||
|
|
||
| @Entity | ||
| @Table(name="tb_pwd_disability") | ||
| class PWDDisability( | ||
| @Id | ||
| @GeneratedValue(strategy= GenerationType.IDENTITY) | ||
| val id: Long?= null, | ||
|
|
||
| @Enumerated(EnumType.STRING) | ||
| val disability: Disability, | ||
|
|
||
| @ManyToOne | ||
| @JoinColumn(name="pwd_id") | ||
| val pwd: PWD | ||
| ) |
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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,12 @@ | ||
| package ufrpe.sbpc.botpcd.entity | ||
|
|
||
| /* | ||
| (DISPONIVEL) ele pode receber um atendimento | ||
| (OCUPADO) ele esta em atendimento, mas quando finalizar o codigo trocara para disponivel | ||
| (INDISPONIVEL) ele foi ao banheiro / esta ocupado. Nao vai receber chamado ate que altere seu status manualmente para available | ||
| */ | ||
| enum class UserStatus(val text: String) { | ||
| AVAILABLE("Disponível"), | ||
| BUSY("Ocupado"), | ||
| UNAVAILABLE("Indisponível") | ||
| } |
6 changes: 6 additions & 0 deletions
6
src/main/kotlin/ufrpe/sbpc/botpcd/repository/AttendanceRepository.kt
This file contains hidden or 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 ufrpe.sbpc.botpcd.repository | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository | ||
| import ufrpe.sbpc.botpcd.entity.Attendance | ||
|
|
||
| interface AttendanceRepository : JpaRepository<Attendance, Long> |
This file contains hidden or 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
12 changes: 12 additions & 0 deletions
12
src/main/kotlin/ufrpe/sbpc/botpcd/repository/MessageExchangeRepository.kt
This file contains hidden or 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,12 @@ | ||
| package ufrpe.sbpc.botpcd.repository | ||
|
|
||
| import org.springframework.data.jpa.repository.JpaRepository | ||
| import org.springframework.data.jpa.repository.Query | ||
| import ufrpe.sbpc.botpcd.entity.MessageExchange | ||
|
|
||
| interface MessageExchangeRepository: JpaRepository<MessageExchange, Long> { | ||
| @Query( | ||
| "SELECT m FROM MessageExchange m WHERE m.toPhoneNumber = :toPhoneNumber AND m.fromPhoneNumber = :fromPhoneNumber ORDER BY m.createAt DESC LIMIT 1" | ||
| ) | ||
| fun lastExchangeMessage(toPhoneNumber: String, fromPhoneNumber: String): MessageExchange? | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.