openapi: 3.0.3
info:
  title: Survey Service Api definition
  description: Survey API used to manage surveys
  version: v2
  contact:
    email: example@carlsberggroup.com
    name: CADI Team
servers:
  - url: http://localhost:3000
    description: This is a sample description for this server url.
security:
  - X-API-KEY: []
tags:
  - name: surveyV1
    description: Survey API endpoints
  - name: submissionV1
    description: Submissions API endpoints
  - name: submissionReportV1
    description: Submission Report API endpoints
paths:
  /customers/{customerId}/surveys/{surveyEid}:
    post:
      summary: Survey submission creation
      operationId: submitAnswersV2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmissionDto-v1'
        required: true
      responses:
        '201':
          $ref: '#/components/responses/SubmissionDto'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
      description: Creates and submits a survey submission
      tags:
        - submissionV1
    parameters:
      - $ref: '#/components/parameters/customerId'
      - $ref: '#/components/parameters/surveyEid'
  /submissions/soft-deleted:
    delete:
      summary: Deletes submissions by ids
      operationId: deleteBySoftDeleted
      responses:
        '204':
          description: No Content
      description: Deletes all submissions marked has soft deleted
      tags:
        - submissionV1
    get:
      description: Gets a list of soft deleted ids
      summary: Get soft deleted
      operationId: getSubmissionSoftDeletedIds
      responses:
        '200':
          description: OK - Soft deleted submissions
          content:
            application/hal+json:
              schema:
                type: array
                items:
                  type: string
      tags:
        - submissionV1
  /submissions/{submissionEid}:
    get:
      summary: Retrieve a submission by eid
      operationId: getSubmissionByEidV2
      responses:
        '200':
          $ref: '#/components/responses/SubmissionDto'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
      description: Retrieve a submission by submission eid
      tags:
        - submissionV1
    parameters:
      - $ref: '#/components/parameters/submissionEid'
  /{salesOrgCode}/surveys/{surveyEid}:
    put:
      summary: Update a survey by id
      operationId: updateSurveyV2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveyDto-v1'
        required: true
        description: Update a survey by id
      responses:
        '200':
          $ref: '#/components/responses/SurveyDto'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
      description: Update a survey from a specific sales org code
      tags:
        - surveyV1
    parameters:
      - $ref: '#/components/parameters/salesOrgCode'
      - $ref: '#/components/parameters/surveyEid'
  /{salesOrgCode}/surveys:
    post:
      summary: Create new Survey
      operationId: createSurveyV2
      parameters:
        - name: salesOrgCode
          in: path
          example: A001
          description: The sales org code
          required: true
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveyDto-v1'
        required: true
      responses:
        '201':
          $ref: '#/components/responses/SurveyDto'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
      description: Creates a new survey
      tags:
        - surveyV1
    parameters:
      - $ref: '#/components/parameters/salesOrgCode'
  /{salesOrgCode}/surveys/{surveyEid}/duplicate:
    post:
      summary: Duplicate a Survey
      operationId: duplicateSurveyV2
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SurveyDuplicateDto-v1'
        required: true
      responses:
        '201':
          $ref: '#/components/responses/SurveyDto'
        '400':
          $ref: '#/components/responses/BadRequestResponse'
      description: Duplicates a already existing Survey
      tags:
        - surveyV1
    parameters:
      - $ref: '#/components/parameters/salesOrgCode'
      - $ref: '#/components/parameters/surveyEid'
