feat: add CPONE patient registration endpoint

This commit is contained in:
2026-09-07 16:25:32 +07:00
parent aae3c733ae
commit c5a959742b
11 changed files with 665 additions and 79 deletions

View File

@@ -13,6 +13,7 @@ type Config struct {
AppHost string
AppPort string
RSCode string
DepartmentID string
BearerToken string
DBMaxOpenConns int
DBMaxIdleConns int
@@ -33,6 +34,7 @@ func Load(path string) (Config, error) {
AppHost: env("APP_HOST", "0.0.0.0"),
AppPort: env("APP_PORT", "8080"),
RSCode: env("CPONE_RS_CODE", ""),
DepartmentID: env("CPONE_DEPARTEMEN_ID", ""),
BearerToken: env("CPONE_BEARER_TOKEN", ""),
DBMaxOpenConns: envInt("DB_MAX_OPEN_CONNS", 25),
DBMaxIdleConns: envInt("DB_MAX_IDLE_CONNS", 25),
@@ -47,6 +49,9 @@ func Load(path string) (Config, error) {
if cfg.RSCode == "" {
return Config{}, fmt.Errorf("CPONE_RS_CODE wajib diisi")
}
if cfg.DepartmentID == "" {
return Config{}, fmt.Errorf("CPONE_DEPARTEMEN_ID wajib diisi")
}
if cfg.BearerToken == "" {
return Config{}, fmt.Errorf("CPONE_BEARER_TOKEN wajib diisi")
}