Private
Public Access
feat: añadida entidad de devoluciones
This commit is contained in:
1 parent
bd65f3477a
commit
a85af05dae
4 files changed
+54
-8
No files matched your search
@@ -0,0 +1,12 @@
|
||||
package models
|
||||
|
||||
type Devolucion struct {
|
||||
Comprobante
|
||||
Motivo string `gorm:"type:varchar(200);not null" json:"motivo"`
|
||||
FacturaOrigen Factura `gorm:"foreignKey:FacturaOrigenID" json:"facturaOrigen"`
|
||||
FacturaOrigenID uint `gorm:"column:facturaOrigenID;not null" json:"facturaOrigenId"`
|
||||
}
|
||||
|
||||
func (Devolucion) TableName() string {
|
||||
return "devolucion"
|
||||
}
|
||||
+16
-3
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"repuestera_back/config"
|
||||
"repuestera_back/models"
|
||||
"repuestera_back/models/contabilidad"
|
||||
"repuestera_back/models/logs"
|
||||
models_seguridad "repuestera_back/models/seguridad"
|
||||
"repuestera_back/repositorios"
|
||||
@@ -25,13 +26,25 @@ func main() {
|
||||
&models_seguridad.Grupo{},
|
||||
// &models_seguridad.Empresa{},
|
||||
&models.Almacen{},
|
||||
&models.Cajon{},
|
||||
&models.Estante{},
|
||||
&models.Marca{},
|
||||
&models.Repuesto{},
|
||||
&models.Stock{},
|
||||
&models.Factura{},
|
||||
&models.OrdenCompra{},
|
||||
&models.Devolucion{},
|
||||
&models.Reserva{},
|
||||
&models.Remito{},
|
||||
&models.NotaCredito{},
|
||||
&models.NotaDebito{},
|
||||
&models.Descuento{},
|
||||
&models.FormaDePago{},
|
||||
&models.Recibo{},
|
||||
&models.Pago{},
|
||||
&models.Proveedor{},
|
||||
&models.Cliente{},
|
||||
&contabilidad.AsientoContable{},
|
||||
&contabilidad.MovimientoContable{},
|
||||
&contabilidad.CuentaContable{},
|
||||
&logs.Log{},
|
||||
); err != nil {
|
||||
log.Fatalf("failed to migrate database: %v", err)
|
||||
@@ -54,7 +67,7 @@ func main() {
|
||||
routes.RepuestoRoute(r)
|
||||
routes.LogsRoute(r)
|
||||
|
||||
fmt.Println("callback registrado:", config.DB.Callback().Create().Get("auditoria:log_create") != nil)
|
||||
fmt.Println("callback registrado:", config.DB.Callback().Create().Get("auditoria:log_create") != nil)
|
||||
|
||||
r.Run(":8080")
|
||||
}
|
||||
@@ -22,6 +22,7 @@ Las siguientes entidades heredan de gorm.Model
|
||||
|
||||
- Cliente
|
||||
- Descuento
|
||||
- Devolucion
|
||||
- FormaPago
|
||||
- Comprobante
|
||||
- Factura
|
||||
@@ -158,8 +159,6 @@ Nombre: string
|
||||
Repuestos: []Repuesto
|
||||
}
|
||||
|
||||
|
||||
|
||||
class "NotaCredito" as NC {
|
||||
Motivo: string
|
||||
FacturaOrigenID: uint
|
||||
@@ -178,6 +177,27 @@ FacturaOrigen: Factura
|
||||
NotaDebito "0..1" --> "1" Factura
|
||||
|
||||
|
||||
class "Devolucion" as DV {
|
||||
Motivo: string
|
||||
FacturaOrigenID: uint
|
||||
FacturaOrigen: Factura
|
||||
Detalles: []DevolucionDetalle
|
||||
}
|
||||
|
||||
Devolucion <|-- Comprobante
|
||||
Devolucion "0..1" <--o "1" Factura
|
||||
|
||||
|
||||
class "DevolucionDetalle" as DVD {
|
||||
RepuestoID: uint64
|
||||
Cantidad: uint
|
||||
PrecioUnitario: float64
|
||||
Subtotal: float64
|
||||
}
|
||||
|
||||
DevolucionDetalle "1" --> "1" Repuesto
|
||||
|
||||
|
||||
class "OrdenCompra" as O {
|
||||
ProveedorId: uint
|
||||
Proveedor: Proveedor
|
||||
@@ -248,7 +268,7 @@ FechaVencimiento: time.Time
|
||||
}
|
||||
|
||||
Reserva "0..*" --> "1" Cliente
|
||||
Repuestos "1..*" --> "1" Reserva
|
||||
Repuesto "1..*" --> "1" Reserva
|
||||
Almacen "1" --> "0..*" Reserva
|
||||
Reserva "1" --> "1" EstadoReserva
|
||||
|
||||
@@ -326,6 +346,7 @@ Comprobante --|> Recibo
|
||||
Comprobante --|> NotaCredito
|
||||
Comprobante --|> NotaDebito
|
||||
Comprobante --|> OrdenCompra
|
||||
Comprobante --|> Devolucion
|
||||
|
||||
|
||||
@enduml
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user