mirror of
https://github.com/serty2005/rmser.git
synced 2026-02-04 19:02:33 -06:00
Перевел на multi-tenant
Добавил поставщиков Накладные успешно создаются из фронта
This commit is contained in:
@@ -11,10 +11,11 @@ import (
|
||||
|
||||
// Recipe - Технологическая карта
|
||||
type Recipe struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
|
||||
ProductID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
DateFrom time.Time `gorm:"index"`
|
||||
DateTo *time.Time
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;"`
|
||||
RMSServerID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
ProductID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
DateFrom time.Time `gorm:"index"`
|
||||
DateTo *time.Time
|
||||
|
||||
Product catalog.Product `gorm:"foreignKey:ProductID"`
|
||||
Items []RecipeItem `gorm:"foreignKey:RecipeID;constraint:OnDelete:CASCADE"`
|
||||
@@ -22,11 +23,12 @@ type Recipe struct {
|
||||
|
||||
// RecipeItem - Ингредиент
|
||||
type RecipeItem struct {
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()"`
|
||||
RecipeID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
ProductID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
AmountIn decimal.Decimal `gorm:"type:numeric(19,4);not null"`
|
||||
AmountOut decimal.Decimal `gorm:"type:numeric(19,4);not null"`
|
||||
ID uuid.UUID `gorm:"type:uuid;primary_key;default:gen_random_uuid()"`
|
||||
RMSServerID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
RecipeID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
ProductID uuid.UUID `gorm:"type:uuid;not null;index"`
|
||||
AmountIn decimal.Decimal `gorm:"type:numeric(19,4);not null"`
|
||||
AmountOut decimal.Decimal `gorm:"type:numeric(19,4);not null"`
|
||||
|
||||
Product catalog.Product `gorm:"foreignKey:ProductID"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user