order

package
v0.0.0-...-fc1d3c0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotFound = errors.New("order not found")

ErrNotFound is returned when an order is missing.

Module provides the order repository to Fx.

Functions

This section is empty.

Types

type Repository

type Repository struct {
	// contains filtered or unexported fields
}

Repository encapsulates read/write access for orders.

func NewRepository

func NewRepository(conns *database.Connections) *Repository

NewRepository wires a repository backed by configured database connections.

func (*Repository) Create

func (r *Repository) Create(ctx context.Context, order *entity.Order) error

Create persists a new order using the write connection.

func (*Repository) GetByID

func (r *Repository) GetByID(ctx context.Context, id int64) (*entity.Order, error)

GetByID fetches an order by primary key using the read replica when available.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL