diff --git a/src/api/index.ts b/src/api/index.ts index cfeb244eadd5c15b0d35dcb2b438c22b5e9a2ab6..6eac6e3b97685b4ddc4f788b6f48f939dfa831e5 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -12,8 +12,7 @@ export type { AccountRequestDTO } from './models/AccountRequestDTO'; export type { AccountResponseDTO } from './models/AccountResponseDTO'; export type { AuthenticationResponse } from './models/AuthenticationResponse'; export type { BadgeDTO } from './models/BadgeDTO'; -export type { BankAccountDTO } from './models/BankAccountDTO'; -export type { BankAccountResponseDTO } from './models/BankAccountResponseDTO'; +export type { BalanceDTO } from './models/BalanceDTO'; export type { BankIDRequest } from './models/BankIDRequest'; export type { BankProfile } from './models/BankProfile'; export type { BankProfileDTO } from './models/BankProfileDTO'; diff --git a/src/api/models/BankAccountResponseDTO.ts b/src/api/models/BalanceDTO.ts similarity index 82% rename from src/api/models/BankAccountResponseDTO.ts rename to src/api/models/BalanceDTO.ts index ed03efb50ae0c92f6556f22171663b4ef04d0d94..9d400734e966952ab4492239c3977e4d7a434edb 100644 --- a/src/api/models/BankAccountResponseDTO.ts +++ b/src/api/models/BalanceDTO.ts @@ -2,7 +2,7 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export type BankAccountResponseDTO = { +export type BalanceDTO = { bban?: number; balance?: number; }; diff --git a/src/api/models/BankAccountDTO.ts b/src/api/models/BankAccountDTO.ts deleted file mode 100644 index b1ac2aac884d14d4e4a3241482e6861a8e91a7ab..0000000000000000000000000000000000000000 --- a/src/api/models/BankAccountDTO.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do not edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type BankAccountDTO = { - bban?: number; - bankAccountType?: string; -}; - diff --git a/src/api/models/SignUpRequest.ts b/src/api/models/SignUpRequest.ts index 72720c40f1f0d870e4f713aaa2215dbd3b59f914..ae32d8fef4943a273dac83e3f72e48b759582779 100644 --- a/src/api/models/SignUpRequest.ts +++ b/src/api/models/SignUpRequest.ts @@ -8,6 +8,8 @@ export type SignUpRequest = { lastName?: string; email?: string; password?: string; + checkingAccountBBAN?: number; + savingsAccountBBAN?: number; configuration: ConfigurationDTO; }; diff --git a/src/api/models/UserDTO.ts b/src/api/models/UserDTO.ts index 5d036f873750a6e1dc8ec600620eb6c54ff937a2..a94d14567640f5d9b30901361f5fd94097ce2f93 100644 --- a/src/api/models/UserDTO.ts +++ b/src/api/models/UserDTO.ts @@ -2,7 +2,6 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { BankAccountResponseDTO } from './BankAccountResponseDTO'; import type { PointDTO } from './PointDTO'; import type { StreakDTO } from './StreakDTO'; export type UserDTO = { @@ -15,8 +14,8 @@ export type UserDTO = { createdAt?: string; role?: string; subscriptionLevel?: string; - checkingAccount?: BankAccountResponseDTO; - savingsAccount?: BankAccountResponseDTO; + checkingAccountBBAN?: number; + savingsAccountBBAN?: number; point?: PointDTO; streak?: StreakDTO; }; diff --git a/src/api/models/UserUpdateDTO.ts b/src/api/models/UserUpdateDTO.ts index d1d922cf444e61f26af805484b2fe9c0cc6e5426..ea34828c404818efdad9904e2d7c6e29ae847591 100644 --- a/src/api/models/UserUpdateDTO.ts +++ b/src/api/models/UserUpdateDTO.ts @@ -9,6 +9,8 @@ export type UserUpdateDTO = { email?: string; profileImage?: number; bannerImage?: number; + savingsAccountBBAN?: number; + checkingAccountBBAN?: number; configuration?: ConfigurationDTO; }; diff --git a/src/api/services/AccountControllerService.ts b/src/api/services/AccountControllerService.ts index 181460cbe891524b1508866a63130c5546ab56ee..407586d5513b619bf165f827ec56ee730f42fb85 100644 --- a/src/api/services/AccountControllerService.ts +++ b/src/api/services/AccountControllerService.ts @@ -5,6 +5,7 @@ import type { Account } from '../models/Account'; import type { AccountRequestDTO } from '../models/AccountRequestDTO'; import type { AccountResponseDTO } from '../models/AccountResponseDTO'; +import type { BalanceDTO } from '../models/BalanceDTO'; import type { CancelablePromise } from '../core/CancelablePromise'; import { OpenAPI } from '../core/OpenAPI'; import { request as __request } from '../core/request'; @@ -30,6 +31,28 @@ export class AccountControllerService { }, }); } + /** + * Create account + * Create account with random balance + * @returns BalanceDTO Successfully created account + * @throws ApiError + */ + public static getAccountsByBban({ + bban, + }: { + bban: number, + }): CancelablePromise<BalanceDTO> { + return __request(OpenAPI, { + method: 'GET', + url: '/bank/v1/account/balance/{bban}', + path: { + 'bban': bban, + }, + errors: { + 404: `Provided bban could not be found`, + }, + }); + } /** * Get user accounts * Get accounts associated with a user by providing their social security number diff --git a/src/api/services/UserService.ts b/src/api/services/UserService.ts index 51df6e46b965ecbb438f7dcfb68258422e13d22e..937ebd2a011227360c45a788069445e0bad0a35e 100644 --- a/src/api/services/UserService.ts +++ b/src/api/services/UserService.ts @@ -2,8 +2,6 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -import type { Account } from '../models/Account'; -import type { BankAccountDTO } from '../models/BankAccountDTO'; import type { FeedbackRequestDTO } from '../models/FeedbackRequestDTO'; import type { FeedbackResponseDTO } from '../models/FeedbackResponseDTO'; import type { PasswordResetDTO } from '../models/PasswordResetDTO'; @@ -109,24 +107,6 @@ export class UserService { mediaType: 'application/json', }); } - /** - * Update a user's bank account - * Changes either a user's checking account or savings account - * @returns Account OK - * @throws ApiError - */ - public static selectBankAccount({ - requestBody, - }: { - requestBody: BankAccountDTO, - }): CancelablePromise<Account> { - return __request(OpenAPI, { - method: 'PATCH', - url: '/api/users/update-account', - body: requestBody, - mediaType: 'application/json', - }); - } /** * Update a password * Update the password of the authenticated user @@ -220,6 +200,18 @@ export class UserService { url: '/api/users/me', }); } + /** + * Delete the authenticated user + * Delete the authenticated user + * @returns any Successfully deleted user + * @throws ApiError + */ + public static deleteUser(): CancelablePromise<any> { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/users/me', + }); + } /** * Send feedback * Send feedback from a user.