productbatch

package
v0.0.0-...-e85e4ab Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SqlReportBatchAll = "" /* 140-byte string literal not displayed */

	SqlReportBatchByID = "" /* 163-byte string literal not displayed */

	SqlCreateBatch = "" /* 232-byte string literal not displayed */

	SqlGetByBatchNum = "SELECT batch_number FROM product_batches WHERE batch_number = ?"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ProductBatch

type ProductBatch struct {
	ID              int    `json:"id"`
	BatchNumber     int    `json:"batch_number"`
	CurQuantity     int    `json:"current_quantity"`
	CurTemperature  int    `json:"current_temperature"`
	DueDate         string `json:"due_date"`
	InitialQuantity int    `json:"initial_quantity"`
	ManufactDate    string `json:"manufacturing_date"`
	ManufactHour    int    `json:"manufacturing_hour"`
	MinTemperature  int    `json:"minimum_temperature"`
	ProductTypeID   int    `json:"product_id" binding:"required"`
	SectionID       int    `json:"section_id" binding:"required"`
}

type Report

type Report struct {
	SecID     int `json:"section_id"`
	SecNum    int `json:"section_number"`
	ProdCount int `json:"products_count"`
}

type Repository

type Repository interface {
	Create(ctx context.Context, pb ProductBatch) (ProductBatch, error)
	Report(ctx context.Context) ([]Report, error)
	ReportByID(ctx context.Context, id int) (Report, error)
	GetByBatchNum(ctx context.Context, bn int) (ProductBatch, error)
}

func NewRepository

func NewRepository(db *sql.DB) Repository

type Services

type Services interface {
	Report(ctx context.Context) ([]Report, error)
	ReportByID(ctx context.Context, id int) (Report, error)
	Create(ctx context.Context, pb ProductBatch) (ProductBatch, error)
}

func NewService

func NewService(r Repository) Services

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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