Files
query-orchestration/internal/document/version.go
T
Michael McGuinness 24a038ec3d Merged in feature/doctextstructure (pull request #56)
DocTextRunner Structure

* firstround

* shorttests
2025-02-07 14:15:06 +00:00

49 lines
942 B
Go

package document
import (
"fmt"
"github.com/google/uuid"
)
type IsTextExtractedParams struct {
DocumentID uuid.UUID
MinCleanVersion int32
MinTextVersion int32
}
func (s *Service) IsTextExtracted(params *IsTextExtractedParams) error {
// TODO
return nil
}
func (s *Service) GetCleanVersion() int32 {
// TODO - actual version
return 1
}
func (s *Service) GetTextVersion() int32 {
// TODO - actual version
return 1
}
func (s *Service) IsValidCleanVersion(v int32) error {
currentVersion := s.GetCleanVersion()
if v < 1 || v > currentVersion {
return fmt.Errorf("document clean code version must be in the range 0 < version <= %d", currentVersion)
}
return nil
}
func (s *Service) IsValidTextVersion(v int32) error {
currentVersion := s.GetTextVersion()
if v < 1 || v > currentVersion {
return fmt.Errorf("document text code version must be in the range 0 < version <= %d", currentVersion)
}
return nil
}