You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: orders_postgres.go
    path of file: ./repos/go-coffeeshop/internal/counter/infras/repo
    
    the code of the file until where you have to start completion: package repo

import (
	"context"
	"database/sql"
	"fmt"
	"strconv"
	"time"

	"github.com/google/uuid"
	"github.com/google/wire"
	"github.com/pkg/errors"
	"github.com/samber/lo"
	"github.com/thangchung/go-coffeeshop/internal/counter/domain"
	"github.com/thangchung/go-coffeeshop/internal/counter/infras/postgresql"
	"github.com/thangchung/go-coffeeshop/internal/counter/usecases/orders"
	shared "github.com/thangchung/go-coffeeshop/internal/pkg/shared_kernel"
	"github.com/thangchung/go-coffeeshop/pkg/postgres"
)

const _defaultEntityCap = 64

type orderRepo struct {
	pg postgres.DBEngine
}

var _ orders.OrderRepo = (*orderRepo)(nil)

var RepositorySet = wire.NewSet(NewOrderRepo)

func NewOrderRepo(pg postgres.DBEngine) orders.OrderRepo {
	return &orderRepo{pg: pg}
}

func (d *orderRepo) GetAll(ctx context.Context) ([]*domain.Order, error) {
	querier := postgresql.New(d.pg.GetDB())

	results, err := querier.GetAll(ctx)
	if err != nil {
		return nil, errors.Wrap(err, "querier.GetAll")
	}

	uniqueResults := lo.UniqBy(results, func(x postgresql.GetAllRow) string {
		return x.ID.String()
	})
	orders := lo.Map(uniqueResults, func(x postgresql.GetAllRow, _ int) *domain.Order {
		return &domain.Order{
			ID:              x.ID,
			OrderSource:     shared.OrderSource(x.OrderSource),
			LoyaltyMemberID: x.LoyaltyMemberID,
			OrderStatus:     shared.Status(x.OrderStatus),
		}
	})
	lineItems := lo.Map(results, func(x postgresql.GetAllRow, _ int) *domain.LineItem {
		priceX, err := strconv.ParseFloat(x.Price, 32)
		if err != nil {
			return nil
		}
		price
    
func (d *orderRepo) GetByID(ctx context.Context, id uuid.UUID) (*domain.Order, error) {
	querier := postgresql.New(d.pg.GetDB())

	results, err := querier.GetByID(ctx, id)
	if err != nil {
		return nil, errors.Wrap(err, "querier.GetAll")
	}

	uniqueResults := lo.UniqBy(results, func(x postgresql.GetByIDRow) string {
		return x.ID.String()
	})

	orders := lo.Map(uniqueResults, func(x postgresql.GetByIDRow, _ int) *domain.Order {
		return &domain.Order{
			ID:              x.ID,
			OrderSource:     shared.OrderSource(x.OrderSource),
			LoyaltyMemberID: x.LoyaltyMemberID,
			OrderStatus:     shared.Status(x.OrderStatus),
		}
	})
	lineItems := lo.Map(results, func(x postgresql.GetByIDRow, _ int) *domain.LineItem {
		priceX, err := strconv.ParseFloat(x.Price, 32)
		if err != nil {
			return nil
		}
		price := float32(priceX)

		return &domain.LineItem{
			ID:             x.LineItemID.UUID,
			ItemType:       shared.ItemType(x.ItemType),
			Name:           x.Name,
			Price:          price,
			ItemStatus:     shared.Status(x.ItemStatus),
			IsBaristaOrder: x.IsBaristaOrder,
			OrderID:        x.ID,
		}
	})

	if len(orders) == 0 {
		return nil, nil
	}

	order := &domain.Order{
		ID:              orders[0].ID,
		OrderSource:     orders[0].OrderSource,
		LoyaltyMemberID: orders[0].LoyaltyMemberID,
		OrderStatus:     orders[0].OrderStatus,
	}

	for _, ol := range lineItems {
		order.LineItems = append(order.LineItems, &domain.LineItem{
			ID:             ol.ID,
			ItemType:       ol.ItemType,
			Name:           ol.Name,
			Price:          ol.Price,
			ItemStatus:     ol.ItemStatus,
			IsBaristaOrder: ol.IsBaristaOrder,
		})
	}

	return order, nil
}