-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🔨 Type alert store * 🔨 Type appointment store * 🔨 Fix dayjs type * 🔨 Type booking modal store * 🔨 Fix dayjs timezone conversion * 🔨 We don't striclty check for null * 🔨 Type booking view store * 🔨 Type calendar store * 🔨 Type external connections store * 🔨 Type schedule store * 🔨 Type user store * ➕ Add types for API fetch and return * 🔨 Fix use fetch types * 🔨 Fix linter issue * 🔨 Rename FetchAny to Fetch
- Loading branch information
Showing
13 changed files
with
235 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,144 @@ | ||
import { Dayjs } from "dayjs"; | ||
import { UseFetchReturn } from '@vueuse/core'; | ||
|
||
export type Attendee = { | ||
id: number; | ||
email: string; | ||
name: string; | ||
timezone: string; | ||
} | ||
|
||
export type Slot = { | ||
id: number; | ||
start: Dayjs; | ||
duration: number; | ||
attendee_id: number; | ||
booking_tkn: string; | ||
booking_expires_at: string; | ||
booking_status: number; | ||
meeting_link_id: number; | ||
meeting_link_url: string; | ||
appointment_id: number; | ||
subscriber_id: number; | ||
time_updated: string; | ||
attendee: Attendee; | ||
} | ||
|
||
export type Appointment = { | ||
id: number; | ||
title: string; | ||
details: string; | ||
slug: string; | ||
location_url: string; | ||
calendar_id: number; | ||
duration: number; | ||
location_type: number; | ||
location_suggestions: string; | ||
location_selected: number; | ||
location_name: string; | ||
location_phone: string; | ||
keep_open: boolean; | ||
status: number; | ||
meeting_link_provider: string; | ||
uuid: string; | ||
time_created: string; | ||
time_updated: string; | ||
slots: Slot[]; | ||
calendar_title: string; | ||
calendar_color: string; | ||
active: boolean; | ||
}; | ||
|
||
export type Calendar = { | ||
id?: number; | ||
connected: boolean; | ||
title: string; | ||
color: string; | ||
}; | ||
|
||
export type ExternalConnection = { | ||
owner_id: number; | ||
name: string; | ||
type: string; | ||
type_id: string; | ||
}; | ||
|
||
export type ExternalConnectionCollection = { | ||
fxa?: ExternalConnection[]; | ||
google?: ExternalConnection[]; | ||
zoom?: ExternalConnection[]; | ||
}; | ||
|
||
// This will be used later if we provide custom availabilities | ||
// in addition to general availability too | ||
export type Availability = { | ||
id?: number; | ||
}; | ||
|
||
export type Schedule = { | ||
active: boolean; | ||
name: string; | ||
slug: string; | ||
calendar_id: number; | ||
location_type: number; | ||
location_url: string; | ||
details: string; | ||
start_date: string; | ||
end_date: string; | ||
start_time: string; | ||
end_time: string; | ||
earliest_booking: number; | ||
farthest_booking: number; | ||
weekdays: number[]; | ||
slot_duration: number; | ||
meeting_link_provider: string; | ||
id: number; | ||
time_created: string; | ||
time_updated: string; | ||
availabilities?: Availability[]; | ||
calendar: Calendar; | ||
}; | ||
|
||
export type User = { | ||
email: string; | ||
preferredEmail: string; | ||
level: number; | ||
name: string; | ||
timezone: string; | ||
username: string; | ||
signedUrl: string; | ||
avatarUrl: string; | ||
accessToken: string; | ||
scheduleSlugs: string[]; | ||
} | ||
|
||
export type Subscriber = { | ||
username: string; | ||
name: string; | ||
email: string; | ||
preferred_email: string; | ||
level: number; | ||
timezone: string; | ||
avatar_url: string; | ||
} | ||
|
||
export type Signature = { | ||
url: string; | ||
} | ||
|
||
// Types and aliases used for our custom createFetch API calls and return types | ||
export type Fetch = (url: string) => UseFetchReturn<any> & PromiseLike<UseFetchReturn<any>>; | ||
export type BooleanResponse = UseFetchReturn<boolean>; | ||
export type SignatureResponse = UseFetchReturn<Signature>; | ||
export type SubscriberResponse = UseFetchReturn<Subscriber>; | ||
export type TokenResponse = UseFetchReturn<Token>; | ||
export type AppointmentListResponse = UseFetchReturn<Appointment[]>; | ||
export type CalendarListResponse = UseFetchReturn<Calendar[]>; | ||
export type ScheduleListResponse = UseFetchReturn<Schedule[]>; | ||
export type ExternalConnectionCollectionResponse = UseFetchReturn<ExternalConnectionCollection>; | ||
|
||
export type Error = { error: boolean|string|null }; | ||
export type Token = { | ||
access_token: string; | ||
token_type: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 6 additions & 4 deletions
10
frontend/src/stores/booking-view-store.js → frontend/src/stores/booking-view-store.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.