diff --git a/client/src/api/services/DefaultService.ts b/client/src/api/services/DefaultService.ts index 4ceef98..22c9ff8 100644 --- a/client/src/api/services/DefaultService.ts +++ b/client/src/api/services/DefaultService.ts @@ -2,464 +2,490 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { CancelablePromise } from "../core/CancelablePromise"; -import { OpenAPI } from "../core/OpenAPI"; -import { request as __request } from "../core/request"; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; export class DefaultService { - /** - * Register a new user - * @param requestBody - * @returns any User created - * @throws ApiError - */ - public static postAuthSignup(requestBody: { - email: string; - password: string; - }): CancelablePromise { - return __request(OpenAPI, { - method: "POST", - url: "/auth/signup", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Login and receive JWT token - * @param requestBody - * @returns any Token returned - * @throws ApiError - */ - public static postAuthLogin(requestBody: { - email: string; - password: string; - }): CancelablePromise { - return __request(OpenAPI, { - method: "POST", - url: "/auth/login", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * List all user expenses - * @param start Start date - * @param end End date - * @param category - * @param type - * @returns any List of expenses - * @throws ApiError - */ - public static getExpenses( - start?: string, - end?: string, - category?: string, - type?: "recurring" | "one-time" - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/expenses", - query: { - start: start, - end: end, - category: category, - type: type, - }, - }); - } - /** - * Create a new expense - * @param formData - * @returns any Expense created - * @throws ApiError - */ - public static postExpenses(formData?: { - amount: number; - date: string; - categoryId: string; - description?: string; - type?: "one-time" | "recurring"; - startDate?: string; - endDate?: string; - receipt?: Blob; - }): CancelablePromise { - return __request(OpenAPI, { - method: "POST", - url: "/expenses", - formData: formData, - mediaType: "multipart/form-data", - }); - } - /** - * Get a single expense - * @param id - * @returns any Expense data - * @throws ApiError - */ - public static getExpenses1(id: string): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/expenses/{id}", - path: { - id: id, - }, - }); - } - /** - * Update an expense - * @param id - * @param formData - * @returns any Expense updated - * @throws ApiError - */ - public static putExpenses( - id: string, - formData?: { - amount?: number; - date?: string; - categoryId?: string; - description?: string; - type?: "one-time" | "recurring"; - startDate?: string; - endDate?: string; - receipt?: Blob; + /** + * Register a new user + * @param requestBody + * @returns any User created + * @throws ApiError + */ + public static postAuthSignup( + requestBody: { + email: string; + password: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/auth/signup', + body: requestBody, + mediaType: 'application/json', + }); } - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", - url: "/expenses/{id}", - path: { - id: id, - }, - formData: formData, - mediaType: "multipart/form-data", - }); - } - /** - * Delete an expense - * @param id - * @returns void - * @throws ApiError - */ - public static deleteExpenses(id: string): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", - url: "/expenses/{id}", - path: { - id: id, - }, - }); - } - /** - * Get system income categories - * @returns any List of system income categories" - * @throws ApiError - */ - public static getIncomesCategories(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/incomes/categories", - }); - } - /** - * Get user's custom income categories - * @returns any List of user's custom income categories - * @throws ApiError - */ - public static getIncomesCustomCategories(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/incomes/custom-categories", - }); - } - /** - * Create a new custom income category - * @param requestBody - * @returns any Income category created - * @throws ApiError - */ - public static postIncomesCustomCategories(requestBody: { - category_name: string; - icon_url?: string; - }): CancelablePromise { - return __request(OpenAPI, { - method: "POST", - url: "/incomes/custom-categories", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Update an income category - * @param id - * @param requestBody - * @returns any Income category updated - * @throws ApiError - */ - public static putIncomesCustomCategories( - id: string, - requestBody: { - category_name: string; - icon_url?: string; + /** + * Login and receive JWT token + * @param requestBody + * @returns any Token returned + * @throws ApiError + */ + public static postAuthLogin( + requestBody: { + email: string; + password: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/auth/login', + body: requestBody, + mediaType: 'application/json', + }); } - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", - url: "/incomes/custom-categories/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete an income category - * @param id - * @returns void - * @throws ApiError - */ - public static deleteIncomesCustomCategories( - id: string - ): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", - url: "/incomes/custom-categories/{id}", - path: { - id: id, - }, - }); - } - /** - * List all incomes - * @param start - * @param end - * @returns any List of incomes - * @throws ApiError - */ - public static getIncomes( - start?: string, - end?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/incomes", - query: { - start: start, - end: end, - }, - }); - } - /** - * Create new income - * @param requestBody - * @returns any Income created - * @throws ApiError - */ - public static postIncomes(requestBody?: { - amount: number; - date?: string; - source?: string; - description?: string; - category_id?: number; - }): CancelablePromise { - return __request(OpenAPI, { - method: "POST", - url: "/incomes", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Get an income entry - * @param id - * @returns any Income data - * @throws ApiError - */ - public static getIncomes1(id: string): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/incomes/{id}", - path: { - id: id, - }, - }); - } - /** - * Update an income entry - * @param id - * @param requestBody - * @returns any Income updated - * @throws ApiError - */ - public static putIncomes( - id: string, - requestBody?: { - amount?: number; - date?: string; - source?: string; - description?: string; + /** + * List all user expenses + * @param start Start date + * @param end End date + * @param category + * @param type + * @returns any List of expenses + * @throws ApiError + */ + public static getExpenses( + start?: string, + end?: string, + category?: string, + type?: 'recurring' | 'one-time', + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/expenses', + query: { + 'start': start, + 'end': end, + 'category': category, + 'type': type, + }, + }); } - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", - url: "/incomes/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete an income entry - * @param id - * @returns void - * @throws ApiError - */ - public static deleteIncomes(id: string): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", - url: "/incomes/{id}", - path: { - id: id, - }, - }); - } - /** - * List user categories - * @returns any List of categories - * @throws ApiError - */ - public static getCategories(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/categories", - }); - } - /** - * Create new category - * @param requestBody - * @returns any Category created - * @throws ApiError - */ - public static postCategories(requestBody?: { - name: string; - }): CancelablePromise { - return __request(OpenAPI, { - method: "POST", - url: "/categories", - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Rename a category - * @param id - * @param requestBody - * @returns any Category updated - * @throws ApiError - */ - public static putCategories( - id: string, - requestBody?: { - name?: string; + /** + * Create a new expense + * @param formData + * @returns any Expense created + * @throws ApiError + */ + public static postExpenses( + formData?: { + amount: number; + date: string; + categoryId: string; + description?: string; + type?: 'one-time' | 'recurring'; + startDate?: string; + endDate?: string; + receipt?: Blob; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/expenses', + formData: formData, + mediaType: 'multipart/form-data', + }); + } + /** + * Get a single expense + * @param id + * @returns any Expense data + * @throws ApiError + */ + public static getExpenses1( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/expenses/{id}', + path: { + 'id': id, + }, + }); + } + /** + * Update an expense + * @param id + * @param formData + * @returns any Expense updated + * @throws ApiError + */ + public static putExpenses( + id: string, + formData?: { + amount?: number; + date?: string; + categoryId?: string; + description?: string; + type?: 'one-time' | 'recurring'; + startDate?: string; + endDate?: string; + receipt?: Blob; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/expenses/{id}', + path: { + 'id': id, + }, + formData: formData, + mediaType: 'multipart/form-data', + }); + } + /** + * Delete an expense + * @param id + * @returns void + * @throws ApiError + */ + public static deleteExpenses( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/expenses/{id}', + path: { + 'id': id, + }, + }); + } + /** + * Get system income categories + * @returns any List of system income categories + * @throws ApiError + */ + public static getIncomesCategories(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/incomes/categories', + }); + } + /** + * Get user's custom income categories + * @returns any List of user's custom income categories + * @throws ApiError + */ + public static getIncomesCustomCategories(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/incomes/custom-categories', + }); + } + /** + * Create a new custom income category + * @param requestBody + * @returns any Income category created + * @throws ApiError + */ + public static postIncomesCustomCategories( + requestBody: { + category_name: string; + icon_url?: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/incomes/custom-categories', + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Update an income category + * @param id + * @param requestBody + * @returns any Income category updated + * @throws ApiError + */ + public static putIncomesCustomCategories( + id: string, + requestBody: { + category_name: string; + icon_url?: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/incomes/custom-categories/{id}', + path: { + 'id': id, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Delete an income category + * @param id + * @returns void + * @throws ApiError + */ + public static deleteIncomesCustomCategories( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/incomes/custom-categories/{id}', + path: { + 'id': id, + }, + }); + } + /** + * List all incomes + * @param start + * @param end + * @returns any List of incomes + * @throws ApiError + */ + public static getIncomes( + start?: string, + end?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/incomes', + query: { + 'start': start, + 'end': end, + }, + }); + } + /** + * Create new income + * @param requestBody + * @returns any Income created + * @throws ApiError + */ + public static postIncomes( + requestBody?: { + amount: number; + date?: string; + source?: string; + description?: string; + category_id?: number; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/incomes', + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Get an income entry + * @param id + * @returns any Income data + * @throws ApiError + */ + public static getIncomes1( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/incomes/{id}', + path: { + 'id': id, + }, + }); + } + /** + * Update an income entry + * @param id + * @param requestBody + * @returns any Income updated + * @throws ApiError + */ + public static putIncomes( + id: string, + requestBody?: { + amount?: number; + date?: string; + source?: string; + description?: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/incomes/{id}', + path: { + 'id': id, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Delete an income entry + * @param id + * @returns void + * @throws ApiError + */ + public static deleteIncomes( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/incomes/{id}', + path: { + 'id': id, + }, + }); + } + /** + * List user categories + * @returns any List of categories + * @throws ApiError + */ + public static getCategories(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/categories', + }); + } + /** + * Create new category + * @param requestBody + * @returns any Category created + * @throws ApiError + */ + public static postCategories( + requestBody?: { + name: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/categories', + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Rename a category + * @param id + * @param requestBody + * @returns any Category updated + * @throws ApiError + */ + public static putCategories( + id: string, + requestBody?: { + name?: string; + }, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/categories/{id}', + path: { + 'id': id, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Delete a category + * @param id + * @returns void + * @throws ApiError + */ + public static deleteCategories( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/categories/{id}', + path: { + 'id': id, + }, + }); + } + /** + * Get current month summary + * @param month + * @returns any Monthly summary + * @throws ApiError + */ + public static getSummaryMonthly( + month?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/summary/monthly', + query: { + 'month': month, + }, + }); + } + /** + * Get summary for custom range + * @param start + * @param end + * @returns any Summary + * @throws ApiError + */ + public static getSummary( + start?: string, + end?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/summary', + query: { + 'start': start, + 'end': end, + }, + }); + } + /** + * Budget overrun alert + * @returns any Alert info + * @throws ApiError + */ + public static getSummaryAlerts(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/summary/alerts', + }); + } + /** + * Download/view receipt + * @param id + * @returns any Receipt file + * @throws ApiError + */ + public static getReceipts( + id: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/receipts/{id}', + path: { + 'id': id, + }, + }); + } + /** + * Get user profile + * @returns any Profile info + * @throws ApiError + */ + public static getUserProfile(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/user/profile', + }); } - ): CancelablePromise { - return __request(OpenAPI, { - method: "PUT", - url: "/categories/{id}", - path: { - id: id, - }, - body: requestBody, - mediaType: "application/json", - }); - } - /** - * Delete a category - * @param id - * @returns void - * @throws ApiError - */ - public static deleteCategories(id: string): CancelablePromise { - return __request(OpenAPI, { - method: "DELETE", - url: "/categories/{id}", - path: { - id: id, - }, - }); - } - /** - * Get current month summary - * @param month - * @returns any Monthly summary - * @throws ApiError - */ - public static getSummaryMonthly(month?: string): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/summary/monthly", - query: { - month: month, - }, - }); - } - /** - * Get summary for custom range - * @param start - * @param end - * @returns any Summary - * @throws ApiError - */ - public static getSummary( - start?: string, - end?: string - ): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/summary", - query: { - start: start, - end: end, - }, - }); - } - /** - * Budget overrun alert - * @returns any Alert info - * @throws ApiError - */ - public static getSummaryAlerts(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/summary/alerts", - }); - } - /** - * Download/view receipt - * @param id - * @returns any Receipt file - * @throws ApiError - */ - public static getReceipts(id: string): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/receipts/{id}", - path: { - id: id, - }, - }); - } - /** - * Get user profile - * @returns any Profile info - * @throws ApiError - */ - public static getUserProfile(): CancelablePromise { - return __request(OpenAPI, { - method: "GET", - url: "/user/profile", - }); - } } diff --git a/server/docs/Expense Tracker API.yaml b/server/docs/Expense Tracker API.yaml index 48843a0..c4dee71 100644 --- a/server/docs/Expense Tracker API.yaml +++ b/server/docs/Expense Tracker API.yaml @@ -22,7 +22,6 @@ paths: password: type: string responses: - "201": "201": description: User created /auth/login: @@ -41,7 +40,6 @@ paths: password: type: string responses: - "200": "200": description: Token returned /expenses: @@ -68,7 +66,6 @@ paths: type: string enum: [recurring, one-time] responses: - "200": "200": description: List of expenses post: @@ -99,7 +96,6 @@ paths: type: string format: binary responses: - "201": "201": description: Expense created /expenses/{id}: @@ -109,15 +105,9 @@ paths: required: true schema: type: string - - in: path - name: id - required: true - schema: - type: string get: summary: Get a single expense responses: - "200": "200": description: Expense data put: @@ -147,13 +137,11 @@ paths: type: string format: binary responses: - "200": "200": description: Expense updated delete: summary: Delete an expense responses: - "204": "204": description: Expense deleted /incomes/categories: @@ -161,65 +149,7 @@ paths: summary: Get system income categories responses: "200": - description: List of system income categories" - /incomes/custom-categories: - get: - summary: Get user's custom income categories - responses: - "200": - description: List of user's custom income categories - post: - summary: Create a new custom income category - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [category_name] - properties: - category_name: - type: string - icon_url: - type: string - responses: - "201": - description: Income category created - /incomes/custom-categories/{id}: - parameters: - - in: path - name: id - required: true - schema: - type: string - put: - summary: Update an income category - requestBody: - required: true - content: - application/json: - schema: - type: object - required: [category_name] - properties: - category_name: - type: string - icon_url: - type: string - responses: - "200": - description: Income category updated - delete: - summary: Delete an income category - responses: - "204": - description: Income category deleted - /incomes/categories: - get: - summary: Get system income categories - responses: - "200": - description: List of system income categories" + description: List of system income categories /incomes/custom-categories: get: summary: Get user's custom income categories @@ -285,7 +215,6 @@ paths: schema: type: string responses: - "200": "200": description: List of incomes post: @@ -307,10 +236,7 @@ paths: type: string category_id: type: number - category_id: - type: number responses: - "201": "201": description: Income created /incomes/{id}: @@ -320,15 +246,9 @@ paths: required: true schema: type: string - - in: path - name: id - required: true - schema: - type: string get: summary: Get an income entry responses: - "200": "200": description: Income data put: @@ -348,20 +268,17 @@ paths: description: type: string responses: - "200": "200": description: Income updated delete: summary: Delete an income entry responses: - "204": "204": description: Income deleted /categories: get: summary: List user categories responses: - "200": "200": description: List of categories post: @@ -376,18 +293,17 @@ paths: name: type: string responses: - "201": "201": description: Category created /categories/{id}: + parameters: + - in: path + name: id + required: true + schema: + type: string put: summary: Rename a category - parameters: - - in: path - name: id - required: true - schema: - type: string requestBody: content: application/json: @@ -397,19 +313,11 @@ paths: name: type: string responses: - "200": "200": description: Category updated delete: summary: Delete a category - parameters: - - in: path - name: id - required: true - schema: - type: string responses: - "204": "204": description: Category deleted /summary/monthly: @@ -421,7 +329,6 @@ paths: schema: type: string responses: - "200": "200": description: Monthly summary /summary: @@ -437,14 +344,12 @@ paths: schema: type: string responses: - "200": "200": description: Summary /summary/alerts: get: summary: Budget overrun alert responses: - "200": "200": description: Alert info /receipts/{id}: @@ -457,14 +362,11 @@ paths: schema: type: string responses: - "200": "200": description: Receipt file /user/profile: get: summary: Get user profile responses: - "200": "200": description: Profile info -