feat (consultation): add guard for diff doctor_id
This commit is contained in:
@@ -321,6 +321,16 @@ func Reply(input e.ReplyDto) (*d.Data, error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if data.Doctor_Id != nil && data.Doctor_Id != doctor_id {
|
||||
event.Status = "failed"
|
||||
event.ErrInfo = pl.ErrorInfo{
|
||||
Code: "data-handled-mismatch",
|
||||
Detail: "data handled by different user/person",
|
||||
Raw: errors.New("data handled by different user/person"),
|
||||
}
|
||||
return pl.SetLogError(&event, input)
|
||||
}
|
||||
|
||||
data.Doctor_Id = doctor_id
|
||||
data.Solution = input.Solution
|
||||
data.RepliedAt = pu.GetTimeNow()
|
||||
|
||||
Reference in New Issue
Block a user