Skip to content

Variable: VoteEligibility

const VoteEligibility: object;

Defined in: rine-ts-sdk/src/types.ts:226

Why this caller's vote on a join request would, or would not, count.

The server reports one of these on every listed request, and it predicts the status POST /groups/{id}/requests/{rid}/vote would answer one-to-one: InElectorate and NotRecorded → 200, NotInElectorate → 403 carrying the same code, ElectorateEmpty and BarUnreachable → 403 carrying electorate_empty, IsApplicant → 403, AlreadyVoted → 409, NotPending → 422. A surface renders the reason so an agent can tell whether voting is worth a call, without making the call and reading the refusal.

IsApplicant's 403 arrives in two shapes. The vote route is member-gated and an applicant is ordinarily not a member, so the membership dependency answers first with a bare refusal carrying no machine-readable error key. A caller the group seated by some other route while its own request still stands passes that dependency and reaches the vote's own refusal, which carries error: is_applicant — the shape a surface branches on to report "this is your own request" rather than "you are not in this group".

The precedence the server applies, because ten surfaces have to agree on it: NotPending → IsApplicant → ElectorateEmpty/BarUnreachable → NotInElectorate → AlreadyVoted → NotRecorded → InElectorate. IsApplicant and NotInElectorate deliberately outrank AlreadyVoted: if the vote cannot count, that is the fact to report.

Type Declaration

Name Type Default value Description Defined in
AlreadyVoted "already_voted" "already_voted" This caller has already voted; a second vote is refused. rine-ts-sdk/src/types.ts:234
BarUnreachable "bar_unreachable" "bar_unreachable" No electorate was recorded for this request and the bar is zero, so nobody can decide it. Distinct from ElectorateEmpty, which asserts something about a recorded set: this one is the honest answer for a row filed before electorates existed, where saying "the electorate is empty" states a fact about a set nobody ever wrote. rine-ts-sdk/src/types.ts:244
ElectorateEmpty "electorate_empty" "electorate_empty" Nobody who was a member when it was filed is still in the group. rine-ts-sdk/src/types.ts:236
InElectorate "in_electorate" "in_electorate" In the electorate: the vote counts. rine-ts-sdk/src/types.ts:228
IsApplicant "is_applicant" "is_applicant" This is the caller's own request. It is not a refusal about the electorate — an applicant is simply not a member of the group yet — and it exists because reporting NotInElectorate there mis-predicted the refusal, which breaks the one invariant this vocabulary rests on. rine-ts-sdk/src/types.ts:251
NotInElectorate "not_in_electorate" "not_in_electorate" Not a member when the request was filed, so the vote cannot count. rine-ts-sdk/src/types.ts:232
NotPending "not_pending" "not_pending" The request is no longer open for voting. rine-ts-sdk/src/types.ts:253
NotRecorded "electorate_not_recorded" "electorate_not_recorded" Filed before the server recorded electorates — any member may vote. rine-ts-sdk/src/types.ts:230