feat: harden support, localize knowledge and add operator availability [skip ci]
Source-only publication of reviewed commit 64e96a7f423673dc29ad56485be9fc79bce8af1c.
Passed in isolation: focused frontend/backend tests, race checks, TypeScript typecheck, lint, Go compilation, Flowgram build, and deterministic SDK build/tests.
Not accepted as a production release: Next.js export/native assembly remains blocked by environment memory limits; browser interaction and MySQL staging acceptance remain unverified. No production server, database/schema, runtime configuration, deployment, release tag, or workflow execution was performed.
Expected source tree: 0a4a7528e9.
This commit is contained in:
17
internal/repositories/conversation_dispatch_queries.go
Normal file
17
internal/repositories/conversation_dispatch_queries.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package repositories
|
||||
|
||||
import (
|
||||
"agent-desk/internal/models"
|
||||
"agent-desk/internal/pkg/enums"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// FindPendingDispatchBatch returns a bounded, checked page. A failed read must
|
||||
// not be mistaken for an empty queue by setup or the periodic dispatcher.
|
||||
func (r *conversationRepository) FindPendingDispatchBatch(db *gorm.DB, limit int) ([]models.Conversation, error) {
|
||||
conversations := make([]models.Conversation, 0)
|
||||
err := db.Where("status = ? AND current_assignee_id = ?", enums.IMConversationStatusPending, 0).
|
||||
Order("id DESC").Limit(limit).Find(&conversations).Error
|
||||
return conversations, err
|
||||
}
|
||||
Reference in New Issue
Block a user