Refactor Tender Management to Introduce Notice Entity and Repository

- Replaced the tender repository with a new notice repository, encapsulating notice-related data access methods.
- Introduced the Notice entity to represent tender/contract notices, including relevant fields and methods for managing notice data.
- Updated the TED scraper to utilize the new notice repository for creating and managing notices, enhancing the integration with the tender management system.
- Implemented Ollama SDK initialization in the web bootstrap process, allowing for improved AI interactions.
- Enhanced the tender service to include Ollama SDK for additional functionality, ensuring a more robust service layer.
This commit is contained in:
n.nakhostin
2025-10-04 15:22:49 +03:30
parent 154610e2a0
commit cc3d6163ed
15 changed files with 1088 additions and 85 deletions
+4 -4
View File
@@ -2,7 +2,7 @@ package schedule
import (
"time"
"tm/internal/tender"
"tm/internal/notice"
"tm/pkg/logger"
"tm/pkg/mongo"
@@ -13,7 +13,7 @@ import (
type CronScheduler struct {
cron *cron.Cron
mongoManager *mongo.ConnectionManager
tenderRepo tender.TenderRepository
noticeRepo notice.Repository
logger logger.Logger
}
@@ -31,14 +31,14 @@ type Job struct {
}
// NewCronScheduler creates a new cron scheduler instance
func NewCronScheduler(logger logger.Logger, mongoManager *mongo.ConnectionManager, tenderRepo tender.TenderRepository) *CronScheduler {
func NewCronScheduler(logger logger.Logger, mongoManager *mongo.ConnectionManager, noticeRepo notice.Repository) *CronScheduler {
// Create cron with timezone support and seconds precision
c := cron.New(cron.WithLocation(time.UTC), cron.WithSeconds())
return &CronScheduler{
cron: c,
mongoManager: mongoManager,
tenderRepo: tenderRepo,
noticeRepo: noticeRepo,
logger: logger,
}
}