Добавлен чекбокс «Складские цены» (по аналогии с «Аренда»), управляющий показом складских цен во всех ценовых интерфейсах конфигурации, включая CSV-экспорт. «Только наличие» перенесён из настроек цен конфигурации в настройки проекта и активен только при включённых складских ценах. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
45 lines
1.9 KiB
Go
45 lines
1.9 KiB
Go
package services
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"git.mchus.pro/mchus/quoteforge/internal/models"
|
|
)
|
|
|
|
var (
|
|
ErrConfigNotFound = errors.New("configuration not found")
|
|
ErrConfigForbidden = errors.New("access to configuration forbidden")
|
|
)
|
|
|
|
// ConfigurationGetter is an interface for services that can retrieve configurations.
|
|
// Used by handlers to work with LocalConfigurationService.
|
|
type ConfigurationGetter interface {
|
|
GetByUUID(uuid string, ownerUsername string) (*models.Configuration, error)
|
|
GetByUUIDNoAuth(uuid string) (*models.Configuration, error)
|
|
}
|
|
|
|
type CreateConfigRequest struct {
|
|
Name string `json:"name"`
|
|
Items models.ConfigItems `json:"items"`
|
|
ProjectUUID *string `json:"project_uuid,omitempty"`
|
|
CustomPrice *float64 `json:"custom_price"`
|
|
Notes string `json:"notes"`
|
|
IsTemplate bool `json:"is_template"`
|
|
ServerCount int `json:"server_count"`
|
|
ServerModel string `json:"server_model,omitempty"`
|
|
SupportCode string `json:"support_code,omitempty"`
|
|
Article string `json:"article,omitempty"`
|
|
PricelistID *uint `json:"pricelist_id,omitempty"`
|
|
WarehousePricelistID *uint `json:"warehouse_pricelist_id,omitempty"`
|
|
CompetitorPricelistID *uint `json:"competitor_pricelist_id,omitempty"`
|
|
ConfigType string `json:"config_type,omitempty"` // "server" | "storage"
|
|
DisablePriceRefresh bool `json:"disable_price_refresh"`
|
|
}
|
|
|
|
type ArticlePreviewRequest struct {
|
|
Items models.ConfigItems `json:"items"`
|
|
ServerModel string `json:"server_model"`
|
|
SupportCode string `json:"support_code,omitempty"`
|
|
PricelistID *uint `json:"pricelist_id,omitempty"`
|
|
}
|