добавил ручки для фронта

This commit is contained in:
2025-11-30 02:02:11 +03:00
parent da62ea5b98
commit 714844058f
9 changed files with 99 additions and 9 deletions

View File

@@ -67,7 +67,6 @@ func (s *Service) ProcessReceiptImage(ctx context.Context, imgData []byte) ([]Pr
} else {
// Если не нашли, пробуем найти точное совпадение по имени в каталоге (на всякий случай)
// (В реальном проекте тут может быть нечеткий поиск, но пока точный)
// TODO: Добавить метод FindByName в репозиторий каталога, если нужно
}
processed = append(processed, item)
@@ -118,6 +117,11 @@ func (s *Service) SaveMapping(rawName string, productID uuid.UUID) error {
return s.ocrRepo.SaveMatch(rawName, productID)
}
// GetKnownMatches возвращает список всех обученных связей
func (s *Service) GetKnownMatches() ([]ocr.ProductMatch, error) {
return s.ocrRepo.GetAllMatches()
}
// FindKnownMatch ищет, знаем ли мы уже этот товар
func (s *Service) FindKnownMatch(rawName string) (*uuid.UUID, error) {
return s.ocrRepo.FindMatch(rawName)