54 lines
1.5 KiB
Go
54 lines
1.5 KiB
Go
package model
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
type OrganizationAccess struct {
|
|
Organizations []Organization `json:"organizations"`
|
|
DefaultOrganizationID *int64 `json:"default_organization_id"`
|
|
}
|
|
|
|
type OrganizationAuditLog struct {
|
|
ID int64 `json:"id"`
|
|
ActorUserID int64 `json:"actor_user_id"`
|
|
OrganizationID *int64 `json:"organization_id"`
|
|
Action string `json:"action"`
|
|
OldValue json.RawMessage `json:"old_value"`
|
|
NewValue json.RawMessage `json:"new_value"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
}
|
|
|
|
type Organization struct {
|
|
ID int64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
Status string `json:"status"`
|
|
DefaultTimezone string `json:"default_timezone"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Role struct {
|
|
ID int64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
Enabled bool `json:"enabled"`
|
|
Permissions []Permission `json:"permissions"`
|
|
CreatedAt time.Time `json:"created_at"`
|
|
UpdatedAt time.Time `json:"updated_at"`
|
|
}
|
|
|
|
type Permission struct {
|
|
ID int64 `json:"id"`
|
|
Code string `json:"code"`
|
|
Name string `json:"name"`
|
|
}
|
|
|
|
type UpdateRoleRequest struct {
|
|
Name string `json:"name" binding:"required"`
|
|
Enabled bool `json:"enabled"`
|
|
PermissionCodes []string `json:"permission_codes"`
|
|
}
|