From c55b5a06cf6738f47907f367ddde067123fe79c9 Mon Sep 17 00:00:00 2001 From: "fabio.d.mota" Date: Tue, 10 Oct 2023 10:27:41 +0100 Subject: [PATCH] fix(Country Risk Documentation): Add new documentation yaml for standard_api.yaml --- CHANGELOG.md | 2 +- docs/swagger/dashboard_controller.yml | 939 ++++++++++++++++++ ...tandard_api.yml => sharing_controller.yml} | 0 3 files changed, 940 insertions(+), 1 deletion(-) create mode 100644 docs/swagger/dashboard_controller.yml rename docs/swagger/{standard_api.yml => sharing_controller.yml} (100%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68e42e9..7dd36cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added project name to Sonar Cloud properties. - Added Suppliers and Customers fields for logic filtering. - Added new client ID to get roles from the newly published Country Risk app. -- Added new file for [Standard Api Documentation](docs/swagger/standard_api.yml) +- Added new file for [Standard Api Documentation](docs/swagger/sharing_controller.yml) ### Changed - Mapped between API and new Data Model for getting Suppliers and Customers. diff --git a/docs/swagger/dashboard_controller.yml b/docs/swagger/dashboard_controller.yml new file mode 100644 index 0000000..3a942e5 --- /dev/null +++ b/docs/swagger/dashboard_controller.yml @@ -0,0 +1,939 @@ +openapi: 3.0.1 +info: + title: VAS API + description: Swagger documentation for the Value Added Services APIs + version: '1.0' +servers: + - url: / +security: + - open_id_scheme: + - read + - write +paths: + /api/dashboard/updateReports: + put: + tags: + - Dashboard Controller + summary: Update Reports that + operationId: updateReports + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReportDTO' + required: true + responses: + '200': + description: Reports updated with success + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/uploadCsv: + post: + tags: + - Dashboard Controller + summary: Inserts information from an CSV file into the database, with the associated user + operationId: uploadFile + parameters: + - name: ratingName + in: header + required: true + schema: + type: string + - name: year + in: header + required: true + schema: + type: integer + format: int32 + - name: type + in: header + required: true + schema: + type: string + - name: companyUser + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + requestBody: + content: + multipart/form-data: + schema: + type: object + properties: + file: + type: string + format: binary + responses: + '200': + description: CSV file uploaded with success + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '400': + description: Bad Request + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '401': + description: Authentication Required + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '500': + description: Unexpected Error + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/shareReport: + post: + tags: + - Dashboard Controller + summary: Share Reports + operationId: shareReport + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReportDTO' + required: true + responses: + '200': + description: Reports shared with success + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/saveUserRanges: + post: + tags: + - Dashboard Controller + summary: Saves the current user ranges + operationId: saveRanges + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + requestBody: + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/RangeDTO' + required: true + responses: + '200': + description: Ranges saved with success + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '400': + description: Bad Request + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/saveReports: + post: + tags: + - Dashboard Controller + summary: Save new Reports + operationId: saveReports + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + requestBody: + content: + application/json: + schema: + $ref: '#/components/schemas/ReportDTO' + required: true + responses: + '200': + description: Reports saved with success + content: + '*/*': + schema: + $ref: '#/components/schemas/ResponseMessage' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/ratingsByYear: + get: + tags: + - Dashboard Controller + summary: Retrieves ratings based on inserted year + operationId: ratingsByYear + parameters: + - name: year + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Ratings of inserted custom year retrieved with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/DataSourceDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getWorldMap: + get: + tags: + - Dashboard Controller + summary: Retrieves a score based on selected ratings, year and current user + operationId: getDashBoardWorldMap + parameters: + - name: ratings[] + in: query + required: true + schema: + type: array + items: + $ref: '#/components/schemas/RatingDTO' + default: [] + - name: companyUser + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + - name: year + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + responses: + '200': + description: World map information requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/DashBoardWorldMapDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getUserRanges: + get: + tags: + - Dashboard Controller + summary: Retrieves current user ranges + operationId: userRanges + parameters: + - name: companyUser + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: User Ranges requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/RangeDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getUserFromCompany: + get: + tags: + - Dashboard Controller + summary: Retrieves Company User of a Company + operationId: getUserFromCompany + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Users get with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/CompanyUserDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getTemplate: + get: + tags: + - Dashboard Controller + summary: Retrieves an CSV template + operationId: getTemplate + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: CSV file retrieved with success + content: + '*/*': + schema: + type: array + items: + type: string + format: byte + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getTableInfo: + get: + tags: + - Dashboard Controller + summary: Retrieves Business partners based on selected ratings, year and current user + operationId: getAllDashBoardTable + parameters: + - name: ratings[] + in: query + required: true + schema: + type: array + items: + $ref: '#/components/schemas/RatingDTO' + default: [] + - name: year + in: query + required: false + schema: + type: integer + format: int32 + default: 0 + - name: companyUser + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: 'Business partners request with success based on selected variables ' + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/DashBoardTableDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getReportsValueByReport: + get: + tags: + - Dashboard Controller + summary: Retrieves all Reports that a user can get + operationId: getReportsValueByReport + parameters: + - name: reportDTO + in: query + required: true + schema: + $ref: '#/components/schemas/ReportDTO' + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Report values requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/ReportValuesDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getReportsByCompanyUser: + get: + tags: + - Dashboard Controller + summary: Retrieves all Reports that a user can get + operationId: getReportsByCompanyUser + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Reports requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/ReportDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getCountryFilterByISO2: + get: + tags: + - Dashboard Controller + summary: Retrieves all countries in the database filter by ISO CODE 2 + operationId: getCountrys + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Countries requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/CountryDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getCompanyBpns: + get: + tags: + - Dashboard Controller + summary: Retrieves all Business Partners of a Company + operationId: getCompanyBpns + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Bpn requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/BusinessPartnerDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getBpnCountrys: + get: + tags: + - Dashboard Controller + summary: Retrieves all countries in the database OF THE Bpns + operationId: getBpnCountrys + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Countries requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/CountryDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/getAllUserBPDMGates: + get: + tags: + - Dashboard Controller + summary: Retrieves all Gate values that a user can get + operationId: getAllUserBPDMGates + parameters: + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Gate values requested with success + content: + '*/*': + schema: + type: array + items: + $ref: '#/components/schemas/CompanyGatesDTO' + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/allYears: + get: + tags: + - Dashboard Controller + summary: Retrieves all years saved on the database + operationId: getYears + parameters: + - name: companyUser + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: All years requested with success + content: + '*/*': + schema: + type: array + items: + type: integer + format: int32 + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/deleteReport/{id}: + delete: + tags: + - Dashboard Controller + summary: Deletes Report + operationId: deleteReport + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Deleted reported with success + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] + /api/dashboard/deleteRating/{id}: + delete: + tags: + - Dashboard Controller + summary: Deletes Rating + operationId: deleteRating + parameters: + - name: id + in: path + required: true + schema: + type: integer + format: int64 + - name: companyUserDTO + in: query + required: true + schema: + $ref: '#/components/schemas/CompanyUserDTO' + responses: + '200': + description: Deleted rating with success + '401': + description: Authentication Required + security: + - bearerAuth: [] + - open_id_scheme: [] +components: + schemas: + ReportDTO: + required: + - reportName + type: object + properties: + id: + type: integer + format: int64 + reportName: + type: string + example: Fake Report + companyUserName: + type: string + example: John + company: + type: string + example: Test Company + email: + type: string + example: John@email.com + type: + type: string + example: Company + enum: + - Global + - Custom + - Company + reportValues: + type: array + items: + $ref: '#/components/schemas/ReportValuesDTO' + ReportValuesDTO: + type: object + properties: + name: + type: string + example: Range + objectValue: + type: object + CompanyUserDTO: + required: + - companyName + - email + - name + type: object + properties: + name: + type: string + example: John + email: + type: string + example: John@email.com + companyName: + type: string + example: TestCompany + ResponseMessage: + type: object + properties: + message: + type: string + RangeDTO: + required: + - range + - value + type: object + properties: + range: + type: string + example: Max + enum: + - Max + - Between + - Min + value: + type: integer + format: int32 + example: 80 + description: + type: string + example: Max value + companyUser: + $ref: '#/components/schemas/CompanyUserDTO' + DataSourceDTO: + required: + - dataSourceName + - type + - yearPublished + type: object + properties: + id: + type: integer + format: int64 + dataSourceName: + type: string + example: Fake Rating + type: + type: string + example: Custom + enum: + - Global + - Custom + - Company + yearPublished: + type: integer + format: int32 + example: 2021 + fileName: + type: string + example: Test Company Rating + BusinessPartnerDTO: + type: object + properties: + id: + type: integer + format: int64 + bpn: + type: string + example: BPN-NUMBER + legalName: + type: string + example: Divape Company + street: + type: string + example: 1st + houseNumber: + type: string + example: Sutteridge + zipCode: + type: string + example: '633104' + city: + type: string + example: Covilhã + country: + type: string + example: Portugal + longitude: + type: string + example: '107.6185727' + latitude: + type: string + example: '-6.6889038' + supplier: + type: boolean + example: false + customer: + type: boolean + example: true + ShareDTO: + type: object + properties: + id: + type: integer + format: int64 + bpn: + type: string + example: BPN-NUMBER + country: + type: string + example: Portugal + iso2: + type: string + example: PT + rating: + type: array + items: + $ref: '#/components/schemas/ShareRatingDTO' + ShareRatingDTO: + type: object + properties: + dataSourceName: + type: string + example: Fake Rating + score: + type: number + format: float + example: 100 + RatingDTO: + type: object + properties: + dataSourceName: + type: string + example: Fake Rating + weight: + type: number + format: float + example: 100 + CountryDTO: + required: + - continent + - country + - iso2 + - iso3 + - latitude + - longitude + - totalBpn + type: object + properties: + id: + type: integer + format: int64 + country: + type: string + example: Germany + iso3: + type: string + example: DEU + iso2: + type: string + example: DE + continent: + type: string + example: Europe + latitude: + type: string + example: '-2.9814344' + longitude: + type: string + example: '23.8222636' + totalBpn: + type: integer + format: int64 + example: 11 + DashBoardWorldMapDTO: + type: object + properties: + country: + $ref: '#/components/schemas/CountryDTO' + score: + type: number + format: float + example: 90 + DashBoardTableDTO: + type: object + properties: + id: + type: integer + format: int64 + bpn: + type: string + example: BPN-NUMBER + legalName: + type: string + example: Divape Company + street: + type: string + example: 1st + houseNumber: + type: string + example: Sutteridge + zipCode: + type: string + example: '633104' + city: + type: string + example: Covilhã + country: + type: string + example: Portugal + score: + type: number + format: float + example: 90 + rating: + type: string + example: Fake Rating + longitude: + type: string + example: '107.6185727' + latitude: + type: string + example: '-6.6889038' + supplier: + type: boolean + example: false + customer: + type: boolean + example: true + CompanyGatesDTO: + required: + - companyGateValue + - gateName + type: object + properties: + id: + type: integer + format: int64 + gateName: + type: string + companyGateValue: + type: string + securitySchemes: + open_id_scheme: + type: oauth2 + flows: + authorizationCode: + authorizationUrl: https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/auth + tokenUrl: https://centralidp.dev.demo.catena-x.net/auth/realms/CX-Central/protocol/openid-connect/token + bearerAuth: + type: http + scheme: bearer + bearerFormat: JWT diff --git a/docs/swagger/standard_api.yml b/docs/swagger/sharing_controller.yml similarity index 100% rename from docs/swagger/standard_api.yml rename to docs/swagger/sharing_controller.yml