translation body update

This commit is contained in:
Mazyar
2026-05-13 14:50:37 +03:30
parent ba9e7483ad
commit 584992f0b6
3 changed files with 33 additions and 18 deletions
+9 -4
View File
@@ -1047,6 +1047,9 @@ func (s *tenderService) TriggerAITranslate(ctx context.Context, id, language str
if t.NoticePublicationID == "" {
return nil, fmt.Errorf("tender has no notice publication ID")
}
if strings.TrimSpace(t.ContractFolderID) == "" {
return nil, fmt.Errorf("tender has no contract folder ID")
}
if tr, ok := t.Translations[targetLanguage]; ok {
return &AITranslateResponse{
@@ -1058,10 +1061,12 @@ func (s *tenderService) TriggerAITranslate(ctx context.Context, id, language str
}
resp, err := s.aiSummarizerClient.FetchTranslationOnDemand(ctx, ai_summarizer.TranslateRequest{
NoticeID: t.NoticePublicationID,
Title: t.Title,
Description: t.Description,
Language: targetLanguage,
NoticeID: t.NoticePublicationID,
ContractFolderID: t.ContractFolderID,
NoticePublicationID: t.NoticePublicationID,
Title: t.Title,
Description: t.Description,
Language: targetLanguage,
})
if err != nil {
s.logger.Error("On-demand AI translation failed", map[string]interface{}{