diff --git a/docs/tech-articles/_category_.json b/docs/tech-articles/_category_.json deleted file mode 100644 index 1599b8d..0000000 --- a/docs/tech-articles/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Tech Articles", - "position": 2 -} \ No newline at end of file diff --git a/docs/tech-articles/articles.md b/docs/tech-articles/articles.md deleted file mode 100644 index fed522d..0000000 --- a/docs/tech-articles/articles.md +++ /dev/null @@ -1,149 +0,0 @@ ---- -sidebar_position: 1 ---- - -# ARTICLES: 📰 - -### POST news: -Endpoint: `/news` - -Type: Multpartform - -Attributes: - - title: String - - body: Text - - tags: List of Strings - - image: file (optional) - - isPublished: boolean (optional) - - -### GET news preview: -Endpoint: `/news/preview` - -Type: pathParameters - - sortBy: String (optional) ['view', 'latest' or 'relevance'] - - title: String (optional) - - tags: List of Strings (optional) - - size: int (optional) - - page: int (optional) - -e.g.: `/news/preview?sortBy=relevance&size=5&page=2` - -Return: -```json -{ - "id": "UUID" - "updateDate": - "title": - "author": - "imageUrl": "url" - "alreadyUpVoted": boolean -} -``` - -### GET news by ID: -Endpoint: `/news/{uuid}` - -Return: -```json -{ - "id": UUID - "author": - "creationDate": - "updateDate": - "title": - "body": "Text" - "tags": List - "imageUrl": "url" - "isPublished": boolean - "alreadyUpVoted": boolean -} -``` - -### GET news by author: - -Endpoint: `/news/author` - -Type: pathParameters - - sortBy: String (optional) ['published' or 'archived'] - - size: int (optional) - - page: int (optional) - -Return: -```json -{ - "id": "UUID" - "updateDate": - "title": - "author": - "imageUrl": "url" -} -``` - - -### PATCH update news: -Endpoint: `/news/{uuid}/` - -Type: Multpartform - -Attributes: - - title: String (optional) - - body: Text (optional) - - tags: List of Strings (optional) - - image: file (optional) - - -### PATCH publish news: -Endpoint: `/news/{uuid}/publish` - - -### PATCH archive news: -Endpoint: `/news/{uuid}/archive` - -### PATCH upVote for news -Endpoint `/news/{uuid}/upvote` - -Type: Header - - Authorization: Bearer token (azure) - - -## NEWS BACKUP: - -### GET news backup by ID: -Endpoint: `/news/{uuid}/backup` - -Type: pathParameters - - level: int (1 to 3) - -e.g.: `/news/ne7uhd-75h/backup?level=2` - -Return: -```json -{ - "id": long - "newsId": "uuid" - "title": - "body": "Text" - "imageUrl": "url" -} -``` - -### PUT restore news from a backup: -Endpoint: `/news/{uuid}/backup/{backupId}/restore` - -Return: -```json -{ - "id": UUID - "author": - "creationDate": - "updateDate": - "title": - "body": "Text" - "tags": List - "imageUrl": "url" - "isPublished": boolean -} -``` \ No newline at end of file diff --git a/docs/tech-articles/comments.md b/docs/tech-articles/comments.md deleted file mode 100644 index 1a558cc..0000000 --- a/docs/tech-articles/comments.md +++ /dev/null @@ -1,48 +0,0 @@ ---- -sidebar_position: 2 ---- - -# COMMENTS: ✍ - -### POST comment: -Endpoint: `/comments/{newsId}` - -Type: Json - -Attributes: - - comment: String - - -### GET comments: -Obs: always returning base on upVotes (relevance) - -Endpoint: `/comments/{newsId}` - -Return: -```json -{ - "id": long - "newsId": "uuid" - "author": - "publicationDate": - "comment": - "upVotes": int - "alreadyUpVoted": boolean -} -``` - -### PATCH upVote for comments -Endpoint `/comments/{id}/upvote` - -Type: Header - - Authorization: Bearer token (azure) - - -### DELETE comment - -Endpoint: `/comments/{newsId}` - -Type: Header - - Authorization: Bearer token (azure) \ No newline at end of file diff --git a/docs/tech-radar/_category_.json b/docs/tech-radar/_category_.json deleted file mode 100644 index e3f3457..0000000 --- a/docs/tech-radar/_category_.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "label": "Tech Radar", - "position": 3 -} \ No newline at end of file diff --git a/docs/tech-radar/items.md b/docs/tech-radar/items.md deleted file mode 100644 index 8664857..0000000 --- a/docs/tech-radar/items.md +++ /dev/null @@ -1,163 +0,0 @@ ---- -sidebar_position: 2 ---- -# ITEMS - -___ -### Obs: - -Unique attributes: - - [ title ] -___ - -### POST item ( BDUSER / ADMIN ): -Endpoint: `/items/create` - -Type: JSON - -Attributes: - -```json -{ - "isActive": false, - "title": "Blockchain", - "ring": "HOLD", - "expectation": "FIVE_TEN", - "quadrant": "FIRST_QUADRANT", - "body": "..." -} -``` - -Return: -```json -{ - "id": "UUID", - "flag": null, - "isActive": false, - "authorEmail": "networkuser@bosch.com", - "revisions": [], - "title": "Blockchain", - "creationDate": "2024-04-23", - "publicationDate": null, - "updateDate": null, - "ring": "HOLD", - "expectation": "5 - 10", - "quadrantId": "first-quadrant", - "body": "" -} -``` - - -### GET active items preview ( USER / BDUSER / ADMIN ): -Endpoint: `/items` - -Return: -```json -[ - { - "id": "UUID-1", - "title": "title1", - "ring": "TRIAL", - "expectation": "5 - 10", - "quadrantId": "first-quadrant", - "isActive": true - } -] -``` - - -### GET all items ( USER / BDUSER / ADMIN ): -Endpoint: `/items/all` - -Return: -```json -[ - { - "id": "UUID-1", - "title": "title1", - "ring": "TRIAL", - "expectation": "5 - 10", - "quadrantId": "first-quadrant", - "isActive": true - }, - { - "id": "UUID-2", - "title": "title2", - "ring": "HOLD", - "expectation": "2 - 5", - "quadrantId": "first-quadrant", - "isActive": false - } -] -``` - - -### GET item detail ( USER / BDUSER / ADMIN ): -Endpoint: `/items/< UUID:itemId >/detail` - -Return (< Item detail >): -```json -{ - "id": "UUID", - "flag": null, - "isActive": false, - "authorEmail": "networkuser2@bosch.com", - "revisions": [ - "networkuser1@bosch.com", - "networkuser2@bosch.com" - ], - "title": "title", - "creationDate": "YYYY-MM-DD", - "publicationDate": null, - "updateDate": "YYYY-MM-DD", - "ring": "TRIAL", - "expectation": "5 - 10", - "quadrantId": "first-quadrant", - "body": "" -} -``` - - -### PATCH update item ( BDUSER / ADMIN ): -Endpoint: `/items/< UUID:itemId >` - -Attributes: -```json -{ - "title": "title UP", - "ring": "TRIAL", - "expectation": "UNKNOWN", - "quadrant": "SECOND_QUADRANT", - "body": "up" -} -``` - -Return: < Item detail > - - -### PATCH publish item ( AUTHOR / ADMIN ): -Endpoint: `/items/< UUID:itemId >/publish` - -Return: < Item detail > - -If already publish, returns: -```json -{ - "field": "item", - "message": "Item already published!" -} -``` - - -### PATCH archive item ( AUTHOR / ADMIN ): -Endpoint: `/items/< UUID:itemId >/archive` - -Return: < Item detail > - -If already archived, returns: -```json -{ - "field": "item", - "message": "Item already archived!" -} -``` \ No newline at end of file diff --git a/docs/tech-radar/quadrant.md b/docs/tech-radar/quadrant.md deleted file mode 100644 index 7440137..0000000 --- a/docs/tech-radar/quadrant.md +++ /dev/null @@ -1,100 +0,0 @@ ---- -sidebar_position: 1 ---- -# QUADRANT - -___ -### Obs: -Quadrant is represented by an Enum: - - - [ FIRST_QUADRANT, SECOND_QUADRANT, THIRD_QUADRANT, FOURTH_QUADRANT ] - -Ring is represented by an Enum: - - - [ HOLD, OBSERVE, TRIAL, ADOPT ] - -Expectation is represented by an Enum: - - - [ UNKNOWN("-"), ZERO_TWO("0 - 2"), TWO_FIVE("2 - 5"), FIVE_TEN("5 - 10") ] -___ - -### POST quadrant ( ADMIN ): -Endpoint: `/quadrants/create` - -Type: JSON - -Attributes: - -Unique: [ quadrant, title, name, position ] - -```json -{ - "quadrant": "FIRST_QUADRANT", - "title": "Platforms & Operations", - "name": "platforms-and-operations", - "color": "...", - "txtColor": "...", - "position": 1, - "description": "..." -} -``` - -Return: -```json -{ - "id": "first-quadrant", - "name": "platforms-and-operations", - "title": "Platforms & Operations", - "color": "...", - "txtColor": "...", - "position": 1, - "description": "..." -} -``` - - -### GET quadrants ( USER / BDUSER / ADMIN ): -Endpoint: `/quadrants` - -Return: -```json -[ - { - "name": "platforms-and-operations", - "title": "Platform & Operations", - "color": "...", - "txtColor": "...", - "position": 1, - "description": "..." - } -] -``` - - -### PATCH update quadrant ( ADMIN ): -Endpoint: `/quadrants/< String:quadrantId >` - -Attributes: -```json -{ - "title": "Platform & Operations UP", - "name": "platforms-and-operations UP", - "color": "up", - "txtColor": "up", - "position": 2, - "description": "up" -} -``` - -Return: -```json -{ - "id": "first-quadrant", - "name": "platforms-and-operations UP", - "title": "Platform & Operations UP", - "color": "up", - "txtColor": "up", - "position": 2, - "description": "up" -} -``` \ No newline at end of file diff --git a/docs/technical-content/software-requirements.md b/docs/technical-content/software-requirements.md index a5d7c5b..fa1d60f 100644 --- a/docs/technical-content/software-requirements.md +++ b/docs/technical-content/software-requirements.md @@ -26,9 +26,9 @@ articles creation and control function. Allows all Bosch users view a radar with the technologies that “will impact the Bosch”, “are being studied by the company” and which “are in -use”, in addition to each news item having documentation. For +use”, in addition to each article item having documentation. For BD employees or with administrative access, has the -news creation and control function. +article creation and control function. ## Requirements Description @@ -48,17 +48,17 @@ news creation and control function. recently added or updated, or is the same as older of a week. -- News page: - - The website must display a page with a news preview through +- Articles page: + - The website must display a page with a article preview through of cards. - - Users should be able to filter news by tags and name - of the news. - - Users should be able to click on the news card and be + - Users should be able to filter article by tags and name + of the article. + - Users should be able to click on the article card and be directed to a page to read it. - Comments and rating: - - Users must be able to comment on news - - Users must be able to “upvote” the news. + - Users must be able to comment on article + - Users must be able to “upvote” the article. - Link to Bosch Tube: - Users must be able to access Bosch Tube (Bosch videos platforms) @@ -70,16 +70,16 @@ news creation and control function. - Users must be able to create and update the properties of quadrants -- Admin actions for TechNews: - - Users must be able to create and update their own news and +- Admin actions for TechArticle: + - Users must be able to create and update their own articles and from other users. - Actions by BD collaborators for TechRadar: - Users must be able to create and update documentation for technologies they added. -- Actions by BD collaborators for TechNews: - - Users must be able to create and update their own news +- Actions by BD collaborators for TechArticles: + - Users must be able to create and update their own articles ### Non-Functional Requirements diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 64442c9..2566b9a 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -1,137 +1,125 @@ -import {themes as prismThemes} from 'prism-react-renderer'; -import type {Config} from '@docusaurus/types'; -import type * as Preset from '@docusaurus/preset-classic'; +import { themes as prismThemes } from "prism-react-renderer"; +import type { Config } from "@docusaurus/types"; +import type * as Preset from "@docusaurus/preset-classic"; +import type { ScalarOptions } from "@scalar/docusaurus"; +import configSwagger from "./static/config.json"; const config: Config = { - title: 'BDTechCenter', - tagline: 'Bosch Digital technology centralization platform', - favicon: 'img/logo.png', + title: "BDTechCenter", + tagline: "Bosch Digital technology centralization platform", + favicon: "img/logo.ico", - // Set the production url of your site here - url: 'https://bdtechcenter.github.io', - // Set the // pathname under which your site is served - // For GitHub pages deployment, it is often '//' - baseUrl: '/', + // Set the production url of your site here + url: "http://localhost:7777", + // Set the // pathname under which your site is served + // For GitHub pages deployment, it is often '//' + baseUrl: "/", - // GitHub pages deployment config. - // If you aren't using GitHub pages, you don't need these. - organizationName: 'bdtechcenter', // Usually your GitHub org/user name. - projectName: 'BDTechCenter', // Usually your repo name. + onBrokenLinks: "warn", + onBrokenMarkdownLinks: "warn", - onBrokenLinks: 'warn', - onBrokenMarkdownLinks: 'warn', + // Even if you don't use internationalization, you can use this field to set + // useful metadata like html lang. For example, if your site is Chinese, you + // may want to replace "en" with "zh-Hans". + i18n: { + defaultLocale: "en", + locales: ["en"], + }, - // Even if you don't use internationalization, you can use this field to set - // useful metadata like html lang. For example, if your site is Chinese, you - // may want to replace "en" with "zh-Hans". - i18n: { - defaultLocale: 'en', - locales: ['en'], - }, + presets: [ + [ + "classic", + { + docs: { + sidebarPath: "./sidebars.ts", + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: + "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", + }, + blog: { + showReadingTime: true, + // Please change this to your repo. + // Remove this to remove the "edit this page" links. + editUrl: + "https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/", + }, + theme: { + customCss: "./src/css/custom.css", + }, + } satisfies Preset.Options, + ], + ], - presets: [ - [ - 'classic', - { - docs: { - sidebarPath: './sidebars.ts', - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', - }, - blog: { - showReadingTime: true, - // Please change this to your repo. - // Remove this to remove the "edit this page" links. - editUrl: - 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', - }, - theme: { - customCss: './src/css/custom.css', - }, - } satisfies Preset.Options, - ], - ], + plugins: [ + [ + "@scalar/docusaurus", + { + id: "bdtc/api-reference", + label: "API Reference", + route: "/api-reference", + configuration: { + theme: "none", + spec: { + content: configSwagger, + }, + }, + } as ScalarOptions, + ], + ], - themeConfig: { - // Replace with your project's social card - image: 'img/docusaurus-social-card.jpg', - navbar: { - title: 'BDTechCenter', - logo: { - alt: 'BDTechCenter Logo', - src: 'img/logo.png', - }, - items: [ - { - type: 'docSidebar', - sidebarId: 'tutorialSidebar', - position: 'left', - label: 'Docs', - }, - {to: '/blog', label: 'Blog', position: 'left'}, - { - href: 'https://github.com/BDTechCenter', - label: 'GitHub', - position: 'right', - }, - ], - }, - footer: { - style: 'dark', - links: [ - { - title: 'Docs', - items: [ - { - label: 'docs', - to: '/docs/technical-content/software-requirements', - }, - ], - }, - { - title: 'Links', - items: [ - { - label: 'Blog', - to: '/blog', - }, - { - label: 'GitHub', - href: 'https://github.com/BDTechCenter', - }, - { - label: 'Bosch', - href: 'https://bzo.bosch.com/bzo/en/start_page.html', - }, - ], - }, - { - title: 'Docusaurus', - items: [ - { - label: 'Stack Overflow', - href: 'https://stackoverflow.com/questions/tagged/docusaurus', - }, - { - label: 'Discord', - href: 'https://discordapp.com/invite/docusaurus', - }, - { - label: 'Twitter', - href: 'https://twitter.com/docusaurus', - }, - ], - }, - ], - copyright: `Copyright © ${new Date().getFullYear()} BDTechCenter, Inc.`, - }, - prism: { - theme: prismThemes.github, - darkTheme: prismThemes.dracula, - }, - } satisfies Preset.ThemeConfig, + themeConfig: { + // Replace with your project's social card + image: "img/docusaurus-social-card.jpg", + navbar: { + title: "BDTechCenter", + logo: { + alt: "BDTechCenter Logo", + src: "img/logo.png", + }, + items: [ + { + type: "docSidebar", + sidebarId: "tutorialSidebar", + position: "left", + label: "Docs", + }, + { to: "/blog", label: "Blog", position: "left" }, + { + href: "https://github.com/BDTechCenter", + label: "GitHub", + position: "right", + }, + ], + }, + footer: { + style: "dark", + links: [ + { + title: "Links", + items: [ + { + label: "Blog", + to: "/blog", + }, + { + label: "GitHub", + href: "https://github.com/BDTechCenter", + }, + { + label: "Bosch", + href: "https://bzo.bosch.com/bzo/en/start_page.html", + }, + ], + }, + ], + copyright: `Copyright © ${new Date().getFullYear()} BDTechCenter, Inc.`, + }, + prism: { + theme: prismThemes.github, + darkTheme: prismThemes.dracula, + }, + } satisfies Preset.ThemeConfig, }; export default config; diff --git a/package.json b/package.json index e40a6da..25e92a2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ "@docusaurus/core": "3.2.1", "@docusaurus/preset-classic": "3.2.1", "@mdx-js/react": "^3.0.0", + "@scalar/api-reference-react": "^0.1.85", + "@scalar/docusaurus": "^0.2.43", "clsx": "^2.0.0", "prism-react-renderer": "^2.3.0", "react": "^18.0.0", diff --git a/static/config.json b/static/config.json new file mode 100644 index 0000000..75e499e --- /dev/null +++ b/static/config.json @@ -0,0 +1,2768 @@ +{ + "swagger": "2.0", + "info": { + "title": "BD TC Combine API's", + "version": "1.0.0" + }, + "servers": [ + { + "url": "http://10.234.84.58:8766/", + "description": "Generated server url" + } + ], + "paths": { + "/comments/{articleId}": { + "post": { + "tags": [ + "Comments Controller" + ], + "summary": "Create comment for article", + "operationId": "createComment", + "parameters": [ + { + "name": "articleId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "comment" + ], + "type": "object", + "properties": { + "comment": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "newsId": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "publicationDate": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "upVotes": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + } + }, + "/articles": { + "post": { + "tags": [ + "Articles Controller" + ], + "summary": "Create a new article", + "description": "For this transaction you need the role 'BDUSER'", + "operationId": "createNews", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "body", + "title" + ], + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "image": { + "type": "string", + "format": "binary" + }, + "isPublished": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "creationDate": { + "type": "string" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/comments/{id}": { + "delete": { + "tags": [ + "Comments Controller" + ], + "summary": "Delete a comment", + "description": "Only the author or user with 'ADMIN' role can delete a comment", + "operationId": "deleteComment", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + }, + "patch": { + "tags": [ + "Comments Controller" + ], + "summary": "Update a comment", + "description": "Only the author or user with 'ADMIN' role can update a comment", + "operationId": "updateComment", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "comment" + ], + "type": "object", + "properties": { + "comment": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "newsId": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "publicationDate": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "upVotes": { + "type": "integer", + "format": "int32" + } + } + } + } + } + } + } + } + }, + "/comments/{id}/upvote": { + "patch": { + "tags": [ + "Comments Controller" + ], + "summary": "Add or remove a upvote to measure comment relevance", + "operationId": "addUpVoteToComment", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/articles/{id}": { + "get": { + "tags": [ + "Articles Controller" + ], + "summary": "Get full article details based on id", + "operationId": "getNewsById", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "creationDate": { + "type": "string" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + }, + "alreadyUpVoted": { + "type": "boolean" + } + } + } + } + } + } + } + }, + "patch": { + "tags": [ + "Articles Controller" + ], + "summary": "Update a article", + "description": "Only the author or user with 'ADMIN' role can update an article", + "operationId": "updateNews", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "image": { + "type": "string", + "format": "binary" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "creationDate": { + "type": "string" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/articles/{id}/upvote": { + "patch": { + "tags": [ + "Articles Controller" + ], + "summary": "Add or remove a upvote to measure article relevance", + "description": "If you already upVoted the article, your upVote will be delete,\notherwise it will be created\n", + "operationId": "addUpVoteToNews", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "string" + } + } + } + } + } + } + }, + "/articles/{id}/publish": { + "patch": { + "tags": [ + "Articles Controller" + ], + "summary": "Publish an archived article", + "description": "Only the author or user with 'ADMIN' role can publish an article", + "operationId": "publishNews", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "creationDate": { + "type": "string" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/articles/{id}/archive": { + "patch": { + "tags": [ + "Articles Controller" + ], + "summary": "Archive a published article", + "description": "Only the author or user with 'ADMIN' role can archive an article", + "operationId": "archiveNews", + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "creationDate": { + "type": "string" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "body": { + "type": "string" + }, + "tags": { + "uniqueItems": true, + "type": "array", + "items": { + "type": "string" + } + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/comments/{newsId}": { + "get": { + "tags": [ + "Comments Controller" + ], + "summary": "Get comment details with number of upVotes", + "operationId": "getNewsComments", + "parameters": [ + { + "name": "newsId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + }, + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "newsId": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "publicationDate": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "alreadyUpVoted": { + "type": "boolean" + } + } + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageable": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + } + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "empty": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/comments/me": { + "get": { + "tags": [ + "Comments Controller" + ], + "summary": "Get comment based on author (logged user)", + "operationId": "getCommentsByAuthor", + "parameters": [ + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "newsId": { + "type": "string", + "format": "uuid" + }, + "author": { + "type": "string" + }, + "publicationDate": { + "type": "string" + }, + "comment": { + "type": "string" + }, + "upVotes": { + "type": "integer", + "format": "int32" + } + } + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageable": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + } + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "empty": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/articles/preview": { + "get": { + "tags": [ + "Articles Controller" + ], + "summary": "Get published articles", + "operationId": "getNewsPreview", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "description": "choose between: 'view' (most viewed), 'latest' and 'relevance' (based on upVotes)", + "required": false, + "schema": { + "type": "string", + "default": "latest" + } + }, + { + "name": "title", + "in": "query", + "description": "filter the articles by specific title", + "required": false, + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "tags", + "in": "query", + "description": "filter the articles by specific tags", + "required": false, + "schema": { + "type": "string", + "default": "" + } + }, + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + } + } + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageable": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + } + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "empty": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/articles/me": { + "get": { + "tags": [ + "Articles Controller" + ], + "summary": "Get articles based on author", + "description": "Return the articles based on the logged user, by the JWT token", + "operationId": "getNewsBasedOnAuthor", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "description": "choose between 'published' and 'archived'", + "required": false, + "schema": { + "type": "string", + "default": "empty" + } + }, + { + "name": "pageable", + "in": "query", + "required": true, + "schema": { + "type": "object", + "properties": { + "page": { + "minimum": 0, + "type": "integer", + "format": "int32" + }, + "size": { + "minimum": 1, + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "array", + "items": { + "type": "string" + } + } + } + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "totalPages": { + "type": "integer", + "format": "int32" + }, + "totalElements": { + "type": "integer", + "format": "int64" + }, + "size": { + "type": "integer", + "format": "int32" + }, + "content": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "updateDate": { + "type": "string" + }, + "title": { + "type": "string" + }, + "author": { + "type": "string" + }, + "views": { + "type": "integer", + "format": "int64" + }, + "upVotes": { + "type": "integer", + "format": "int32" + }, + "imageUrl": { + "type": "string" + }, + "isPublished": { + "type": "boolean" + } + } + } + }, + "number": { + "type": "integer", + "format": "int32" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageable": { + "type": "object", + "properties": { + "offset": { + "type": "integer", + "format": "int64" + }, + "sort": { + "type": "object", + "properties": { + "empty": { + "type": "boolean" + }, + "sorted": { + "type": "boolean" + }, + "unsorted": { + "type": "boolean" + } + } + }, + "pageNumber": { + "type": "integer", + "format": "int32" + }, + "pageSize": { + "type": "integer", + "format": "int32" + }, + "paged": { + "type": "boolean" + }, + "unpaged": { + "type": "boolean" + } + } + }, + "numberOfElements": { + "type": "integer", + "format": "int32" + }, + "first": { + "type": "boolean" + }, + "last": { + "type": "boolean" + }, + "empty": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "/quadrants": { + "get": { + "tags": [ + "Quadrants Controller" + ], + "summary": "Get quadrants for radar view", + "operationId": "getQuadrants", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Quadrants Controller" + ], + "summary": "Create a quadrant", + "description": "Quadrants are represented by enums, use this notation:\nOnly one of each: FIRST_QUADRANT, SECOND_QUADRANT, THIRD_QUADRANT, FOURTH_QUADRANT\n\nOnly users with 'ADMIN' role can create quadrant\n", + "operationId": "createQuadrant", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "color", + "name", + "position", + "quadrant", + "title" + ], + "type": "object", + "properties": { + "quadrant": { + "type": "string", + "enum": [ + "FIRST_QUADRANT", + "SECOND_QUADRANT", + "THIRD_QUADRANT", + "FOURTH_QUADRANT" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/quadrants/multiple": { + "post": { + "tags": [ + "Quadrants Controller" + ], + "summary": "Create multiple quadrants", + "description": "Create multiple quadrants all at once, passing a list of objects\nOnly users with 'ADMIN' role can create quadrants\n", + "operationId": "createMultipleQuadrants", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "color", + "name", + "position", + "quadrant", + "title" + ], + "type": "object", + "properties": { + "quadrant": { + "type": "string", + "enum": [ + "FIRST_QUADRANT", + "SECOND_QUADRANT", + "THIRD_QUADRANT", + "FOURTH_QUADRANT" + ] + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/items": { + "get": { + "tags": [ + "Items Controller" + ], + "summary": "Get active items for radar view", + "operationId": "getItems", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "isActive": { + "type": "boolean" + } + } + } + } + } + } + } + } + }, + "post": { + "tags": [ + "Items Controller" + ], + "summary": "Create radar item", + "description": "Rings and Expectation are represented by enums, use this notation:\nrings: HOLD, OBSERVE, TRIAL, ADOPT\nexpectation: UNKNOWN(\"-\"), ZERO_TWO(\"0 - 2\"), TWO_FIVE(\"2 - 5\"), FIVE_TEN(\"5 - 10\")\nOnly user with 'BDUSER' or 'ADMIN' role can create item\n", + "operationId": "createItem", + "requestBody": { + "content": { + "application/json": { + "schema": { + "required": [ + "expectation", + "isActive", + "quadrant", + "ring", + "title" + ], + "type": "object", + "properties": { + "isActive": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string", + "enum": [ + "UNKNOWN", + "ZERO_TWO", + "TWO_FIVE", + "FIVE_TEN" + ] + }, + "quadrant": { + "type": "string", + "enum": [ + "FIRST_QUADRANT", + "SECOND_QUADRANT", + "THIRD_QUADRANT", + "FOURTH_QUADRANT" + ] + }, + "body": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + }, + "authorEmail": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "creationDate": { + "type": "string", + "format": "date" + }, + "publicationDate": { + "type": "string", + "format": "date" + }, + "updateDate": { + "type": "string", + "format": "date" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/items/multiple": { + "post": { + "tags": [ + "Items Controller" + ], + "summary": "Create multiple items all at once", + "description": "Create multiple items all at once, passing a list of objects\nOnly user with 'BDUSER' or 'ADMIN' role can create items\n", + "operationId": "createMultipleItems", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "required": [ + "expectation", + "isActive", + "quadrant", + "ring", + "title" + ], + "type": "object", + "properties": { + "isActive": { + "type": "boolean" + }, + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string", + "enum": [ + "UNKNOWN", + "ZERO_TWO", + "TWO_FIVE", + "FIVE_TEN" + ] + }, + "quadrant": { + "type": "string", + "enum": [ + "FIRST_QUADRANT", + "SECOND_QUADRANT", + "THIRD_QUADRANT", + "FOURTH_QUADRANT" + ] + }, + "body": { + "type": "string" + } + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + }, + "authorEmail": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "creationDate": { + "type": "string", + "format": "date" + }, + "publicationDate": { + "type": "string", + "format": "date" + }, + "updateDate": { + "type": "string", + "format": "date" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + } + } + } + } + } + } + }, + "/quadrants/{quadrantId}": { + "get": { + "tags": [ + "Quadrants Controller" + ], + "summary": "Get quadrant by id", + "operationId": "getQuadrantWithItem", + "parameters": [ + { + "name": "quadrantId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "description": { + "type": "string" + }, + "items": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "isActive": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + } + }, + "patch": { + "tags": [ + "Quadrants Controller" + ], + "summary": "Update quadrant information", + "description": "Only users with 'ADMIN' role can update quadrant", + "operationId": "updateQuandrant", + "parameters": [ + { + "name": "quadrantId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string" + }, + "name": { + "type": "string" + }, + "title": { + "type": "string" + }, + "color": { + "type": "string" + }, + "position": { + "type": "integer", + "format": "int32" + }, + "description": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/items/{itemId}": { + "get": { + "tags": [ + "Items Controller" + ], + "summary": "Get item detail", + "operationId": "getItemDetail", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + }, + "authorEmail": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "creationDate": { + "type": "string", + "format": "date" + }, + "publicationDate": { + "type": "string", + "format": "date" + }, + "updateDate": { + "type": "string", + "format": "date" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "tags": [ + "Items Controller" + ], + "summary": "Update item information", + "description": "Only users with 'BDUSER' or 'ADMIN' role can update item\n", + "operationId": "updateItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string", + "enum": [ + "UNKNOWN", + "ZERO_TWO", + "TWO_FIVE", + "FIVE_TEN" + ] + }, + "quadrant": { + "type": "string", + "enum": [ + "FIRST_QUADRANT", + "SECOND_QUADRANT", + "THIRD_QUADRANT", + "FOURTH_QUADRANT" + ] + }, + "body": { + "type": "string" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + }, + "authorEmail": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "creationDate": { + "type": "string", + "format": "date" + }, + "publicationDate": { + "type": "string", + "format": "date" + }, + "updateDate": { + "type": "string", + "format": "date" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/items/{itemId}/publish": { + "patch": { + "tags": [ + "Items Controller" + ], + "summary": "Publish item", + "description": "Only users with 'ADMIN' role can publish item\n", + "operationId": "publishItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + }, + "authorEmail": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "creationDate": { + "type": "string", + "format": "date" + }, + "publicationDate": { + "type": "string", + "format": "date" + }, + "updateDate": { + "type": "string", + "format": "date" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/items/{itemId}/archive": { + "patch": { + "tags": [ + "Items Controller" + ], + "summary": "Archive item", + "description": "Only item author or user with 'ADMIN' role can archive item\n", + "operationId": "archiveItem", + "parameters": [ + { + "name": "itemId", + "in": "path", + "required": true, + "schema": { + "type": "string", + "format": "uuid" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + }, + "authorEmail": { + "type": "string" + }, + "revisions": { + "type": "array", + "items": { + "type": "string" + } + }, + "title": { + "type": "string" + }, + "creationDate": { + "type": "string", + "format": "date" + }, + "publicationDate": { + "type": "string", + "format": "date" + }, + "updateDate": { + "type": "string", + "format": "date" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "body": { + "type": "string" + } + } + } + } + } + } + } + } + }, + "/quadrants/{quadrantId}/items": { + "get": { + "tags": [ + "Quadrants Controller" + ], + "summary": "Get all items from a specific quadrant", + "operationId": "getQuadrantItems", + "parameters": [ + { + "name": "quadrantId", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "isActive": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "/items/review": { + "get": { + "tags": [ + "Items Controller" + ], + "summary": "Get items for admin review", + "operationId": "getItemsAdminReview", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + }, + "authorEmail": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "/items/me": { + "get": { + "tags": [ + "Items Controller" + ], + "summary": "Get items related to user", + "description": "In case user has ADMIN role, it will return all items, otherwise will return only the items related to them", + "operationId": "getItemsMe", + "parameters": [ + { + "name": "sortBy", + "in": "query", + "required": false, + "schema": { + "type": "string", + "default": "all" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "title": { + "type": "string" + }, + "authorEmail": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "isActive": { + "type": "boolean" + }, + "needAdminReview": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + }, + "/items/all": { + "get": { + "tags": [ + "Items Controller" + ], + "summary": "Get all items for radar view", + "operationId": "getAllItems", + "responses": { + "200": { + "description": "OK", + "content": { + "*/*": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "format": "uuid" + }, + "flag": { + "type": "string", + "enum": [ + "CHANGED", + "DEFAULT", + "NEW" + ] + }, + "title": { + "type": "string" + }, + "ring": { + "type": "string", + "enum": [ + "HOLD", + "OBSERVE", + "TRIAL", + "ADOPT" + ] + }, + "expectation": { + "type": "string" + }, + "quadrantId": { + "type": "string" + }, + "isActive": { + "type": "boolean" + } + } + } + } + } + } + } + } + } + } + } +} \ No newline at end of file