Implement Tender ID and Project Name Generation in Notice Worker
- Refactored the NoticeWorker to generate unique tender IDs using the PBL naming convention (SCDYYNNN format) and project names based on client and opportunity details. - Introduced methods for generating tender IDs and project names, including logic for extracting client and opportunity names, ensuring consistency and clarity in naming. - Updated the Tender entity to include a new ProjectName field, enhancing the data structure for better project identification. - Added MongoDB indexing for the new project_name field to optimize query performance. - Improved error handling and logging during the tender ID generation process, ensuring robustness in the worker's functionality.
This commit is contained in:
@@ -44,6 +44,7 @@ func NewRepository(mongoManager *orm.ConnectionManager, logger logger.Logger) Te
|
||||
// Create indexes for tenders collection
|
||||
tenderIndexes := []orm.Index{
|
||||
*orm.CreateUniqueIndex("tender_id_idx", bson.D{{Key: "tender_id", Value: 1}}),
|
||||
*orm.NewIndex("project_name_idx", bson.D{{Key: "project_name", Value: 1}}),
|
||||
*orm.NewIndex("contract_notice_id_idx", bson.D{{Key: "contract_notice_id", Value: 1}}),
|
||||
*orm.NewIndex("status_idx", bson.D{{Key: "status", Value: 1}}),
|
||||
*orm.NewIndex("source_idx", bson.D{{Key: "source", Value: 1}}),
|
||||
|
||||
Reference in New Issue
Block a user