mirror of
https://github.com/urosran/cally.git
synced 2026-10-25 15:47:55 +00:00
Syncing rework
This commit is contained in:
@@ -1,10 +1,29 @@
|
||||
import {ProfileType} from "@/contexts/AuthContext";
|
||||
export type ProfileType = 'parent' | 'child';
|
||||
|
||||
export interface User {
|
||||
uid: string;
|
||||
email: string | null;
|
||||
export interface CalendarAccount {
|
||||
accessToken: string;
|
||||
refreshToken?: string;
|
||||
resourceId?: string;
|
||||
email?: string;
|
||||
expiresAt?: Date;
|
||||
}
|
||||
|
||||
export interface GoogleAccount extends CalendarAccount {
|
||||
scope?: string;
|
||||
}
|
||||
|
||||
export interface MicrosoftAccount extends CalendarAccount {
|
||||
subscriptionId?: string;
|
||||
}
|
||||
|
||||
export interface AppleAccount extends CalendarAccount {
|
||||
identityToken?: string;
|
||||
}
|
||||
|
||||
export type CalendarAccounts = {
|
||||
[email: string]: GoogleAccount | MicrosoftAccount | AppleAccount;
|
||||
};
|
||||
|
||||
export interface UserProfile {
|
||||
userType: ProfileType;
|
||||
firstName: string;
|
||||
@@ -21,23 +40,7 @@ export interface UserProfile {
|
||||
eventColor?: string | null;
|
||||
timeZone?: string | null;
|
||||
firstDayOfWeek?: string | null;
|
||||
googleAccounts?: Object;
|
||||
microsoftAccounts?: Object;
|
||||
appleAccounts?: Object;
|
||||
}
|
||||
|
||||
export interface ParentProfile extends UserProfile {
|
||||
userType: ProfileType.PARENT;
|
||||
childrenIds: string[];
|
||||
}
|
||||
|
||||
export interface ChildProfile extends UserProfile {
|
||||
userType: ProfileType.CHILD;
|
||||
birthday: Date;
|
||||
parentId: string;
|
||||
}
|
||||
|
||||
export interface CaregiverProfile extends UserProfile {
|
||||
userType: ProfileType.CAREGIVER;
|
||||
contact: string;
|
||||
}
|
||||
googleAccounts?: { [email: string]: GoogleAccount };
|
||||
microsoftAccounts?: { [email: string]: MicrosoftAccount };
|
||||
appleAccounts?: { [email: string]: AppleAccount };
|
||||
}
|
||||
Reference in New Issue
Block a user