package shipment_status_log

import (
	"context"
	"github.com/UpmeshLTD/urus-aio/infrastructure/db/entities"
	"github.com/UpmeshLTD/urus-aio/shipment/db/gormdb"
)

type Service interface {
	GetList(ctx context.Context, courierTrackingID string) ([]*entities.ShipmentStatusLog, error)
}

type serviceImpl struct {
	db   gormdb.GormDB
	repo Repository
}

func NewService(
	db gormdb.GormDB,
	repo Repository,
) Service {
	return &serviceImpl{
		db:   db,
		repo: repo,
	}
}

func (s serviceImpl) GetList(ctx context.Context, courierTrackingID string) ([]*entities.ShipmentStatusLog, error) {
	return s.repo.GetList(ctx, s.db.DB(), courierTrackingID)
}
