This commit is contained in:
Aditya Siregar
2025-08-09 23:44:03 +07:00
parent 61d6eed373
commit de60983e4e
24 changed files with 493 additions and 153 deletions
+6
View File
@@ -2,6 +2,12 @@ package contract
import "time"
const (
SettingIncomingLetterPrefix = "INCOMING_LETTER_PREFIX"
SettingIncomingLetterSequence = "INCOMING_LETTER_SEQUENCE"
SettingIncomingLetterRecipients = "INCOMING_LETTER_RECIPIENTS"
)
type ErrorResponse struct {
Error string `json:"error"`
Message string `json:"message"`
+18 -13
View File
@@ -39,21 +39,23 @@ type LoginRequest struct {
}
type LoginResponse struct {
Token string `json:"token"`
ExpiresAt time.Time `json:"expires_at"`
User UserResponse `json:"user"`
Roles []RoleResponse `json:"roles"`
Permissions []string `json:"permissions"`
Positions []PositionResponse `json:"positions"`
Token string `json:"token"`
ExpiresAt time.Time `json:"expires_at"`
User UserResponse `json:"user"`
Roles []RoleResponse `json:"roles"`
Permissions []string `json:"permissions"`
Departments []DepartmentResponse `json:"departments"`
}
type UserResponse struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
IsActive bool `json:"is_active"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Roles []RoleResponse `json:"roles,omitempty"`
Profile *UserProfileResponse `json:"profile,omitempty"`
}
type ListUsersRequest struct {
@@ -61,6 +63,8 @@ type ListUsersRequest struct {
Limit int `json:"limit" validate:"min=1,max=100"`
Role *string `json:"role,omitempty"`
IsActive *bool `json:"is_active,omitempty"`
Search *string `json:"search,omitempty"`
RoleCode *string `json:"role_code,omitempty"`
}
type ListUsersResponse struct {
@@ -74,7 +78,7 @@ type RoleResponse struct {
Code string `json:"code"`
}
type PositionResponse struct {
type DepartmentResponse struct {
ID uuid.UUID `json:"id"`
Name string `json:"name"`
Code string `json:"code"`
@@ -97,6 +101,7 @@ type UserProfileResponse struct {
LastSeenAt *time.Time `json:"last_seen_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
Roles []RoleResponse `json:"roles"`
}
type UpdateUserProfileRequest struct {