2025-01-21 18:24:14 +00:00
|
|
|
package client
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"context"
|
2025-03-05 12:05:46 +00:00
|
|
|
|
2025-01-21 18:24:14 +00:00
|
|
|
"queryorchestration/internal/database"
|
|
|
|
|
|
|
|
|
|
"github.com/google/uuid"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func (s *Service) Get(ctx context.Context, id uuid.UUID) (*Client, error) {
|
2025-01-31 13:43:55 +00:00
|
|
|
client, err := s.cfg.GetDBQueries().GetClient(ctx, database.MustToDBUUID(id))
|
2025-01-21 18:24:14 +00:00
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return &Client{
|
|
|
|
|
ID: database.MustToUUID(client.ID),
|
|
|
|
|
Name: client.Name,
|
|
|
|
|
CanSync: client.Cansync,
|
|
|
|
|
}, nil
|
|
|
|
|
}
|