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:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user