openapi: 3.0.1
info:
  title: HelloCrifGateway
  description: Hello Crif - Api Gateway
  version: '1.1.0'
servers:
  - url: https://api-uat.crif.com/hello-crif/1.1.0
paths:
  /consents:
    get:
      tags:
        - Consents
      summary: Get all consents
      operationId: findAllUsingGET
      parameters:
        - name: page
          in: query
          description: Page number (default value 0)
          schema:
            type: integer
            format: int32
          x-example: 0
        - name: size
          in: query
          description: Page size (default value 20)
          schema:
            type: integer
            format: int32
          x-example: 20
        - name: sort
          in: query
          description: 'Sort using format FIELD_NAME,ORDER (ORDER can be asc or desc)'
          style: form
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageOfConsent'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      tags:
        - Consents
      summary: Insert a new Consent
      operationId: insertUsingPOST
      requestBody:
        description: dto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateConsent'
        required: true
        x-bodyName: dto
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Consent'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Maximum number of consents reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/consents/{identifier}/{showcase}':
    get:
      tags:
        - Consents
      summary: Get a single consent (with all details) by identifier and showcase
      operationId: findByIdUsingGET
      parameters:
        - name: identifier
          in: path
          description: identifier
          required: true
          schema:
            type: integer
            format: int32
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Consent'
        '404':
          description: Consent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      tags:
        - Consents
      summary: Delete a single consent (with all details) by identifier and showcase
      operationId: deleteUsingDELETE
      parameters:
        - name: identifier
          in: path
          description: identifier
          required: true
          schema:
            type: integer
            format: int32
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content:
            application/json: { }
        '401':
          description: Unauthorized error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Consent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /showcases:
    get:
      tags:
        - Showcases
      summary: Get all showcases
      operationId: findAllUsingGET_2
      parameters:
        - name: page
          in: query
          description: Page number (default value 0)
          schema:
            type: integer
            format: int32
          x-example: 0
        - name: size
          in: query
          description: Page size (default value 20)
          schema:
            type: integer
            format: int32
          x-example: 20
        - name: sort
          in: query
          description: 'Sort using format FIELD_NAME,ORDER (ORDER can be asc or desc)'
          style: form
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageOfShowcase'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      tags:
        - Showcases
      summary: Insert a new showcase
      operationId: insertUsingPOST_2
      requestBody:
        description: dto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateShowcase'
        required: true
        x-bodyName: dto
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Showcase'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Maximum number of showcases reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  /showcases/search:
    post:
      tags:
        - Showcases
      summary: Search showcases by filter
      operationId: searchUsingPOST_1
      parameters:
        - name: page
          in: query
          description: Page number (default value 0)
          schema:
            type: integer
            format: int32
          x-example: 0
        - name: size
          in: query
          description: Page size (default value 20)
          schema:
            type: integer
            format: int32
          x-example: 20
        - name: sort
          in: query
          description: 'Sort using format FIELD_NAME,ORDER (ORDER can be asc or desc)'
          style: form
          schema:
            type: array
            items:
              type: string
      requestBody:
        description: searchDto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchShowcase'
        required: true
        x-bodyName: searchDto
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageOfShowcase'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/showcases/{name}':
    get:
      tags:
        - Showcases
      summary: Get a single showcase (with all details) by name
      operationId: findByIdUsingGET_2
      parameters:
        - name: name
          in: path
          description: name
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Showcase'
        '404':
          description: Showcase not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      tags:
        - Showcases
      summary: Delete a single showcase (with all details) by name
      operationId: deleteUsingDELETE_2
      parameters:
        - name: name
          in: path
          description: name
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content:
            application/json: { }
        '404':
          description: Consent not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      tags:
        - Showcases
      summary: Update showcase
      operationId: updateUsingPATCH_1
      parameters:
        - name: name
          in: path
          description: name
          required: true
          schema:
            type: string
      requestBody:
        description: dto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchShowcase'
        required: true
        x-bodyName: dto
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Showcase'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/showcases/{showcase}/reminders':
    get:
      tags:
        - Reminders
      summary: Get all reminders
      operationId: findAllUsingGET_1
      parameters:
        - name: page
          in: query
          description: Page number (default value 0)
          schema:
            type: integer
            format: int32
          x-example: 0
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
        - name: size
          in: query
          description: Page size (default value 20)
          schema:
            type: integer
            format: int32
          x-example: 20
        - name: sort
          in: query
          description: 'Sort using format FIELD_NAME,ORDER (ORDER can be asc or desc)'
          style: form
          schema:
            type: array
            items:
              type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageOfReminder'
        '404':
          description: Showcase not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    post:
      tags:
        - Reminders
      summary: Insert a new reminder
      operationId: insertUsingPOST_1
      parameters:
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
      requestBody:
        description: dto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateReminder'
        required: true
        x-bodyName: dto
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reminder'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Showcase not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '409':
          description: Maximum number of reminders reached
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/showcases/{showcase}/reminders/search':
    post:
      tags:
        - Reminders
      summary: Search reminders by filter
      operationId: searchUsingPOST
      parameters:
        - name: page
          in: query
          description: Page number (default value 0)
          schema:
            type: integer
            format: int32
          x-example: 0
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
        - name: size
          in: query
          description: Page size (default value 20)
          schema:
            type: integer
            format: int32
          x-example: 20
        - name: sort
          in: query
          description: 'Sort using format FIELD_NAME,ORDER (ORDER can be asc or desc)'
          style: form
          schema:
            type: array
            items:
              type: string
      requestBody:
        description: searchDto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SearchReminder'
        required: true
        x-bodyName: searchDto
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageOfReminder'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
  '/showcases/{showcase}/reminders/{identifier}':
    get:
      tags:
        - Reminders
      summary: Get a single reminder (with all details) by identifier and showcase
      operationId: findByIdUsingGET_1
      parameters:
        - name: identifier
          in: path
          description: identifier
          required: true
          schema:
            type: string
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reminder'
        '404':
          description: Reminder not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    delete:
      tags:
        - Reminders
      summary: Delete a single reminder (with all details) by identifier and showcase
      operationId: deleteUsingDELETE_1
      parameters:
        - name: identifier
          in: path
          description: identifier
          required: true
          schema:
            type: string
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
      responses:
        '204':
          description: No Content
          content:
            application/json: { }
        '404':
          description: Reminder not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Generic Internal Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
    patch:
      tags:
        - Reminders
      summary: Update a reminder
      operationId: updateUsingPATCH
      parameters:
        - name: identifier
          in: path
          description: identifier
          required: true
          schema:
            type: string
        - name: showcase
          in: path
          description: showcase
          required: true
          schema:
            type: string
      requestBody:
        description: dto
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchReminder'
        required: true
        x-bodyName: dto
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Reminder'
        '400':
          description: Validation error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    Consent:
      title: Consent
      type: object
      properties:
        consentLevel:
          enum:
            - READ_ONLY
            - FULL_ACCESS
          type: string
          description: Permission Level
          example: READ_ONLY
        identifier:
          type: integer
          description: Identifier of the consent
          format: int32
          example: 0
        showcase:
          type: string
          description: Showcase name
          example: showcase1
        username:
          type: string
          description: Username
          example: user1
      description: Consent (Full Information)
    CreateConsent:
      title: CreateConsent
      type: object
      properties:
        consentLevel:
          enum:
            - READ_ONLY
            - FULL_ACCESS
          type: string
          description: Permission Level
          example: READ_ONLY
        showcase:
          type: string
          description: Showcase name
          example: showcase1
        username:
          type: string
          description: Username
          example: user1
      description: Consent for creation (without identifier). Identifier will be generated automatically.
    CreateReminder:
      title: CreateReminder
      type: object
      properties:
        relevance:
          type: integer
          description: Reminder relevance
          format: int32
          example: 1
        selectableTextIdx:
          type: integer
          description: Index in a list of texts
          format: int32
          example: 1
      description: Reminder to create (without identifier) in a specified showcase. Identifier will be generated automatically.
    CreateShowcase:
      title: CreateShowcase
      type: object
      properties:
        validFrom:
          type: string
          description: Start validity of showcase
          format: date-time
          example: '0001-01-01'
        validTo:
          type: string
          description: Final validity of showcase
          format: date-time
          example: '0001-01-01'
      description: Showcase for insert/update.
    ErrorResponse:
      title: ErrorResponse
      type: object
      properties:
        fault:
          $ref: '#/components/schemas/Fault'
      description: All details about an occurred error
    Fault:
      title: Fault
      type: object
      properties:
        code:
          type: integer
          description: Error code
          format: int32
          example: 404
        description:
          type: string
          description: Error description
          example: 'Entity not found with id [123]'
        message:
          type: string
          description: Error message
          example: Not Found
      description: Fault details
    PageOfConsent:
      title: PageOfConsent
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Consent'
          description: Elements contained in this page
        numberOfElements:
          type: integer
          description: Number of Elements in this page
          format: int32
          example: 5
        page:
          type: integer
          description: Page number
          format: int32
          example: 100
        size:
          type: integer
          description: Page size
          format: int32
          example: 10
        totalElements:
          type: integer
          description: Number of total elements (indipendent from pagination)
          format: int64
          example: 995
        totalPages:
          type: integer
          description: Number of total pages available
          format: int32
          example: 100
      description: Paged list
    PageOfReminder:
      title: PageOfReminder
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Reminder'
          description: Elements contained in this page
        numberOfElements:
          type: integer
          description: Number of Elements in this page
          format: int32
          example: 5
        page:
          type: integer
          description: Page number
          format: int32
          example: 100
        size:
          type: integer
          description: Page size
          format: int32
          example: 10
        totalElements:
          type: integer
          description: Number of total elements (indipendent from pagination)
          format: int64
          example: 995
        totalPages:
          type: integer
          description: Number of total pages available
          format: int32
          example: 100
      description: Paged list
    PageOfShowcase:
      title: PageOfShowcase
      type: object
      properties:
        content:
          type: array
          items:
            $ref: '#/components/schemas/Showcase'
          description: Elements contained in this page
        numberOfElements:
          type: integer
          description: Number of Elements in this page
          format: int32
          example: 5
        page:
          type: integer
          description: Page number
          format: int32
          example: 100
        size:
          type: integer
          description: Page size
          format: int32
          example: 10
        totalElements:
          type: integer
          description: Number of total elements (indipendent from pagination)
          format: int64
          example: 995
        totalPages:
          type: integer
          description: Number of total pages available
          format: int32
          example: 100
      description: Paged list
    PatchReminder:
      title: PatchReminder
      type: object
      properties:
        relevance:
          type: integer
          description: Reminder relevance
          format: int32
          example: 1
        selectableTextIdx:
          type: integer
          description: Index in a list of texts
          format: int32
          example: 1
      description: Reminder for insert/update.
    PatchShowcase:
      title: PatchShowcase
      type: object
      properties:
        validFrom:
          type: string
          description: Start validity of showcase
          format: date-time
          example: '0001-01-01'
        validTo:
          type: string
          description: Final validity of showcase
          format: date-time
          example: '0001-01-01'
      description: Showcase for insert/update.
    Reminder:
      title: Reminder
      type: object
      properties:
        identifier:
          type: string
          description: Identifier of reminder
          example: reminder-showcase-user1-10
        relevance:
          type: integer
          description: Relevance of this reminder
          format: int32
          example: 1
        showcase:
          type: string
          description: Showcase that contains this reminder
          example: showcase-user1-10
        text:
          type: string
          description: Text of this reminder
          example: This is a simple reminder
      description: Reminder (Full Information)
    SearchReminder:
      title: SearchReminder
      type: object
      properties:
        relevance:
          type: integer
          description: Filter by relevance
          format: int32
          example: 1
        textFilter:
          type: string
          description: Filter by text
          example: this
      description: Reminder Search Object
    SearchShowcase:
      title: SearchShowcase
      type: object
      properties:
        endValidity:
          type: string
          description: Filter by end validity
          format: date-time
          example: '0001-01-01'
        nameFilter:
          type: string
          description: Filter by name
          example: show1
        startValidity:
          type: string
          description: Filter by start validity
          format: date-time
          example: '0001-01-01'
      description: Showcase Search Object
    Showcase:
      title: Showcase
      type: object
      properties:
        name:
          type: string
          description: Name of showcase
          example: shocase-user1-10
        owner:
          type: string
          description: User that has created showcase
          example: user1
        validFrom:
          type: string
          description: Start validity of showcase
          format: date-time
          example: '0001-01-01'
        validTo:
          type: string
          description: Final validity of showcase
          format: date-time
          example: '0001-01-01'
      description: Showcase (Full Information)
  securitySchemes:
    Password:
      type: oauth2
      flows:
        password:
          tokenUrl: https://iam-uat.crif.com/oauth2/token
          scopes: { }
    Authorization_Code:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://iam-uat.crif.com/oauth2/authorize
          tokenUrl: https://iam-uat.crif.com/oauth2/token
          scopes: { }
security:
  - Password: [ ]
  - Authorization_Code: [ ]
tags:
  - name: Consents
    description: Consents APIs
  - name: Reminders
    description: Reminders APIs
  - name: Showcases
    description: Showcases APIs