Update Worker Satu Sehat
This commit is contained in:
No files matched your search
@@ -8,15 +8,9 @@ import (
|
||||
"service/internal/infrastructure/config"
|
||||
"service/internal/infrastructure/transport/http/middleware"
|
||||
|
||||
antrolHttp "service/internal/infrastructure/transport/http/handlers/bpjs/antrol"
|
||||
aplicareHttp "service/internal/infrastructure/transport/http/handlers/bpjs/aplicare"
|
||||
apotekHttp "service/internal/infrastructure/transport/http/handlers/bpjs/apotek"
|
||||
vclaimHttp "service/internal/infrastructure/transport/http/handlers/bpjs/vclaim"
|
||||
authHttp "service/internal/infrastructure/transport/http/handlers/main/auth"
|
||||
healthHttp "service/internal/infrastructure/transport/http/handlers/main/health"
|
||||
roleHttp "service/internal/infrastructure/transport/http/handlers/main/master/roles"
|
||||
satuSehatRefHttp "service/internal/infrastructure/transport/http/handlers/satusehat/reference"
|
||||
satuSehatUsecaseHttp "service/internal/infrastructure/transport/http/handlers/satusehat/usecase"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
swaggerFiles "github.com/swaggo/files"
|
||||
@@ -26,40 +20,10 @@ import (
|
||||
// ModuleHandlers menampung seluruh HTTP handler opsional dari berbagai modul.
|
||||
// Jika sebuah handler bernilai nil, maka rutenya akan otomatis diabaikan (disabled).
|
||||
type ModuleHandlers struct {
|
||||
Auth *authHttp.AuthHandler
|
||||
RolePages *roleHttp.RolPagesHandler
|
||||
RolePermission *roleHttp.RolPermissionHandler
|
||||
RoleMaster *roleHttp.RoleMasterHandler
|
||||
Sep *vclaimHttp.SepHandler
|
||||
Peserta *vclaimHttp.PesertaHandler
|
||||
Antrol *antrolHttp.AntrolHandler
|
||||
AplicareBed *aplicareHttp.BedHandler
|
||||
ApotekReference *apotekHttp.ReferenceHandler
|
||||
SatuSehatAuth *satuSehatRefHttp.AuthHandler
|
||||
SatuSehatPatient *satuSehatRefHttp.PatientHandler
|
||||
SatuSehatPractitioner *satuSehatRefHttp.PractitionerHandler
|
||||
SatuSehatOrganization *satuSehatRefHttp.OrganizationHandler
|
||||
SatuSehatLocation *satuSehatRefHttp.LocationHandler
|
||||
SatuSehatKFA *satuSehatRefHttp.KFAHandler
|
||||
SSAllergyIntolerance *satuSehatUsecaseHttp.AllergyIntoleranceHandler
|
||||
SSCarePlan *satuSehatUsecaseHttp.CarePlanHandler
|
||||
SSClinicalImpression *satuSehatUsecaseHttp.ClinicalImpressionHandler
|
||||
SSComposition *satuSehatUsecaseHttp.CompositionHandler
|
||||
SSCondition *satuSehatUsecaseHttp.ConditionHandler
|
||||
SSDiagnosticReport *satuSehatUsecaseHttp.DiagnosticReportHandler
|
||||
SSEncounter *satuSehatUsecaseHttp.EncounterHandler
|
||||
SSEpisodeOfCare *satuSehatUsecaseHttp.EpisodeOfCareHandler
|
||||
SSImagingStudy *satuSehatUsecaseHttp.ImagingStudyHandler
|
||||
SSImmunization *satuSehatUsecaseHttp.ImmunizationHandler
|
||||
SSMedication *satuSehatUsecaseHttp.MedicationHandler
|
||||
SSMedicationDispense *satuSehatUsecaseHttp.MedicationDispenseHandler
|
||||
SSMedicationRequest *satuSehatUsecaseHttp.MedicationRequestHandler
|
||||
SSMedicationStatement *satuSehatUsecaseHttp.MedicationStatementHandler
|
||||
SSObservation *satuSehatUsecaseHttp.ObservationHandler
|
||||
SSProcedure *satuSehatUsecaseHttp.ProcedureHandler
|
||||
SSQuestionnaireResponse *satuSehatUsecaseHttp.QuestionnaireResponseHandler
|
||||
SSServiceRequest *satuSehatUsecaseHttp.ServiceRequestHandler
|
||||
SSSpecimen *satuSehatUsecaseHttp.SpecimenHandler
|
||||
Auth *authHttp.AuthHandler
|
||||
RolePages *roleHttp.RolPagesHandler
|
||||
RolePermission *roleHttp.RolPermissionHandler
|
||||
RoleMaster *roleHttp.RoleMasterHandler
|
||||
}
|
||||
|
||||
// SetupRoutes mendaftarkan seluruh endpoint API secara dinamis berdasarkan
|
||||
@@ -153,111 +117,6 @@ func SetupRoutes(
|
||||
if h.RoleMaster != nil {
|
||||
h.RoleMaster.RegisterRoutes(protected)
|
||||
}
|
||||
|
||||
// --- Routes Modul BPJS VClaim ---
|
||||
if h.Sep != nil {
|
||||
h.Sep.RegisterRoutes(protected)
|
||||
}
|
||||
if h.Peserta != nil {
|
||||
h.Peserta.RegisterRoutes(protected)
|
||||
}
|
||||
|
||||
// --- Routes Modul BPJS Antrol ---
|
||||
if h.Antrol != nil {
|
||||
h.Antrol.RegisterRoutes(protected)
|
||||
}
|
||||
|
||||
// --- Routes Modul BPJS Aplicares ---
|
||||
if h.AplicareBed != nil {
|
||||
h.AplicareBed.RegisterRoutes(protected)
|
||||
}
|
||||
|
||||
// --- Routes Modul BPJS Apotek ---
|
||||
if h.ApotekReference != nil {
|
||||
h.ApotekReference.RegisterRoutes(protected)
|
||||
}
|
||||
|
||||
// --- Routes Modul Satu Sehat ---
|
||||
// Buat grup khusus untuk membatasi traffic hit API ke Kemenkes
|
||||
satuSehatGroup := protected.Group("")
|
||||
satuSehatGroup.Use(middleware.MemoryRateLimitMiddleware(5.0, 10)) // Max 5 RPS, Burst capacity 10
|
||||
{
|
||||
if h.SatuSehatAuth != nil {
|
||||
h.SatuSehatAuth.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SatuSehatPatient != nil {
|
||||
h.SatuSehatPatient.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SatuSehatPractitioner != nil {
|
||||
h.SatuSehatPractitioner.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SatuSehatOrganization != nil {
|
||||
h.SatuSehatOrganization.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SatuSehatLocation != nil {
|
||||
h.SatuSehatLocation.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SatuSehatKFA != nil {
|
||||
h.SatuSehatKFA.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSAllergyIntolerance != nil {
|
||||
h.SSAllergyIntolerance.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSCarePlan != nil {
|
||||
h.SSCarePlan.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSClinicalImpression != nil {
|
||||
h.SSClinicalImpression.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSComposition != nil {
|
||||
h.SSComposition.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSCondition != nil {
|
||||
h.SSCondition.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSDiagnosticReport != nil {
|
||||
h.SSDiagnosticReport.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSEncounter != nil {
|
||||
h.SSEncounter.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSEpisodeOfCare != nil {
|
||||
h.SSEpisodeOfCare.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSImagingStudy != nil {
|
||||
h.SSImagingStudy.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSImmunization != nil {
|
||||
h.SSImmunization.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSMedication != nil {
|
||||
h.SSMedication.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSMedicationDispense != nil {
|
||||
h.SSMedicationDispense.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSMedicationRequest != nil {
|
||||
h.SSMedicationRequest.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSMedicationStatement != nil {
|
||||
h.SSMedicationStatement.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSObservation != nil {
|
||||
h.SSObservation.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSProcedure != nil {
|
||||
h.SSProcedure.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSQuestionnaireResponse != nil {
|
||||
h.SSQuestionnaireResponse.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSServiceRequest != nil {
|
||||
h.SSServiceRequest.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
if h.SSSpecimen != nil {
|
||||
h.SSSpecimen.RegisterRoutes(satuSehatGroup)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user