openapi: 3.0.0
info:
  title: api.adeodc.dk
  contact:
    email: mke@codinggroup.dk
  version: '1.0'
paths:
  /company:
    get:
      tags:
        - Company
      description: 'Lists all companies in the system'
      operationId: 061bde5a1cfc044c4d5a26ac639e0f81
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
  '/company/{id}':
    get:
      tags:
        - Company
      description: 'Gets a single company with the specified id'
      operationId: a770524042d50ad61d95f9aed0644e3f
      parameters:
        -
          name: id
          in: path
          description: 'Id of the company'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
        '404':
          description: 'Company not found'
  /happiness:
    get:
      tags:
        - Happiness
      description: 'Lists all customer happiness registrations in the system'
      operationId: 47e4b8e60e5966ed3972786f7b73757d
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
    post:
      tags:
        - Happiness
      description: 'Creates an registration for a company'
      operationId: ba5374f8e7969f57f2971beba914b8e7
      requestBody:
        description: 'Create happiness object'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CompanyHappiness'
      responses:
        '201':
          description: Success
        '400':
          description: 'Company not found'
        '401':
          description: 'Not authorized'
  /happiness/latest:
    get:
      tags:
        - Happiness
      description: 'Lists the latests customer happiness registration for each customer within 30 days in the system'
      operationId: c511e9115e6b22227d843eae032dbc0b
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
  '/happiness/{id}':
    get:
      tags:
        - Happiness
      description: 'Get a company happiness registration by id'
      operationId: 2f1402c3b6bc2bc8fb040f6594366f5f
      parameters:
        -
          name: id
          in: path
          description: 'id of the company happiness registration'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CompanyHappiness'
        '401':
          description: 'Not authorized'
        '404':
          description: 'Company happiness registration not found'
        '500':
          description: 'Internal server error'
      security:
        -
          bearerAuth: []
  /email/create:
    post:
      tags:
        - Email
      description: 'Creates an email'
      operationId: eddbc3402c474ad00a3f6aa704372324
      requestBody:
        description: 'Create email object'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateEmail'
      responses:
        '201':
          description: Success
        '400':
          description: 'User not found'
        '401':
          description: 'Not authorized'
  /email/send:
    get:
      tags:
        - Email
      description: 'Sends emails from the system queue'
      operationId: 1d24ed3ddd67167f5c200e9633cc1ee7
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
  /news:
    get:
      tags:
        - News
      description: 'Lists all news in the system'
      operationId: 07fce9ff0a03b0fdcf5a6a761d8398f8
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
  '/news/{id}':
    get:
      tags:
        - News
      description: 'Gets a single news article with the specified id'
      operationId: f55e389edee73ee1206763479d34c2ce
      parameters:
        -
          name: id
          in: path
          description: 'Id of the news article'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
        '404':
          description: 'News article not found'
  /office:
    get:
      tags:
        - office
      description: 'Lists all Office in the system'
      operationId: ad34666b7ff557b7012401f8536a7362
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
    post:
      tags:
        - office
      description: 'Creates a new Office'
      operationId: 5716db9e037974eda200d884937453c4
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateOffice'
      responses:
        '201':
          description: Success
        '400':
          description: 'Bad request'
        '401':
          description: 'Not authorized'
  '/office/{id}':
    get:
      tags:
        - office
      description: 'Gets a single Office with the specified id'
      operationId: e1c85cba69c72dd3d3687e07452f7630
      parameters:
        -
          name: id
          in: path
          description: 'Id of the Office'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
        '404':
          description: 'Office not found'
    put:
      tags:
        - office
      description: 'Updates a single Office with the specified id'
      operationId: 704e729b36deb9956607288e0990ccd7
      parameters:
        -
          name: id
          in: path
          description: 'Office id to update'
          required: true
          schema:
            type: integer
            format: int64
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/EditOffice'
      responses:
        '200':
          description: Success
        '404':
          description: 'Office not found'
        '401':
          description: 'Not authorized'
    delete:
      tags:
        - office
      description: 'Deletes a single Office with the specified id'
      operationId: 9cc1def9c3ba0cdd66fcbcd9a9076b87
      parameters:
        -
          name: id
          in: path
          description: 'Office id to delete'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
        '404':
          description: 'Office not found'
        '401':
          description: 'Not authorized'
  /users:
    get:
      tags:
        - User
      description: 'Lists all users in the system'
      operationId: e56423e47ff6c0eaac836d31e856d6ac
      responses:
        '200':
          description: Success
        '401':
          description: 'Not authorized'
    post:
      tags:
        - User
      description: 'Creates an user'
      operationId: c330b78c86f6a53939df702f13ba0529
      requestBody:
        description: 'Create user object'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUser'
      responses:
        '200':
          description: Success
        '404':
          description: 'User not found'
        '401':
          description: 'Not authorized'
  '/users/{id}':
    get:
      tags:
        - User
      description: 'Gets a single user with the specified id'
      operationId: be445fa68712c785af5f50b6e2a0c641
      parameters:
        -
          name: id
          in: path
          description: 'Id of the user'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
        '404':
          description: 'User not found'
        '401':
          description: 'Not authorized'
  '/userswithcompany/{id}':
    get:
      tags:
        - User
      description: 'Gets a single user and their company with the specified id'
      operationId: fe4c6bf091a98b3c951d810ad5d7938d
      parameters:
        -
          name: id
          in: path
          description: 'Id of the user'
          required: true
          schema:
            type: integer
            format: int64
      responses:
        '200':
          description: Success
        '404':
          description: 'User not found'
        '401':
          description: 'Not authorized'
  '/users/{email}':
    get:
      tags:
        - User
      description: 'Gets a single user with the specified email'
      operationId: a64a5b06fe16c271b059edff9caad96e
      parameters:
        -
          name: email
          in: path
          description: 'Email of the user'
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Success
        '404':
          description: 'User not found'
        '401':
          description: 'Not authorized'
  /users/forgot-password:
    post:
      tags:
        - User
      description: 'Sends an email to a user that has forgotten their password'
      operationId: ba9cbc0efbe7987463c55b6119e7e424
      requestBody:
        description: 'Forgot password object'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ForgotPassword'
      responses:
        '200':
          description: Success
  /users/reset-password:
    post:
      tags:
        - User
      description: 'Resets a users password, based on the recoverycode from forgot-password'
      operationId: 40e2211321faad2a09873332e448162e
      requestBody:
        description: 'Reset password object'
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ResetPassword'
      responses:
        '200':
          description: Success
