NobGit
public imalexnord read

Slot

Calendar-first scheduling powered by Cloudflare Workers and Google Calendar.

Languages

Repository composition by tracked source files.

TypeScript
TypeScript 79% CSS 19% SQL 2% HTML 0%
Create file Wiki Documentation
Clone
https://nobgit.com/user/imalexnord/slot.git
ssh://[email protected]:2222/user/imalexnord/slot.git
types.ts
export interface Env {
  DB: D1Database;
  ASSETS?: Fetcher;
  APP_URL: string;
  ADMIN_EMAIL: string;
  GOOGLE_CLIENT_ID: string;
  GOOGLE_CLIENT_SECRET: string;
  SESSION_SECRET: string;
  TOKEN_ENCRYPTION_KEY: string;
  STRIPE_SECRET_KEY?: string;
  STRIPE_WEBHOOK_SECRET?: string;
}

export interface AppSettings {
  title: string;
  subtitle: string;
  timezone: string;
  bookingWindowDays: number;
  minimumNoticeMinutes: number;
  bufferBeforeMinutes: number;
  bufferAfterMinutes: number;
  slotIncrementMinutes: number;
  durations: number[];
  calendarId: string;
  busyCalendarIds: string[];
  defaultMeetingMode: MeetingMode;
  allowMeetingModes: MeetingMode[];
  inPersonLocation: string;
  paymentEnabled: boolean;
  paymentRatePerMinute: number;
  paymentFreeDurations: number[];
  paymentCurrency: string;
  paymentLabel: string;
  availability: WeeklyAvailability;
}

export type MeetingMode = 'google_meet' | 'phone' | 'in_person' | 'decide_later';

export interface AvailabilityInterval {
  start: string;
  end: string;
}

export type WeeklyAvailability = Record<string, AvailabilityInterval[]>;

export interface BusyRange {
  start: number;
  end: number;
}

export interface RecurringUnavailablePeriod {
  id: string;
  weekdays: number[];
  start: string;
  end: string;
  label?: string;
}

export interface AvailabilityBlock {
  id: string;
  date: string;
  start?: string;
  end?: string;
  allDay: boolean;
  label?: string;
}

export interface BookingRequest {
  start: string;
  duration: number;
  name: string;
  email: string;
  phone?: string;
  message?: string;
  meetingMode: MeetingMode;
  website?: string;
}