<commit_before>@using WebMatrix.WebData;
@*
    Allows a client to create a booking, in other words: to book a service professional.
    There is only POST access, no editing, no fetching.
    On creation, the just created booking details are returned and later can
    be fetched using the /bookings API.

    Options:

    - GET /
        @params {
            serviceProfessionalUserID:int,
            jobTitleID:int,
            bookCode:string [Optional]
        }

        @result RestBooking. See the /bookings API for details.
    
    - POST /
        @params {
            TODO complete list

            serviceAddressID:int ID of the address where service will be performed (must belong to client or service professional
                and is overwrited by the value of serviceAddress[addressID] if provided.
            serviceAddress:Address Object to hold a serviceAddress[addressID] or the full details of a new
                address saved for the client to be used as the place where service will be performed.
        }

        @result RestBooking. See the /bookings API for details.
        
    EXAMPLES {
        "Client Booking: Create booking: Post to create booking and Get to request the initial data for a new booking": {
            "url": "/api/v1/en-US/me/client-booking",
            "get": {
                "serviceProfessionalUserID": 141,
                "jobTitleID": 106,
                "bookCode": null
            },
            "post": {
                "serviceProfessionalUserID": 141,
                "jobTitleID": 106,
                "serviceStartTime": "2015-10-19T08:30:00.000Z",
                "alternative1StartTime": "2015-10-26T09:30:00.000Z",
                "alternative2StartTime": null,
                "serviceAddress": {
                    "addressID": 240,
                    "addressName": "Service Area",
                    "addressLine1": "",
                    "postalCode": 98001,
                    "countryCode": "US",
                    "latitude": 47.3394747,
                    "longitude": -122.2667661,
                },
                "services": [8, 108],
                "promotionalCode":null,
                "billingAddress": {
                    "postalCode": 90001,
                    "paymentMethodID": "0",
                    "nameOnCard": "",
                    "cardNumber": "123456789456123",
                    "expirationMonth": "01",
                    "expirationYear": "2017",
                    "securityCode": "1565",
                    "savePayment": false
                },
                "specialRequests": "Some notes to the professional"
            }
        },
        "Client Booking: Update booking": {
            "url": "/api/v1/en-US/me/client-booking/34",
            "put": {
                "serviceStartTime": "2015-10-19T08:30:00.000Z",
                "serviceAddress": {
                    "addressID": 240,
                    "addressName": "Service Area",
                    "addressLine1": "",
                    "postalCode": 98001,
                    "countryCode": "US",
                    "latitude": 47.3394747,
                    "longitude": -122.2667661,
                },
                "services": [8, 108],
                "specialRequests": "Some notes to the professional"
            }
        },
        "Client Booking: Cancel booking": {
            "url": "/api/v1/en-US/me/client-booking/34/cancel",
            "post": {}
        },
        "Client Booking: Decline/deny booking": {<commit_msg>Added paymentMethod sample data to docs at client-booking<commit_after>@using WebMatrix.WebData;
@*
    Allows a client to create a booking, in other words: to book a service professional.
    There is only POST access, no editing, no fetching.
    On creation, the just created booking details are returned and later can
    be fetched using the /bookings API.

    Options:

    - GET /
        @params {
            serviceProfessionalUserID:int,
            jobTitleID:int,
            bookCode:string [Optional]
        }

        @result RestBooking. See the /bookings API for details.

    - POST /
        @params {
            TODO complete list

            serviceAddressID:int ID of the address where service will be performed (must belong to client or service professional
                and is overwrited by the value of serviceAddress[addressID] if provided.
            serviceAddress:Address Object to hold a serviceAddress[addressID] or the full details of a new
                address saved for the client to be used as the place where service will be performed.
        }

        @result RestBooking. See the /bookings API for details.

    EXAMPLES {
        "Client Booking: Create booking: Post to create booking and Get to request the initial data for a new booking": {
            "url": "/api/v1/en-US/me/client-booking",
            "get": {
                "serviceProfessionalUserID": 141,
                "jobTitleID": 106,
                "bookCode": null
            },
            "post": {
                "serviceProfessionalUserID": 141,
                "jobTitleID": 106,
                "serviceStartTime": "2015-10-19T08:30:00.000Z",
                "alternative1StartTime": "2015-10-26T09:30:00.000Z",
                "alternative2StartTime": null,
                "serviceAddress": {
                    "addressID": 240,
                    "addressName": "Service Area",
                    "addressLine1": "",
                    "postalCode": 98001,
                    "countryCode": "US",
                    "latitude": 47.3394747,
                    "longitude": -122.2667661,
                },
                "services": [8, 108],
                "promotionalCode":null,
                "billingAddress": {
                    "postalCode": 90001,
                    "paymentMethodID": "0",
                    "nameOnCard": "",
                    "cardNumber": "123456789456123",
                    "expirationMonth": "01",
                    "expirationYear": "2017",
                    "securityCode": "1565",
                    "savePayment": false
                },
                "specialRequests": "Some notes to the professional",
                "paymentMethod": {
                    "paymentMethodID": "TEST: previously saved method token",
                    "cardNumber": "123443121234",
                    "nameOnCard": "Me",
                    "expirationMonth": "11",
                    "expirationYear": "2018",
                    "securityCode": "123",
                    "savePayment": true
                }
            }
        },
        "Client Booking: Update booking": {
            "url": "/api/v1/en-US/me/client-booking/34",
            "put": {
                "serviceStartTime": "2015-10-19T08:30:00.000Z",
                "serviceAddress": {
                    "addressID": 240,
                    "addressName": "Service Area",
                    "addressLine1": "",
                    "postalCode": 98001,
                    "countryCode": "US",
                    "latitude": 47.3394747,
                    "longitude": -122.2667661,
                },
                "services": [8, 108],
                "specialRequests": "Some notes to the professional"
            }
        },
        "Client Booking: Cancel booking": {
            "url": "/api/v1/en-US/me/client-booking/34/cancel",
            "post": {}
        },
        "Client Booking: Decline/deny booking": {
{'fraction_non_alphanumeric': 0.10241123476417593, 'fraction_numerical': 0.04703232644409115, 'mean_word_length': 1.39498730964467, 'pattern_counts': {'":': 108, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4134502', 'n_tokens_mistral': 2219, 'n_tokens_neox': 1862, 'n_words': 532}