Private
Public Access
28 lines
657 B
Go
28 lines
657 B
Go
package directors
|
|
|
|
import (
|
|
builders "repuestera_back/dto/Builders"
|
|
dto "repuestera_back/dto/Descuentos"
|
|
"repuestera_back/models"
|
|
)
|
|
|
|
type DescuentoDirector struct{}
|
|
|
|
func NewDescuentoDirector() *DescuentoDirector {
|
|
return &DescuentoDirector{}
|
|
}
|
|
|
|
func (d *DescuentoDirector) Crear(data dto.DescuentoDto) (*models.Descuento, error) {
|
|
return builders.NewDescuentoBuilder().
|
|
ConDto(data).
|
|
ConActivoPorDefecto(true).
|
|
Build()
|
|
}
|
|
|
|
func (d *DescuentoDirector) Actualizar(data dto.DescuentoDto, activoPorDefecto bool) (*models.Descuento, error) {
|
|
return builders.NewDescuentoBuilder().
|
|
ConDto(data).
|
|
ConActivoPorDefecto(activoPorDefecto).
|
|
Build()
|
|
}
|