Table of Contents

Class AdminAuditEntity

Namespace
FishMMO.Database.Npgsql.Entities
Assembly
FishMMO-DB.dll

One operator action, recorded permanently.

public class AdminAuditEntity
Inheritance
AdminAuditEntity
Inherited Members

Remarks

Append-only by construction. There is no update path and no delete path on IAdminAuditService, and no property here that an action could sensibly revise: a row describes a thing that happened, and what happened does not change afterwards. That is also why it carries no xmin concurrency token, unlike every other entity in this assembly — a concurrency token exists to mediate competing writers of one row, and this row has exactly one writer, once.

The actor is a plain string with no foreign key, deliberately, and this is the single most important decision in the table. A cascade from accounts would mean that deleting an operator erases the record of everything that operator did, which is precisely the case the log exists for. The name is copied in, not referenced.

Refusals are recorded as well as successes. An operator repeatedly failing to reach something is more interesting than one who succeeds, and a log that holds only successes cannot tell the difference between "never attempted" and "attempted and stopped".

Properties

Action

What was done, as a stable dotted identifier such as character.rename. Stable because queries and retention rules are written against it; the human wording belongs in the interface, not in the data.

public string Action { get; set; }

Property Value

string

ActorAccessLevel

The actor's access level at the moment of the action, not now. A later demotion must not rewrite what the record says they were allowed to do at the time.

public byte ActorAccessLevel { get; set; }

Property Value

byte

ActorName

The account that acted, copied from accounts.name without a foreign key so the record survives the account.

public string ActorName { get; set; }

Property Value

string

ActorSessionID

The panel session the action came from, or null. Lets a run of actions be tied together as one sitting even when the session row is long gone.

public long? ActorSessionID { get; set; }

Property Value

long?

Details

What actually changed, as compact JSON, or null. Free-form because the shape differs per action; it is for a human reading one row, never for querying.

public string Details { get; set; }

Property Value

string

ID

Surrogate key. Ascending, so it also orders ties within a timestamp.

public long ID { get; set; }

Property Value

long

IpAddress

The address the request came from, as the panel resolved it.

public string IpAddress { get; set; }

Property Value

string

OccurredUtc

When the action was attempted, UTC.

public DateTime OccurredUtc { get; set; }

Property Value

DateTime

Outcome

Why it was not, when it was not.

public string Outcome { get; set; }

Property Value

string

Reason

The reason the operator gave. The point of the whole exercise.

public string Reason { get; set; }

Property Value

string

RequestKey

The writer's once-per-request identity: a retry after a lost reply finds the row its first attempt wrote instead of writing a second one. Null for rows written without one.

public Guid? RequestKey { get; set; }

Property Value

Guid?

Source

Where the action was taken: panel or game.

public string Source { get; set; }

Property Value

string

Remarks

Both write to this one table deliberately. An operator who cannot do something in the panel and then does it from a chat command should not thereby leave a gap in the record, and "show me everything this person did" must not require two queries against two logs with two different shapes.

Succeeded

Whether the action was carried out.

public bool Succeeded { get; set; }

Property Value

bool

TargetID

The target's identifier, as text, because targets are keyed by number in some tables and by name in others and one column has to hold both.

public string TargetID { get; set; }

Property Value

string

TargetName

The target's name as it read at the time. Denormalised on purpose: a character renamed later must not make this row describe the wrong thing.

public string TargetName { get; set; }

Property Value

string

TargetType

What kind of thing was acted on: character, account, and so on.

public string TargetType { get; set; }

Property Value

string