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
Branches
No related tags found
1 merge request!99fix: new OpenAPI spec
Pipeline #284945 failed
......@@ -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';
......
......@@ -2,7 +2,7 @@
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type BankAccountResponseDTO = {
export type BalanceDTO = {
bban?: 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 = {
lastName?: string;
email?: string;
password?: string;
checkingAccountBBAN?: number;
savingsAccountBBAN?: number;
configuration: ConfigurationDTO;
};
......@@ -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;
};
......
......@@ -9,6 +9,8 @@ export type UserUpdateDTO = {
email?: string;
profileImage?: number;
bannerImage?: number;
savingsAccountBBAN?: number;
checkingAccountBBAN?: number;
configuration?: ConfigurationDTO;
};
......@@ -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
......
......@@ -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.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment