@startuml "Context Diagram"

title "OC-Paciente - Diagrama de contexto do sistema"

!include https://raw.githubusercontent.com/adrianvlupu/C4-PlantUML/latest/C4_Context.puml

LAYOUT_WITH_LEGEND()
LAYOUT_LEFT_RIGHT()

skinparam backgroundcolor transparent

/'Actors'/
Person(ActorPatient, "Paciente", "É o ator responsável por realizar a interação com o sistema ")

/'Internal Systems'/
System(SystemOCPatient, "Sistema OC-Paciente", "Responsável pelas funcionalidades: listagem e agendamento de consultas, gestão de acompanhantes, visualização de laudos, gestão de acesso ao prontuário.")

/'External Systems'/
System_Ext(SystemMyPhysicianApi, "API Meu Médico", "Responsável por fornecer conexão direta com o sistema Meu Médico.")
System_Ext(SystemApiCore, "API Core", "Responsável por fornecer conexão direta com os dados do CMS da api-core.")
System_Ext(SystemTasyApi, "API Tasy", "Responsável por fornecer conexão direta com o sistema Tasy.")
System_Ext(SystemAWSCognito, "AWS Cognito", "Responsável por gerenciar todo a autenticação do usuário (Cadastro, Login, MFA, Recuperação de conta).")
System_Ext(SystemAWSSecretManager, "AWS SecretManager", "Responsável por gerenciar variáveis de ambiente.")
System_Ext(SystemGoogleRecaptcha, "Google Recaptcha", "Responsável por validar recaptcha.")

/'Relations'/
Rel(ActorPatient, SystemOCPatient, "Visualiza e interage com as funcionalidades do sistema")
Rel(SystemOCPatient, SystemGoogleRecaptcha, "Valida token recaptcha", "@google-cloud/recaptcha-enterprise")
Rel(SystemOCPatient, SystemAWSCognito, "Autentica o paciente", "@aws-sdk/client-cognito-identity-provider")
Rel(SystemOCPatient, SystemAWSSecretManager, "Obtém variáveis de ambiente", "@aws-sdk/client-secrets-manager")
Rel(SystemOCPatient, SystemMyPhysicianApi, "Obtém agendamentos do paciente", "JSON/HTTPS")
Rel(SystemOCPatient, SystemTasyApi, "Obtém dados do Tasy", "JSON/HTTPS")
Rel(SystemOCPatient, SystemApiCore, "Gestão de acesso ao prontuário", "JSON/HTTPS")

@enduml