Table of Contents

Class SupportTicketsController

Namespace
FishMMO.ControlPanel.Controllers
Assembly
FishMMO-ControlPanel.dll

The staff side of the support queue.

[ApiController]
[Route("api/support/tickets")]
public sealed class SupportTicketsController : ControllerBase
Inheritance
SupportTicketsController
Inherited Members

Remarks

Game master and above. The player's own view of the same tickets lives in MyTicketsController, as a separate controller rather than a branch inside these actions — because the difference between them is whether internal staff notes are returned, and a single action deciding that from a claim is one refactor away from getting it wrong.

Every write here is recorded by AuditActionFilter. Nothing in this file calls an audit method.

Constructors

SupportTicketsController(ISupportTicketService, IAccountService, AuditScope, ILogger<SupportTicketsController>)

public SupportTicketsController(ISupportTicketService tickets, IAccountService accounts, AuditScope audit, ILogger<SupportTicketsController> log)

Parameters

tickets ISupportTicketService
accounts IAccountService
audit AuditScope
log ILogger<SupportTicketsController>

Methods

Assign(long, AssignRequest)

Takes a ticket, or hands it back.

[HttpPost("{id:long}/assign")]
[Authorize(Policy = "Support")]
[Audited("ticket.assign", TargetType = "ticket", TargetRouteValue = "id")]
public Task<IActionResult> Assign(long id, SupportTicketsController.AssignRequest request)

Parameters

id long
request SupportTicketsController.AssignRequest

Returns

Task<IActionResult>

Get(long)

One ticket, with the whole conversation including internal notes.

[HttpGet("{id:long}")]
[Authorize(Policy = "Support")]
public Task<IActionResult> Get(long id)

Parameters

id long

Returns

Task<IActionResult>

Reply(long, ReplyRequest)

Replies to the player, or writes a note only staff can see.

[HttpPost("{id:long}/reply")]
[Authorize(Policy = "Support")]
[Audited("ticket.reply", TargetType = "ticket", TargetRouteValue = "id")]
public Task<IActionResult> Reply(long id, SupportTicketsController.ReplyRequest request)

Parameters

id long
request SupportTicketsController.ReplyRequest

Returns

Task<IActionResult>

Search(int[], int?, string, bool, string, string, string, int, int, int?)

The queue.

[HttpGet]
[Authorize(Policy = "Support")]
public Task<IActionResult> Search(int[] status, int? category, string assignedTo, bool unassigned = false, string reporter = null, string target = null, string subject = null, int page = 1, int pageSize = 25, int? tier = null)

Parameters

status int[]
category int?
assignedTo string
unassigned bool
reporter string
target string
subject string
page int
pageSize int
tier int?

Returns

Task<IActionResult>

SetPriority(long, PriorityRequest)

Sets the staff priority.

[HttpPost("{id:long}/priority")]
[Authorize(Policy = "Support")]
[Audited("ticket.priority", TargetType = "ticket", TargetRouteValue = "id")]
public Task<IActionResult> SetPriority(long id, SupportTicketsController.PriorityRequest request)

Parameters

id long
request SupportTicketsController.PriorityRequest

Returns

Task<IActionResult>

SetStatus(long, StatusRequest)

Moves a ticket's status, and records what was decided when finishing it.

[HttpPost("{id:long}/status")]
[Authorize(Policy = "Support")]
[Audited("ticket.status", TargetType = "ticket", TargetRouteValue = "id")]
public Task<IActionResult> SetStatus(long id, SupportTicketsController.StatusRequest request)

Parameters

id long
request SupportTicketsController.StatusRequest

Returns

Task<IActionResult>

SetTier(long, TierRequest)

Moves a ticket to another support tier: promotes it to the administrators, or hands it back.

[HttpPost("{id:long}/tier")]
[Authorize(Policy = "Support")]
[Audited("ticket.tier", TargetType = "ticket", TargetRouteValue = "id")]
public Task<IActionResult> SetTier(long id, SupportTicketsController.TierRequest request)

Parameters

id long
request SupportTicketsController.TierRequest

Returns

Task<IActionResult>

Remarks

Tiers are access levels — GameMaster (2) and Admin (3). The service clears the assignee and writes the reason onto the ticket as a staff note in one transaction. A game master may promote; only an administrator may hand a ticket back down, because only they can act on it once it is there.