{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "type": "object",
    "properties": {
        "pricing_rule_name": {
            "type": "string",
            "input_type": "text",
            "hidden": false,
            "title": "Name",
            "tab": "",
            "misc": {
                "tooltip": "Enter a name to identify the pricing rule."
            },
            "required": true,
            "dependency": [],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_priority": {
            "type": "string",
            "input_type": "select",
            "hidden": false,
            "title": "Priority",
            "tab": "",
            "misc": {
                "tooltip": "Specify the order for applying pricing rules to a service. This matters when you apply multiple rules for the same service.",
                "options": {
                    "1": "low",
                    "10": "medium",
                    "20": "high"
                }
            },
            "required": true,
            "dependency": [],
            "default_value": 1,
            "editable": true
        },
        "pricing_rule_type": {
            "type": "string",
            "input_type": "select",
            "hidden": false,
            "title": "Type",
            "tab": "",
            "misc": {
                "tooltip": "Select the <a rel=\"noopener\" target=\"_blank\" href=\"https://webba-booking.com/documentation/payment/pricing-rules/\">type of pricing rule</a>.",
                "options": {
                    "date_range": "Price for date range",
                    "early_booking": "Price for early booking",
                    "custom_field": "Price based on custom field value",
                    "day_of_week_and_time": "Price for day of week and time range",
                    "number_of_seats": "Price based on number of seats booked",
                    "number_of_timeslots": "Price based on number of timeslots booked"
                }
            },
            "required": true,
            "dependency": [],
            "default_value": null,
            "editable": true
        },
        "pricing_rule_date_range": {
            "type": "string",
            "input_type": "date_range",
            "hidden": true,
            "title": "Date range",
            "tab": "",
            "misc": {
                "time_zone": "Asia/Dhaka"
            },
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "date_range"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_days_number": {
            "type": "string",
            "input_type": "text",
            "hidden": true,
            "title": "Minimum number of days before the booked date",
            "tab": "",
            "misc": {
                "sub_type": "positive_integer"
            },
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "early_booking"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_custom_field_id": {
            "type": "string",
            "input_type": "text",
            "hidden": true,
            "title": "Custom field ID",
            "tab": "",
            "misc": null,
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "custom_field"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_custom_field_operator": {
            "type": "string",
            "input_type": "radio",
            "hidden": true,
            "title": "Operator",
            "tab": "",
            "misc": {
                "options": {
                    "equals": "equals",
                    "more_than": "more than",
                    "less_than": "less than"
                }
            },
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "custom_field"
                ]
            ],
            "default_value": "equals",
            "editable": true
        },
        "pricing_rule_custom_field_value": {
            "type": "string",
            "input_type": "text",
            "hidden": true,
            "title": "Custom field value",
            "tab": "",
            "misc": null,
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "custom_field"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_number_of_seats_operator": {
            "type": "string",
            "input_type": "radio",
            "hidden": true,
            "title": "Operator",
            "tab": "",
            "misc": {
                "options": {
                    "equals": "equals",
                    "more_than": "more than",
                    "less_than": "less than"
                }
            },
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "number_of_seats"
                ]
            ],
            "default_value": "equals",
            "editable": true
        },
        "pricing_rule_number_of_seats_value": {
            "type": "string",
            "input_type": "text",
            "hidden": true,
            "title": "Number of seats",
            "tab": "",
            "misc": null,
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "number_of_seats"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_number_of_timeslots_operator": {
            "type": "string",
            "input_type": "radio",
            "hidden": true,
            "title": "Operator",
            "tab": "",
            "misc": {
                "options": {
                    "equals": "equals",
                    "more_than": "more than",
                    "less_than": "less than"
                }
            },
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "number_of_timeslots"
                ]
            ],
            "default_value": "equals",
            "editable": true
        },
        "pricing_rule_number_of_timeslots_value": {
            "type": "string",
            "input_type": "text",
            "hidden": true,
            "title": "Number of timeslots",
            "tab": "",
            "misc": null,
            "required": true,
            "dependency": [
                [
                    "type",
                    "=",
                    "number_of_timeslots"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_only_same_service": {
            "type": "string",
            "input_type": "checkbox",
            "hidden": true,
            "title": "Only timeslots in the same service",
            "tab": "",
            "misc": {
                "yes": "Yes",
                "tooltip": "Select the <a rel=\"noopener\" target=\"_blank\" href=\"https://webba-booking.com/documentation/payment/pricing-rules/\">type of pricing rule</a>."
            },
            "required": false,
            "dependency": [
                [
                    "type",
                    "=",
                    "number_of_timeslots"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_day_time": {
            "type": "json",
            "input_type": "business_hours",
            "hidden": true,
            "title": "Day of week and time range",
            "tab": "",
            "misc": null,
            "required": false,
            "dependency": [
                [
                    "type",
                    "=",
                    "day_of_week_and_time"
                ]
            ],
            "default_value": [],
            "editable": true
        },
        "pricing_rule_action": {
            "type": "string",
            "input_type": "radio",
            "hidden": false,
            "title": "Action",
            "tab": "",
            "misc": {
                "options": {
                    "increase": "increase",
                    "reduce": "reduce",
                    "replace": "replace"
                }
            },
            "required": true,
            "dependency": [],
            "default_value": "increase",
            "editable": true
        },
        "pricing_rule_amount": {
            "type": "string",
            "input_type": "text",
            "hidden": false,
            "title": "Amount",
            "tab": "",
            "misc": {
                "tooltip": "Set the value by which the price will be increased, decreased, or replaced.",
                "sub_type": "none_negative_float"
            },
            "required": false,
            "dependency": [],
            "default_value": "0",
            "editable": true
        },
        "pricing_rule_fixed_percent": {
            "type": "string",
            "input_type": "radio",
            "hidden": false,
            "title": "Fixed / percent",
            "tab": "",
            "misc": {
                "options": {
                    "fixed": "fixed",
                    "percent": "percent"
                }
            },
            "required": true,
            "dependency": [
                [
                    "action",
                    "!=",
                    "replace"
                ],
                [
                    "action",
                    "!=",
                    "multiply"
                ]
            ],
            "default_value": "fixed",
            "editable": true
        },
        "pricing_rule_multiply_amount": {
            "type": "string",
            "input_type": "checkbox",
            "hidden": true,
            "title": "Multiply amount by the field value",
            "tab": "",
            "misc": {
                "yes": "Yes"
            },
            "required": false,
            "dependency": [
                [
                    "type",
                    "=",
                    "custom_field"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_related_to_seats_number": {
            "type": "string",
            "input_type": "checkbox",
            "hidden": true,
            "title": "The field is related to the number of seats booked",
            "tab": "",
            "misc": {
                "yes": "Yes"
            },
            "required": false,
            "dependency": [
                [
                    "type",
                    "=",
                    "custom_field"
                ]
            ],
            "default_value": "",
            "editable": true
        },
        "pricing_rule_is_for_entire_order": {
            "type": "string",
            "input_type": "checkbox",
            "hidden": true,
            "title": "Apply the pricing rule to the entire order instead of individual time slots.",
            "tab": "",
            "misc": {
                "yes": "Yes"
            },
            "required": false,
            "dependency": [],
            "default_value": "",
            "editable": true
        }
    }
}