Add PDF reports, file uploads, admin auth, and comprehensive tests
Features: - PDF service for generating task reports with ReportLab-style formatting - Storage service for file uploads (local and S3-compatible) - Admin authentication middleware with JWT support - Admin user model and repository Infrastructure: - Updated Docker configuration for admin panel builds - Email service enhancements for task notifications - Updated router with admin and file upload routes - Environment configuration updates Tests: - Unit tests for handlers (auth, residence, task) - Unit tests for models (user, residence, task) - Unit tests for repositories (user, residence, task) - Unit tests for services (residence, task) - Integration test setup - Test utilities for mocking database and services Database: - Admin user seed data - Updated test data seeds 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ type UserResponse struct {
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
IsActive bool `json:"is_active"`
|
||||
Verified bool `json:"verified"`
|
||||
DateJoined time.Time `json:"date_joined"`
|
||||
LastLogin *time.Time `json:"last_login,omitempty"`
|
||||
}
|
||||
@@ -90,6 +91,10 @@ type ErrorResponse struct {
|
||||
|
||||
// NewUserResponse creates a UserResponse from a User model
|
||||
func NewUserResponse(user *models.User) UserResponse {
|
||||
verified := false
|
||||
if user.Profile != nil {
|
||||
verified = user.Profile.Verified
|
||||
}
|
||||
return UserResponse{
|
||||
ID: user.ID,
|
||||
Username: user.Username,
|
||||
@@ -97,6 +102,7 @@ func NewUserResponse(user *models.User) UserResponse {
|
||||
FirstName: user.FirstName,
|
||||
LastName: user.LastName,
|
||||
IsActive: user.IsActive,
|
||||
Verified: verified,
|
||||
DateJoined: user.DateJoined,
|
||||
LastLogin: user.LastLogin,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user