Files
online-backend/internal/currency/storage.go
GuwandykA d3e188affe
Some checks failed
CI/CD / Vet, test, build (push) Has been cancelled
CI/CD / Docker image (push) Has been cancelled
CI/CD / Deploy binary to server (push) Has been cancelled
ch logika
2026-09-18 11:53:37 +05:00

20 lines
693 B
Go

package currency
import (
"context"
"errors"
)
// ErrDuplicate is returned by Repository.Create/Update when the
// currency_from/currency_to pair already exists among active (non-deleted)
// rows, so the handler can respond with a clean 409 instead of a raw 500.
var ErrDuplicate = errors.New("currency pair already exists")
type Repository interface {
List(ctx context.Context, filter ListFilter) (ListCurrencyDTO, error)
GetByID(ctx context.Context, id int64) (CurrencyDTO, error)
Create(ctx context.Context, dto CreateCurrencyDTO) (CurrencyDTO, error)
Update(ctx context.Context, id int64, dto UpdateCurrencyDTO) (CurrencyDTO, error)
Delete(ctx context.Context, id int64) error
}