reconcile and rep ids sorted
This commit is contained in:
parent
ede7884b31
commit
e0911df455
5 changed files with 112 additions and 12 deletions
17
fakes.go
17
fakes.go
|
|
@ -6,8 +6,23 @@ import (
|
|||
|
||||
type fakeST struct {
|
||||
dept string
|
||||
err error
|
||||
chapterID int64
|
||||
err error
|
||||
|
||||
agents map[int64]int64 // userID → existing agent, 0 or absent = none
|
||||
assigned map[int64]int64 // recorded writes
|
||||
}
|
||||
|
||||
func (f *fakeST) ActiveAgent(ctx context.Context, userID int64) (int64, error) {
|
||||
return f.agents[userID], nil
|
||||
}
|
||||
|
||||
func (f *fakeST) AssignAgent(ctx context.Context, userID, agentID int64) error {
|
||||
if f.assigned == nil {
|
||||
f.assigned = map[int64]int64{}
|
||||
}
|
||||
f.assigned[userID] = agentID
|
||||
return nil
|
||||
}
|
||||
|
||||
func (f *fakeST) GetUser(ctx context.Context, id int64) (*User, error) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue