Init commit. Rewrite of old project. Not done
This commit is contained in:
131
constants/Types.ts
Normal file
131
constants/Types.ts
Normal file
@ -0,0 +1,131 @@
|
||||
/* Types */
|
||||
|
||||
// User Table in DB
|
||||
export type User = {
|
||||
id: number;
|
||||
appleId: string | null;
|
||||
email: string;
|
||||
fullName: string;
|
||||
pfpUrl: string | null;
|
||||
pushToken: string;
|
||||
createdAt: Date;
|
||||
metadata?: Record<string, string>;
|
||||
};
|
||||
// Relationship Table in DB
|
||||
export type Relationship = {
|
||||
id: number;
|
||||
title: string;
|
||||
requestorId: number;
|
||||
isAccepted: boolean;
|
||||
relationshipStartDate: Date;
|
||||
};
|
||||
export type UserRelationship = {
|
||||
id: number;
|
||||
userId: number;
|
||||
relationshipId: number;
|
||||
};
|
||||
// Mutated Data from Relationship
|
||||
// & UserRelationship Tables in DB
|
||||
export type RelationshipData = {
|
||||
relationship: Relationship;
|
||||
Partner: User;
|
||||
};
|
||||
// Countdown Table in DB
|
||||
export type Countdown = {
|
||||
id: number;
|
||||
relationshipId: number;
|
||||
title: string;
|
||||
date: Date;
|
||||
createdAt: Date;
|
||||
};
|
||||
// Mutated Data for Login
|
||||
// API Response
|
||||
export type InitialData = {
|
||||
user: User;
|
||||
relationshipData: RelationshipData;
|
||||
countdown: Countdown;
|
||||
};
|
||||
// Message Table in DB
|
||||
export type Message = {
|
||||
id: number;
|
||||
senderId: number;
|
||||
receiverId: number;
|
||||
text: string;
|
||||
createdAt: Date;
|
||||
isRead: boolean;
|
||||
hasLocation: boolean;
|
||||
hasMedia: boolean;
|
||||
hasQuickReply: boolean;
|
||||
};
|
||||
// MessageMedia Table in DB
|
||||
export type MessageMedia = {
|
||||
id: number;
|
||||
messageId: number;
|
||||
mediaType:
|
||||
'image' | 'video' | 'audio' | 'file';
|
||||
url: string;
|
||||
size?: number;
|
||||
metadata?: string;
|
||||
order: number;
|
||||
};
|
||||
// MessageLocation Table in DB
|
||||
export type MessageLocation = {
|
||||
id: number;
|
||||
messageId: number;
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
};
|
||||
// Quick Reply Table in DB
|
||||
export type QuickReply = {
|
||||
id: number;
|
||||
messageId: number;
|
||||
type: 'radio' | 'checkbox';
|
||||
keepIt: boolean;
|
||||
};
|
||||
// Quick Reply Option Table in DB
|
||||
export type QuickReplyOption = {
|
||||
id: number;
|
||||
quickReplyId: number;
|
||||
title: string;
|
||||
value: string;
|
||||
};
|
||||
|
||||
export type GCUser = {
|
||||
_id: number;
|
||||
name: string;
|
||||
avatar?: string;
|
||||
};
|
||||
export type GCQuickReplies = {
|
||||
type: 'radio' | 'checkbox';
|
||||
values: GCQuickReplyOptions[];
|
||||
keepIt?: boolean;
|
||||
};
|
||||
export type GCQuickReplyOptions = {
|
||||
title: string;
|
||||
value: string;
|
||||
};
|
||||
export type GCLocation = {
|
||||
latitude: number;
|
||||
longitude: number;
|
||||
};
|
||||
export type GCMessage = {
|
||||
_id: number;
|
||||
text: string;
|
||||
createdAt: Date;
|
||||
user: GCUser;
|
||||
image?: string;
|
||||
video?: string;
|
||||
audio?: string;
|
||||
location?: GCLocation;
|
||||
system?: boolean;
|
||||
sent?: boolean;
|
||||
received?: boolean;
|
||||
pending?: boolean;
|
||||
quickReplies?: GCQuickReplies;
|
||||
};
|
||||
export type NotificationMessage = {
|
||||
sound?: string;
|
||||
title: string;
|
||||
body: string;
|
||||
data?: any;
|
||||
};
|
Reference in New Issue
Block a user