BokaMera.API.Host

<back to all web services

GDPRCustomerQuery

Requires Authentication
Requires any of the roles:bookingsupplier-administrator-write, superadmin, bookingsupplier-administrator-read
The following routes are available for this service:
GET/gdpr/customers/{CustomerId}Get all customer information stored on the customerGet all information stored on the customer
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerBookingsResponse:
    # @ApiMember(Description="The company ID associated with this booking")
    company_id: Optional[str] = None
    """
    The company ID associated with this booking
    """


    # @ApiMember(Description="The unique identifier of the booking")
    id: int = 0
    """
    The unique identifier of the booking
    """


    # @ApiMember(Description="The customer ID associated with this booking")
    customer_id: Optional[str] = None
    """
    The customer ID associated with this booking
    """


    # @ApiMember(Description="The service ID for this booking")
    service_id: int = 0
    """
    The service ID for this booking
    """


    # @ApiMember(Description="The current status of the booking")
    status_id: int = 0
    """
    The current status of the booking
    """


    # @ApiMember(Description="The start date and time of the booking")
    from_: datetime.datetime = field(metadata=config(field_name='from'), default=datetime.datetime(1, 1, 1))
    """
    The start date and time of the booking
    """


    # @ApiMember(Description="The end date and time of the booking")
    to: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The end date and time of the booking
    """


    # @ApiMember(Description="The date when the booking was cancelled or unbooked")
    unbooked_on: Optional[datetime.datetime] = None
    """
    The date when the booking was cancelled or unbooked
    """


    # @ApiMember(Description="Comments added when the booking was cancelled")
    unbooked_comments: Optional[str] = None
    """
    Comments added when the booking was cancelled
    """


    # @ApiMember(Description="Comments added when the booking was created")
    booked_comments: Optional[str] = None
    """
    Comments added when the booking was created
    """


    # @ApiMember(Description="The name of the person who made the booking")
    booked_by: Optional[str] = None
    """
    The name of the person who made the booking
    """


    # @ApiMember(Description="General comments about the booking")
    comments: Optional[str] = None
    """
    General comments about the booking
    """


    # @ApiMember(Description="Custom text field 1")
    text_field1: Optional[str] = None
    """
    Custom text field 1
    """


    # @ApiMember(Description="Custom text field 2")
    text_field2: Optional[str] = None
    """
    Custom text field 2
    """


    # @ApiMember(Description="Custom text field 3")
    text_field3: Optional[str] = None
    """
    Custom text field 3
    """


    # @ApiMember(Description="Custom text field 4")
    text_field4: Optional[str] = None
    """
    Custom text field 4
    """


    # @ApiMember(Description="Custom text field 5")
    text_field5: Optional[str] = None
    """
    Custom text field 5
    """


    # @ApiMember(Description="Custom text field 6")
    text_field6: Optional[str] = None
    """
    Custom text field 6
    """


    # @ApiMember(Description="Custom text field 7")
    text_field7: Optional[str] = None
    """
    Custom text field 7
    """


    # @ApiMember(Description="Custom text field 8")
    text_field8: Optional[str] = None
    """
    Custom text field 8
    """


    # @ApiMember(Description="Custom text field 9")
    text_field9: Optional[str] = None
    """
    Custom text field 9
    """


    # @ApiMember(Description="Custom text field 10")
    text_field10: Optional[str] = None
    """
    Custom text field 10
    """


    # @ApiMember(Description="Custom text field 11")
    text_field11: Optional[str] = None
    """
    Custom text field 11
    """


    # @ApiMember(Description="Custom text field 12")
    text_field12: Optional[str] = None
    """
    Custom text field 12
    """


    # @ApiMember(Description="Custom text field 13")
    text_field13: Optional[str] = None
    """
    Custom text field 13
    """


    # @ApiMember(Description="Custom text field 14")
    text_field14: Optional[str] = None
    """
    Custom text field 14
    """


    # @ApiMember(Description="Custom text field 15")
    text_field15: Optional[str] = None
    """
    Custom text field 15
    """


    # @ApiMember(Description="Custom text field 16")
    text_field16: Optional[str] = None
    """
    Custom text field 16
    """


    # @ApiMember(Description="Custom text field 17")
    text_field17: Optional[str] = None
    """
    Custom text field 17
    """


    # @ApiMember(Description="Custom text field 18")
    text_field18: Optional[str] = None
    """
    Custom text field 18
    """


    # @ApiMember(Description="Custom text field 19")
    text_field19: Optional[str] = None
    """
    Custom text field 19
    """


    # @ApiMember(Description="Custom text field 20")
    text_field20: Optional[str] = None
    """
    Custom text field 20
    """


    # @ApiMember(Description="The date when the booking was last updated")
    updated_date: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the booking was last updated
    """


    # @ApiMember(Description="The date when the booking was created")
    created_date: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the booking was created
    """


    # @ApiMember(Description="Comments sent to the customer about this booking")
    comments_to_customer: Optional[str] = None
    """
    Comments sent to the customer about this booking
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerMessageLogResponse:
    # @ApiMember(Description="The company ID associated with this message")
    company_id: Optional[str] = None
    """
    The company ID associated with this message
    """


    # @ApiMember(Description="The unique identifier of the message")
    id: int = 0
    """
    The unique identifier of the message
    """


    # @ApiMember(Description="The booking ID this message is related to, if any")
    booking_id: Optional[int] = None
    """
    The booking ID this message is related to, if any
    """


    # @ApiMember(Description="The recipient of the message")
    receiver: Optional[str] = None
    """
    The recipient of the message
    """


    # @ApiMember(Description="The sender of the message")
    sender: Optional[str] = None
    """
    The sender of the message
    """


    # @ApiMember(Description="The title or subject of the message")
    message_title: Optional[str] = None
    """
    The title or subject of the message
    """


    # @ApiMember(Description="The body content of the message")
    message_body: Optional[str] = None
    """
    The body content of the message
    """


    # @ApiMember(Description="The name of the person who created the message")
    created_by: Optional[str] = None
    """
    The name of the person who created the message
    """


    # @ApiMember(Description="The date when the message was created")
    created: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the message was created
    """


    # @ApiMember(Description="Whether the message was successfully sent")
    sent: bool = False
    """
    Whether the message was successfully sent
    """


    # @ApiMember(Description="The date when the message was sent")
    sent_date: Optional[datetime.datetime] = None
    """
    The date when the message was sent
    """


    # @ApiMember(Description="The method used to send the message (e.g., email, SMS)")
    send_method_id: int = 0
    """
    The method used to send the message (e.g., email, SMS)
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InvoiceAddressResponse:
    invoice_address_id: Optional[str] = None
    user_id: Optional[str] = None
    corporate_identity_number: Optional[str] = None
    invoice_address1: Optional[str] = None
    invoice_address2: Optional[str] = None
    invoice_city: Optional[str] = None
    invoice_postal_code: Optional[str] = None
    invoice_country_code: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserProfileResponse:
    id: Optional[str] = None
    firstname: Optional[str] = None
    lastname: Optional[str] = None
    phone: Optional[str] = None
    email: Optional[str] = None
    invoice_address: Optional[InvoiceAddressResponse] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerInfoResponse:
    # @ApiMember(Description="The unique identifier of the user")
    user_id: Optional[str] = None
    """
    The unique identifier of the user
    """


    # @ApiMember(Description="The user's first name")
    firstname: Optional[str] = None
    """
    The user's first name
    """


    # @ApiMember(Description="The user's last name")
    lastname: Optional[str] = None
    """
    The user's last name
    """


    # @ApiMember(Description="The user's phone number")
    phone: Optional[str] = None
    """
    The user's phone number
    """


    # @ApiMember(Description="The user's email address")
    email: Optional[str] = None
    """
    The user's email address
    """


    # @ApiMember(Description="Whether the user account is currently active")
    active: bool = False
    """
    Whether the user account is currently active
    """


    # @ApiMember(Description="The user's Facebook username")
    facebook_username: Optional[str] = None
    """
    The user's Facebook username
    """


    # @ApiMember(Description="Custom text field 1")
    text_field1: Optional[str] = None
    """
    Custom text field 1
    """


    # @ApiMember(Description="Custom text field 2")
    text_field2: Optional[str] = None
    """
    Custom text field 2
    """


    # @ApiMember(Description="Custom text field 3")
    text_field3: Optional[str] = None
    """
    Custom text field 3
    """


    # @ApiMember(Description="Custom text field 4")
    text_field4: Optional[str] = None
    """
    Custom text field 4
    """


    # @ApiMember(Description="Custom text field 5")
    text_field5: Optional[str] = None
    """
    Custom text field 5
    """


    # @ApiMember(Description="Custom text field 6")
    text_field6: Optional[str] = None
    """
    Custom text field 6
    """


    # @ApiMember(Description="Custom text field 7")
    text_field7: Optional[str] = None
    """
    Custom text field 7
    """


    # @ApiMember(Description="Custom text field 8")
    text_field8: Optional[str] = None
    """
    Custom text field 8
    """


    # @ApiMember(Description="Custom text field 9")
    text_field9: Optional[str] = None
    """
    Custom text field 9
    """


    # @ApiMember(Description="Custom text field 10")
    text_field10: Optional[str] = None
    """
    Custom text field 10
    """


    # @ApiMember(Description="Custom text field 11")
    text_field11: Optional[str] = None
    """
    Custom text field 11
    """


    # @ApiMember(Description="Custom text field 12")
    text_field12: Optional[str] = None
    """
    Custom text field 12
    """


    # @ApiMember(Description="Custom text field 13")
    text_field13: Optional[str] = None
    """
    Custom text field 13
    """


    # @ApiMember(Description="Custom text field 14")
    text_field14: Optional[str] = None
    """
    Custom text field 14
    """


    # @ApiMember(Description="Custom text field 15")
    text_field15: Optional[str] = None
    """
    Custom text field 15
    """


    # @ApiMember(Description="Custom text field 16")
    text_field16: Optional[str] = None
    """
    Custom text field 16
    """


    # @ApiMember(Description="Custom text field 17")
    text_field17: Optional[str] = None
    """
    Custom text field 17
    """


    # @ApiMember(Description="Custom text field 18")
    text_field18: Optional[str] = None
    """
    Custom text field 18
    """


    # @ApiMember(Description="Custom text field 19")
    text_field19: Optional[str] = None
    """
    Custom text field 19
    """


    # @ApiMember(Description="Custom text field 20")
    text_field20: Optional[str] = None
    """
    Custom text field 20
    """


    # @ApiMember(Description="The date when the customer information was last updated")
    updated: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the customer information was last updated
    """


    # @ApiMember(Description="The date when the customer information was created")
    created: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the customer information was created
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerCommentsResponse:
    # @ApiMember(Description="The company ID associated with this comment")
    company_id: Optional[str] = None
    """
    The company ID associated with this comment
    """


    # @ApiMember(Description="The unique identifier of the comment")
    id: int = 0
    """
    The unique identifier of the comment
    """


    # @ApiMember(Description="The customer ID this comment is associated with")
    customer_id: Optional[str] = None
    """
    The customer ID this comment is associated with
    """


    # @ApiMember(Description="The content of the comment")
    comments: Optional[str] = None
    """
    The content of the comment
    """


    # @ApiMember(Description="The date when the comment was last updated")
    updated: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the comment was last updated
    """


    # @ApiMember(Description="The date when the comment was created")
    created: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the comment was created
    """


    # @ApiMember(Description="URL to any image associated with the comment")
    image_url: Optional[str] = None
    """
    URL to any image associated with the comment
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerNewsletterLogResponse:
    # @ApiMember(Description="The company ID associated with this newsletter")
    company_id: Optional[str] = None
    """
    The company ID associated with this newsletter
    """


    # @ApiMember(Description="The unique identifier of the newsletter log entry")
    id: int = 0
    """
    The unique identifier of the newsletter log entry
    """


    # @ApiMember(Description="The newsletter ID this log entry is related to, if any")
    newsletters_id: Optional[int] = None
    """
    The newsletter ID this log entry is related to, if any
    """


    # @ApiMember(Description="The recipient of the newsletter")
    receiver: Optional[str] = None
    """
    The recipient of the newsletter
    """


    # @ApiMember(Description="The sender of the newsletter")
    sender: Optional[str] = None
    """
    The sender of the newsletter
    """


    # @ApiMember(Description="The title or subject of the newsletter")
    message_title: Optional[str] = None
    """
    The title or subject of the newsletter
    """


    # @ApiMember(Description="The body content of the newsletter")
    message_body: Optional[str] = None
    """
    The body content of the newsletter
    """


    # @ApiMember(Description="Whether the newsletter was successfully sent")
    sent: bool = False
    """
    Whether the newsletter was successfully sent
    """


    # @ApiMember(Description="The date when the newsletter was created")
    created: datetime.datetime = datetime.datetime(1, 1, 1)
    """
    The date when the newsletter was created
    """


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerQueryResponse:
    # @ApiMember(Description="List of all bookings associated with the customer")
    bookings: Optional[List[GDPRCustomerBookingsResponse]] = None
    """
    List of all bookings associated with the customer
    """


    # @ApiMember(Description="List of all message logs associated with the customer")
    message_log: Optional[List[GDPRCustomerMessageLogResponse]] = None
    """
    List of all message logs associated with the customer
    """


    # @ApiMember(Description="The user profile information for the customer")
    user_profile: Optional[UserProfileResponse] = None
    """
    The user profile information for the customer
    """


    # @ApiMember(Description="Detailed customer information")
    customer: Optional[GDPRCustomerInfoResponse] = None
    """
    Detailed customer information
    """


    # @ApiMember(Description="List of all comments associated with the customer")
    customer_comment: Optional[List[GDPRCustomerCommentsResponse]] = None
    """
    List of all comments associated with the customer
    """


    # @ApiMember(Description="List of all newsletter logs associated with the customer")
    newsletter_log: Optional[List[GDPRCustomerNewsletterLogResponse]] = None
    """
    List of all newsletter logs associated with the customer
    """


    # @ApiMember(Description="Response status information")
    response_status: Optional[ResponseStatus] = None
    """
    Response status information
    """


