Templates

Methods and related types for `scrims.templates`.

Templates (scrims.templates)

Table of Contents

Methods

Method Signature
fetchAll fetchAll(calendarId: string) => Promise<ScrimsTemplate[]>
fetchCountByCalendar fetchCountByCalendar(calendarId: string) => Promise<number>

Method Signatures

fetchAll

fetchAll(
  calendarId: string,
): Promise<ScrimsTemplate[]>

fetchCountByCalendar

fetchCountByCalendar(
  calendarId: string,
): Promise<number>

Related Type References

JsonObject

type JsonObject = Record<string, unknown>;

CustomQuestionValidation

type CustomQuestionValidation = JsonObject
  & {
        min_length?: number;
        max_length?: number;
        min_value?: number;
        max_value?: number;
        pattern?: string;
        custom_message?: string;
      };

CustomQuestion

type CustomQuestion = JsonObject
  & {
        _id?: string;
        question?: string;
        type?: string;
        required?: boolean;
        placeholder?: string;
        options?: string[];
        validation?: CustomQuestionValidation;
        help_text?: string;
        icon?: string;
        order?: number;
      };

RegistrationDeadline

type RegistrationDeadline = JsonObject
  & {
        days?: number;
        hours?: number;
        minutes?: number;
      };

General

type General = JsonObject
  & {
        allow_multiple_hosts?: boolean;
        allow_multiple_specs?: boolean;
        add_creator_as_host?: boolean;
        enable_tickets?: boolean;
        enable_registration_deadline?: boolean;
        total_capacity?: number;
        specs_label?: string;
        ticket_label?: string;
        host_label?: string;
        invited_label?: string;
        confirmed_label?: string;
        late_label?: string;
        tentative_label?: string;
        absence_label?: string;
        kicked_label?: string;
        ticket_icon?: string;
        invited_icon?: string;
        confirmed_icon?: string;
        late_icon?: string;
        tentative_icon?: string;
        absence_icon?: string;
        kicked_icon?: string;
        host_icon?: string;
        empty_icon?: string;
        signups_icon?: string;
        countdown_icon?: string;
        static_icon?: string;
        reset_specs_icon?: string;
        enable_bundles?: boolean;
        members_only?: boolean;
        allow_multiple_ticket?: boolean;
        registration_deadline?: RegistrationDeadline;
      };

Register

type Register = JsonObject
  & {
        show_form?: boolean;
        custom_questions?: CustomQuestion[];
      };

Waitlist

type Waitlist = JsonObject
  & {
        waitlist_enabled?: boolean;
        waitlist_label?: string;
        waitlist_icon?: string;
        waitlist_message?: string;
        waitlist_time?: string;
        waitlist_threshold?: number;
        waitlist_max_capacity?: number;
        open_waitlist_if?: string[];
      };

TicketTag

type TicketTag = JsonObject
  & {
        name?: string;
        icon?: string;
      };

Fee

type Fee = JsonObject
  & {
        high?: number;
        low?: number;
        discount?: number;
        offer?: string;
        currency?: string;
        tax?: number;
      };

SalesPeriod

type SalesPeriod = JsonObject
  & {
        sales_start?: string | Date;
        sales_end?: string | Date;
        timezone?: string;
        utc?: string | Date;
      };

Capacity

type Capacity = JsonObject
  & {
        max_quantity_per_order?: number;
        min_quantity_per_order?: number;
        quantity_required?: number;
        max_quantity?: number;
        quantity_remaining?: number;
      };

Refunds

type Refunds = JsonObject
  & {
        allowed?: boolean;
        processed_by?: string;
      };

BoosterOverrides

type BoosterOverrides = JsonObject
  & {
        sales_period?: JsonObject;
        fee?: JsonObject;
        requires_approval?: boolean;
      };

EventTicket

type EventTicket = JsonObject
  & {
        _id?: string;
        name?: string;
        description?: string;
        color?: string;
        icon?: string;
        image?: string;
        ticket_specs?: TicketSpec[];
        ticket_tags?: TicketTag[];
        fee?: Fee;
        sales_period?: SalesPeriod;
        capacity?: Capacity;
        requires_approval?: boolean;
        refunds?: Refunds;
        booster_overrides?: BoosterOverrides;
      };

TicketSpec

type TicketSpec = JsonObject
  & {
        name?: string;
        icon?: string;
        color?: string;
        description?: string;
        max_capacity?: number;
      };

ScrimsTemplate

type ScrimsTemplate = JsonObject
  & {
        _id?: string;
        calendar?: string;
        name?: string;
        icon?: string;
        template?: string;
        tickets?: EventTicket[];
        allowed_roles?: string[];
        banned_roles?: string[];
        assign_roles?: string[];
        remove_assigned_roles?: boolean;
        general?: General;
        register?: Register;
        waitlist?: Waitlist;
        created_at?: string | Date;
        updated_at?: string | Date;
      };