dolar from gitea

This commit is contained in:
maximo tejeda 2024-12-02 15:24:35 -04:00
parent 1113c9a597
commit 3f5366770d

View File

@ -3,13 +3,13 @@ package dolar
import ( import (
"context" "context"
"github.com/maximotejeda/dolar/proto/golang/dolar" dl "github.com/maximotejeda/dolar/proto/golang/dolar"
"github.com/maximotejeda/us_dop_scrapper/internal/application/core/domain" "github.com/maximotejeda/us_dop_scrapper/internal/application/core/domain"
"google.golang.org/grpc" "google.golang.org/grpc"
) )
type Adapter struct { type Adapter struct {
dolar dolar.DollarClient dolar dl.DollarClient
conn *grpc.ClientConn conn *grpc.ClientConn
} }
@ -20,8 +20,8 @@ func NewAdapter(conn *grpc.ClientConn) (*Adapter, error) {
func (a *Adapter) NewHistory(history *domain.History) error { func (a *Adapter) NewHistory(history *domain.History) error {
_, err := a.dolar.NewHistory(context.Background(), _, err := a.dolar.NewHistory(context.Background(),
&dolar.AddDolarRequest{ &dl.AddDolarRequest{
Institution: &dolar.History{ Institution: &dl.History{
Name: history.Name, Name: history.Name,
Compra: float32(history.Compra), Compra: float32(history.Compra),
Venta: float32(history.Venta), Venta: float32(history.Venta),