{
    "openapi": "3.0.0",
    "info": {
        "title": "UDAO API documentation",
        "description": "<p>In order to change the language of the documentation to PL please type https://udao.pl/docs/api-docs-pl.json in the Explore window above and click the button.</p><h2>Example procedure for buying -contest/event- insurance policy:</h2>\n     <ol>\n        <li>`/contest/quota` - getting list of available insurance packages</li>\n        <li>`/contest/calculation` - getting total cost of the insurance policy for selected packages</li>\n        <li>`/send-owu` - sending General Terms and Conditions of Insurance (OWU in polish) to the given e-mail address</li>\n        <li>`/contest/order` - ordering selected packages and sending required personal data. At this point, insurance policies are waiting to be generated until payment is confirmed</li>\n        <li>`/order/set-paid` - confirming payment for the order. At this point, policies are being generated and sent</li>\n     </ol>\n    <h2>Example procedure for buying -training- insurance policy:</h2>\n    <ol>\n    <li>`/training/quota` - getting list of available insurance packages</li>\n    <li>`/training/calculation` - getting total cost of the insurance policy for selected packages</li>\n    <li>`/send-owu` - sending General Terms and Conditions of Insurance (OWU in polish) to the given e-mail address</li>\n    <li>`/training/order` - ordering selected packages and sending required personal data. At this point, insurance policies are waiting to be generated until payment is confirmed</li>\n    <li>`/order/set-paid` - confirming payment for the order. At this point, policies are being generated and sent</li>\n    </ol>\n    ",
        "contact": {
            "email": "marcin.sowinski@udao.pl"
        },
        "version": "1.0.0"
    },
    "servers": [
        {
            "url": "https://udao.dwsystems.pl/api",
            "description": "API - test server"
        }
    ],
    "paths": {
        "/contest/calculation": {
            "post": {
                "tags": [
                    "Contest"
                ],
                "summary": "Method that calculates total cost of insurance for selected insurance packages.",
                "description": "Returns total cost to pay for selected insurance packages.<br/>\n    Calling parameters are the same as in calling the /contest/quota method. Additionally, the `packages` parameter\n    has to be provided with a list of IDs of selected insurance packages (returned by the /contest/quota method).<br/>\n    As a result, the total cost in PLN (polish zloty) for given insurance policies is returned.\n    ",
                "operationId": "getContestCalculation",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiCalculationContestRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiCalculationResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/training/calculation": {
            "post": {
                "tags": [
                    "Training"
                ],
                "summary": "Method that calculates total cost of insurance for selected insurance packages.",
                "description": "Returns total cost to pay for selected insurance packages.<br/>\n       Calling parameters are the same as in calling the /training/quota method. Additionally following parameters has to be provided:\n        <ul>\n            <li>`packages` with a list of IDs of selected insurance packages (returned by the /training/quota method). Only only insurance package can be selected for a given insurance product.</li>\n            <li>`payment_type` type of payment, `single` for annual payment and `recurring` for automatic monthly payment</li>\n        </ul>\n     As a result, the total cost in PLN (polish zloty) for given insurance policies is returned. In case of `single` payment type, it is the total cost for one year.\n     In case of `recurring` payment type, it is the total cost for each month.\n     ",
                "operationId": "getTrainingCalculation",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiCalculationTrainingRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiQuotaTrainingResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Unauthenticated"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error processing request",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/training/order": {
            "post": {
                "tags": [
                    "Training"
                ],
                "summary": "Method that allows to order selected insurance packages for a training",
                "description": "Method that allows to order selected insurance packages for a training returned by the /training/quota method.<br/>\n      The insurance by default start from the next day after the order and expires after one year.<br/>\n    Below a list of available packages passed as the `packages` parameter:\n    <ul>\n    <li>Rehabilitaion (Rehabilitacja) - Basic package (ID:1), Komfort package (ID:2), Premium package (ID:3)</li>\n    <li>Accident (NNW) - Basic package (ID:4), Komfort package (ID:5), Premium package (ID:6)</li>\n    <li>Third party liability (OC) - Standard package (ID:8)\n    </li>\n    </ul>\n    The personal data of the insurer `person_insurer_data` are required if the insured person is a minor (is not yet an adult).<br/>\n    If the insured person is a minor, only the accident insurance (NNW) can be order.<br/>\n    The `agreement_marketing` parameter means the agreement for marketing.<br/><br/>\n    As result the number of the order `order_number` is returned. Making the order alone does not make the policies to generate.\n    Only when the order is marked as paid using the /order/set-paid method, the policies are being generated and sent to the e-mail\n    address of the insured person.\n    ",
                "operationId": "orderTraining",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiOrderTrainingRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiOrderTrainingResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contest/order": {
            "post": {
                "tags": [
                    "Contest"
                ],
                "summary": "Method that allows to order selected insurance packages for a contest/training",
                "description": "Method that allows to order selected insurance packages for a contest/training returned by the /contest/quota method.<br/>\n    Below a list of available packages passed as the `packages` parameter:\n    <ul>\n    <li>ID:12 - rehabilitation (rehabilitacja)</li>\n    <li>ID:15 - accident (NNW)</li>\n    <li>ID:16 - contest/event resignation insurance - the resignation is possible only when there is more than 10 days to the contest/event\n    the resignation cost is calculated as 9% of the contest/event participation price, but min. 5 PLN and max. 135 PLN\n    (as 135 PLN is 9% from 1500 PLN)\n    </li>\n    <li>ID:20 - contest/event insurance for nonresidents\n    </li>\n    </ul>\n    The personal data of the insurer `person_insurer_data` are required if the insured person is a minor (is not yet an adult).<br/>\n    The `agreement_marketing` parameter means the agreement for marketing.<br/><br/>\n    As result the number of the order `order_number` is returned. Making the order alone does not make the policies to generate.\n    Only when the order is marked as paid using the /order/set-paid method, the policies are being generated and sent to the e-mail\n    address of the insured person.\n    ",
                "operationId": "orderContest",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiOrderContestRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiOrderTrainingResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/fit/order": {
            "post": {
                "tags": [
                    "Fit"
                ],
                "summary": "Method that allows to order selected insurance packages relate with fitness activities",
                "description": "Method that allows to order selected insurance packages related with fitness activities returned by the /fit/quota method.",
                "operationId": "orderFit",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiOrderFitRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiOrderFitResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/order/set-paid": {
            "post": {
                "tags": [
                    "Payment"
                ],
                "summary": "Method for marking the order as paid.",
                "description": "Marks given order as paid. After payment the policies are being generated and sent to the insured person e-mail address.\n            The order has to be marked as paid not later than 30 minutes after the time when the order was made. Additionally, the payment has to take place\n            during the same day as the order.",
                "operationId": "setOrderPaid",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiSetOrderPaymentRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "properties": {
                                                "order_number": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "collectionFormat": "multi",
                                                    "example": [
                                                        "No such order.",
                                                        "Order is already paid."
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/send-owu": {
            "post": {
                "tags": [
                    "OWU"
                ],
                "summary": "Method sending the General Terms and Conditions of Insurance (OWU in polish) for a given e-mail address",
                "description": "Sends the General Terms and Conditions of Insurance with selected attachemnts.<br/>\n           List of available attachments:<br/>\n           <ul>\n               <li>training_nnw - General Terms and Conditions of Insurance related to an accident during a training (NNW in polish)</li>\n               <li>training_reh - General Terms and Conditions of Insurance related to rehabilitation after accident during a training</li>\n               <li>training_oc - General Terms and Conditions of Third Party Liability Insurance related to a participation in a training</li>\n               <li>contest - General Terms and Conditions of Insurances related to a participation in a contest/event</li>\n               <li>nonresidents - General Terms and Conditions of Insurances related to a participation in a contest/event for nonresidents</li>\n               <li>fit - General Terms and Conditions of Insurances related to the UDAO FIT product</li>\n          </ul><br/>\n          The message is being sent right after the request.",
                "operationId": "sendOwu",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiSendOwuRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "OK"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "properties": {
                                        "message": {
                                            "type": "string",
                                            "example": "The given data was invalid."
                                        },
                                        "errors": {
                                            "properties": {
                                                "email": {
                                                    "type": "array",
                                                    "items": {
                                                        "type": "string"
                                                    },
                                                    "collectionFormat": "multi",
                                                    "example": [
                                                        "The e-mail address where the GTCI should be sent is required.",
                                                        "Bad e-mail address format."
                                                    ]
                                                }
                                            },
                                            "type": "object"
                                        }
                                    },
                                    "type": "object"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/training/quota": {
            "post": {
                "tags": [
                    "Training"
                ],
                "summary": "Method that returns available insurance packages related with training attendance.",
                "description": "Method that returns available insurance products, their insurance packages with prices related with training attendance.<br/>\n    Information about insured person birtdate `person_insured_data.birth_date` is required, because minor persons (not yet adult)\n    can only be insured in terms of accident insurance (polish NNW).<br/>\n    The `price` parameter returns annual price (single payment for the whole insurance), and the `price_per_month` parameter returns price per monthly when monthly payment is selected.<br/>\n    In terms of the Rehabilitation Insurance following parameters are returned:\n    <ul>\n    <li>`max_refund` - max rehabilitation refund</li>\n    </ul>\n    In terms of Accident Insurance (NNW) following parameters are returned:\n    <ul>\n    <li>`max_death_refund` - max refund in case of death in an accident</li>\n    <li>`max_bone_group_1` - max refund for bone fracture group I</li>\n    <li>`max_bone_group_2` - max refund for bone fracture group II</li>\n    <li>`max_bone_group_3` - max refund for bone fracture group III</li>\n    <li>`max_injury_group_1` - max refund for injury group I</li>\n    <li>`max_injury_group_2` - max refund for injury group II</li>\n    <li>`max_injury_group_3` - max refund for injury group III</li>\n    </ul>\n    In terms of Third Party Liability Insurance (OC) following parameters are returned:\n    <ul>\n    <li>`max_refund` - guaranteed insurance amount (sum)</li>\n    <li>`deductible` - deductible</li>\n    </ul>\n\n    ",
                "operationId": "getTrainingQuota",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiQuotaTrainingRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiQuotaTrainingResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/contest/quota": {
            "post": {
                "tags": [
                    "Contest"
                ],
                "summary": "Method that returns available insurance packages related with participation in a contest/event.",
                "description": "Method that returns available insurance products, their insurance packages with prices related with contest/event participation.<br/>\n    Information about insured person birthdate `person_insured_data.birth_date` is required.\n    This information is required to calculate the maximal insurance refunds in the Accident Insurance (NNW).\n    For nonresidents, information about insured person citizenship country code (compatible with the ISO 3166-1 alfa-2) `person_insured_data.citizenship_code` is required.\n    The event start date `event_start_date` parameter and the event end date `event_date_end` are required\n    in order to check if the contest/event resignation insurance is available. The contest/event resignation insurance is available\n    only when there is more than 10 days left to the event starting date.<br/>\n    The cost of participation in the constest/event `event_price` parameter is required in order to calculate the cost\n    of the contest/event resignation insurance.<br/>\n    The resignation cost is calculated as 9% of the contest/event participation price `event_price`, but min. 5 PLN and max. 135 PLN\n    (as 135 PLN is 9% from 1500 PLN).<br/><br/>\n    In terms of the Rehabilitation Insurance following parameters are returned:\n    <ul>\n    <li>`max_refund` - max rehabilitation refund</li>\n    </ul>\n    In terms of Accident Insurance (NNW) following parameters are returned:\n    <ul>\n    <li>`max_death_refund` - max refund in case of death in an accident</li>\n    <li>`max_bone_group_1` - max refund for bone fracture group I</li>\n    <li>`max_bone_group_2` - max refund for bone fracture group II</li>\n    <li>`max_bone_group_3` - max refund for bone fracture group III</li>\n    <li>`max_injury_group_1` - max refund for injury group I</li>\n    <li>`max_injury_group_2` - max refund for injury group II</li>\n    <li>`max_injury_group_3` - max refund for injury group III</li>\n    </ul>\n    In terms of Resignation Insurance following parameters are returned:\n    <ul>\n    <li>`max_resignation_refund` - max resignation refund</li>\n    </ul>\n    In terms of insurance for nonresidents you have to send:\n    <ul>\n    <li>`person_insured_data.birth_date`</li>\n    <li>`person_insured_data.citizenship_code` as mentioned earlier</li>\n    </ul>\n    The insured person's age must be between 18 and 65 years old.\n    For nonresidents only one package is returned with following parameters:\n    <ul>\n    <li>`max_death_refund` - max refund in case of death in an accident</li>\n    <li>`max_bone_group_1` - max refund for bone fracture group I</li>\n    <li>`max_bone_group_2` - max refund for bone fracture group II</li>\n    <li>`max_bone_group_3` - max refund for bone fracture group III</li>\n    <li>`max_injury_group_1` - max refund for injury group I</li>\n    <li>`max_injury_group_2` - max refund for injury group II</li>\n    <li>`max_injury_group_3` - max refund for injury group III</li>\n    <li>`max_rehab_refund` - max reimbursement of rehabilitation costs</li>\n    <li>`max_documents_loss_refund` - max refund in case of loss of documents necessary for travel</li>\n    <li>`max_missed_event_injury_refund` - max refund in case of non-participation in a sports event due to critical illness, death of a close person, road accident or collision, or delay of a means of transport</li>\n    <li>`max_missed_event_documents_loss_refund` - max refund in case of non-participation in a sports event due to loss of documents necessary for travel</li>\n    </ul>\n    The insurance package for nonresidents cost is calculated as 13% of the contest/event participation price event_price, but min. 50 PLN and max. 650 PLN (as 650 PLN is 13% from 5000 PLN).\n    ",
                "operationId": "getContestQuota",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiQuotaContestRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiQuotaContestResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/fit/quota": {
            "post": {
                "tags": [
                    "Fit"
                ],
                "summary": "Method that returns insurance options specifically related to fitness activities.",
                "description": "This method fetches available insurance products and packages related to fitness activities.",
                "operationId": "getFitQuota",
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/ApiQuotaFitRequest"
                            }
                        }
                    }
                },
                "responses": {
                    "200": {
                        "description": "Successful operation",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiQuotaFitResponse"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Error: Unauthorized"
                    },
                    "403": {
                        "description": "Forbidden"
                    },
                    "422": {
                        "description": "Error: Unprocessable Content",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/ApiErrorResponse"
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "ApiCalculationContestRequest": {
                "title": "ContestCalculationRequestBody",
                "description": "Request body of calculating the total cost of insurance for selected insurance packages",
                "required": [
                    "person_insured_birthdate",
                    "event_date_start",
                    "event_date_end",
                    "event_price",
                    "packages"
                ],
                "type": "object",
                "allOf": [
                    {
                        "properties": {
                            "packages": {
                                "title": "Insurance packages to be ordered",
                                "description": "List of insurance packages. The packages cannot duplicate.",
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                },
                                "example": [
                                    12,
                                    15,
                                    16
                                ]
                            }
                        }
                    },
                    {
                        "$ref": "#/components/schemas/ApiQuotaContestRequest"
                    }
                ]
            },
            "ApiCalculationTrainingRequest": {
                "title": "TrainingCalculationRequestBody",
                "description": "Request body of calculating the total cost of insurance for selected insurance packages",
                "required": [
                    "person_insured_birthdate",
                    "packages"
                ],
                "type": "object",
                "allOf": [
                    {
                        "properties": {
                            "packages": {
                                "title": "Insurance packages to be ordered",
                                "description": "List of insurance packages. The packages cannot duplicate.",
                                "type": "array",
                                "items": {
                                    "type": "integer"
                                },
                                "example": [
                                    3,
                                    6,
                                    8
                                ]
                            },
                            "payment_type": {
                                "title": "Payment type",
                                "description": "Payment type, annual (single) or monthly (recurring).",
                                "type": "string",
                                "enum": [
                                    "single",
                                    "recurring"
                                ],
                                "example": "single"
                            }
                        }
                    },
                    {
                        "$ref": "#/components/schemas/ApiQuotaTrainingRequest"
                    }
                ]
            },
            "ApiOrderContestRequest": {
                "title": "ContestOrderRequestBody",
                "description": "Request body of ordering selected insurance packages for contest/event",
                "required": [
                    "event_name",
                    "event_date_start",
                    "event_date_end",
                    "event_price",
                    "event_country_code",
                    "packages",
                    "person_insured_data",
                    "agreement_martketing"
                ],
                "properties": {
                    "packages": {
                        "title": "Insurance packages to order",
                        "description": "Insurance packages list. The packages cannot duplicate.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "example": [
                            12,
                            15,
                            16
                        ]
                    },
                    "event_name": {
                        "title": "Name of the contest/event",
                        "description": "Name of the event/contest",
                        "type": "string",
                        "maxLength": 150,
                        "example": "Runmageddon"
                    },
                    "event_date_start": {
                        "title": "event_date_start",
                        "description": "Contest/event start date",
                        "type": "date",
                        "format": "Y-m-d",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2022-05-15"
                    },
                    "event_date_end": {
                        "title": "event_date_end",
                        "description": "Contest/event ending date",
                        "type": "date",
                        "format": "Y-m-d",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2022-05-15"
                    },
                    "event_country_code": {
                        "title": "event_country_code",
                        "description": "Contest/event country code compatible with the ISO 3166-1 alfa-2",
                        "type": "string",
                        "example": "PL"
                    },
                    "event_price": {
                        "title": "event_price",
                        "description": "The cost of participation in the contest/event. Needed to calculate the price of the contest/event resignation insurance.",
                        "type": "number",
                        "format": "float",
                        "example": "350.00"
                    },
                    "person_insured_data": {
                        "$ref": "#/components/schemas/PersonData"
                    },
                    "person_insurer_data": {
                        "$ref": "#/components/schemas/PersonData"
                    },
                    "agreement_marketing": {
                        "title": "agreement_marketing",
                        "description": "Agreement for marketing contact",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "ApiOrderFitRequest": {
                "title": "FitOrderRequestBody",
                "description": "Request body of ordering selected insurance packages for contest/event",
                "required": [
                    "event_name",
                    "event_date_start",
                    "event_date_end",
                    "event_price",
                    "event_country_code",
                    "packages",
                    "person_insured_data",
                    "agreement_martketing"
                ],
                "properties": {
                    "packages": {
                        "title": "Insurance packages to order",
                        "description": "Insurance packages list. The packages cannot duplicate.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "example": [
                            21,
                            29,
                            45
                        ]
                    },
                    "gym_pass_date_bought": {
                        "title": "gym_pass_date_bought",
                        "description": "Gym pass date bought",
                        "type": "date",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2025-05-15"
                    },
                    "gym_pass_date_start": {
                        "title": "gym_pass_date_start",
                        "description": "Gym pass start date",
                        "type": "date",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2025-05-15"
                    },
                    "gym_pass_date_end": {
                        "title": "gym_pass_date_end",
                        "description": "Gym pass ending date",
                        "type": "date",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2025-05-15"
                    },
                    "gym_pass_price": {
                        "title": "gym_pass_price",
                        "description": "Cost of the gym pass. Required for calculation of gym pass refund insurance.",
                        "type": "number",
                        "format": "float",
                        "example": "350.00"
                    },
                    "period_days": {
                        "title": "period_days",
                        "description": "Single game pass duration in days.",
                        "type": "interger",
                        "format": "integer",
                        "example": "28"
                    },
                    "person_insured_data": {
                        "$ref": "#/components/schemas/PersonData"
                    },
                    "person_insurer_data": {
                        "$ref": "#/components/schemas/PersonData"
                    },
                    "agreement_marketing": {
                        "title": "agreement_marketing",
                        "description": "Agreement for marketing contact",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "ApiOrderTrainingRequest": {
                "title": "TrainingOrderRequestBody",
                "description": "Request body of ordering selected insurance packages for training",
                "required": [
                    "person_insured_data",
                    "order",
                    "agreement_marketing"
                ],
                "properties": {
                    "person_insured_data": {
                        "$ref": "#/components/schemas/PersonData"
                    },
                    "person_insurer_data": {
                        "$ref": "#/components/schemas/PersonData"
                    },
                    "packages": {
                        "title": "Insurance packages to order",
                        "description": "Insurance packages list. The packages cannot duplicate.",
                        "type": "array",
                        "items": {
                            "type": "integer"
                        },
                        "example": [
                            3,
                            6,
                            8
                        ]
                    },
                    "payment_type": {
                        "title": "Payment type",
                        "description": "Payment type, annual (single) or monthly (recurring).",
                        "type": "string",
                        "enum": [
                            "single",
                            "recurring"
                        ],
                        "example": "single"
                    },
                    "agreement_marketing": {
                        "title": "agreement_marketing",
                        "description": "Agreement for marketing contact",
                        "type": "boolean"
                    }
                },
                "type": "object"
            },
            "ApiQuotaContestRequest": {
                "title": "ContestQuotaRequestBody",
                "description": "Request body of getting the list of insurance packages related with starting in a contest/event",
                "required": [
                    "person_insured_birthdate",
                    "event_date_start",
                    "event_date_end",
                    "event_price"
                ],
                "properties": {
                    "person_insured_data": {
                        "$ref": "#/components/schemas/PersonDataBirthDateAndCitizenship"
                    },
                    "event_date_start": {
                        "title": "event_date_start",
                        "description": "Contest/event start date",
                        "type": "date",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2022-05-15"
                    },
                    "event_date_end": {
                        "title": "event_date_end",
                        "description": "Contest/event ending date",
                        "type": "date",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2022-05-15"
                    },
                    "event_price": {
                        "title": "event_price",
                        "description": "Cost of starting in a contest/event. Required for calculation of event resignation insurance premium.",
                        "type": "number",
                        "format": "float",
                        "example": "350.00"
                    }
                },
                "type": "object"
            },
            "ApiQuotaFitRequest": {
                "title": "ContestFitRequestBody",
                "description": "Request body of getting the list of insurance packages related with starting in a contest/event",
                "required": [
                    "person_insured_birthdate",
                    "event_date_start",
                    "event_date_end",
                    "event_price"
                ],
                "properties": {
                    "gym_pass_date_start": {
                        "title": "gym_pass_date_start",
                        "description": "Gym pass start date",
                        "type": "date",
                        "pattern": "/([0-9]{4})-(?:[0-9]{2})-([0-9]{2})/",
                        "example": "2025-05-15"
                    },
                    "gym_pass_price": {
                        "title": "gym_pass_price",
                        "description": "Cost of the gym pass. Required for calculation of gym pass refund insurance.",
                        "type": "number",
                        "format": "float",
                        "example": "350.00"
                    },
                    "period_days": {
                        "title": "period_days",
                        "description": "Single game pass duration in days.",
                        "type": "interger",
                        "format": "integer",
                        "example": "28"
                    }
                },
                "type": "object"
            },
            "ApiQuotaTrainingRequest": {
                "title": "TrainingQuotaRequestBody",
                "description": "Request body of getting the list of insurance packages related with training attendance",
                "required": [
                    "person_insured_birthdate"
                ],
                "properties": {
                    "person_insured_data": {
                        "$ref": "#/components/schemas/PersonDataBirthDate"
                    }
                },
                "type": "object"
            },
            "ApiSendOwuRequest": {
                "title": "SendOwuRequestBody",
                "description": "Request body for sending General Terms and Conditions of Insurance (OWU in polish) to the given e-mail address.",
                "required": [
                    "email"
                ],
                "properties": {
                    "email": {
                        "title": "email",
                        "description": "E-mail address where the GTCI should be sent",
                        "type": "string",
                        "format": "email",
                        "example": "jan.kowalski@example.com"
                    },
                    "options": {
                        "title": "options",
                        "description": "List of attachments which can be sent with the GTCI message.",
                        "type": "array",
                        "items": {
                            "type": "string",
                            "enum": [
                                "training_nnw",
                                "training_reh",
                                "training_oc",
                                "contest",
                                "nonresidents",
                                "fit"
                            ]
                        },
                        "example": [
                            "training_nnw",
                            "training_reh"
                        ]
                    }
                },
                "type": "object"
            },
            "ApiSetOrderPaymentRequest": {
                "title": "OrderPaidRequestBody",
                "properties": {
                    "order_number": {
                        "title": "Order number",
                        "description": "Number of the order which should be marked as paid",
                        "type": "string",
                        "example": "cb38shsj36c5"
                    },
                    "due_date": {
                        "title": "Gym pass payment date",
                        "description": "",
                        "type": "string",
                        "example": "2025-01-08"
                    }
                },
                "type": "object"
            },
            "Package": {
                "title": "PackageObject",
                "description": "Package represantion",
                "properties": {
                    "id": {
                        "title": "id",
                        "description": "Package identifier",
                        "type": "integer",
                        "example": "12"
                    },
                    "name": {
                        "title": "name",
                        "description": "Package name",
                        "type": "string",
                        "example": "Premium"
                    },
                    "price": {
                        "title": "price",
                        "description": "Package price",
                        "type": "float",
                        "example": "7.99"
                    },
                    "max_refund": {
                        "title": "max_refund",
                        "description": "Max cost refund for rehabilitation",
                        "type": "float",
                        "example": "10000"
                    }
                },
                "type": "object"
            },
            "PersonData": {
                "title": "PersonDataObject",
                "description": "Personal data",
                "required": [
                    "name",
                    "surname",
                    "email",
                    "birth_date",
                    "birth_country_code",
                    "citizenship_code",
                    "postal_code",
                    "city",
                    "street",
                    "house_number"
                ],
                "properties": {
                    "name": {
                        "description": "Person name",
                        "type": "string",
                        "maxLength": 32,
                        "example": "Jan"
                    },
                    "surname": {
                        "title": "surname",
                        "description": "Person surname",
                        "type": "string",
                        "maxLength": 32,
                        "example": "Kowalski"
                    },
                    "phone": {
                        "title": "phone",
                        "description": "Phone number",
                        "type": "string",
                        "maxLength": 24,
                        "minLength": 7,
                        "pattern": "/^[\\d\\+\\ \\-]+$/",
                        "example": "+48555666777"
                    },
                    "email": {
                        "title": "email",
                        "description": "E-mail address",
                        "type": "string",
                        "maxLength": 48,
                        "example": "jan.kowalski@example.com"
                    },
                    "birth_date": {
                        "title": "birth_date",
                        "description": "Birthdate in Y-m-d format",
                        "type": "string",
                        "example": "1976-04-16"
                    },
                    "birth_country_code": {
                        "title": "birth_country_code",
                        "description": "Birth country code compatible with the ISO 3166-1 alfa-2",
                        "type": "string",
                        "example": "PL"
                    },
                    "citizenship_code": {
                        "title": "citizenship_code",
                        "description": "Citizenship country code compatible with the ISO 3166-1 alfa-2",
                        "type": "string",
                        "example": "PL"
                    },
                    "postal_code": {
                        "title": "postal_code",
                        "description": "ZIP code",
                        "type": "string",
                        "maxLength": 10,
                        "example": "02-768"
                    },
                    "city": {
                        "title": "city",
                        "description": "City",
                        "type": "string",
                        "maxLength": 32,
                        "example": "Warszawa"
                    },
                    "street": {
                        "title": "street",
                        "description": "Street",
                        "type": "string",
                        "maxLength": 128,
                        "example": "Słoneczna"
                    },
                    "house_number": {
                        "title": "house_number",
                        "description": "House number",
                        "type": "string",
                        "maxLength": 15,
                        "example": "17B"
                    },
                    "flat_number": {
                        "title": "flat_number",
                        "description": "Flat number",
                        "type": "string",
                        "maxLength": 15,
                        "example": "130"
                    },
                    "id_number": {
                        "title": "id_number",
                        "description": "ID number",
                        "type": "string",
                        "maxLength": 32,
                        "example": "AAABBB1234"
                    }
                },
                "type": "object"
            },
            "PersonDataBirthDate": {
                "title": "PersonDataBirthDateObject",
                "description": "Personal data containing only birthdate",
                "required": [
                    "birth_date"
                ],
                "properties": {
                    "birth_date": {
                        "title": "birth_date",
                        "description": "Birthdate in Y-m-d format",
                        "type": "string",
                        "example": "1976-04-16"
                    }
                },
                "type": "object"
            },
            "PersonDataBirthDateAndCitizenship": {
                "title": "PersonDataBirthDateAndCitizenshipObject",
                "description": "Personal data containing only birthdate and citizenship",
                "required": [
                    "birth_date"
                ],
                "properties": {
                    "birth_date": {
                        "title": "birth_date",
                        "description": "Birthdate in Y-m-d format",
                        "type": "string",
                        "example": "1976-04-16"
                    },
                    "citizenship_code": {
                        "title": "citizenship_code",
                        "description": "Citizenship country code compatible with the ISO 3166-1 alfa-2",
                        "type": "string",
                        "example": "GB"
                    }
                },
                "type": "object"
            },
            "Product": {
                "title": "ProductObject",
                "description": "Product representation",
                "properties": {
                    "id": {
                        "title": "id",
                        "description": "Product identifier",
                        "type": "integer",
                        "example": "4"
                    },
                    "name": {
                        "title": "name",
                        "description": "Product name",
                        "type": "string",
                        "example": "Rehabilitacja"
                    },
                    "packages": {
                        "title": "Product packages",
                        "description": "List of available product packages",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Package"
                        }
                    }
                },
                "type": "object"
            },
            "ApiCalculationResponse": {
                "title": "CalculationResponseBody",
                "description": "Response for a request for calculating total cost for selected insurance packages",
                "properties": {
                    "total": {
                        "title": "total",
                        "description": "Insurance total cost in PLN (polish zloty)",
                        "type": "number",
                        "format": "float",
                        "example": "210.50"
                    }
                },
                "type": "object"
            },
            "ApiErrorResponse": {
                "title": "ErrorResponseBody",
                "description": "Response body with errors",
                "properties": {
                    "message": {
                        "title": "Message",
                        "description": "Error message",
                        "example": "The given data was invalid."
                    },
                    "errors": {
                        "title": "Errors",
                        "description": "Object containing an array of errors for each field.",
                        "properties": {
                            "field_name": {
                                "type": "array",
                                "items": {
                                    "type": "string"
                                },
                                "collectionFormat": "multi",
                                "example": [
                                    "Field field_name is required.",
                                    "Field field_name format error."
                                ]
                            }
                        },
                        "type": "object"
                    }
                },
                "type": "object"
            },
            "ApiOrderFitResponse": {
                "title": "OrderNumberResponseBody",
                "properties": {
                    "order_number": {
                        "title": "Order number",
                        "description": "Number of the newly created order",
                        "type": "string",
                        "example": "cb38shsj36c5"
                    }
                },
                "type": "object"
            },
            "ApiOrderTrainingResponse": {
                "title": "OrderNumberResponseBody",
                "properties": {
                    "order_number": {
                        "title": "Order number",
                        "description": "Number of the newly created order",
                        "type": "string",
                        "example": "cb38shsj36c5"
                    }
                },
                "type": "object"
            },
            "ApiQuotaContestResponse": {
                "title": "ContestQuotaResponseBody",
                "description": "Insurance products list",
                "properties": {
                    "products": {
                        "title": "Insurance products",
                        "description": "List of insurance products",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Product"
                        }
                    }
                },
                "type": "object"
            },
            "ApiQuotaFitResponse": {
                "title": "FitQuotaResponseBody",
                "description": "Insurance products list",
                "properties": {
                    "products": {
                        "title": "Insurance products",
                        "description": "List of insurance products",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Product"
                        }
                    }
                },
                "type": "object"
            },
            "ApiQuotaTrainingResponse": {
                "title": "TrainingQuotaResponseBody",
                "description": "Insurance products list",
                "properties": {
                    "products": {
                        "title": "Insurance products",
                        "description": "Insurance product list",
                        "type": "array",
                        "items": {
                            "$ref": "#/components/schemas/Product"
                        }
                    }
                },
                "type": "object"
            }
        },
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "description": "Autoryzacja za pomocą klucza dostarczonego przez zespół UDAO",
                "scheme": "bearer"
            }
        }
    },
    "security": [
        {
            "bearerAuth": []
        }
    ]
}
