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.
This commit is contained in:
Nima Nakhostin
2025-11-29 10:11:51 +03:30
parent c1e1e211e5
commit e2e9159ac3
+2 -2
View File
@@ -142,13 +142,13 @@ func (r *noticeRepository) GetByContractNoticeID(ctx context.Context, contractNo
// GetUnProcessedNotices retrieves unprocessed notices // GetUnProcessedNotices retrieves unprocessed notices
func (r *noticeRepository) GetUnProcessedNotices(ctx context.Context, limit int, skip int) ([]Notice, int64, error) { 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{ pagination := orm.Pagination{
Limit: limit, Limit: limit,
Skip: skip, Skip: skip,
SortField: "created_at", SortField: "created_at",
SortOrder: 1, SortOrder: -1,
} }
result, err := r.ormRepo.FindAll(ctx, filter, pagination) result, err := r.ormRepo.FindAll(ctx, filter, pagination)