mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 13:31:56 +00:00
18 lines
471 B
Go
18 lines
471 B
Go
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
|
|
}
|