components:
  schemas:
    SurveyStatus:
      description: The Surveys available status
      example: DRAFT
      type: string
      enum:
        - DRAFT
        - PUBLISHED
        - ARCHIVED
        - PREPUBLISHED
        - OUTDATED
      x-examples:
        Example 1: DRAFT
      x-stoplight:
        id: 8xsjl6og39d30
    SurveyType:
      description: The Surveys available types
      example: FIT
      type: string
      enum:
        - PROSPECT
        - FIT
        - FORM
        - OUTLET
      x-examples:
        Example 1: PROSPECT
      x-stoplight:
        id: nv8k3oewjppur
    AnswerDto-v1:
      description: The survey Answer model
      title: answerDto-v1
      x-stoplht:
        id: weva2c0t4tez8
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: f297062b-43e1-4c6f-9caf-1b5492cbd8c6
          description: Answer Unique ID
        choiceId:
          type: string
          format: uuid
          example: c62684bd-790e-4ad3-b1c1-f685b0ed9236
          description: Choice Unique ID
        choiceWeight:
          type: integer
          format: int32
          example: 3
          description: The choice weight
        questionId:
          type: string
          format: uuid
          example: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
          description: The question unique ID
        value:
          type: string
          example: My answer
          description: The answer value
        createdBy:
          type: string
          example: me@carlsberg.com
          description: Answer created by
        modifiedBy:
          type: string
          example: me@carlsberg.com
          description: Answer modified by
      required:
        - createdBy
        - modifiedBy
      x-examples:
        Example 1:
          id: f297062b-43e1-4c6f-9caf-1b5492cbd8c6
          choiceId: c62684bd-790e-4ad3-b1c1-f685b0ed9236
          choiceWeight: 3
          questionId: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
          value: My answer
          createdBy: me@carlsberg.com
          modifiedBy: me@carlsberg.com
      x-stoplight:
        id: 5z4lr2w0nd9tj
    ChoiceDto-v1:
      title: choiceDto-v1
      description: The Surveu question Choice model
      x-stoplight:
        id: 09bxxmpycbxun
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: c62684bd-790e-4ad3-b1c1-f685b0ed9236
          description: Choice unique id
        text:
          type: string
          example: My choice
          description: Choice text
        hint:
          type: string
          example: The hint
          description: The choice hint
        weight:
          type: integer
          format: int32
          example: 1
          description: The choice weight
        assetIdentifier:
          type: string
          example: asset
          description: The choice asset id
        order:
          type: integer
          format: int32
          example: 1
          description: The choice order
        createdBy:
          type: string
          example: me@carlsberg.com
          description: Choice created by
        modifiedBy:
          type: string
          example: me@carlsberg.com
          description: Choice modified by
      required:
        - createdBy
        - modifiedBy
      x-examples:
        Example 1:
          id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
          text: My choice
          hint: The hint
          weight: 1
          assetIdentifier: asset
          order: 1
          createdBy: me@carlsberg.com
          modifiedBy: me@carlsberg.com
    QuestionDto-v1:
      description: The Survey Question model
      title: questionDto-v1
      x-stoplight:
        id: 2xxmtyvr3htcd
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
          description: Question unique id
        text:
          type: string
          example: Is this a question?
          description: Question text
        type:
          type: string
          example: boolean
          description: The question type
        order:
          type: integer
          format: int32
          example: 1
          description: The question order
        weight:
          type: integer
          format: int32
          example: 3
          description: The question weight
        choices:
          type: array
          description: The question choices
          items:
            $ref: '#/components/schemas/ChoiceDto-v1'
          example:
            - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
              text: My choice
              hint: The hint
              weight: 1
              assetIdentifier: asset
              order: 1
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
          required:
            - mandatory
            - createdBy
            - modifiedBy
      x-examples:
        Example 1:
          id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
          text: Is this a question?
          type: boolean
          order: 1
          weight: 3
          choices:
            - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
              text: My choice
              hint: The hint
              weight: 1
              assetIdentifier: asset
              order: 1
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
          mandatory: true
          createdBy: me@carlsberg.com
          modifiedBy: me@carlsberg.com
    SectionDto-v1:
      title: sectionDto-v1
      description: The Survey sections model
      x-stoplight:
        id: ft3jfjp1hc5f9
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: bae9ef76-3a9c-48d4-877b-09b96964bdf4
          description: Section unique id
        name:
          type: string
          example: Section1
          description: The Section name
        order:
          type: integer
          format: int32
          example: 1
        questions:
          type: array
          description: The section questions
          items:
            $ref: '#/components/schemas/QuestionDto-v1'
          example:
            - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
              text: Is this a question?
              type: boolean
              order: 1
              weight: 3
              choices:
                - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                  text: My choice
                  hint: The hint
                  weight: 1
                  assetIdentifier: asset
                  order: 1
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              mandatory: true
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
      required:
        - createdBy
        - modifiedBy
      x-examples:
        Example 1:
          id: bae9ef76-3a9c-48d4-877b-09b96964bdf4
          name: Section1
          order: 1
          questions:
            - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
              text: Is this a question?
              type: boolean
              order: 1
              weight: 3
              choices:
                - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                  text: My choice
                  hint: The hint
                  weight: 1
                  assetIdentifier: asset
                  order: 1
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              mandatory: true
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
          createdBy: me@carlsberg.com
          modifiedBy: me@carlsberg.com
    SubmissionDto-v1:
      title: submissionDto-v1
      description: The Survey Submission Model
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: 7c8b8546-ed43-4f64-b8e1-053f86eaef70
          description: Submission unique id
        submittedAt:
          type: string
          format: date-time
          example: '2023-04-12T12:12:22'
          description: Submission submitted at
        customerId:
          type: string
          example: '512345'
          description: The customer unique id
        calendarId:
          type: string
          example: 01GYG0PN0GBPHD45ZKRQT7VZ4N
          description: The calendar unique id
        userId:
          type: string
          example: me@carlsberg.com
          description: The user unique id
        userName:
          type: string
          example: John Doe
          description: The user name
        isSoftDelete:
          type: boolean
          example: true
          description: Is submissions soft deleted?
        score:
          type: integer
          format: int32
          example: 10
          description: Submission score
        surveyType:
          $ref: '#/components/schemas/SurveyType'
        survey:
          $ref: '#/components/schemas/SurveyDto-v1'
        createdBy:
          type: string
          example: me@carlsberg.com
          description: Submissions created by
        createdAt:
          type: string
          example: '2023-04-12T12:12:22'
          description: Submissions created at
        modifiedBy:
          type: string
          example: me@carlsberg.com
          description: Submission modified by
        modifiedAt:
          type: string
          example: '2023-04-12T12:12:22'
          description: Submissions modified at
        userEmailAddress:
          type: string
          example: me@carlsberg.com
          description: The user email address
        answers:
          type: array
          description: Submissions answers list
          items:
            $ref: '#/components/schemas/AnswerDto-v1'
          example:
            - id: f297062b-43e1-4c6f-9caf-1b5492cbd8c6
              choiceId: c62684bd-790e-4ad3-b1c1-f685b0ed9236
              choiceWeight: 3
              questionId: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
              value: My answer
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
      required:
        - createdBy
        - modifiedBy
      x-examples:
        Example 1:
          id: 7c8b8546-ed43-4f64-b8e1-053f86eaef70
          submittedAt: '2023-04-12T12:12:22'
          customerId: '512345'
          calendarId: 01GYG0PN0GBPHD45ZKRQT7VZ4N
          userId: me@carlsberg.com
          userName: John Doe
          isSoftDelete: true
          score: 10
          surveyType: FIT
          survey:
            id: ef6f380d-341a-45f0-ad97-ef95be2004b7
            salesOrgCode: L001
            name: John Doe
            description: Survey description
            type: FIT
            readOnly: true
            mandatory: true
            singleAnswer: true
            status: DRAFT
            order: 1
            startDate: '2023-04-12T12:12:22'
            endDate: '2023-04-12T12:12:22'
            migrated: true
            questionCount: 3
            createdBy: me@carlsberg.com
            createdAt: '2023-04-12T12:12:22'
            modifiedBy: me@carlsberg.com
            modifiedByUserName: me@carlsberg.com
            modifiedAt: '2023-04-12T12:12:22'
            sections:
              - id: bae9ef76-3a9c-48d4-877b-09b96964bdf4
                name: Section1
                order: 1
                questions:
                  - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                    text: Is this a question?
                    type: boolean
                    order: 1
                    weight: 3
                    choices:
                      - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                        text: My choice
                        hint: The hint
                        weight: 1
                        assetIdentifier: asset
                        order: 1
                        createdBy: me@carlsberg.com
                        modifiedBy: me@carlsberg.com
                    mandatory: true
                    createdBy: me@carlsberg.com
                    modifiedBy: me@carlsberg.com
                createdBy: me@carlsberg.com
                modifiedBy: me@carlsberg.com
            questions:
              - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                text: Is this a question?
                type: boolean
                order: 1
                weight: 3
                choices:
                  - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                    text: My choice
                    hint: The hint
                    weight: 1
                    assetIdentifier: asset
                    order: 1
                    createdBy: me@carlsberg.com
                    modifiedBy: me@carlsberg.com
                mandatory: true
                createdBy: me@carlsberg.com
                modifiedBy: me@carlsberg.com
            lastSubmission:
              id: 7c8b8546-ed43-4f64-b8e1-053f86eaef70
              submittedAt: '2023-04-12T12:12:22'
              customerId: '512345'
              calendarId: 01GYG0PN0GBPHD45ZKRQT7VZ4N
              userId: me@carlsberg.com
              userName: John Doe
              isSoftDelete: true
              score: 10
              surveyType: FIT
              survey: {}
              createdBy: me@carlsberg.com
              createdAt: '2023-04-12T12:12:22'
              modifiedBy: me@carlsberg.com
              modifiedAt: '2023-04-12T12:12:22'
              userEmailAddress: me@carlsberg.com
              answers:
                - id: f297062b-43e1-4c6f-9caf-1b5492cbd8c6
                  choiceId: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                  choiceWeight: 3
                  questionId: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                  value: My answer
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
          createdBy: me@carlsberg.com
          createdAt: '2023-04-12T12:12:22'
          modifiedBy: me@carlsberg.com
          modifiedAt: '2023-04-12T12:12:22'
          userEmailAddress: me@carlsberg.com
          answers:
            - id: f297062b-43e1-4c6f-9caf-1b5492cbd8c6
              choiceId: c62684bd-790e-4ad3-b1c1-f685b0ed9236
              choiceWeight: 3
              questionId: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
              value: My answer
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
      x-stoplight:
        id: l8urui1o71ctx
    SurveyDto-v1:
      title: surveyDto-v1
      description: The Survey DTO Model
      x-stoplight:
        id: gpmvcmzvy0x5d
      type: object
      properties:
        id:
          type: string
          format: uuid
          example: ef6f380d-341a-45f0-ad97-ef95be2004b7
          description: Survey unique id
        salesOrgCode:
          type: string
          example: L001
          description: The sales org code
        name:
          type: string
          example: John Doe
          description: The survey name
        description:
          type: string
          example: Survey description
          description: The survey description
        type:
          $ref: '#/components/schemas/SurveyType'
        readOnly:
          type: boolean
          example: true
          description: Is survey read only?
        mandatory:
          type: boolean
          example: true
          description: Is survey mandatory?
        singleAnswer:
          type: boolean
          example: true
          description: Is single answer survey?
        status:
          $ref: '#/components/schemas/SurveyStatus'
        order:
          type: integer
          format: int32
          example: 1
          description: The survey order
        startDate:
          type: string
          format: date-time
          example: '2023-04-12T12:12:22'
          description: The survey start date
        endDate:
          type: string
          format: date-time
          example: '2023-04-12T12:12:22'
          description: The survey end date
        migrated:
          type: boolean
          example: true
          description: Has been migrated?
        questionCount:
          type: integer
          format: int32
          example: 3
          description: Number of questions
        createdBy:
          type: string
          example: me@carlsberg.com
          description: Survey created by
        createdAt:
          type: string
          example: '2023-04-12T12:12:22'
          description: Survey created at
        modifiedBy:
          type: string
          example: me@carlsberg.com
          description: Survey modified by
        modifiedByUserName:
          type: string
          example: me@carlsberg.com
          description: User name that modified the survey
        modifiedAt:
          type: string
          example: '2023-04-12T12:12:22'
          description: Survey modified at
        sections:
          type: array
          description: List of survey sections
          items:
            $ref: '#/components/schemas/SectionDto-v1'
          example:
            - id: bae9ef76-3a9c-48d4-877b-09b96964bdf4
              name: Section1
              order: 1
              questions:
                - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                  text: Is this a question?
                  type: boolean
                  order: 1
                  weight: 3
                  choices:
                    - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                      text: My choice
                      hint: The hint
                      weight: 1
                      assetIdentifier: asset
                      order: 1
                      createdBy: me@carlsberg.com
                      modifiedBy: me@carlsberg.com
                  mandatory: true
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
        questions:
          type: array
          description: List of survey questions
          items:
            $ref: '#/components/schemas/QuestionDto-v1'
          example:
            - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
              text: Is this a question?
              type: boolean
              order: 1
              weight: 3
              choices:
                - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                  text: My choice
                  hint: The hint
                  weight: 1
                  assetIdentifier: asset
                  order: 1
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              mandatory: true
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
        lastSubmission:
          $ref: '#/components/schemas/SubmissionDto-v1'
      required:
        - mandatory
        - singleAnswer
        - status
        - startDate
        - createdBy
        - modifiedBy
      x-examples:
        Example 1:
          id: ef6f380d-341a-45f0-ad97-ef95be2004b7
          salesOrgCode: L001
          name: John Doe
          description: Survey description
          type: FIT
          readOnly: true
          mandatory: true
          singleAnswer: true
          status: DRAFT
          order: 1
          startDate: '2023-04-12T12:12:22'
          endDate: '2023-04-12T12:12:22'
          migrated: true
          questionCount: 3
          createdBy: me@carlsberg.com
          createdAt: '2023-04-12T12:12:22'
          modifiedBy: me@carlsberg.com
          modifiedByUserName: me@carlsberg.com
          modifiedAt: '2023-04-12T12:12:22'
          sections:
            - id: bae9ef76-3a9c-48d4-877b-09b96964bdf4
              name: Section1
              order: 1
              questions:
                - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                  text: Is this a question?
                  type: boolean
                  order: 1
                  weight: 3
                  choices:
                    - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                      text: My choice
                      hint: The hint
                      weight: 1
                      assetIdentifier: asset
                      order: 1
                      createdBy: me@carlsberg.com
                      modifiedBy: me@carlsberg.com
                  mandatory: true
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
          questions:
            - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
              text: Is this a question?
              type: boolean
              order: 1
              weight: 3
              choices:
                - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                  text: My choice
                  hint: The hint
                  weight: 1
                  assetIdentifier: asset
                  order: 1
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              mandatory: true
              createdBy: me@carlsberg.com
              modifiedBy: me@carlsberg.com
          lastSubmission:
            id: 7c8b8546-ed43-4f64-b8e1-053f86eaef70
            submittedAt: '2023-04-12T12:12:22'
            customerId: '512345'
            calendarId: 01GYG0PN0GBPHD45ZKRQT7VZ4N
            userId: me@carlsberg.com
            userName: John Doe
            isSoftDelete: true
            score: 10
            surveyType: FIT
            survey:
              id: ef6f380d-341a-45f0-ad97-ef95be2004b7
              salesOrgCode: L001
              name: John Doe
              description: Survey description
              type: FIT
              readOnly: true
              mandatory: true
              singleAnswer: true
              status: DRAFT
              order: 1
              startDate: '2023-04-12T12:12:22'
              endDate: '2023-04-12T12:12:22'
              migrated: true
              questionCount: 3
              createdBy: me@carlsberg.com
              createdAt: '2023-04-12T12:12:22'
              modifiedBy: me@carlsberg.com
              modifiedByUserName: me@carlsberg.com
              modifiedAt: '2023-04-12T12:12:22'
              sections:
                - id: bae9ef76-3a9c-48d4-877b-09b96964bdf4
                  name: Section1
                  order: 1
                  questions:
                    - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                      text: Is this a question?
                      type: boolean
                      order: 1
                      weight: 3
                      choices:
                        - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                          text: My choice
                          hint: The hint
                          weight: 1
                          assetIdentifier: asset
                          order: 1
                          createdBy: me@carlsberg.com
                          modifiedBy: me@carlsberg.com
                      mandatory: true
                      createdBy: me@carlsberg.com
                      modifiedBy: me@carlsberg.com
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              questions:
                - id: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                  text: Is this a question?
                  type: boolean
                  order: 1
                  weight: 3
                  choices:
                    - id: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                      text: My choice
                      hint: The hint
                      weight: 1
                      assetIdentifier: asset
                      order: 1
                      createdBy: me@carlsberg.com
                      modifiedBy: me@carlsberg.com
                  mandatory: true
                  createdBy: me@carlsberg.com
                  modifiedBy: me@carlsberg.com
              lastSubmission: {}
            createdBy: me@carlsberg.com
            createdAt: '2023-04-12T12:12:22'
            modifiedBy: me@carlsberg.com
            modifiedAt: '2023-04-12T12:12:22'
            userEmailAddress: me@carlsberg.com
            answers:
              - id: f297062b-43e1-4c6f-9caf-1b5492cbd8c6
                choiceId: c62684bd-790e-4ad3-b1c1-f685b0ed9236
                choiceWeight: 3
                questionId: e9e9124b-1132-4fd4-9a8d-d440dfbb7ee2
                value: My answer
                createdBy: me@carlsberg.com
                modifiedBy: me@carlsberg.com
    SurveyDuplicateDto-v1:
      title: surveyDuplicateDto-v1
      description: Survey duplicate request model
      type: object
      properties:
        duplicatedBy:
          type: string
          example: me@carlsberg.com
          description: Survey duplicated by
      x-examples:
        Example 1:
          duplicatedBy: me@carlsberg.com
      x-stoplight:
        id: p9ulwx9t8sdu0
    Error-v1:
      title: Error-v1
      x-stoplight:
        id: hftd8gdtwu2xf
      type: object
      properties:
        title:
          type: string
          description: A short summary of the problem type. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
          example: Bad Request
          x-stoplight:
            id: dkmvc7693prag
        status:
          type: integer
          format: int32
          description: The HTTP status code generated by the origin server for this occurrence of the problem.
          minimum: 100
          example: 400
          x-stoplight:
            id: wt55z1tpma9w7
        detail:
          type: string
          description: A human readable explanation specific to this occurrence of the problem that is helpful to locate the problem and give advice on how to proceed. Written in English and readable for engineers, usually not suited for non technical stakeholders and not localized.
          example: Invalid place order request
          x-stoplight:
            id: cuker93l57uku
        errorCode:
          type: string
          description: The error code of this problem
          example: ORD-001
          x-stoplight:
            id: plzq9vr69coj7
        errorMessage:
          type: string
          description: Brief message about the error. It is usually key message beside errorCode for client to identify the problem.
          example: Invalid input parameters for order
          x-stoplight:
            id: 1tnbg9bge54ko
        errorMetadata:
          type: object
          description: Specific metadata for the error code
          example:
            validationErrors:
              - field: beerType
                message: Beer type is required
              - field: quantity
                message: Quantity must be greater than 0
              - field: deliveryDate
                message: Delivery date is required
          x-stoplight:
            id: ppljacja5x6sr
      required:
        - title
        - status
        - detail
        - errorCode
      description: Represents a standardized format for describing errors in an API
  parameters:
    customerId:
      name: customerId
      in: path
      required: true
      schema:
        type: string
      description: Customer ID
      example: '213414'
    surveyEid:
      name: surveyEid
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Survey UUID
      example: ef6f380d-341a-45f0-ad97-ef95be2004b7
    submissionEid:
      name: submissionEid
      in: path
      required: true
      schema:
        type: string
        format: uuid
      description: Submission UUID
      example: 7c8b8546-ed43-4f64-b8e1-053f86eaef70
    salesOrgCode:
      name: salesOrgCode
      in: path
      required: true
      schema:
        type: string
      description: The sales org code
      example: A001
  responses:
    BadRequestResponse:
      description: |-
        - SVR-001 - SalesOrg is not available
        - SVR-002 - Mandatory fields not present on the request body
        - SVR-003 - Invalid parameter value
        - SVR-004 - Entity not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error-v1'
          examples:
            Example 1:
              value:
                title: Bad Request
                status: 400
                detail: Bad request
                errorCode: SVR-400
                errorMessage: string
                errorMetadata: {}
      headers: {}
    SubmissionDto:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SubmissionDto-v1'
    SurveyDto:
      description: Example response
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/SurveyDto-v1'
  securitySchemes:
    X-API-KEY:
      name: X-API-KEY
      type: apiKey
      in: query
x-stoplight:
  id: 88l69h2jgofk3
