From e2e9159ac39c23ea845270361371d1a60c4054f9 Mon Sep 17 00:00:00 2001 From: Nima Nakhostin Date: Sat, 29 Nov 2025 10:11:51 +0330 Subject: [PATCH] Update GetUnProcessedNotices to filter by main_classification and change sort order - Modified the GetUnProcessedNotices method in the notice repository to include a filter for main_classification set to "72000000". - Changed the sort order from ascending to descending for the created_at field, improving the retrieval of unprocessed notices. --- internal/notice/repository.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/notice/repository.go b/internal/notice/repository.go index 3b66ca0..6a4aa27 100644 --- a/internal/notice/repository.go +++ b/internal/notice/repository.go @@ -142,13 +142,13 @@ func (r *noticeRepository) GetByContractNoticeID(ctx context.Context, contractNo // GetUnProcessedNotices retrieves unprocessed notices func (r *noticeRepository) GetUnProcessedNotices(ctx context.Context, limit int, skip int) ([]Notice, int64, error) { - filter := bson.M{"processing_metadata.processed": false} + filter := bson.M{"processing_metadata.processed": false, "main_classification": "72000000"} pagination := orm.Pagination{ Limit: limit, Skip: skip, SortField: "created_at", - SortOrder: 1, + SortOrder: -1, } result, err := r.ormRepo.FindAll(ctx, filter, pagination)