Documentation
¶
Index ¶
- type Batch
- type BatchEvent
- type BatchIngredient
- type PostgreSQLGORMRepository
- func (r *PostgreSQLGORMRepository) Create(ctx context.Context, batch Batch) (*Batch, error)
- func (r *PostgreSQLGORMRepository) DeleteByID(ctx context.Context, id uuid.UUID) error
- func (r *PostgreSQLGORMRepository) GetByID(ctx context.Context, id uuid.UUID) (*Batch, error)
- func (r *PostgreSQLGORMRepository) GetByName(ctx context.Context, name string) (*Batch, error)
- func (r *PostgreSQLGORMRepository) List(ctx context.Context) ([]Batch, error)
- func (r *PostgreSQLGORMRepository) Migrate(ctx context.Context) error
- func (r *PostgreSQLGORMRepository) Update(ctx context.Context, batch Batch) (*Batch, error)
- type Repository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Batch ¶
type Batch struct { Id uuid.UUID `json:"id"` Name string `json:"name"` CacaoPercentage float32 `json:"cacao_percentage"` Output int `json:"output"` Ingredients []BatchIngredient `json:"ingredients"` History []BatchEvent `json:"history"` Notes string `json:"notes"` AptForProduction bool `json:"apt_for_production"` }
func (*Batch) AddIngredient ¶
func (b *Batch) AddIngredient(i BatchIngredient)
func (*Batch) MarkAptForProduction ¶
func (b *Batch) MarkAptForProduction()
func (*Batch) RemoveAptForProduction ¶
func (b *Batch) RemoveAptForProduction()
type BatchEvent ¶
type BatchIngredient ¶
type PostgreSQLGORMRepository ¶
type PostgreSQLGORMRepository struct {
// contains filtered or unexported fields
}
func NewPostgreSQLGORMRepository ¶
func NewPostgreSQLGORMRepository(db *gorm.DB) *PostgreSQLGORMRepository
func (*PostgreSQLGORMRepository) DeleteByID ¶
func (*PostgreSQLGORMRepository) List ¶
func (r *PostgreSQLGORMRepository) List(ctx context.Context) ([]Batch, error)
type Repository ¶
type Repository interface { Migrate(ctx context.Context) error Create(ctx context.Context, batch Batch) (*Batch, error) List(ctx context.Context) ([]Batch, error) GetByID(ctx context.Context, id uuid.UUID) (*Batch, error) GetByName(ctx context.Context, name string) (*Batch, error) Update(ctx context.Context, batch Batch) (*Batch, error) DeleteByID(ctx context.Context, id uuid.UUID) error }
Click to show internal directories.
Click to hide internal directories.