diff --git a/src/api/index.ts b/src/api/index.ts index 952a64c78269b8003d0635a30820fdd15932e689..b63858683d0644088eaa29f307035f0f4d44ef0b 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -7,17 +7,35 @@ export { CancelablePromise, CancelError } from './core/CancelablePromise'; export { OpenAPI } from './core/OpenAPI'; export type { OpenAPIConfig } from './core/OpenAPI'; +export type { Account } from './models/Account'; +export type { AccountRequestDTO } from './models/AccountRequestDTO'; +export type { AccountResponseDTO } from './models/AccountResponseDTO'; export type { AuthenticationResponse } from './models/AuthenticationResponse'; +export type { BankProfile } from './models/BankProfile'; +export type { BankProfileDTO } from './models/BankProfileDTO'; +export type { BankProfileResponseDTO } from './models/BankProfileResponseDTO'; +export type { ChallengeDTO } from './models/ChallengeDTO'; +export type { ConfigurationDTO } from './models/ConfigurationDTO'; +export type { CreateGoalDTO } from './models/CreateGoalDTO'; +export type { DailyChallengeProgressDTO } from './models/DailyChallengeProgressDTO'; export type { ExceptionResponse } from './models/ExceptionResponse'; +export type { GoalDTO } from './models/GoalDTO'; export type { LeaderboardDTO } from './models/LeaderboardDTO'; export type { LeaderboardEntryDTO } from './models/LeaderboardEntryDTO'; export type { LoginRequest } from './models/LoginRequest'; +export { ParticipantDTO } from './models/ParticipantDTO'; +export type { ParticipantUserDTO } from './models/ParticipantUserDTO'; export type { PasswordResetDTO } from './models/PasswordResetDTO'; export type { ProfileDTO } from './models/ProfileDTO'; export type { SignUpRequest } from './models/SignUpRequest'; +export type { TransactionDTO } from './models/TransactionDTO'; export type { UserDTO } from './models/UserDTO'; export type { UserUpdateDTO } from './models/UserUpdateDTO'; +export { AccountControllerService } from './services/AccountControllerService'; export { AuthenticationService } from './services/AuthenticationService'; +export { BankProfileControllerService } from './services/BankProfileControllerService'; +export { GoalService } from './services/GoalService'; export { LeaderboardService } from './services/LeaderboardService'; +export { TransactionControllerService } from './services/TransactionControllerService'; export { UserService } from './services/UserService'; diff --git a/src/api/models/Account.ts b/src/api/models/Account.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb3a63221139e5c22defbd906d3017d6286435ab --- /dev/null +++ b/src/api/models/Account.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BankProfile } from './BankProfile'; +export type Account = { + bban?: number; + balance?: number; + bankProfile?: BankProfile; +}; + diff --git a/src/api/models/AccountRequestDTO.ts b/src/api/models/AccountRequestDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2f7ddd34fb91f531ac004c517213fcd31dd2c0d --- /dev/null +++ b/src/api/models/AccountRequestDTO.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type AccountRequestDTO = { + ssn?: number; +}; + diff --git a/src/api/models/AccountResponseDTO.ts b/src/api/models/AccountResponseDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..276a2131b75b4c6dd96beb6eae76e448f0a07bb6 --- /dev/null +++ b/src/api/models/AccountResponseDTO.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type AccountResponseDTO = { + bankProfileId?: number; + balance?: number; +}; + diff --git a/src/api/models/BankProfile.ts b/src/api/models/BankProfile.ts new file mode 100644 index 0000000000000000000000000000000000000000..b4fe99e6921234a056658b64a4b0ea6ec5e33f69 --- /dev/null +++ b/src/api/models/BankProfile.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Account } from './Account'; +export type BankProfile = { + id?: number; + ssn?: number; + accounts?: Array<Account>; +}; + diff --git a/src/api/models/BankProfileDTO.ts b/src/api/models/BankProfileDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..e6b1b89cb3c01a69bb0276e169f93d7e5787c5a7 --- /dev/null +++ b/src/api/models/BankProfileDTO.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type BankProfileDTO = { + ssn?: number; +}; + diff --git a/src/api/models/BankProfileResponseDTO.ts b/src/api/models/BankProfileResponseDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ef2360b3463e66b704ff1b587f7598b4efba5dd --- /dev/null +++ b/src/api/models/BankProfileResponseDTO.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Account } from './Account'; +export type BankProfileResponseDTO = { + ssn?: number; + accounts?: Array<Account>; +}; + diff --git a/src/api/models/ChallengeDTO.ts b/src/api/models/ChallengeDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..f5bd38d483c363d921274e9ed77dbd5e6d4aef75 --- /dev/null +++ b/src/api/models/ChallengeDTO.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { DailyChallengeProgressDTO } from './DailyChallengeProgressDTO'; +export type ChallengeDTO = { + id?: number; + potentialSavingAmount?: number; + points?: number; + days?: number; + createdAt?: string; + dailyChallengeProgressList?: Array<DailyChallengeProgressDTO>; +}; + diff --git a/src/api/models/ConfigurationDTO.ts b/src/api/models/ConfigurationDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..4d4b45261998b7595857854df32b24269b026d4f --- /dev/null +++ b/src/api/models/ConfigurationDTO.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ConfigurationDTO = { + commitment?: string; + experience?: string; + challengeTypes?: Array<string>; +}; + diff --git a/src/api/models/CreateGoalDTO.ts b/src/api/models/CreateGoalDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..61eb0457b42b2aebf8be3c560bcd62d2346648e4 --- /dev/null +++ b/src/api/models/CreateGoalDTO.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type CreateGoalDTO = { + goalName?: string; + description?: string; + targetAmount?: number; + targetDate?: string; +}; + diff --git a/src/api/models/DailyChallengeProgressDTO.ts b/src/api/models/DailyChallengeProgressDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7bda736cefef3aebff0533272807cde205e16ee --- /dev/null +++ b/src/api/models/DailyChallengeProgressDTO.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type DailyChallengeProgressDTO = { + id?: number; + challengeDay?: number; + completedAt?: string; +}; + diff --git a/src/api/models/GoalDTO.ts b/src/api/models/GoalDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..004eb49fd0bec010a1d4227bac6ec6bbc3daea50 --- /dev/null +++ b/src/api/models/GoalDTO.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ChallengeDTO } from './ChallengeDTO'; +import type { ParticipantDTO } from './ParticipantDTO'; +export type GoalDTO = { + id?: number; + goalName?: string; + description?: string; + targetAmount?: number; + targetDate?: string; + completedAt?: string; + createdAt?: string; + challenges?: Array<ChallengeDTO>; + participants?: Array<ParticipantDTO>; +}; + diff --git a/src/api/models/ParticipantDTO.ts b/src/api/models/ParticipantDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..0615b50834924e46416818dffbb00718b3607bab --- /dev/null +++ b/src/api/models/ParticipantDTO.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ParticipantUserDTO } from './ParticipantUserDTO'; +export type ParticipantDTO = { + role?: ParticipantDTO.role; + user?: ParticipantUserDTO; +}; +export namespace ParticipantDTO { + export enum role { + CREATOR = 'CREATOR', + CONTRIBUTOR = 'CONTRIBUTOR', + } +} + diff --git a/src/api/models/ParticipantUserDTO.ts b/src/api/models/ParticipantUserDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..5499c09f765c2b01e58efea75581a8f14d3f9e40 --- /dev/null +++ b/src/api/models/ParticipantUserDTO.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ParticipantUserDTO = { + firstName?: string; + lastName?: string; +}; + diff --git a/src/api/models/PasswordResetDTO.ts b/src/api/models/PasswordResetDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..383b7ad1f57b7f48dc891ec0f3f2a86a28d03f29 --- /dev/null +++ b/src/api/models/PasswordResetDTO.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PasswordResetDTO = { + token: string; + password?: string; +}; + diff --git a/src/api/models/SignUpRequest.ts b/src/api/models/SignUpRequest.ts index f9aa1f6162784c19e4012289fd61c429edf6eea7..72720c40f1f0d870e4f713aaa2215dbd3b59f914 100644 --- a/src/api/models/SignUpRequest.ts +++ b/src/api/models/SignUpRequest.ts @@ -2,13 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ConfigurationDTO } from './ConfigurationDTO'; export type SignUpRequest = { firstName?: string; lastName?: string; email?: string; password?: string; - commitment?: string; - experience?: string; - challengeTypes?: Array<string>; + configuration: ConfigurationDTO; }; diff --git a/src/api/models/TransactionDTO.ts b/src/api/models/TransactionDTO.ts new file mode 100644 index 0000000000000000000000000000000000000000..d974cb53a8a01cb4c99043e2cb3a983a608d295f --- /dev/null +++ b/src/api/models/TransactionDTO.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TransactionDTO = { + debtorBBAN?: number; + creditorBBAN?: number; + amount?: number; +}; + diff --git a/src/api/models/UserUpdateDTO.ts b/src/api/models/UserUpdateDTO.ts index 54cc0f5524b3ca515f3b671e02edf92ec05a54aa..00b3b0a05950d06f960971ef120d217a33202b39 100644 --- a/src/api/models/UserUpdateDTO.ts +++ b/src/api/models/UserUpdateDTO.ts @@ -2,13 +2,12 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ +import type { ConfigurationDTO } from './ConfigurationDTO'; export type UserUpdateDTO = { firstName?: string; lastName?: string; email?: string; password?: string; - commitment?: string; - experience?: string; - challengeTypes?: Array<string>; + configuration?: ConfigurationDTO; }; diff --git a/src/api/services/AccountControllerService.ts b/src/api/services/AccountControllerService.ts new file mode 100644 index 0000000000000000000000000000000000000000..181460cbe891524b1508866a63130c5546ab56ee --- /dev/null +++ b/src/api/services/AccountControllerService.ts @@ -0,0 +1,77 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Account } from '../models/Account'; +import type { AccountRequestDTO } from '../models/AccountRequestDTO'; +import type { AccountResponseDTO } from '../models/AccountResponseDTO'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class AccountControllerService { + /** + * Create account + * Create account with random balance + * @returns AccountResponseDTO Successfully created account + * @throws ApiError + */ + public static createAccount({ + requestBody, + }: { + requestBody: AccountRequestDTO, + }): CancelablePromise<AccountResponseDTO> { + return __request(OpenAPI, { + method: 'POST', + url: '/bank/v1/account/create-account', + body: requestBody, + mediaType: 'application/json', + errors: { + 404: `Provided bank profile id could not be found`, + }, + }); + } + /** + * Get user accounts + * Get accounts associated with a user by providing their social security number + * @returns Account No accounts associated with a bank user + * @throws ApiError + */ + public static getAccountsBySsn({ + ssn, + }: { + ssn: number, + }): CancelablePromise<Array<Account>> { + return __request(OpenAPI, { + method: 'GET', + url: '/bank/v1/account/accounts/ssn/{ssn}', + path: { + 'ssn': ssn, + }, + errors: { + 404: `Social security number does not exist`, + }, + }); + } + /** + * Get user accounts + * Get accounts associated with a user by providing their bank profile id + * @returns Account No accounts associated with a bank user + * @throws ApiError + */ + public static getAccounts({ + bankProfileId, + }: { + bankProfileId: number, + }): CancelablePromise<Array<Account>> { + return __request(OpenAPI, { + method: 'GET', + url: '/bank/v1/account/accounts/profile/{bankProfileId}', + path: { + 'bankProfileId': bankProfileId, + }, + errors: { + 404: `Bank profile id does not exist`, + }, + }); + } +} diff --git a/src/api/services/BankProfileControllerService.ts b/src/api/services/BankProfileControllerService.ts new file mode 100644 index 0000000000000000000000000000000000000000..5ae9fa35124c975f752afa4228fccdb1d2bd68b3 --- /dev/null +++ b/src/api/services/BankProfileControllerService.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BankProfileDTO } from '../models/BankProfileDTO'; +import type { BankProfileResponseDTO } from '../models/BankProfileResponseDTO'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class BankProfileControllerService { + /** + * Create bank profile + * Create a bank profile by providing a social security number + * @returns BankProfileResponseDTO Successfully created a bank profile + * @throws ApiError + */ + public static createBankProfile({ + requestBody, + }: { + requestBody: BankProfileDTO, + }): CancelablePromise<BankProfileResponseDTO> { + return __request(OpenAPI, { + method: 'POST', + url: '/bank/v1/profile/create-profile', + body: requestBody, + mediaType: 'application/json', + errors: { + 400: `Could not create profile`, + }, + }); + } +} diff --git a/src/api/services/GoalService.ts b/src/api/services/GoalService.ts new file mode 100644 index 0000000000000000000000000000000000000000..28ae857fcaf1e5268dc6aefc5ba9c9e0d27398f2 --- /dev/null +++ b/src/api/services/GoalService.ts @@ -0,0 +1,47 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CreateGoalDTO } from '../models/CreateGoalDTO'; +import type { GoalDTO } from '../models/GoalDTO'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class GoalService { + /** + * @returns GoalDTO OK + * @throws ApiError + */ + public static createGoal({ + requestBody, + }: { + requestBody: CreateGoalDTO, + }): CancelablePromise<GoalDTO> { + return __request(OpenAPI, { + method: 'POST', + url: '/api/goal/createGoal', + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @returns GoalDTO OK + * @throws ApiError + */ + public static getGoals(): CancelablePromise<Array<GoalDTO>> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/goal/getGoals', + }); + } + /** + * @returns GoalDTO OK + * @throws ApiError + */ + public static getGoal(): CancelablePromise<GoalDTO> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/goal/getGoal', + }); + } +} diff --git a/src/api/services/TransactionControllerService.ts b/src/api/services/TransactionControllerService.ts new file mode 100644 index 0000000000000000000000000000000000000000..f584d0ae03eb7882c73c6e0940575f0c009bd327 --- /dev/null +++ b/src/api/services/TransactionControllerService.ts @@ -0,0 +1,31 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { TransactionDTO } from '../models/TransactionDTO'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class TransactionControllerService { + /** + * Transfer to account + * Transfer money from a users account to another account of the same user + * @returns TransactionDTO No accounts associated with a bank user + * @throws ApiError + */ + public static transferToSelf({ + requestBody, + }: { + requestBody: TransactionDTO, + }): CancelablePromise<TransactionDTO> { + return __request(OpenAPI, { + method: 'POST', + url: '/bank/v1/transaction/norwegian-domestic-payment-to-self', + body: requestBody, + mediaType: 'application/json', + errors: { + 404: `Bank profile id does not exist`, + }, + }); + } +}