Skip to content
Snippets Groups Projects
Commit 5399f1e8 authored by Anders Høvik's avatar Anders Høvik
Browse files

Merge branch 'main' into fix/menu-bug

parents 280a3ccd 1025a902
No related branches found
No related tags found
1 merge request!54Fix/menu bug
Pipeline #280864 passed with warnings
...@@ -36,8 +36,8 @@ ...@@ -36,8 +36,8 @@
"required": true "required": true
}, },
"responses": { "responses": {
"200": { "404": {
"description": "No accounts associated with a bank user", "description": "Bank profile id does not exist",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -46,8 +46,8 @@ ...@@ -46,8 +46,8 @@
} }
} }
}, },
"404": { "200": {
"description": "Bank profile id does not exist", "description": "No accounts associated with a bank user",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -78,8 +78,8 @@ ...@@ -78,8 +78,8 @@
"required": true "required": true
}, },
"responses": { "responses": {
"200": { "400": {
"description": "Successfully created a bank profile", "description": "Could not create profile",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -88,8 +88,8 @@ ...@@ -88,8 +88,8 @@
} }
} }
}, },
"400": { "200": {
"description": "Could not create profile", "description": "Successfully created a bank profile",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -120,8 +120,8 @@ ...@@ -120,8 +120,8 @@
"required": true "required": true
}, },
"responses": { "responses": {
"200": { "404": {
"description": "Successfully created account", "description": "Provided bank profile id could not be found",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -130,8 +130,8 @@ ...@@ -130,8 +130,8 @@
} }
} }
}, },
"404": { "200": {
"description": "Provided bank profile id could not be found", "description": "Successfully created account",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -188,17 +188,17 @@ ...@@ -188,17 +188,17 @@
"required": true "required": true
}, },
"responses": { "responses": {
"204": {
"description": "Password was reset successfully"
},
"403": { "403": {
"description": "Invalid token" "description": "Invalid token"
},
"204": {
"description": "Password was reset successfully"
} }
}, },
"security": [] "security": []
} }
}, },
"/api/image/upload": { "/api/images": {
"post": { "post": {
"tags": [ "tags": [
"Image" "Image"
...@@ -208,7 +208,7 @@ ...@@ -208,7 +208,7 @@
"operationId": "uploadImage", "operationId": "uploadImage",
"requestBody": { "requestBody": {
"content": { "content": {
"application/json": { "multipart/form-data": {
"schema": { "schema": {
"required": [ "required": [
"file" "file"
...@@ -225,19 +225,8 @@ ...@@ -225,19 +225,8 @@
} }
}, },
"responses": { "responses": {
"200": {
"description": "Successfully uploaded the image",
"content": {
"*/*": {
"schema": {
"type": "integer",
"format": "int64"
}
}
}
},
"201": { "201": {
"description": "Created", "description": "Successfully uploaded the image",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -280,7 +269,7 @@ ...@@ -280,7 +269,7 @@
} }
} }
}, },
"/api/budget/update": { "/api/budget/update/{budgetId}": {
"post": { "post": {
"tags": [ "tags": [
"User" "User"
...@@ -288,19 +277,30 @@ ...@@ -288,19 +277,30 @@
"summary": "Updates a budget", "summary": "Updates a budget",
"description": "Updates a budget based on the budget request", "description": "Updates a budget based on the budget request",
"operationId": "updateBudget", "operationId": "updateBudget",
"parameters": [
{
"name": "budgetId",
"in": "path",
"required": true,
"schema": {
"type": "integer",
"format": "int64"
}
}
],
"requestBody": { "requestBody": {
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
"$ref": "#/components/schemas/BudgetResponseDTO" "$ref": "#/components/schemas/BudgetRequestDTO"
} }
} }
}, },
"required": true "required": true
}, },
"responses": { "responses": {
"200": { "500": {
"description": "Successfully updated budget", "description": "Budget is not found",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -309,8 +309,8 @@ ...@@ -309,8 +309,8 @@
} }
} }
}, },
"500": { "200": {
"description": "Budget is not found", "description": "Successfully updated budget",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -352,8 +352,8 @@ ...@@ -352,8 +352,8 @@
"required": true "required": true
}, },
"responses": { "responses": {
"200": { "500": {
"description": "Successfully updated budget", "description": "Error updating expense",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -362,8 +362,8 @@ ...@@ -362,8 +362,8 @@
} }
} }
}, },
"500": { "200": {
"description": "Error updating expense", "description": "Successfully updated budget",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -426,22 +426,22 @@ ...@@ -426,22 +426,22 @@
} }
], ],
"responses": { "responses": {
"200": { "409": {
"description": "Email is valid", "description": "Email already exists",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
"type": "object" "$ref": "#/components/schemas/ExceptionResponse"
} }
} }
} }
}, },
"409": { "200": {
"description": "Email already exists", "description": "Email is valid",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
"$ref": "#/components/schemas/ExceptionResponse" "type": "object"
} }
} }
} }
...@@ -610,6 +610,38 @@ ...@@ -610,6 +610,38 @@
} }
} }
}, },
"/api/users/password": {
"patch": {
"tags": [
"User"
],
"summary": "Update a password",
"description": "Update the password of the authenticated user",
"operationId": "updatePassword",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/PasswordUpdateDTO"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "Successfully updated password",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/UserDTO"
}
}
}
}
}
}
},
"/bank/v1/account/accounts/ssn/{ssn}": { "/bank/v1/account/accounts/ssn/{ssn}": {
"get": { "get": {
"tags": [ "tags": [
...@@ -679,8 +711,8 @@ ...@@ -679,8 +711,8 @@
} }
], ],
"responses": { "responses": {
"200": { "404": {
"description": "No accounts associated with a bank user", "description": "Bank profile id does not exist",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -692,8 +724,8 @@ ...@@ -692,8 +724,8 @@
} }
} }
}, },
"404": { "200": {
"description": "Bank profile id does not exist", "description": "No accounts associated with a bank user",
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
...@@ -859,7 +891,7 @@ ...@@ -859,7 +891,7 @@
} }
} }
}, },
"/api/image/{id}": { "/api/images/{id}": {
"get": { "get": {
"tags": [ "tags": [
"Image" "Image"
...@@ -884,16 +916,24 @@ ...@@ -884,16 +916,24 @@
"content": { "content": {
"*/*": { "*/*": {
"schema": { "schema": {
"type": "array", "type": "string",
"items": { "format": "binary"
"type": "string", }
"format": "byte" }
} }
},
"404": {
"description": "Image not found",
"content": {
"*/*": {
"schema": {
"$ref": "#/components/schemas/ExceptionResponse"
} }
} }
} }
} }
} },
"security": []
} }
}, },
"/api/goal/getGoals": { "/api/goal/getGoals": {
...@@ -984,8 +1024,8 @@ ...@@ -984,8 +1024,8 @@
} }
], ],
"responses": { "responses": {
"200": { "500": {
"description": "Successfully got budget", "description": "Budget is not found",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -994,8 +1034,8 @@ ...@@ -994,8 +1034,8 @@
} }
} }
}, },
"500": { "200": {
"description": "Budget is not found", "description": "Successfully got budget",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -1106,8 +1146,8 @@ ...@@ -1106,8 +1146,8 @@
} }
], ],
"responses": { "responses": {
"200": { "500": {
"description": "Successfully deleted budget", "description": "Budget is not found",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -1116,8 +1156,8 @@ ...@@ -1116,8 +1156,8 @@
} }
} }
}, },
"500": { "200": {
"description": "Budget is not found", "description": "Successfully deleted budget",
"content": { "content": {
"application/json": { "application/json": {
"schema": { "schema": {
...@@ -1420,13 +1460,9 @@ ...@@ -1420,13 +1460,9 @@
} }
} }
}, },
"BudgetResponseDTO": { "BudgetRequestDTO": {
"type": "object", "type": "object",
"properties": { "properties": {
"id": {
"type": "integer",
"format": "int64"
},
"budgetName": { "budgetName": {
"type": "string" "type": "string"
}, },
...@@ -1435,10 +1471,6 @@ ...@@ -1435,10 +1471,6 @@
}, },
"expenseAmount": { "expenseAmount": {
"type": "number" "type": "number"
},
"createdAt": {
"type": "string",
"format": "date-time"
} }
} }
}, },
...@@ -1457,20 +1489,6 @@ ...@@ -1457,20 +1489,6 @@
} }
} }
}, },
"BudgetRequestDTO": {
"type": "object",
"properties": {
"budgetName": {
"type": "string"
},
"budgetAmount": {
"type": "number"
},
"expenseAmount": {
"type": "number"
}
}
},
"Badge": { "Badge": {
"type": "object", "type": "object",
"properties": { "properties": {
...@@ -1663,6 +1681,10 @@ ...@@ -1663,6 +1681,10 @@
"email": { "email": {
"type": "string" "type": "string"
}, },
"profileImage": {
"type": "integer",
"format": "int64"
},
"checkingAccount": { "checkingAccount": {
"$ref": "#/components/schemas/Account" "$ref": "#/components/schemas/Account"
}, },
...@@ -1701,21 +1723,21 @@ ...@@ -1701,21 +1723,21 @@
"enabled": { "enabled": {
"type": "boolean" "type": "boolean"
}, },
"accountNonExpired": {
"type": "boolean"
},
"credentialsNonExpired": {
"type": "boolean"
},
"username": {
"type": "string"
},
"authorities": { "authorities": {
"type": "array", "type": "array",
"items": { "items": {
"$ref": "#/components/schemas/GrantedAuthority" "$ref": "#/components/schemas/GrantedAuthority"
} }
}, },
"username": {
"type": "string"
},
"accountNonExpired": {
"type": "boolean"
},
"credentialsNonExpired": {
"type": "boolean"
},
"accountNonLocked": { "accountNonLocked": {
"type": "boolean" "type": "boolean"
} }
...@@ -1813,8 +1835,9 @@ ...@@ -1813,8 +1835,9 @@
"email": { "email": {
"type": "string" "type": "string"
}, },
"password": { "profileImage": {
"type": "string" "type": "integer",
"format": "int64"
}, },
"configuration": { "configuration": {
"$ref": "#/components/schemas/ConfigurationDTO" "$ref": "#/components/schemas/ConfigurationDTO"
...@@ -1834,6 +1857,10 @@ ...@@ -1834,6 +1857,10 @@
"lastName": { "lastName": {
"type": "string" "type": "string"
}, },
"profileImage": {
"type": "integer",
"format": "int64"
},
"email": { "email": {
"type": "string" "type": "string"
}, },
...@@ -1858,6 +1885,17 @@ ...@@ -1858,6 +1885,17 @@
} }
} }
}, },
"PasswordUpdateDTO": {
"type": "object",
"properties": {
"oldPassword": {
"type": "string"
},
"newPassword": {
"type": "string"
}
}
},
"ProfileDTO": { "ProfileDTO": {
"type": "object", "type": "object",
"properties": { "properties": {
...@@ -1871,6 +1909,10 @@ ...@@ -1871,6 +1909,10 @@
"lastName": { "lastName": {
"type": "string" "type": "string"
}, },
"profileImage": {
"type": "integer",
"format": "int64"
},
"createdAt": { "createdAt": {
"type": "string", "type": "string",
"format": "date-time" "format": "date-time"
...@@ -1910,6 +1952,28 @@ ...@@ -1910,6 +1952,28 @@
} }
} }
}, },
"BudgetResponseDTO": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int64"
},
"budgetName": {
"type": "string"
},
"budgetAmount": {
"type": "number"
},
"expenseAmount": {
"type": "number"
},
"createdAt": {
"type": "string",
"format": "date-time"
}
}
},
"ExpenseResponseDTO": { "ExpenseResponseDTO": {
"type": "object", "type": "object",
"properties": { "properties": {
......
...@@ -37,6 +37,7 @@ export type { LoginRequest } from './models/LoginRequest'; ...@@ -37,6 +37,7 @@ export type { LoginRequest } from './models/LoginRequest';
export { ParticipantDTO } from './models/ParticipantDTO'; export { ParticipantDTO } from './models/ParticipantDTO';
export type { ParticipantUserDTO } from './models/ParticipantUserDTO'; export type { ParticipantUserDTO } from './models/ParticipantUserDTO';
export type { PasswordResetDTO } from './models/PasswordResetDTO'; export type { PasswordResetDTO } from './models/PasswordResetDTO';
export type { PasswordUpdateDTO } from './models/PasswordUpdateDTO';
export type { Point } from './models/Point'; export type { Point } from './models/Point';
export type { ProfileDTO } from './models/ProfileDTO'; export type { ProfileDTO } from './models/ProfileDTO';
export type { SignUpRequest } from './models/SignUpRequest'; export type { SignUpRequest } from './models/SignUpRequest';
......
/* generated using openapi-typescript-codegen -- do not edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type PasswordUpdateDTO = {
oldPassword?: string;
newPassword?: string;
};
...@@ -6,6 +6,7 @@ export type ProfileDTO = { ...@@ -6,6 +6,7 @@ export type ProfileDTO = {
id?: number; id?: number;
firstName?: string; firstName?: string;
lastName?: string; lastName?: string;
profileImage?: number;
createdAt?: string; createdAt?: string;
}; };
...@@ -13,6 +13,7 @@ export type User = { ...@@ -13,6 +13,7 @@ export type User = {
firstName?: string; firstName?: string;
lastName?: string; lastName?: string;
email?: string; email?: string;
profileImage?: number;
checkingAccount?: Account; checkingAccount?: Account;
savingsAccount?: Account; savingsAccount?: Account;
password?: string; password?: string;
...@@ -23,10 +24,10 @@ export type User = { ...@@ -23,10 +24,10 @@ export type User = {
streak?: Streak; streak?: Streak;
configuration?: Configuration; configuration?: Configuration;
enabled?: boolean; enabled?: boolean;
authorities?: Array<GrantedAuthority>;
username?: string;
accountNonExpired?: boolean; accountNonExpired?: boolean;
credentialsNonExpired?: boolean; credentialsNonExpired?: boolean;
username?: string;
authorities?: Array<GrantedAuthority>;
accountNonLocked?: boolean; accountNonLocked?: boolean;
}; };
export namespace User { export namespace User {
......
...@@ -6,6 +6,7 @@ export type UserDTO = { ...@@ -6,6 +6,7 @@ export type UserDTO = {
id?: number; id?: number;
firstName?: string; firstName?: string;
lastName?: string; lastName?: string;
profileImage?: number;
email?: string; email?: string;
createdAt?: string; createdAt?: string;
role?: string; role?: string;
......
...@@ -7,7 +7,7 @@ export type UserUpdateDTO = { ...@@ -7,7 +7,7 @@ export type UserUpdateDTO = {
firstName?: string; firstName?: string;
lastName?: string; lastName?: string;
email?: string; email?: string;
password?: string; profileImage?: number;
configuration?: ConfigurationDTO; configuration?: ConfigurationDTO;
}; };
...@@ -13,36 +13,39 @@ export class ImageService { ...@@ -13,36 +13,39 @@ export class ImageService {
* @throws ApiError * @throws ApiError
*/ */
public static uploadImage({ public static uploadImage({
requestBody, formData,
}: { }: {
requestBody?: { formData?: {
file: Blob; file: Blob;
}, },
}): CancelablePromise<number> { }): CancelablePromise<number> {
return __request(OpenAPI, { return __request(OpenAPI, {
method: 'POST', method: 'POST',
url: '/api/image/upload', url: '/api/images',
body: requestBody, formData: formData,
mediaType: 'application/json', mediaType: 'multipart/form-data',
}); });
} }
/** /**
* Retrieve an image * Retrieve an image
* Retrieve an image from the server * Retrieve an image from the server
* @returns string Successfully retrieved the image * @returns binary Successfully retrieved the image
* @throws ApiError * @throws ApiError
*/ */
public static getImage({ public static getImage({
id, id,
}: { }: {
id: number, id: number,
}): CancelablePromise<Array<string>> { }): CancelablePromise<Blob> {
return __request(OpenAPI, { return __request(OpenAPI, {
method: 'GET', method: 'GET',
url: '/api/image/{id}', url: '/api/images/{id}',
path: { path: {
'id': id, 'id': id,
}, },
errors: {
404: `Image not found`,
},
}); });
} }
} }
...@@ -10,6 +10,7 @@ import type { BudgetResponseDTO } from '../models/BudgetResponseDTO'; ...@@ -10,6 +10,7 @@ import type { BudgetResponseDTO } from '../models/BudgetResponseDTO';
import type { ExpenseRequestDTO } from '../models/ExpenseRequestDTO'; import type { ExpenseRequestDTO } from '../models/ExpenseRequestDTO';
import type { ExpenseResponseDTO } from '../models/ExpenseResponseDTO'; import type { ExpenseResponseDTO } from '../models/ExpenseResponseDTO';
import type { PasswordResetDTO } from '../models/PasswordResetDTO'; import type { PasswordResetDTO } from '../models/PasswordResetDTO';
import type { PasswordUpdateDTO } from '../models/PasswordUpdateDTO';
import type { ProfileDTO } from '../models/ProfileDTO'; import type { ProfileDTO } from '../models/ProfileDTO';
import type { UserDTO } from '../models/UserDTO'; import type { UserDTO } from '../models/UserDTO';
import type { UserUpdateDTO } from '../models/UserUpdateDTO'; import type { UserUpdateDTO } from '../models/UserUpdateDTO';
...@@ -63,13 +64,18 @@ export class UserService { ...@@ -63,13 +64,18 @@ export class UserService {
* @throws ApiError * @throws ApiError
*/ */
public static updateBudget({ public static updateBudget({
budgetId,
requestBody, requestBody,
}: { }: {
requestBody: BudgetResponseDTO, budgetId: number,
requestBody: BudgetRequestDTO,
}): CancelablePromise<Record<string, any>> { }): CancelablePromise<Record<string, any>> {
return __request(OpenAPI, { return __request(OpenAPI, {
method: 'POST', method: 'POST',
url: '/api/budget/update', url: '/api/budget/update/{budgetId}',
path: {
'budgetId': budgetId,
},
body: requestBody, body: requestBody,
mediaType: 'application/json', mediaType: 'application/json',
errors: { errors: {
...@@ -157,6 +163,24 @@ export class UserService { ...@@ -157,6 +163,24 @@ export class UserService {
mediaType: 'application/json', mediaType: 'application/json',
}); });
} }
/**
* Update a password
* Update the password of the authenticated user
* @returns UserDTO Successfully updated password
* @throws ApiError
*/
public static updatePassword({
requestBody,
}: {
requestBody: PasswordUpdateDTO,
}): CancelablePromise<UserDTO> {
return __request(OpenAPI, {
method: 'PATCH',
url: '/api/users/password',
body: requestBody,
mediaType: 'application/json',
});
}
/** /**
* Get a profile * Get a profile
* Get the profile of a user * Get the profile of a user
......
...@@ -62,8 +62,7 @@ const handleSubmit = async () => { ...@@ -62,8 +62,7 @@ const handleSubmit = async () => {
const updateUserPayload: UserUpdateDTO = { const updateUserPayload: UserUpdateDTO = {
firstName: firstNameRef.value, firstName: firstNameRef.value,
lastName: surnameRef.value, lastName: surnameRef.value,
email: emailRef.value, email: emailRef.value
password: passwordRef.value
}; };
......
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