package repository import "errors" // ErrStoreScopeRequired is returned when a store-scoped write or list has no shop. var ErrStoreScopeRequired = errors.New("store scope is required") // StoreScope identifies the shop for a repository call. type StoreScope struct { TenantID int64 StoreID int64 } // Valid reports whether both tenant and store identifiers are present. func (s StoreScope) Valid() bool { return s.TenantID > 0 && s.StoreID > 0 } func requireWriteScope(scope StoreScope) error { if !scope.Valid() { return ErrStoreScopeRequired } return nil }