From 1860facd2c59d035b718c033077c619fb677c2fb Mon Sep 17 00:00:00 2001 From: VIktorGrev <viktog2210@gmail.com> Date: Thu, 2 May 2024 17:15:50 +0200 Subject: [PATCH] feat: Generating openAPI --- spec.json | 26 ++++++++++++++++-------- src/api/index.ts | 1 + src/api/models/BankAccountResponseDTO.ts | 9 ++++++++ src/api/models/UserDTO.ts | 5 +++-- 4 files changed, 31 insertions(+), 10 deletions(-) create mode 100644 src/api/models/BankAccountResponseDTO.ts diff --git a/spec.json b/spec.json index d0da00c..aaf7188 100644 --- a/spec.json +++ b/spec.json @@ -867,8 +867,8 @@ } } }, - "404": { - "description": "User not found", + "401": { + "description": "Invalid credentials", "content": { "application/json": { "schema": { @@ -877,8 +877,8 @@ } } }, - "401": { - "description": "Invalid credentials", + "404": { + "description": "User not found", "content": { "application/json": { "schema": { @@ -2236,6 +2236,18 @@ } } }, + "BankAccountResponseDTO": { + "type": "object", + "properties": { + "bban": { + "type": "integer", + "format": "int64" + }, + "balance": { + "type": "number" + } + } + }, "ChallengeDTO": { "type": "object", "properties": { @@ -2445,12 +2457,10 @@ "type": "string" }, "checkingAccountBBAN": { - "type": "integer", - "format": "int64" + "$ref": "#/components/schemas/BankAccountResponseDTO" }, "savingsAccountBBAN": { - "type": "integer", - "format": "int64" + "$ref": "#/components/schemas/BankAccountResponseDTO" }, "point": { "$ref": "#/components/schemas/PointDTO" diff --git a/src/api/index.ts b/src/api/index.ts index 664ddc6..cfeb244 100644 --- a/src/api/index.ts +++ b/src/api/index.ts @@ -13,6 +13,7 @@ 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 { 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/BankAccountResponseDTO.ts new file mode 100644 index 0000000..ed03efb --- /dev/null +++ b/src/api/models/BankAccountResponseDTO.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type BankAccountResponseDTO = { + bban?: number; + balance?: number; +}; + diff --git a/src/api/models/UserDTO.ts b/src/api/models/UserDTO.ts index a94d145..f3426ff 100644 --- a/src/api/models/UserDTO.ts +++ b/src/api/models/UserDTO.ts @@ -2,6 +2,7 @@ /* 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 = { @@ -14,8 +15,8 @@ export type UserDTO = { createdAt?: string; role?: string; subscriptionLevel?: string; - checkingAccountBBAN?: number; - savingsAccountBBAN?: number; + checkingAccountBBAN?: BankAccountResponseDTO; + savingsAccountBBAN?: BankAccountResponseDTO; point?: PointDTO; streak?: StreakDTO; }; -- GitLab