Private
Public Access
29 lines
847 B
Go
29 lines
847 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"gorm.io/datatypes"
|
|
)
|
|
|
|
type Remito struct {
|
|
Comprobante
|
|
FechaEmision time.Time `gorm:"not null" json:"fechaEmision"`
|
|
TipoOperacion TipoOperacion `gorm:"type:varchar(20);not null" json:"tipoOperacion"`
|
|
EmisorID uint `gorm:"not null" json:"emisorId"`
|
|
ReceptorID uint `gorm:"not null" json:"receptorId"`
|
|
|
|
AlmacenOrigenID *string `gorm:"column:almacen_origen_id;type:varchar(5)" json:"almacenOrigenId,omitempty"`
|
|
AlmacenOrigen *Almacen `gorm:"foreignKey:AlmacenOrigenID" json:"almacenOrigen,omitempty"`
|
|
|
|
Detalles datatypes.JSONSlice[RemitoDetalle] `gorm:"type:json" json:"detalles,omitempty"`
|
|
}
|
|
|
|
type TipoOperacion string
|
|
|
|
const (
|
|
OperacionCompra TipoOperacion = "COMPRA"
|
|
OperacionVenta TipoOperacion = "VENTA"
|
|
OperacionMovimiento TipoOperacion = "MOVIMIENTO"
|
|
)
|