# @ValidateRequest(Validator="IsAuthenticated")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GDPRCustomerQuery(ICompany):
    # @ApiMember(Description="Enter the company and id you want to see the information for a resource, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown ", IsRequired=true, ParameterType="query")
    company_id: Optional[str] = None
    """
    Enter the company and id you want to see the information for a resource, if blank company id and you are an admin, your company id will be used. If blank id, all resources will be shown 
    """


    # @ApiMember(Description="Id of the customer", IsRequired=true, ParameterType="path")
    customer_id: Optional[str] = None
    """
    Id of the customer
    """

Python GDPRCustomerQuery DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

GET /gdpr/customers/{CustomerId} HTTP/1.1 
Host: api.bokamera.se 
Accept: text/jsv
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Bookings: 
	[
		{
			Id: 0,
			ServiceId: 0,
			StatusId: 0,
			UnbookedOn: "0001-01-01T00:00:00",
			UnbookedComments: String,
			BookedComments: String,
			BookedBy: String,
			Comments: String,
			TextField1: String,
			TextField2: String,
			TextField3: String,
			TextField4: String,
			TextField5: String,
			TextField6: String,
			TextField7: String,
			TextField8: String,
			TextField9: String,
			TextField10: String,
			TextField11: String,
			TextField12: String,
			TextField13: String,
			TextField14: String,
			TextField15: String,
			TextField16: String,
			TextField17: String,
			TextField18: String,
			TextField19: String,
			TextField20: String,
			CommentsToCustomer: String
		}
	],
	MessageLog: 
	[
		{
			Id: 0,
			BookingId: 0,
			Receiver: String,
			Sender: String,
			MessageTitle: String,
			MessageBody: String,
			CreatedBy: String,
			Sent: False,
			SentDate: "0001-01-01T00:00:00",
			SendMethodId: 0
		}
	],
	UserProfile: 
	{
		Firstname: String,
		Lastname: String,
		Phone: String,
		Email: String,
		InvoiceAddress: 
		{
			UserId: 00000000-0000-0000-0000-000000000000,
			CorporateIdentityNumber: String,
			InvoiceAddress1: String,
			InvoiceAddress2: String,
			InvoiceCity: String,
			InvoicePostalCode: String,
			InvoiceCountryCode: String
		}
	},
	Customer: 
	{
		Firstname: String,
		Lastname: String,
		Phone: String,
		Email: String,
		Active: False,
		FacebookUsername: String,
		TextField1: String,
		TextField2: String,
		TextField3: String,
		TextField4: String,
		TextField5: String,
		TextField6: String,
		TextField7: String,
		TextField8: String,
		TextField9: String,
		TextField10: String,
		TextField11: String,
		TextField12: String,
		TextField13: String,
		TextField14: String,
		TextField15: String,
		TextField16: String,
		TextField17: String,
		TextField18: String,
		TextField19: String,
		TextField20: String
	},
	CustomerComment: 
	[
		{
			Id: 0,
			Comments: String
		}
	],
	NewsletterLog: 
	[
		{
			Id: 0,
			NewslettersId: 0,
			Receiver: String,
			Sender: String,
			MessageTitle: String,
			MessageBody: String,
			Sent: False
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}