Split HelpServ into one file per command

REQUEST/CANCEL/LIST/VIEW/TAKE/NEXT/CLOSE each move to their own file;
the oper guard and the shared claim helper stay in lib.rs beside the
dispatcher. No behaviour change.
This commit is contained in:
Jean Chevronnet 2026-07-14 14:45:22 +00:00
parent 1916e5fce5
commit 368e6ba090
No known key found for this signature in database
8 changed files with 144 additions and 115 deletions

View file

@ -0,0 +1,12 @@
use fedserv_api::{Sender, ServiceCtx, Store};
// NEXT: claim the oldest unassigned ticket.
pub fn handle(me: &str, from: &Sender, ctx: &mut ServiceCtx, db: &mut dyn Store) {
if !super::require_oper(me, from, ctx) {
return;
}
match db.help_next_open() {
Some(id) => super::take_id(me, from, id, ctx, db),
None => ctx.notice(me, from.uid, "No unassigned tickets are waiting."),
}
}