recruitment#

Recruitment drive schemas: constants, enums, the addon export/import additions, and the site HTTP API.

local://recruitment-contract.md is the source of truth. A drive is a GuildEvent of kind recruitment (sidequest_common.schemas.events.EventKind.RECRUITMENT) running 14 days by default; the inviter with the most recruits who stay RECRUIT_STAY_DAYS days and reach RECRUIT_MIN_LEVEL wins DRIVE_PRIZE_COPPER, ties each win it, settled DRIVE_SETTLE_DAYS after the drive ends. Who invited whom comes from the in-game guild log (ExportGuildLogEntry), not the addon.

sidequest_common.schemas.recruitment.DRIVE_PRIZE_COPPER = 100000#

10g, paid to the inviter(s) with the most qualifying recruits in a drive. Ties each win it.

sidequest_common.schemas.recruitment.RECRUIT_MIN_LEVEL = 10#
sidequest_common.schemas.recruitment.RECRUIT_STAY_DAYS = 7#
sidequest_common.schemas.recruitment.DRIVE_SETTLE_DAYS = 7#

Payouts settle this many days after the drive’s ends_at.

sidequest_common.schemas.recruitment.DRIVE_DEFAULT_DAYS = 14#

The site form’s default drive length.

sidequest_common.schemas.recruitment.RECRUIT_JOIN_WINDOW#

A join must follow its invite within this window, else the recruit is never_joined.

sidequest_common.schemas.recruitment.MAX_GUILD_LOG_ENTRIES = 500#
sidequest_common.schemas.recruitment.MAX_RECRUIT_PAYOUTS_PAID = 200#
sidequest_common.schemas.recruitment.MAX_RECRUITMENT_LEADERS = 15#

Cap on RecruitmentTally.leaders, the most relevant inviters for the forum starter post.

sidequest_common.schemas.recruitment.GUILD_LOG_DEDUPE_WINDOW#

A re-uploaded guild log row with the same kind/actor/target within this window of a stored row is the same entry.

sidequest_common.schemas.recruitment.RECRUIT_NAME_MAX_LENGTH = 64#

Matches the addon’s character name format (roster.members[].character).

class sidequest_common.schemas.recruitment.GuildLogKind[source]#

Bases: enum.StrEnum

One kind of in-game guild event log entry (QueryGuildEventLog/GetGuildEventInfo).

INVITE = 'invite'#
JOIN = 'join'#
QUIT = 'quit'#
REMOVE = 'remove'#
class sidequest_common.schemas.recruitment.DriveRecruitStatus[source]#

Bases: enum.StrEnum

Where one recruit is in a drive’s 7-day qualification clock.

INVITED = 'invited'#
COUNTING = 'counting'#
QUALIFIED = 'qualified'#
DISQUALIFIED = 'disqualified'#
class sidequest_common.schemas.recruitment.DriveRecruitReason[source]#

Bases: enum.StrEnum

Why a recruit is disqualified. Only set alongside DriveRecruitStatus.DISQUALIFIED.

RETURNING = 'returning'#
OWN_ALT = 'own_alt'#
LEFT = 'left'#
LOW_LEVEL = 'low_level'#
NEVER_JOINED = 'never_joined'#
class sidequest_common.schemas.recruitment.PaidVia[source]#

Bases: enum.StrEnum

How a recruit’s payout was marked paid: the site’s “Mark paid” button, or the addon’s mail-send button.

SITE = 'site'#
ADDON = 'addon'#
class sidequest_common.schemas.recruitment.ExportGuildLogEntry[source]#

Bases: pydantic.BaseModel

One SQX1: guild event log row (max MAX_GUILD_LOG_ENTRIES). at is rounded down to the hour.

actor is the inviter for invite, the member for join/quit, or the removing officer for remove; target is the invitee for invite or the removed member for remove, and omitted for join/quit. promote/demote entries are never exported.

kind: GuildLogKind#
actor: str#
target: str | None#
at: int#
class sidequest_common.schemas.recruitment.ExportRecruitPayoutPaid[source]#

Bases: pydantic.BaseModel

One SQX1: row for a payout the addon’s mail button already sent (max MAX_RECRUIT_PAYOUTS_PAID).

event_id: uuid.UUID#
inviter: str#
copper: int#
at: int#
officer: str#
class sidequest_common.schemas.recruitment.GuildLogImportCounts[source]#

Bases: pydantic.BaseModel

Counts for the guild_log section of one import. merged matches a stored row within the dedupe window.

new: int = 0#
merged: int = 0#
class sidequest_common.schemas.recruitment.RecruitPayoutImportCounts[source]#

Bases: pydantic.BaseModel

Counts for the recruit_payouts_paid section of one import. already_paid is the idempotent no-op case.

new: int = 0#
already_paid: int = 0#
class sidequest_common.schemas.recruitment.GameImportRecruitPayout[source]#

