on going chemo plan

This commit is contained in:
vanilia
2025-12-06 03:58:03 +07:00
85 changed files with 2940 additions and 1320 deletions
+1
View File
@@ -22,6 +22,7 @@ type AuthInfo struct {
Pharmachist_Code *string
Intern_Position_Code *string
Roles []string
Sync bool
// User_DivisionPositions []DivisionPosition
}
+23
View File
@@ -0,0 +1,23 @@
package authentication
import (
"net/http"
d "github.com/karincake/dodol"
rw "github.com/karincake/risoles"
sr "github.com/karincake/serabi"
e "simrs-vx/internal/domain/sync-entities/authentication"
)
func CheckCredentialData(input *e.CredentialDto, r *http.Request, w http.ResponseWriter) bool {
input.Source = r.Header.Get("X-Sync-Source")
input.SecretKey = r.Header.Get("X-Sync-SecretKey")
input.UserName = r.Header.Get("X-Sync-UserName")
if err := sr.Validate(input); err != nil {
rw.WriteJSON(w, http.StatusUnauthorized, d.II{"errors": err}, nil)
return false
}
return true
}