Skip to content

Commit

Permalink
Merge pull request #309 from skedify/develop
Browse files Browse the repository at this point in the history
release/next
  • Loading branch information
BenSwennen authored Jul 29, 2021
2 parents 1446eec + f717838 commit e3ab859
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 5 deletions.
76 changes: 76 additions & 0 deletions types/appointment.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
declare module 'skedify-sdk' {
export type AppointmentState =
| 'incoming'
| 'outgoing'
| 'completed'
| 'cancelled'
| 'accepted'
| 'occurred'

export interface Appointment extends Omit<BaseFields, 'enterprise_id'> {
uuid: string;
listing_uuid: string;
contact_id: string;
customer_id: string;
subject_id: string;
office_id: string;
state: AppointmentState;
meeting_type: string;
first_possibility_id: string;
notes?: string;
outcome_remark?: string;
trailing_buffer_time: number;
metadata: any[];
customer_showed: boolean;
is_success: boolean;
video_url_for_contact: string;
video_url_for_customer: string;
video_test_url_for_contact: string;
video_test_url_for_customer: string;
cancellation_reason_id?: string;
cancelled_by_id?: string;
cancelled_by_type?: string;
initiated_from: string;
initiated_by_id: string;
initiated_by_type: string;
updated_at: string;
updated_by_id: string;
updated_by_type: string;
}

export interface Possibility
extends Omit<BaseFields, 'enterprise_id' | 'external_id'> {
appointment_id: number;
start: string;
end: string;
timezone: string;
duration: number;
is_accepted: boolean;
next_possibility_id: string | null;
created_by_id: number;
created_by_type: string;
updated_by_id: number;
updated_by_type: string;
updated_at: string;
}

export interface WithSubject {
subject: Subject;
}

export interface WithCustomer {
customer: Customer;
}

export interface WithContact {
contact: Employee & WithEmployeeUser;
}

export interface WithAcceptedPossibility {
accepted_possibility: Possibility;
}

export interface WithPossibilities {
possibilities: Possibility[];
}
}
4 changes: 0 additions & 4 deletions types/contactOffices.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ declare module "skedify-sdk" {
updated_at: string | null;
}

export interface WithContact<T> {
contact: Contact & T;
}

export interface WithOffice {
office: Office;
}
Expand Down
24 changes: 24 additions & 0 deletions types/customer.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
declare module 'skedify-sdk' {
export interface Customer extends BaseFields {
uuid: string;
user_id?: string;
preferred_office_id?: string;
preferred_contact_id?: string;
external_id?: string;
email: string;
first_name: string;
last_name: string;
gender?: string;
date_of_birth?: string;
language: string;
phone_number?: string;
profile_picture?: string;
timezone: string;
customer_number?: string;
company?: string;
notes?: string;
is_existing: boolean;
updated_at: string;
location?: string;
}
}
7 changes: 6 additions & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference path="appointment.d.ts" />
/// <reference path="customer.d.ts" />
/// <reference path="calendarEventTemplates.d.ts" />
/// <reference path="contactOfficeSubjects.d.ts" />
/// <reference path="contactOffices.d.ts" />
Expand Down Expand Up @@ -144,7 +146,7 @@ declare module "skedify-sdk" {
outcome_lists: Include;
outcome_outcome_lists: Include;
outcomes: Include;
possibilities: Include;
possibilities: Include & { created_by: Include };
postal_code: Include;
question: Include;
questions: Include;
Expand All @@ -167,6 +169,9 @@ declare module "skedify-sdk" {
admins(): GenericAPI<Admin[]>;
admins(id: string): GenericAPI<Admin>;

appointments(): GenericAPI<Appointment[]>;
appointments(id: string): GenericAPI<Appointment>;

calendarEventTemplates(): GenericAPI<CalendarEventTemplate[]>;
calendarEventTemplates(id: string): GenericAPI<CalendarEventTemplate>;

Expand Down

0 comments on commit e3ab859

Please sign in to comment.