Skip to content
Snippets Groups Projects
Commit e8e628be authored by VIktorGrev's avatar VIktorGrev
Browse files

Merge branch 'feat/profile-and-settings-improvements' of...

Merge branch 'feat/profile-and-settings-improvements' of https://gitlab.stud.idi.ntnu.no/idatt2106-2024-07/frontend into feat/profile-and-settings-improvements
parents 136decaf 2e947a38
No related branches found
No related tags found
1 merge request!99fix: new OpenAPI spec
Pipeline #284945 failed
...@@ -12,8 +12,7 @@ export type { AccountRequestDTO } from './models/AccountRequestDTO'; ...@@ -12,8 +12,7 @@ export type { AccountRequestDTO } from './models/AccountRequestDTO';
export type { AccountResponseDTO } from './models/AccountResponseDTO'; export type { AccountResponseDTO } from './models/AccountResponseDTO';
export type { AuthenticationResponse } from './models/AuthenticationResponse'; export type { AuthenticationResponse } from './models/AuthenticationResponse';
export type { BadgeDTO } from './models/BadgeDTO'; export type { BadgeDTO } from './models/BadgeDTO';
export type { BankAccountDTO } from './models/BankAccountDTO'; export type { BalanceDTO } from './models/BalanceDTO';
export type { BankAccountResponseDTO } from './models/BankAccountResponseDTO';
export type { BankIDRequest } from './models/BankIDRequest'; export type { BankIDRequest } from './models/BankIDRequest';
export type { BankProfile } from './models/BankProfile'; export type { BankProfile } from './models/BankProfile';
export type { BankProfileDTO } from './models/BankProfileDTO'; export type { BankProfileDTO } from './models/BankProfileDTO';
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/* istanbul ignore file */ /* istanbul ignore file */
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
export type BankAccountResponseDTO = { export type BalanceDTO = {
bban?: number; bban?: number;
balance?: number; balance?: number;
}; };
......
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type BankAccountDTO = {
bban?: number;
bankAccountType?: string;
};
...@@ -8,6 +8,8 @@ export type SignUpRequest = { ...@@ -8,6 +8,8 @@ export type SignUpRequest = {
lastName?: string; lastName?: string;
email?: string; email?: string;
password?: string; password?: string;
checkingAccountBBAN?: number;
savingsAccountBBAN?: number;
configuration: ConfigurationDTO; configuration: ConfigurationDTO;
}; };
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
/* istanbul ignore file */ /* istanbul ignore file */
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
import type { BankAccountResponseDTO } from './BankAccountResponseDTO';
import type { PointDTO } from './PointDTO'; import type { PointDTO } from './PointDTO';
import type { StreakDTO } from './StreakDTO'; import type { StreakDTO } from './StreakDTO';
export type UserDTO = { export type UserDTO = {
...@@ -15,8 +14,8 @@ export type UserDTO = { ...@@ -15,8 +14,8 @@ export type UserDTO = {
createdAt?: string; createdAt?: string;
role?: string; role?: string;
subscriptionLevel?: string; subscriptionLevel?: string;
checkingAccount?: BankAccountResponseDTO; checkingAccountBBAN?: number;
savingsAccount?: BankAccountResponseDTO; savingsAccountBBAN?: number;
point?: PointDTO; point?: PointDTO;
streak?: StreakDTO; streak?: StreakDTO;
}; };
......
...@@ -9,6 +9,8 @@ export type UserUpdateDTO = { ...@@ -9,6 +9,8 @@ export type UserUpdateDTO = {
email?: string; email?: string;
profileImage?: number; profileImage?: number;
bannerImage?: number; bannerImage?: number;
savingsAccountBBAN?: number;
checkingAccountBBAN?: number;
configuration?: ConfigurationDTO; configuration?: ConfigurationDTO;
}; };
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
import type { Account } from '../models/Account'; import type { Account } from '../models/Account';
import type { AccountRequestDTO } from '../models/AccountRequestDTO'; import type { AccountRequestDTO } from '../models/AccountRequestDTO';
import type { AccountResponseDTO } from '../models/AccountResponseDTO'; import type { AccountResponseDTO } from '../models/AccountResponseDTO';
import type { BalanceDTO } from '../models/BalanceDTO';
import type { CancelablePromise } from '../core/CancelablePromise'; import type { CancelablePromise } from '../core/CancelablePromise';
import { OpenAPI } from '../core/OpenAPI'; import { OpenAPI } from '../core/OpenAPI';
import { request as __request } from '../core/request'; import { request as __request } from '../core/request';
...@@ -30,6 +31,28 @@ export class AccountControllerService { ...@@ -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 user accounts
* Get accounts associated with a user by providing their social security number * Get accounts associated with a user by providing their social security number
......
...@@ -2,8 +2,6 @@ ...@@ -2,8 +2,6 @@
/* istanbul ignore file */ /* istanbul ignore file */
/* tslint:disable */ /* tslint:disable */
/* eslint-disable */ /* eslint-disable */
import type { Account } from '../models/Account';
import type { BankAccountDTO } from '../models/BankAccountDTO';
import type { FeedbackRequestDTO } from '../models/FeedbackRequestDTO'; import type { FeedbackRequestDTO } from '../models/FeedbackRequestDTO';
import type { FeedbackResponseDTO } from '../models/FeedbackResponseDTO'; import type { FeedbackResponseDTO } from '../models/FeedbackResponseDTO';
import type { PasswordResetDTO } from '../models/PasswordResetDTO'; import type { PasswordResetDTO } from '../models/PasswordResetDTO';
...@@ -109,24 +107,6 @@ export class UserService { ...@@ -109,24 +107,6 @@ export class UserService {
mediaType: 'application/json', 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 a password
* Update the password of the authenticated user * Update the password of the authenticated user
...@@ -220,6 +200,18 @@ export class UserService { ...@@ -220,6 +200,18 @@ export class UserService {
url: '/api/users/me', 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
* Send feedback from a user. * Send feedback from a user.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment