{
  "openapi": "3.1.0",
  "info": {
    "title": "MYFOX General API",
    "version": "1.0.0"
  },
  "tags": [
    {
      "name": "discount",
      "description": "Operations about discount model"
    },
    {
      "name": "reservation",
      "description": "Operations with reservation"
    },
    {
      "name": "ticket",
      "description": "Operations with QR ticket"
    },
    {
      "name": "item",
      "description": "Operations about item model"
    }
  ],
  "paths": {
    "/PROD/discount/all": {
      "post": {
        "tags": [
          "discount"
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopId": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "validFrom": {
                    "type": "string"
                  },
                  "validTo": {
                    "type": "string"
                  },
                  "finalizedAtFrom": {
                    "type": "string"
                  },
                  "finalizedAtTo": {
                    "type": "string"
                  },
                  "itemIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1
                  },
                  "states": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "Available",
                        "Pending",
                        "Redeemed",
                        "Expired",
                        "Canceled"
                      ]
                    },
                    "minItems": 1,
                    "default": [
                      "Available",
                      "Pending",
                      "Redeemed",
                      "Expired",
                      "Canceled"
                    ]
                  },
                  "orderBy": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "finalizedAt": {
                          "type": "string",
                          "enum": [
                            "ASC",
                            "DESC"
                          ]
                        },
                        "createdAt": {
                          "type": "string",
                          "enum": [
                            "ASC",
                            "DESC"
                          ]
                        },
                        "updatedAt": {
                          "type": "string",
                          "enum": [
                            "ASC",
                            "DESC"
                          ]
                        }
                      }
                    }
                  }
                },
                "required": [
                  "shopId"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "code": {
                        "type": "string"
                      },
                      "amountType": {
                        "type": "string",
                        "enum": [
                          "Absolute",
                          "Percent"
                        ]
                      },
                      "amount": {
                        "type": "number"
                      },
                      "state": {
                        "type": "string",
                        "enum": [
                          "Available",
                          "Pending",
                          "Redeemed",
                          "Expired",
                          "Canceled"
                        ]
                      },
                      "validFrom": {
                        "type": "string"
                      },
                      "validTo": {
                        "type": "string"
                      },
                      "finalizedAt": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "meta": {},
                      "createdAt": {
                        "type": "string"
                      },
                      "updatedAt": {
                        "type": "string"
                      },
                      "isReusable": {
                        "type": "boolean"
                      },
                      "categoryId": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "shopId": {
                        "type": "string"
                      },
                      "items": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "id": {
                              "type": "string"
                            }
                          },
                          "required": [
                            "id"
                          ]
                        }
                      }
                    },
                    "required": [
                      "id",
                      "code",
                      "amountType",
                      "amount",
                      "state",
                      "validFrom",
                      "validTo",
                      "finalizedAt",
                      "createdAt",
                      "updatedAt",
                      "isReusable",
                      "categoryId",
                      "shopId",
                      "items"
                    ]
                  }
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Access Forbidden.",
                  "example": {
                    "code": "MFE-UNAUTHORIZED-10002",
                    "message": "Access forbidden.",
                    "statusCode": 403
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PROD/discount/create": {
      "post": {
        "tags": [
          "discount"
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopId": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "amountType": {
                    "type": "string",
                    "enum": [
                      "Absolute",
                      "Percent"
                    ]
                  },
                  "amount": {
                    "type": "number",
                    "exclusiveMinimum": 0
                  },
                  "validFrom": {
                    "type": "string"
                  },
                  "validTo": {
                    "type": "string"
                  },
                  "meta": {
                    "type": "object",
                    "additionalProperties": {}
                  },
                  "isReusable": {
                    "type": "boolean"
                  },
                  "categoryId": {
                    "type": "string"
                  },
                  "itemIds": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "minItems": 1
                  }
                },
                "required": [
                  "shopId",
                  "code",
                  "amountType",
                  "amount",
                  "validFrom",
                  "validTo"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "code": {
                      "type": "string"
                    },
                    "amountType": {
                      "type": "string",
                      "enum": [
                        "Absolute",
                        "Percent"
                      ]
                    },
                    "amount": {
                      "type": "number"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "Available",
                        "Pending",
                        "Redeemed",
                        "Expired",
                        "Canceled"
                      ]
                    },
                    "validFrom": {
                      "type": "string"
                    },
                    "validTo": {
                      "type": "string"
                    },
                    "finalizedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "meta": {},
                    "createdAt": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "isReusable": {
                      "type": "boolean"
                    },
                    "categoryId": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "shopId": {
                      "type": "string"
                    },
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id"
                        ]
                      }
                    }
                  },
                  "required": [
                    "id",
                    "code",
                    "amountType",
                    "amount",
                    "state",
                    "validFrom",
                    "validTo",
                    "finalizedAt",
                    "createdAt",
                    "updatedAt",
                    "isReusable",
                    "categoryId",
                    "shopId",
                    "items"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Access Forbidden.",
                  "example": {
                    "code": "MFE-UNAUTHORIZED-10002",
                    "message": "Access forbidden.",
                    "statusCode": 403
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PROD/discount/cancel": {
      "delete": {
        "tags": [
          "discount"
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopId": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  }
                },
                "required": [
                  "shopId",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "success",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Access Forbidden.",
                  "example": {
                    "code": "MFE-UNAUTHORIZED-10002",
                    "message": "Access forbidden.",
                    "statusCode": 403
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PROD/discount/change": {
      "patch": {
        "tags": [
          "discount"
        ],
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "shopId": {
                    "type": "string"
                  },
                  "code": {
                    "type": "string"
                  },
                  "validFrom": {
                    "type": "string"
                  },
                  "validTo": {
                    "type": "string"
                  },
                  "used": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "shopId",
                  "code"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "count": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "success",
                    "count"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Access Forbidden.",
                  "example": {
                    "code": "MFE-UNAUTHORIZED-10002",
                    "message": "Access forbidden.",
                    "statusCode": 403
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PROD/{alias}/reservation/{calendarToCustomerId}/export-ical": {
      "get": {
        "tags": [
          "reservation"
        ],
        "summary": "Export reservation to iCalendar (ICS)",
        "description": "Exports reservation as an ICS file (text/calendar).",
        "parameters": [
          {
            "in": "path",
            "name": "calendarToCustomerId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/calendar": {
                "schema": {
                  "anyOf": [
                    {
                      "type": "string",
                      "description": "text/calendar"
                    },
                    {
                      "type": "object",
                      "additionalProperties": {}
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "404": {
            "description": "Record was not found.",
            "content": {
              "text/html": {
                "example": "<h1>Bad request</h1>"
              }
            }
          }
        }
      }
    },
    "/PROD/ticket/{calendarToCustomerId}/verify": {
      "get": {
        "tags": [
          "ticket"
        ],
        "summary": "Verify validity of ticket",
        "description": "Verify validity of ticket.",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          },
          {
            "in": "path",
            "name": "calendarToCustomerId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "to": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "visitStateUpdatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "calendarId": {
                      "type": "string"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "customerPhone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "firstItemName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "visitState": {
                      "type": "string",
                      "enum": [
                        "Canceled",
                        "CanceledLate",
                        "NotPresent",
                        "Present",
                        "Regular",
                        "MultiSport"
                      ]
                    },
                    "payState": {
                      "type": "string",
                      "enum": [
                        "NotPaid",
                        "Paid",
                        "PartiallyPaid",
                        "Canceled",
                        "Storno",
                        "MultiSport",
                        "Test"
                      ]
                    },
                    "bail": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "paidAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "amount": {
                          "type": "number",
                          "minimum": 0
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "NotPaid",
                            "Paid",
                            "Refund",
                            "Expired",
                            "Archived",
                            "Canceled",
                            "AutoCanceled"
                          ]
                        },
                        "transactionCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1
                        },
                        "isPaid": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "amount",
                        "state",
                        "transactionCode",
                        "isPaid"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "from",
                    "to",
                    "calendarId",
                    "visitState",
                    "payState"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Record is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Ticket is canceled.",
                  "example": {
                    "code": "MFE-TICKET-10033",
                    "message": "Ticket is canceled.",
                    "statusCode": 403
                  }
                }
              }
            }
          },
          "404": {
            "description": "Record was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Ticket not found.",
                  "example": {
                    "code": "MFE-TICKET-10032",
                    "message": "Ticket not found.",
                    "statusCode": 404
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PROD/item/{itemId}/photo": {
      "post": {
        "tags": [
          "item"
        ],
        "summary": "Upload item photo",
        "description": "Uploads a base64 image to S3 and links it to the item as its picture.",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          },
          {
            "in": "path",
            "name": "itemId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "photo": {
                    "type": "object",
                    "properties": {
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "type": {
                        "type": "string",
                        "pattern": "^image/"
                      },
                      "base64": {
                        "type": "string",
                        "minLength": 1
                      }
                    },
                    "required": [
                      "name",
                      "type",
                      "base64"
                    ]
                  }
                },
                "required": [
                  "photo"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "success": {
                      "type": "boolean"
                    },
                    "itemId": {
                      "type": "string"
                    },
                    "picture": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "secret": {
                          "type": "string"
                        },
                        "url": {
                          "type": "string"
                        },
                        "contentType": {
                          "type": "string"
                        },
                        "size": {
                          "type": "number"
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "secret",
                        "url",
                        "contentType",
                        "size"
                      ]
                    }
                  },
                  "required": [
                    "success",
                    "itemId",
                    "picture"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Access Forbidden.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Access Forbidden.",
                  "example": {
                    "code": "MFE-UNAUTHORIZED-10002",
                    "message": "Access forbidden.",
                    "statusCode": 403
                  }
                }
              }
            }
          },
          "404": {
            "description": "Record was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Item not found.",
                  "example": {
                    "code": "MFE-ITEM-10035",
                    "message": "Item not found.",
                    "statusCode": 404
                  }
                }
              }
            }
          }
        }
      }
    },
    "/PROD/ticket/{calendarToCustomerId}/check-in": {
      "post": {
        "tags": [
          "ticket"
        ],
        "summary": "Check in ticket",
        "description": "Check in ticket.",
        "parameters": [
          {
            "name": "x-api-key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "User token in the request header"
          },
          {
            "in": "path",
            "name": "calendarToCustomerId",
            "schema": {
              "type": "string"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "text/calendar": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "from": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "to": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "visitStateUpdatedAt": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "calendarId": {
                      "type": "string"
                    },
                    "customerName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "customerPhone": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "firstItemName": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "visitState": {
                      "type": "string",
                      "enum": [
                        "Canceled",
                        "CanceledLate",
                        "NotPresent",
                        "Present",
                        "Regular",
                        "MultiSport"
                      ]
                    },
                    "payState": {
                      "type": "string",
                      "enum": [
                        "NotPaid",
                        "Paid",
                        "PartiallyPaid",
                        "Canceled",
                        "Storno",
                        "MultiSport",
                        "Test"
                      ]
                    },
                    "bail": {
                      "type": [
                        "object",
                        "null"
                      ],
                      "properties": {
                        "paidAt": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "amount": {
                          "type": "number",
                          "minimum": 0
                        },
                        "state": {
                          "type": "string",
                          "enum": [
                            "NotPaid",
                            "Paid",
                            "Refund",
                            "Expired",
                            "Archived",
                            "Canceled",
                            "AutoCanceled"
                          ]
                        },
                        "transactionCode": {
                          "type": [
                            "string",
                            "null"
                          ],
                          "minLength": 1
                        },
                        "isPaid": {
                          "type": "boolean"
                        }
                      },
                      "required": [
                        "amount",
                        "state",
                        "transactionCode",
                        "isPaid"
                      ]
                    }
                  },
                  "required": [
                    "id",
                    "from",
                    "to",
                    "calendarId",
                    "visitState",
                    "payState"
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    },
                    "errors": {
                      "type": [
                        "array",
                        "null"
                      ],
                      "items": {
                        "type": "object",
                        "properties": {
                          "field": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "field",
                          "message"
                        ]
                      }
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Validation failed for pathParameters or body.",
                  "example": {
                    "code": "MFE-INPUT-VALIDATION-10000",
                    "message": "Validation failed for pathParameters or body.",
                    "statusCode": 400
                  }
                }
              }
            }
          },
          "403": {
            "description": "Record is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Ticket is canceled.",
                  "example": {
                    "code": "MFE-TICKET-10033",
                    "message": "Ticket is canceled.",
                    "statusCode": 403
                  }
                }
              }
            }
          },
          "404": {
            "description": "Record was not found.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "code": {
                      "type": "string",
                      "enum": [
                        "MFE-INPUT-VALIDATION-10000",
                        "MFE-OUTPUT-VALIDATION-10001",
                        "MFE-UNAUTHORIZED-10002",
                        "MFE-CALENDAR-TO-CUSTOMER-10031",
                        "MFE-TICKET-10032",
                        "MFE-TICKET-10033",
                        "MFE-DISCOUNT-10034",
                        "MFE-ITEM-10035",
                        "MFE-VOUCHER-ORDER-10036",
                        "MFE-VOUCHER-ORDER-10037",
                        "MFE-UNEXPECTED-ERROR-99999"
                      ]
                    },
                    "message": {
                      "type": "string"
                    },
                    "statusCode": {
                      "type": "number"
                    }
                  },
                  "required": [
                    "code",
                    "message",
                    "statusCode"
                  ],
                  "description": "Ticket not found.",
                  "example": {
                    "code": "MFE-TICKET-10032",
                    "message": "Ticket not found.",
                    "statusCode": 404
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}