mirror of
https://github.com/HamzaSha1/zod-backend.git
synced 2026-10-25 14:47:57 +00:00
api client for testing
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
interface ApiErrorField {
|
||||
field: string;
|
||||
message: string;
|
||||
}
|
||||
|
||||
export interface ApiError {
|
||||
statusCode: number;
|
||||
message: string | ApiErrorField[];
|
||||
error: string;
|
||||
}
|
||||
|
||||
export interface ApiResponse<T> {
|
||||
data: T;
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
export interface User {
|
||||
id: string;
|
||||
email: string;
|
||||
customerStatus?: string;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
dateOfBirth?: string;
|
||||
countryOfResidence?: string;
|
||||
isJunior?: boolean;
|
||||
isGuardian?: boolean;
|
||||
}
|
||||
|
||||
export interface LoginResponse {
|
||||
accessToken: string;
|
||||
refreshToken: string;
|
||||
user: User;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
export enum DocumentType {
|
||||
PROFILE_PICTURE = 'PROFILE_PICTURE',
|
||||
PASSPORT = 'PASSPORT',
|
||||
DEFAULT_AVATAR = 'DEFAULT_AVATAR',
|
||||
DEFAULT_TASKS_LOGO = 'DEFAULT_TASKS_LOGO',
|
||||
CUSTOM_AVATAR = 'CUSTOM_AVATAR',
|
||||
CUSTOM_TASKS_LOGO = 'CUSTOM_TASKS_LOGO',
|
||||
GOALS = 'GOALS'
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
export interface Junior {
|
||||
id: string;
|
||||
fullName: string;
|
||||
relationship: string;
|
||||
profilePicture?: {
|
||||
id: string;
|
||||
name: string;
|
||||
extension: string;
|
||||
documentType: string;
|
||||
url: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface CreateJuniorRequest {
|
||||
countryCode: string;
|
||||
phoneNumber: string;
|
||||
firstName: string;
|
||||
lastName: string;
|
||||
dateOfBirth: string;
|
||||
email: string;
|
||||
relationship: string;
|
||||
civilIdFrontId: string;
|
||||
civilIdBackId: string;
|
||||
}
|
||||
|
||||
export interface JuniorTheme {
|
||||
color: string;
|
||||
avatarId: string;
|
||||
}
|
||||
|
||||
export interface PaginatedResponse<T> {
|
||||
data: T[];
|
||||
meta: {
|
||||
page: number;
|
||||
size: number;
|
||||
itemCount: number;
|
||||
pageCount: number;
|
||||
hasPreviousPage: boolean;
|
||||
hasNextPage: boolean;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
import { Junior } from './junior';
|
||||
|
||||
export interface Task {
|
||||
id: string;
|
||||
title: string;
|
||||
description: string;
|
||||
status: 'PENDING' | 'IN_PROGRESS' | 'COMPLETED';
|
||||
dueDate: string;
|
||||
rewardAmount: number;
|
||||
isProofRequired: boolean;
|
||||
submission?: {
|
||||
imageId?: string;
|
||||
submittedAt?: string;
|
||||
status?: 'PENDING' | 'APPROVED' | 'REJECTED';
|
||||
};
|
||||
junior: Junior;
|
||||
image?: {
|
||||
id: string;
|
||||
name: string;
|
||||
extension: string;
|
||||
documentType: string;
|
||||
url: string;
|
||||
};
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
export interface CreateTaskRequest {
|
||||
title: string;
|
||||
description: string;
|
||||
dueDate: string;
|
||||
rewardAmount: number;
|
||||
isProofRequired: boolean;
|
||||
imageId?: string;
|
||||
juniorId: string;
|
||||
}
|
||||
|
||||
export interface TaskSubmission {
|
||||
imageId: string;
|
||||
}
|
||||
|
||||
export type TaskStatus = 'PENDING' | 'IN_PROGRESS' | 'COMPLETED';
|
||||
Reference in New Issue
Block a user