Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuditLog ¶
type AuditLog struct {
Base
UserID uuid.UUID
User User
OrganizationID uuid.UUID
Organization Organization
Action string `gorm:"not null"`
Details []byte `gorm:"type:jsonb"`
}
AuditLog represents a system audit event
type Base ¶
type Base struct {
ID uuid.UUID `gorm:"type:uuid;primary_key;default:uuid_generate_v4()"`
CreatedAt time.Time
UpdatedAt time.Time
}
Base contains common fields
type Organization ¶
type Organization struct {
Base
Name string `gorm:"not null"`
Type string `gorm:"not null"`
Users []User `gorm:"many2many:user_organizations;"`
Roles []Role
}
Organization represents a group of users
type Payment ¶
type Payment struct {
ID string `db:"id"`
Status PaymentStatus `db:"status"`
Amount string `db:"amount"`
Currency string `db:"currency"`
Description string `db:"description"`
OrderID string `db:"order_id"`
CustomerID string `db:"customer_id"`
CreatedAt time.Time `db:"created_at"`
PaidAt *time.Time `db:"paid_at"`
ExpiresAt *time.Time `db:"expires_at"`
RedirectURL string `db:"redirect_url"`
WebhookURL string `db:"webhook_url"`
Metadata []byte `db:"metadata"` // JSON encoded
}
type PaymentFilter ¶
type PaymentStatus ¶
type PaymentStatus string
const ( PaymentStatusPending PaymentStatus = "pending" PaymentStatusPaid PaymentStatus = "paid" PaymentStatusFailed PaymentStatus = "failed" PaymentStatusCancelled PaymentStatus = "cancelled" PaymentStatusExpired PaymentStatus = "expired" )
type Permission ¶
type Permission struct {
Base
Name string `gorm:"not null"`
Description string
Roles []Role `gorm:"many2many:role_permissions;"`
}
Permission represents an action that can be performed
type Role ¶
type Role struct {
Base
Name string `gorm:"not null"`
Description string
OrganizationID uuid.UUID
Organization Organization
Permissions []Permission `gorm:"many2many:role_permissions;"`
}
Role represents a set of permissions
type User ¶
type User struct {
Base
Email string `gorm:"uniqueIndex;not null"`
Name string `gorm:"not null"`
PasswordHash string `gorm:"not null"`
TwoFactorEnabled bool `gorm:"default:false"`
TwoFactorSecret string
Organizations []Organization `gorm:"many2many:user_organizations;"`
}
User represents a system user
Click to show internal directories.
Click to hide internal directories.