(Feat): Initial Commit
Some checks failed
Build & Test / build-test (push) Has been cancelled
Build & Test / swagger-codegen-cli (push) Has been cancelled
CodeQL / Analyze (go) (push) Has been cancelled

This commit is contained in:
2026-07-03 19:41:31 +05:30
commit 7e940c83a7
461 changed files with 45002 additions and 0 deletions

View File

@@ -0,0 +1,32 @@
package mapper
import (
"allaboutapps.dev/aw/go-starter/internal/data/dto"
"allaboutapps.dev/aw/go-starter/internal/models"
)
func LocalAppUserProfileToDTO(appUserProfile *models.AppUserProfile) dto.AppUserProfile {
return dto.AppUserProfile{
UserID: appUserProfile.UserID,
LegalAcceptedAt: appUserProfile.LegalAcceptedAt,
UpdatedAt: appUserProfile.UpdatedAt,
}
}
func LocalUserToDTO(user *models.User) dto.User {
result := dto.User{
ID: user.ID,
Username: user.Username,
IsActive: user.IsActive,
Scopes: user.Scopes,
LastAuthenticatedAt: user.LastAuthenticatedAt,
UpdatedAt: user.UpdatedAt,
PasswordHash: user.Password,
}
if user.R != nil && user.R.AppUserProfile != nil {
result.Profile = LocalAppUserProfileToDTO(user.R.AppUserProfile).Ptr()
}
return result
}