components:
  schemas:
    Company:
      properties:
        id:
          type: integer
          nullable: true
        name:
          type: string
        street:
          type: string
        streetNumber:
          type: string
        city:
          type: string
        zipcode:
          type: integer
        phoneCallingCode:
          type: integer
        phoneNumber:
          type: integer
        email:
          type: string
        createdDate:
          type: string
          format: date-time
      type: object
    CreateCompany:
      properties:
        name:
          type: string
          nullable: true
        street:
          type: string
          nullable: true
        streetNumber:
          type: string
          nullable: true
        city:
          type: string
          nullable: true
        zipcode:
          type: integer
          nullable: true
        phoneCallingCode:
          type: integer
          nullable: true
        phoneNumber:
          type: integer
          nullable: true
        email:
          type: string
          nullable: true
        createdDate:
          type: string
      type: object
    CompanyHappiness:
      properties:
        id:
          type: integer
          nullable: true
        Company_Id:
          type: integer
        state:
          type: integer
        note:
          type: string
        CreatedBy_User_id:
          type: integer
        createdDate:
          type: string
          format: date-time
      type: object
    CreateCompanyHappiness:
      properties:
        note:
          type: string
      type: object
    CreateEmail:
      properties:
        EmailTemplate_id:
          type: integer
        User_id:
          type: integer
          nullable: true
        title:
          type: string
        message:
          type: string
      type: object
    Email:
      properties:
        id:
          type: integer
          nullable: true
        EmailTemplate_id:
          type: integer
        User_id:
          type: integer
        title:
          type: string
        message:
          type: string
        createdDate:
          type: string
          format: date-time
        deliveredDate:
          type: string
          format: date-time
        status:
          type: string
        errorMessage:
          type: string
      type: object
    NewsWithUserDTO:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User:
          $ref: '#/components/schemas/UserSupportTicket'
        topic:
          type: string
        createdDate:
          type: string
          format: date-time
      type: object
    News:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User_id:
          type: integer
        topic:
          type: string
        createdDate:
          type: string
          format: date-time
      type: object
    CreateOffice:
      properties:
        name:
          type: string
        size:
          type: integer
        floor:
          type: integer
        rent:
          type: integer
        move_in:
          type: string
        status:
          type: string
      type: object
    EditOffice:
      properties:
        id:
          type: integer
        name:
          type: string
        size:
          type: integer
        floor:
          type: integer
        rent:
          type: integer
        move_in:
          type: string
        status:
          type: string
      type: object
    Office:
      properties:
        id:
          type: integer
        name:
          type: string
        size:
          type: integer
        floor:
          type: integer
        rent:
          type: integer
        move_in:
          type: string
        status:
          type: string
      type: object
    OperatingInformationWithUserDTO:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User:
          $ref: '#/components/schemas/UserSupportTicket'
        createdDate:
          type: string
          format: date-time
        topic:
          type: string
        description:
          type: string
        expectedStart:
          type: string
          format: date-time
        expectedEnd:
          type: string
          format: date-time
        solved:
          type: boolean
      type: object
    CreateOperatingInformation:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User_id:
          type: integer
        topic:
          type: string
        description:
          type: string
        expectedStart:
          type: string
          format: date-time
        expectedEnd:
          type: string
          format: date-time
        solved:
          type: boolean
      type: object
    OperatingInformation:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User_id:
          type: integer
        createdDate:
          type: string
          format: date-time
        topic:
          type: string
        description:
          type: string
        expectedStart:
          type: string
          format: date-time
        expectedEnd:
          type: string
          format: date-time
        solved:
          type: boolean
      type: object
    OperatingInformationUpdateWithUserDTO:
      properties:
        id:
          type: integer
          nullable: true
        OperatingInformation_id:
          type: integer
          nullable: true
        CreatedBy_User:
          $ref: '#/components/schemas/UserSupportTicket'
        createdDate:
          type: string
          format: date-time
        description:
          type: string
      type: object
    CreateOperatingInformationUpdate:
      properties:
        id:
          type: integer
          nullable: true
        OperatingInformation_id:
          type: integer
          nullable: true
        CreatedBy_User_id:
          type: integer
        createdDate:
          type: string
          format: date-time
        description:
          type: string
      type: object
    OperatingInformationUpdate:
      properties:
        id:
          type: integer
          nullable: true
        OperatingInformation_id:
          type: integer
        CreatedBy_User_id:
          type: integer
        createdDate:
          type: string
          format: date-time
        description:
          type: string
      type: object
    RefreshToken:
      properties:
        uid:
          type: integer
          nullable: true
        refresh_token:
          type: string
        expires_at:
          type: integer
      type: object
    SupportTicketWithUserDTO:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User:
          $ref: '#/components/schemas/UserSupportTicket'
        topic:
          type: string
        status:
          type: string
        AssignedTo_User:
          $ref: '#/components/schemas/UserSupportTicket'
        createdDate:
          type: string
          format: date-time
      type: object
    CreateSupportTicket:
      properties:
        topic:
          type: string
        category:
          type: string
        status:
          type: string
      type: object
    SupportTicket:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User_id:
          type: integer
        topic:
          type: string
        status:
          type: string
        AssignedTo_User_id:
          type: integer
        createdDate:
          type: string
          format: date-time
      type: object
    SupportTicketAnswerWithUserDTO:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User:
          $ref: '#/components/schemas/User'
        createdDate:
          type: string
          format: date-time
        message:
          type: string
        SupportTicket_id:
          type: integer
      type: object
    CreateSupportTicketAnswer:
      properties:
        message:
          type: string
      type: object
    SupportTicketAnswer:
      properties:
        id:
          type: integer
          nullable: true
        CreatedBy_User_id:
          type: integer
        createdDate:
          type: string
          format: date-time
        message:
          type: string
        SupportTicket_id:
          type: integer
      type: object
    UserSupportTicket:
      properties:
        id:
          type: integer
          nullable: true
        company_id:
          type: integer
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        userType:
          type: integer
      type: object
    UserWithCompany:
      properties:
        id:
          type: integer
          nullable: true
        Company:
          $ref: '#/components/schemas/Company'
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        userType:
          type: integer
      type: object
    CreateUser:
      properties:
        company_id:
          type: integer
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        phoneCallingCode:
          type: integer
        phoneNumber:
          type: integer
        password:
          type: string
        userType:
          type: integer
          nullable: true
      type: object
    ForgotPassword:
      properties:
        email:
          type: string
      type: object
    ResetPassword:
      properties:
        email:
          type: string
        recoveryCode:
          type: integer
        password:
          type: string
      type: object
    User:
      properties:
        id:
          type: integer
          nullable: true
        company_id:
          type: integer
        firstName:
          type: string
        lastName:
          type: string
        email:
          type: string
        recoveryCode:
          type: string
        recoveryCodeCreatedDate:
          type: string
          format: date-time
        createdDate:
          type: string
          format: date-time
        userType:
          type: integer
      type: object
