supplier

package
v0.0.0-...-241bfea Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ProtoSupplierTypeToString

func ProtoSupplierTypeToString(t proto.SupplierType) (string, error)

func StringToProtoSupplierType

func StringToProtoSupplierType(s string) (proto.SupplierType, error)

Types

type ProductProvider

type ProductProvider interface {
	ProductsContext(ctx context.Context, ids *[]int32) ([]*protoproduct.Product, error)
}

type Repository

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

func NewRepository

func NewRepository(database *postgres.Database, productProvider ProductProvider) *Repository

func (*Repository) CreateSupplierContext

func (r *Repository) CreateSupplierContext(
	ctx context.Context,
	name string,
) (int32, error)

func (*Repository) ProductSuppliersContext

func (r *Repository) ProductSuppliersContext(ctx context.Context, supplierID *int32) ([]*proto.ProductSupplier, error)

func (*Repository) SupplierContext

func (r *Repository) SupplierContext(ctx context.Context, id int32) (*proto.Supplier, error)

func (*Repository) SuppliersContext

func (r *Repository) SuppliersContext(ctx context.Context) ([]*proto.Supplier, error)

func (*Repository) UpdateSupplierContext

func (r *Repository) UpdateSupplierContext(ctx context.Context, supplier *proto.Supplier) error

Jump to

Keyboard shortcuts

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