package service

import (
	"context"
	"fmt"

	expenseRepo "gitlab.com/mbugroup/lti-api.git/internal/modules/expenses/repositories"
)

// GenerateExpenseReferenceNumber builds a new reference number using the expense sequence.
func GenerateExpenseReferenceNumber(ctx context.Context, repo expenseRepo.ExpenseRepository) (string, error) {
	sequence, err := repo.GetNextSequence(ctx)
	if err != nil {
		return "", err
	}
	return fmt.Sprintf("BOP-LTI-%05d", sequence), nil
}
