openapi: "3.0.0"
info:
  version: 0.0.9
  title: Lueira Instructor REST API
  description: Instructor API for lueira
  contact:
    name: Maladeta Studio
    url: http://www.maladetastudio.com
    email: tech@maladetastudio.com
servers:
  - url: https://api.lueira.com/instructor
  - url: http://localhost:8000/instructor
security:
  - BearerAuth: []
tags:
  - name: Auth
    description: Authentication

paths:
  /auth/request-code:
    post:
      summary: Request verification code
      operationId: AuthRequestVerificationCode
      tags:
        - Auth
      requestBody:
        description: Request a login code via email
        content:
          "application/json":
            schema:
              type: object
              properties:
                email:
                  type: string
                  example: marge@simpsonsskischool.com
      responses:
        "200":
          description: Auth token for a user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InstructorAuthVerificationCode"
  /auth/login:
    post:
      summary: Login a user instructor
      operationId: AuthLogin
      security:
        - {}
      tags:
        - Auth
      requestBody:
        description: Request id and code
        content:
          "application/json":
            schema:
              type: object
              properties:
                request_id:
                  type: string
                  example: alongverificationtoken
                code:
                  type: string
                  example: "123456"
      responses:
        "200":
          description: Auth token for a user
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/AuthToken"

  /tenants:
    get:
      summary: Get all the tenants where the instructor is
      operationId: GetTenants
      security:
        - BearerAuth: []
      tags:
        - Tenants
      responses:
        "200":
          description: All tenants where the instructor is
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Tenant"
  /{tenant_id}/me:
    get:
      summary: Get the instructor of the current user
      operationId: GetMe
      security:
        - BearerAuth: []
      tags:
        - Me
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
      responses:
        "200":
          description: The instructor of a tenant and an email
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Instructor"
  /notification-tokens:
    post:
      summary: Creation of InstructorUserFcmDevice
      operationId: CreateInstructorUserFcmDevice
      security:
        - BearerAuth: []
      tags:
        - InstructorUserFcmDevice
      requestBody:
        description: Create a InstructorUserFcmDevice
        content:
          "application/json":
            schema:
              $ref: "#/components/schemas/InstructorUserFcmDeviceCreateRequest"
      responses:
        "200":
          description: The  InstructorUserFcmDevice
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/InstructorUserFcmDevice"
  /{tenant_id}/private-lessons/orders:
    get:
      summary: List private lesson orders for the tenant
      operationId: PrivateLessonOrderList
      tags:
        - Private lesson
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: query
          name: starts_from
          schema:
            type: string
          description: from date
          example: "2022-07-06T19:43:42Z"
        - in: query
          name: starts_to
          schema:
            type: string
          description: to date
          example: "2022-07-06T19:43:42Z"
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
      responses:
        "200":
          description: List of private lesson orders
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/PrivateLessonOrder"
  /{tenant_id}/private-lessons/orders/{order_id}:
    get:
      summary: Get the private lesson order details
      operationId: PrivateLessonOrderDetails
      tags:
        - Private lesson
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: order_id
          schema:
            type: string
          required: true
          description: Id of the order
          example: plorderid
      responses:
        "200":
          description: Private lesson order details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PrivateLessonOrder"

  /{tenant_id}/group-lessons/sessions:
    get:
      summary: List group lesson product sessions
      operationId: GroupLessonSessionList
      tags:
        - Group lesson
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: query
          name: starts_from
          schema:
            type: string
          description: from date
          example: "2022-07-06T19:43:42Z"
        - in: query
          name: starts_to
          schema:
            type: string
          description: to date
          example: "2022-07-06T19:43:42Z"
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
      responses:
        "200":
          description: List of group lesson product session
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GroupLessonProductSession"
  /{tenant_id}/group-lessons/sessions/{session_id}:
    get:
      summary: Group lesson product session details
      operationId: GroupLessonSessionDetails
      tags:
        - Group lesson
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: session_id
          schema:
            type: string
          required: true
          description: Id of the session
          example: glsessionid
      responses:
        "200":
          description: Details of a session
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/GroupLessonProductSession"
  /{tenant_id}/group-lessons/sessions/{session_id}/orders:
    get:
      summary: List the order for a session
      operationId: GroupLessonProductSessionOrderList
      tags:
        - Group lesson
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: session_id
          schema:
            type: string
          required: true
          description: Id of the session
          example: glsessionid
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
      responses:
        "200":
          description: Orders for the session
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GroupLessonOrder"
  /{tenant_id}/group-lessons/sessions/{session_id}/orders/{order_id}:
    patch:
      summary: Update a group lesson order
      operationId: GroupLessonOrderUpdate
      tags:
        - Group lesson
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: session_id
          schema:
            type: string
          required: true
          description: Id of the session
          example: glsessionid
        - in: path
          name: order_id
          schema:
            type: string
          required: true
          description: Id of the group lesson order
          example: grouplessonorderid
      requestBody:
        description: Update a group lesson order
        content:
          "application/json":
            schema:
              $ref: "#/components/schemas/GroupLessonOrderUpdateRequest"
      responses:
        "200":
          description: Order updated
          content:
            application/json:
              schema:
                type: object
                $ref: "#/components/schemas/GroupLessonOrder"
  /{tenant_id}/time-log:
    post:
      summary: Create a Instructor Time Log
      operationId: InstructorTimeLogCreated
      tags:
        - Intructor Time Log
      deprecated: true
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
      requestBody:
        description: Create a instructor time log
        content:
          "application/json":
            schema:
              $ref: "#/components/schemas/InstructorTimeLogCreateRequest"
      responses:
        "200":
          description: InstructorTimeLog created
          content:
            application/json:
              schema:
                type: object
                $ref: "#/components/schemas/InstructorTimeLog"
  /{tenant_id}/time-logs:
    post:
      summary: Create a Instructor Time Log
      operationId: InstructorTimeLogCreate
      tags:
        - Intructor Time Log
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
      requestBody:
        description: Create a instructor time log
        content:
          "application/json":
            schema:
              $ref: "#/components/schemas/InstructorTimeLogCreateRequest"
      responses:
        "200":
          description: InstructorTimeLog created
          content:
            application/json:
              schema:
                type: object
                $ref: "#/components/schemas/InstructorTimeLog"
    get:
      summary: Get Instructor Time Logs
      operationId: InstructorTimeLogGet
      tags:
        - Intructor Time Log
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - $ref: '#/components/parameters/OffsetParam'
        - $ref: '#/components/parameters/LimitParam'
        - in: query
          name: from
          schema:
            type: string
          description: from date in UTC
          example: "2022-07-06T19:43:42Z"
        - in: query
          name: to
          schema:
            type: string
          description: to date in UTC
          example: "2022-07-06T19:43:42Z"
      responses:
        "200":
          description: InstructorTimeLogs
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/InstructorTimeLog"
  /{tenant_id}/time-logs/{instructor_time_log_id}:
    patch:
      summary: Update a instructor time log
      operationId: InstructorTimeLogUpdate
      tags:
        - Intructor Time Log
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: instructor_time_log_id
          schema:
            type: string
          required: true
          description: Id of the time log
          example: instructor time log
      requestBody:
        description: Update a Instructor Time log
        content:
          "application/json":
            schema:
              $ref: "#/components/schemas/InstructorTimeLogUpdateRequest"
      responses:
        "200":
          description: Instructor Time Log Updated
          content:
            application/json:
              schema:
                type: object
                $ref: "#/components/schemas/InstructorTimeLog"
  /{tenant_id}/time-log/{instructor_time_log_id}:
    patch:
      summary: Update a instructor time log
      operationId: InstructorTimeLogUpdated
      tags:
        - Intructor Time Log
      deprecated: true
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: instructor_time_log_id
          schema:
            type: string
          required: true
          description: Id of the time log
          example: instructor time log
      requestBody:
        description: Update a Instructor Time log
        content:
          "application/json":
            schema:
              $ref: "#/components/schemas/InstructorTimeLogUpdateRequest"
      responses:
        "200":
          description: Instructor Time Log Updated
          content:
            application/json:
              schema:
                type: object
                $ref: "#/components/schemas/InstructorTimeLog"
  /{tenant_id}/galleries:
    get:
      summary: Get galleries
      operationId: GetGalleries
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
      responses:
        "200":
          description: Gallery list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Gallery"
    post:
      summary: Create gallery
      operationId: CreateGallery
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
      requestBody:
        description: Add a new gallery
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GalleryCreateRequest"
      responses:
        "200":
          description: Gallery details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Gallery"
  /{tenant_id}/galleries/{gallery_id}:
    get:
      summary: Get a gallery
      operationId: GetAGallery
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
      responses:
        "200":
          description: Gallery details
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Gallery"
    patch:
      summary: Update a gallery
      operationId: UpdateGallery
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
      requestBody:
        description: Update a gallery
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GalleryUpdateRequest"
      responses:
        "200":
          description: Gallery update
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Gallery"
    delete:
      summary: Delete a gallery
      operationId: DeleteGallery
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
      responses:
        "204":
          description: And it is gone
  /{tenant_id}/galleries/{gallery_id}/items:
    get:
      summary: Get gallery items
      operationId: GetGalleryitems
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
      responses:
        "200":
          description: Gallery items list
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GalleryItem"
    post:
      summary: Create gallery item
      operationId: CreateGalleryItem
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
      requestBody:
        description: Add a new gallery item
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GalleryItemCreateRequest"
      responses:
        "200":
          description: Gallery item details
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GalleryItem"
  /{tenant_id}/galleries/{gallery_id}/items/{item_id}:
    patch:
      summary: Update a gallery item
      operationId: UpdateGalleryItem
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
        - in: path
          name: item_id
          schema:
            type: string
          required: true
          description: Id of the gallery item
          example: glpid
      requestBody:
        description: Update a gallery item
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/GalleryItemUpdateRequest"
      responses:
        "200":
          description: Gallery item update
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/GalleryItem"
    delete:
      summary: Delete a gallery item
      operationId: DeleteGalleryItem
      tags:
        - Galleries
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: gallery_id
          schema:
            type: string
          required: true
          description: Id of the gallery
          example: glpid
        - in: path
          name: item_id
          schema:
            type: string
          required: true
          description: Id of the gallery item
          example: glpid
      responses:
        "204":
          description: And it is gone
  /{tenant_id}/badges:
    get:
      summary: List Badges for the tenant
      operationId: BadgesList
      tags:
        - Badges
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
        - in: query
          name: q
          schema:
            type: string
          description: string to search for
          example: achievement
        - in: query
          name: activity_id
          schema:
            type: string
          description: activity id to search for
          example: activityid
        - in: query
          name: level_id
          schema:
            type: string
          description: level id to search for
          example: levelid
      responses:
        "200":
          description: List of Badges
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Badge"
  /{tenant_id}/feedbacks:
    get:
      summary: List Feedbacks
      operationId: FeedbackList
      tags:
        - Feedbacks
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - $ref: "#/components/parameters/OffsetParam"
        - $ref: "#/components/parameters/LimitParam"
        - in: query
          name: private_lesson_order_id
          schema:
            type: string
          description: Id of the private lesson order
        - in: query
          name: group_lesson_order_id
          schema:
            type: string
          description: Id of the group lesson order
        - in: query
          name: customer_relative_id
          schema:
            type: string
          description: Id of the customer relative
        - in: query
          name: instructor_id
          schema:
            type: string
          description: Id of the instructor
        - in: query
          name: order_id
          schema:
            type: string
          description: Id of the order
        - in: query
          name: group_lesson_session_id
          schema:
            type: string
          description: Id of the session
      responses:
        "200":
          description: List of Feedbacks
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: "#/components/schemas/Feedback"
    post:
      summary: Create a feedback
      operationId: FeedbackCreate
      tags:
        - Feedbacks
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
      requestBody:
        description: Create a badge
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FeedbackCreateRequest"
      responses:
        "200":
          description: FeedbackCreated
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Feedback"
  /{tenant_id}/feedbacks/{feedback_id}:
    get:
      summary: Get a feedback
      operationId: GetFeedback
      tags:
        - Feedbacks
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: feedback_id
          schema:
            type: string
          required: true
          description: Id of the feedback
      responses:
        "200":
          description: Get of a feedback
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Feedback"
    patch:
      summary: Update a feedback
      operationId: FeedbackUpdate
      tags:
        - Feedbacks
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: feedback_id
          schema:
            type: string
          required: true
          description: Id of the feedback
      requestBody:
        description: Feedback to update
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FeedbackUpdateRequest"
      responses:
        "200":
          description: A feedback
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/Feedback"
    delete:
      summary: Delete a feedback
      operationId: FeedbackDelete
      tags:
        - Feedbacks
      parameters:
        - in: path
          name: tenant_id
          schema:
            type: string
          required: true
          description: Id of the tenant
          example: tenantid
        - in: path
          name: feedback_id
          schema:
            type: string
          required: true
          description: Id of the feedback
      responses:
        "204":
          description: And it is gone
  /{tenant_id}/files:
    post:
      summary: Create a file
      description: Create a new file
      operationId: FileCreate
      tags:
        - Files
      requestBody:
        description: file to upload
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/FileCreateRequest"
      responses:
        "200":
          description: A file
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/File"          
components:
  parameters:
    OffsetParam:
      in: query
      name: offset
      schema:
        type: integer
      description: The number of items to skip before starting to collect the result set
    LimitParam:
      in: query
      name: limit
      schema:
        type: integer
      description: The numbers of items to return
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
  schemas:
    Activity:
      type: object
      properties:
        id:
          type: string
          example: activityid
        name:
          type: string
          example: Ski
        created_at:
          $ref: "#/components/schemas/DateTime"
    DateTime:
      type: string
      example: "2022-07-06T19:43:42Z"
    AuthToken:
      type: object
      properties:
        token:
          type: string
          example: asuperlongrandomtokenl
    InstructorAuthVerificationCode:
      type: object
      properties:
        request_id:
          type: string
          example: alongtoken
    FileCreateRequest:
      type: object
      additionalProperties: false
      properties:
        file_name:
          type: string
          example: "dopefilename.png"
        content:
          type: string
          example: "data:image/jpeg;base64,/9j/4AAQSkZ..."
          description: base64 representation of the file
        customer_id:
          type: string
          example: "customerid"          
    Gallery:
      type: object
      properties:
        id:
          type: string
          example: galleryid
        name:
          type: string
          example: gallery
        description:
          type: string
          example: gallerydescription
        default_gallery_item:
          $ref: "#/components/schemas/GalleryItem"          
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    GalleryCreateRequest:
      type: object
      properties:
        name:
          type: string
          example: gallery
        description:
          type: string
          example: gallerydescription
      required:
        - name
    GalleryUpdateRequest:
      type: object
      properties:
        name:
          type: string
          example: gallery
        description:
          type: string
          example: gallerydescription
    GalleryItemCreateRequest:
      type: object
      properties:
        sorting_position:
          type: integer
          example: 3
        description:
          type: string
          example: galleryitemdescription
        file_id:
          type: string
          example: fileid
      required:
        - description
        - sorting_position
        - file_id
    GalleryItemUpdateRequest:
      type: object
      properties:
        sorting_position:
          type: integer
          example: 3
        description:
          type: string
          example: galleryitemdescription
    GalleryItem:
      type: object
      properties:
        id:
          type: string
          example: galleryitemid
        sorting_position:
          type: integer
          example: 4
        description:
          type: string
          example: gallerydescription
        file:
          $ref: "#/components/schemas/File"
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    File:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          example: afileid
        url:
          type: string
          example: "http://example.com/afileid.png"
    Tenant:
      type: object
      properties:
        id:
          type: string
          example: tenantid
        name:
          type: string
          example: Simpson Ski School
        logo_url:
          type: string
          example: https://maladeta.studio
        school_opens_at:
          type: string
          example: 07:00
        school_closes_at:
          type: string
          example: 20:00
        view_threshold_hours:
          type: integer
          example: 48
        timezone:
          type: string
          example: America/Sao_Paulo
    Instructor:
      type: object
      properties:
        id:
          type: string
          example: instructorid
        first_name:
          type: string
          example: Alvaro
        last_name:
          type: string
          example: Gavalda
        email:
          type: string
          example: ag@mldt.xyz
        phone:
          type: string
          example: 600123123
        vat_number:
          type: string
          example: ES000123
        address:
          type: string
          example: Passeig Olimpic 5
        address_extra:
          type: string
          example: Principal 2
        postal_code:
          type: string
          example: 08038
        city:
          type: string
          example: Barcelona
        country_code:
          type: string
          example: es
          description: https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes
        languages:
          type: array
          items:
            type: string
            example: es
        activities:
          type: array
          items:
            $ref: "#/components/schemas/Activity"
        profile_pic_url:
          type: string
          example: http://example.com/profile_pic.jpg
        created_at:
          $ref: "#/components/schemas/DateTime"
    Customer:
      type: object
      properties:
        id:
          type: string
          example: customerid
        first_name:
          type: string
          example: Anton
        last_name:
          type: string
          example: Alvarez
        language_code:
          type: string
          example: ES
        phone:
          type: string
          example: 612345678
        lesson_level:
          $ref: "#/components/schemas/LessonLevel"
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    CustomerRelative:
      type: object
      properties:
        id:
          type: string
          example: customerid
        first_name:
          type: string
          example: Anton
        last_name:
          type: string
          example: Alvarez
        phone:
          type: string
          example: 600123123
        language_code:
          type: string
          example: ES
        comment:
          type: string
          example: Hellowwww
        lesson_level:
          $ref: "#/components/schemas/LessonLevel"
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
        birthdate:
          $ref: "#/components/schemas/DateTime"
        customer:
          $ref: "#/components/schemas/Customer"
    PrivateLessonOrder:
      type: object
      properties:
        id:
          type: string
          example: plid
        order_id:
          type: string
          example: orderid
        order_reference:
          type: string
          example: rndorderref
        order_item_id:
          type: string
          example: orderitemid
        order_item_comment:
          type: string
          example: Likes the color green
        product:
          $ref: "#/components/schemas/PrivateLessonProduct"
        starts_at:
          $ref: "#/components/schemas/DateTime"
        ends_at:
          $ref: "#/components/schemas/DateTime"
        participant_count:
          type: number
          example: 1
        lesson_level:
          $ref: "#/components/schemas/LessonLevel"
        meeting_point:
          $ref: "#/components/schemas/MeetingPoint"
        language_code:
          type: string
          example: es
        instructors:
          type: array
          items:
            $ref: "#/components/schemas/Instructor"
        is_instructor_locked:
          type: boolean
          example: false
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
        order:
          $ref: "#/components/schemas/Order"
        customer_relatives:
          type: array
          items:
            $ref: "#/components/schemas/CustomerRelative"
    PrivateLessonProduct:
      type: object
      properties:
        id:
          type: string
          example: privatelessonproductid
        name:
          type: string
          example: Ski lessons
        description:
          type: string
          example: Para todos los niveles
        activity:
          $ref: "#/components/schemas/Activity"
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    GroupLessonProduct:
      type: object
      properties:
        id:
          type: string
          example: grouplessonproductid
        name:
          type: string
          example: Freeride Experts
        description:
          type: string
          example: Take your free ride skills to the limit
        activity:
          $ref: "#/components/schemas/Activity"
        lesson_level:
          $ref: "#/components/schemas/LessonLevel"
        meeting_point:
          $ref: "#/components/schemas/MeetingPoint"
        language_code:
          type: string
          example: es
        max_participants:
          type: number
          example: 8
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
        languages:
          type: array
          items:
            type: string
            example: es
    GroupLessonProductSession:
      type: object
      properties:
        id:
          type: string
          example: grouplessonproducsessionid
        product:
          $ref: "#/components/schemas/GroupLessonProduct"
        starts_at:
          $ref: "#/components/schemas/DateTime"
        ends_at:
          $ref: "#/components/schemas/DateTime"
        meeting_point:
          $ref: "#/components/schemas/MeetingPoint"
        language_code:
          type: string
          example: es
        max_participants:
          type: number
          example: 8
        instructors:
          type: array
          items:
            $ref: "#/components/schemas/Instructor"
        participant_count:
          type: number
          example: 2
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: string
          example: asdf
        languages:
          type: array
          items:
            type: string
            example: es
    GroupLessonOrder:
      type: object
      properties:
        id:
          type: string
          example: grouplessonorderis
        customer:
          $ref: "#/components/schemas/Customer"
        order_id:
          type: string
          example: orderid
        order_reference:
          type: string
          example: rndorderref
        order_item_id:
          type: string
          example: orderitemid
        order_item_comment:
          type: string
          example: Likes the color green
        session:
          $ref: "#/components/schemas/GroupLessonProductSession"
        participant_name:
          type: string
          example: Jacobo
        participant_phone:
          type: string
          example: "600123321"
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
        has_participant_attended:
          type: boolean
          example: false
        order:
          $ref: "#/components/schemas/Order"
        customer_relative:
          $ref: "#/components/schemas/CustomerRelative"
    LessonLevel:
      type: object
      properties:
        id:
          type: string
          example: lessonlevelid
        name:
          type: string
          example: A1
    MeetingPoint:
      type: object
      properties:
        id:
          type: string
          example: meetingpointid
        name:
          type: string
          example: Escuela de Beret
        color:
          type: string
          example: "#123FFF"
        description:
          type: string
          example: Delante de la esculela en la bandera marcada con la letra A
        created_at:
          $ref: "#/components/schemas/DateTime"
    GroupLessonOrderUpdateRequest:
      type: object
      properties:
        has_participant_attended:
          type: boolean
          example: true
    Order:
      type: object
      properties:
        id:
          type: string
          example: orderid
        reference:
          type: string
          example: shortref
        customer:
          $ref: "#/components/schemas/Customer"
        location:
          $ref: "#/components/schemas/Location"
        status:
          $ref: "#/components/schemas/OrderStatus"
        price:
          $ref: "#/components/schemas/Amount"
        payment_summary:
          $ref: "#/components/schemas/OrderPaymentSummary"
        partner:
          $ref: "#/components/schemas/Partner"
        comment:
          type: string
          example: First time touching snow
        order_item_types:
          $ref: "#/components/schemas/OrderItemTypes"
        is_online_order:
          type: boolean
          example: true
    Location:
      type: object
      properties:
        id:
          type: string
          example: locationid
        name:
          type: string
          example: Reiau 1
    OrderStatus:
      type: string
      enum:
        - IN_PROGRESS
        - CONFIRMED
        - COMPLETED
        - QUOTE
        - CANCELED
    Amount:
      type: object
      properties:
        number:
          type: integer
          example: 5000
        currency_code:
          type: string
          example: EUR
    OrderPaymentSummary:
      type: object
      properties:
        status:
          type: string
          enum:
            - PENDING
            - PARTIAL
            - COMPLETED
        pending:
          $ref: "#/components/schemas/Amount"
        requested:
          $ref: "#/components/schemas/Amount"
        paid:
          $ref: "#/components/schemas/Amount"
    Partner:
      type: object
      properties:
        id:
          type: string
          example: pid
        name:
          type: string
          example: Hotel Tuca
        email:
          type: string
          example: tuca@hotel.com
        phone:
          type: string
          example: 973640000
        comment:
          type: string
          example: Hotel en Betren
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    OrderItemTypes:
      type: array
      items:
        type: string
        enum:
          - CUSTOM
          - RENT
          - GROUP_LESSON
          - PRIVATE_LESSON
          - SHOP
        example: RENT
    PreviousState:
      type: object
      properties:
        user_id:
          type: string
          example: uid
        starts_at:
          $ref: "#/components/schemas/DateTime"
        ends_at:
          $ref: "#/components/schemas/DateTime"
        updated_at:
          $ref: "#/components/schemas/DateTime"
        reason_to_update:
          type: string
          example: I'm out of office  
    User:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          example: uid
        first_name:
          type: string
          example: Marge  
        last_name:
          type: string
          example: Simpson
        is_active:
          type: boolean
          example: true
    InstructorTimeLog:
      type: object
      properties:
        id:
          type: string
          example: pid
        starts_at:
          $ref: "#/components/schemas/DateTime"
        ends_at:
          $ref: "#/components/schemas/DateTime"
        is_time_log_confirmed:
          type: boolean
          example: false
        instructor:
          $ref: "#/components/schemas/Instructor"
        reason_to_update:
          type: string
          example: reason
        previous_states:
          type: array
          items:
            $ref: "#/components/schemas/PreviousState"
        updated_at:
          $ref: "#/components/schemas/DateTime"
        user: 
          $ref: "#/components/schemas/User"
    InstructorTimeLogCreateRequest:
      type: object
      properties:
        starts_at:
          $ref: "#/components/schemas/DateTime"
    InstructorTimeLogUpdateRequest:
      type: object
      properties:
        ends_at:
          $ref: "#/components/schemas/DateTime"
        is_time_log_confirmed:
          type: boolean
          example: false
        starts_at:
          $ref: "#/components/schemas/DateTime"
        reason_to_update:
          type: string
          example: reason
    InstructorUserFcmDeviceCreateRequest:
      type: object
      properties:
        token:
          type: string
          example: tokenexample
    InstructorUserFcmDevice:
      type: object
      properties:
        id:
          type: string
          example: id
        token:
          type: string
          example: tokenexample
    Badge:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          example: badge123
        name:
          type: string
          example: "Master Achiever"
        description:
          type: string
          example: "Badge for completing advanced courses"
        sorting_position:
          type: integer
          format: int8
          example: 1
        image:
          $ref: "#/components/schemas/File"
        activity:
          $ref: "#/components/schemas/Activity"
        lesson_level:
          $ref: "#/components/schemas/LessonLevel"
        translations:
          type: object
          additionalProperties:
            type: object
        design_json:
          type: object
          description: Custom design properties for the badge
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    Feedback:
      type: object
      additionalProperties: false
      properties:
        id:
          type: string
          example: badge123
        comment:
          type: string
          example: "Master Achiever"
        customer_relative:
          $ref: "#/components/schemas/CustomerRelative"
        Instructor:
          $ref: "#/components/schemas/Instructor"
        badges:
          type: array
          items:
            $ref: "#/components/schemas/Badge"
        group_lesson_order:
          $ref: "#/components/schemas/GroupLessonOrder"
        private_lesson_order:
          $ref: "#/components/schemas/PrivateLessonOrder"
        gallery:
          $ref: "#/components/schemas/Gallery"
        created_at:
          $ref: "#/components/schemas/DateTime"
        is_deleted:
          type: boolean
          example: false
    FeedbackCreateRequest:
      type: object
      additionalProperties: false
      properties:
        comment:
          type: string
          example: "Master Achiever"
        customer_id:
          type: string
          example: customerid
        customer_relative_id:
          type: string
          example: relativeid
        badge_ids:
          type: array
          items:
            type: string
            example: badgeid
        gallery_id:
          type: string
          example: "gallery123"
        private_lesson_order_id:
          type: string
          example: "private_lesson_order123"
        group_lesson_order_id:
          type: string
          example: "group_lesson_order123"
      required:
        - comment
    FeedbackUpdateRequest:
      type: object
      additionalProperties: false
      properties:
        comment:
          type: string
          example: "Master Achiever"
        badge_ids:
          type: array
          items:
            type: string
            example: badgeid
        gallery_id:
          type: string
          example: "gallery123"
