From ca4d483f2c8b8017f474ab49441d9b7b0a60179d Mon Sep 17 00:00:00 2001 From: Rostislav Dugin Date: Fri, 13 Mar 2026 17:47:46 +0300 Subject: [PATCH] REFACTOR (golines): Apply golines fixes --- backend/internal/config/config.go | 2 +- backend/internal/features/backups/config/model.go | 2 +- backend/internal/features/intervals/model.go | 6 +++--- backend/internal/features/users/models/users_settings.go | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/backend/internal/config/config.go b/backend/internal/config/config.go index bdbc76b..e2f7ff0 100644 --- a/backend/internal/config/config.go +++ b/backend/internal/config/config.go @@ -29,7 +29,7 @@ type EnvVariables struct { MongodbInstallDir string `env:"MONGODB_INSTALL_DIR"` // Internal database - DatabaseDsn string `env:"DATABASE_DSN" required:"true"` + DatabaseDsn string `env:"DATABASE_DSN" required:"true"` // Internal Valkey ValkeyHost string `env:"VALKEY_HOST" required:"true"` ValkeyPort string `env:"VALKEY_PORT" required:"true"` diff --git a/backend/internal/features/backups/config/model.go b/backend/internal/features/backups/config/model.go index 57fbc0c..d0f0430 100644 --- a/backend/internal/features/backups/config/model.go +++ b/backend/internal/features/backups/config/model.go @@ -43,7 +43,7 @@ type BackupConfig struct { Encryption BackupEncryption `json:"encryption" gorm:"column:encryption;type:text;not null;default:'NONE'"` // MaxBackupSizeMB limits individual backup size. 0 = unlimited. - MaxBackupSizeMB int64 `json:"maxBackupSizeMb" gorm:"column:max_backup_size_mb;type:int;not null"` + MaxBackupSizeMB int64 `json:"maxBackupSizeMb" gorm:"column:max_backup_size_mb;type:int;not null"` // MaxBackupsTotalSizeMB limits total size of all backups. 0 = unlimited. MaxBackupsTotalSizeMB int64 `json:"maxBackupsTotalSizeMb" gorm:"column:max_backups_total_size_mb;type:int;not null"` } diff --git a/backend/internal/features/intervals/model.go b/backend/internal/features/intervals/model.go index d852e17..77c6d13 100644 --- a/backend/internal/features/intervals/model.go +++ b/backend/internal/features/intervals/model.go @@ -13,11 +13,11 @@ type Interval struct { ID uuid.UUID `json:"id" gorm:"primaryKey;type:uuid;default:gen_random_uuid()"` Interval IntervalType `json:"interval" gorm:"type:text;not null"` - TimeOfDay *string `json:"timeOfDay" gorm:"type:text;"` + TimeOfDay *string `json:"timeOfDay" gorm:"type:text;"` // only for WEEKLY - Weekday *int `json:"weekday,omitempty" gorm:"type:int"` + Weekday *int `json:"weekday,omitempty" gorm:"type:int"` // only for MONTHLY - DayOfMonth *int `json:"dayOfMonth,omitempty" gorm:"type:int"` + DayOfMonth *int `json:"dayOfMonth,omitempty" gorm:"type:int"` // only for CRON CronExpression *string `json:"cronExpression,omitempty" gorm:"type:text"` } diff --git a/backend/internal/features/users/models/users_settings.go b/backend/internal/features/users/models/users_settings.go index 5e75d8a..23c882a 100644 --- a/backend/internal/features/users/models/users_settings.go +++ b/backend/internal/features/users/models/users_settings.go @@ -3,11 +3,11 @@ package users_models import "github.com/google/uuid" type UsersSettings struct { - ID uuid.UUID `json:"id" gorm:"type:uuid;primary_key;default:gen_random_uuid()"` + ID uuid.UUID `json:"id" gorm:"type:uuid;primary_key;default:gen_random_uuid()"` // means that any user can register via sign up form without invitation - IsAllowExternalRegistrations bool `json:"isAllowExternalRegistrations" gorm:"column:is_allow_external_registrations"` + IsAllowExternalRegistrations bool `json:"isAllowExternalRegistrations" gorm:"column:is_allow_external_registrations"` // means that any user with role MEMBER can invite other users - IsAllowMemberInvitations bool `json:"isAllowMemberInvitations" gorm:"column:is_allow_member_invitations"` + IsAllowMemberInvitations bool `json:"isAllowMemberInvitations" gorm:"column:is_allow_member_invitations"` // means that any user with role MEMBER can create their own workspaces IsMemberAllowedToCreateWorkspaces bool `json:"isMemberAllowedToCreateWorkspaces" gorm:"column:is_member_allowed_to_create_workspaces"` }