Bases: pydantic.BaseModel

One SQI1: officer payout row: a drive’s winning inviter (most qualifying recruits, ties each win).

event_id: uuid.UUID#
title: str#
inviter: str#
copper: int#
recruits: list[str]#
settles_at: int#
sidequest_common.schemas.recruitment.MAX_IMPORT_DRIVE_RECRUITS = 50#

Cap on GameImportDrive.recruits, the most relevant recruit rows for the addon’s Events tab.

class sidequest_common.schemas.recruitment.GameImportDriveLeader[source]#

Bases: pydantic.BaseModel

One inviter on a drive’s leaderboard in the SQI1: import.

inviter: str#
invited: int#
counting: int#
qualified: int#
class sidequest_common.schemas.recruitment.GameImportDriveRecruit[source]#

Bases: pydantic.BaseModel

One recruit’s state in the SQI1: import.

recruit: str#
inviter: str#
status: DriveRecruitStatus#
reason: DriveRecruitReason | None = None#
qualifies_at: int | None#
class sidequest_common.schemas.recruitment.GameImportDrive[source]#

Bases: pydantic.BaseModel

GameImportEvent.recruitment: a drive’s leaderboard and recruits for the addon’s Events tab.

recruits is ordered counting first (soonest qualifies_at first), then invited (newest invite first), then qualified (newest first), then disqualified (newest first), truncated to MAX_IMPORT_DRIVE_RECRUITS.

leaders: list[GameImportDriveLeader]#
recruits: list[GameImportDriveRecruit]#
class sidequest_common.schemas.recruitment.RecruitmentDriveTotals[source]#

Bases: pydantic.BaseModel

Headcounts across a drive’s recruits, by DriveRecruitStatus plus how many are paid.

invited: int#
joined: int#
counting: int#
qualified: int#
disqualified: int#
paid: int#
class sidequest_common.schemas.recruitment.RecruitLeader[source]#

Bases: pydantic.BaseModel

One inviter’s standing in a drive’s leaderboard.

inviter: str#
member_name: str | None#
discord_id: str | None#
invited: int#
joined: int#
counting: int#
qualified: int#
class sidequest_common.schemas.recruitment.DriveRecruit[source]#

Bases: pydantic.BaseModel

One recruit’s row in a drive’s detail, including their qualification clock and pay state.

recruit: str#
inviter: str#
invited_at: datetime.datetime#
joined_at: datetime.datetime | None#
qualifies_at: datetime.datetime | None#
status: DriveRecruitStatus#
reason: DriveRecruitReason | None#
paid_at: datetime.datetime | None#
class sidequest_common.schemas.recruitment.RecruitmentDrive[source]#

Bases: pydantic.BaseModel

GET /api/events/{event_id}/recruitment: one drive’s full detail, leaderboard, and recruit rows.

event_id: uuid.UUID#
title: str#
starts_at: datetime.datetime#
ends_at: datetime.datetime#
settles_at: datetime.datetime#
reward_copper: int#
min_level: int#
stay_days: int#
totals: RecruitmentDriveTotals#
leaders: list[RecruitLeader]#
recruits: list[DriveRecruit]#
class sidequest_common.schemas.recruitment.RecruitPayout[source]#

Bases: pydantic.BaseModel

GET /api/recruitment/payouts: one winning inviter’s owed (or already-paid) prize for one settled drive.

event_id: uuid.UUID#
title: str#
settles_at: datetime.datetime#
inviter: str#
member_name: str | None#
recruits: list[str]#
copper: int#
paid_at: datetime.datetime | None#
paid_by: str | None#
paid_via: PaidVia | None#
class sidequest_common.schemas.recruitment.RecruitPayoutMarkPaid[source]#

Bases: pydantic.BaseModel

Body for POST /api/recruitment/payouts/paid (officer). Idempotent.

event_id: uuid.UUID#
inviter: str#
class sidequest_common.schemas.recruitment.RecruitmentTally[source]#

Bases: pydantic.BaseModel

DiscordEventPush.recruitment: a drive’s live leaderboard, for the forum starter post.

reward_copper: int#
settles_at: datetime.datetime#
invited: int#
joined: int#
qualified: int#
leaders: list[RecruitLeader]#
class sidequest_common.schemas.recruitment.RecruitShoutout[source]#

Bases: pydantic.BaseModel

One qualified recruit’s shout-out, queued to post as a comment on the drive’s forum thread.

id: uuid.UUID#
thread_id: int#
event_id: uuid.UUID#
inviter: str#
inviter_discord_id: int | None#
recruit: str#
reward_copper: int#
class sidequest_common.schemas.recruitment.RecruitShoutoutAck[source]#

Bases: pydantic.BaseModel

POST /api/guilds/{guild_id}/event-sync/recruit-shoutouts/ack: the bot posted these shout-outs.

ids: list[uuid.UUID]#