Add job helpers

This commit is contained in:
2025-08-12 11:09:51 +03:00
parent 2c9a5f4bfb
commit 394970e400
2 changed files with 14 additions and 6 deletions

View File

@@ -40,3 +40,14 @@ func (j *TranscribeJob) MoveToStateAndDelay(state string, delay *time.Time) {
j.DelayTime = delay
j.UpdatedAt = time.Now()
}
func (j *TranscribeJob) Done(transcriptionText string) {
j.MoveToState(StateDone)
j.TranscriptionText = &transcriptionText
}
func (j *TranscribeJob) Fail(errText string) {
j.MoveToState(StateFailed)
j.IsError = true
j.ErrorText = &errText
}