Split contract package

This commit is contained in:
2025-08-12 14:19:42 +03:00
parent e1cb261570
commit bb3247d391
3 changed files with 31 additions and 28 deletions

View File

@@ -1,33 +1,5 @@
package contract
import (
"fmt"
"time"
"git.vakhrushev.me/av/transcriber/internal/entity"
)
type JobNotFoundError struct {
State string
Message string
}
func (e *JobNotFoundError) Error() string {
return fmt.Sprintf("%s - %s", e.State, e.Message)
}
type FileRepository interface {
Create(file *entity.File) error
GetByID(id string) (*entity.File, error)
}
type TranscriptJobRepository interface {
Create(job *entity.TranscribeJob) error
Save(job *entity.TranscribeJob) error
GetByID(id string) (*entity.TranscribeJob, error)
FindAndAcquire(state, acquisitionId string, rottingTime time.Time) (*entity.TranscribeJob, error)
}
type ObjectStorage interface {
}

View File

@@ -0,0 +1,12 @@
package contract
import "fmt"
type JobNotFoundError struct {
State string
Message string
}
func (e *JobNotFoundError) Error() string {
return fmt.Sprintf("%s - %s", e.State, e.Message)
}

View File

@@ -0,0 +1,19 @@
package contract
import (
"time"
"git.vakhrushev.me/av/transcriber/internal/entity"
)
type FileRepository interface {
Create(file *entity.File) error
GetByID(id string) (*entity.File, error)
}
type TranscriptJobRepository interface {
Create(job *entity.TranscribeJob) error
Save(job *entity.TranscribeJob) error
GetByID(id string) (*entity.TranscribeJob, error)
FindAndAcquire(state, acquisitionId string, rottingTime time.Time) (*entity.TranscribeJob, error)
}