HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //home/arjun/projects/buyercall/buyercall/integrations/elasticsearch/documents.py
from elasticsearch_dsl import Document, Date, Integer, Keyword, Text, \
    Boolean, InnerDoc, Object, Nested


class Parameter(InnerDoc):
    key = Text()
    value = Text()


class ErrorLogger(Document):
    environment = Text(fields={'key': Keyword()})
    hostname = Text(fields={'key': Keyword()})
    ip = Text()
    created_at = Date(default_timezone='UTC')
    method = Text(fields={'key': Keyword()})
    is_api = Boolean()
    params = Object(Parameter)
    url = Text()
    status_code = Integer(fields={'key': Keyword()})
    status_code_root = Integer()
    error_detail = Text()
    user_id = Text(fields={'key': Keyword()})
    partnership_id = Text(fields={'key': Keyword()})
    account_id = Text(fields={'key': Keyword()})

    class Index:
        settings = {
            'number_of_shards': 6,
        }


class ActivityLogger(Document):
    notification_id = Text(fields={'key': Keyword()})
    notification_type = Text(fields={'key': Keyword()})
    notification_message_type = Text(fields={'key': Keyword()})

    user_id = Text(fields={'key': Keyword()})
    message = Text()
    user_ip = Text()
    user_device = Text()

    payload = Object()
    hyperlink = Text()

    partnership_id = Text(fields={'key': Keyword()})
    account_id = Text(fields={'key': Keyword()})

    is_read = Boolean()
    is_viewed = Boolean()
    created_at = Date(default_timezone='UTC')

    class Index:
        settings = {
            'number_of_shards': 1,
        }


class LeadInteraction(Document):
    interaction_id = Text(fields={'key': Keyword()})
    customer_id = Text(fields={'key': Keyword()})
    lead_id = Text(fields={'key': Keyword()})
    state = Text(fields={'key': Keyword()})
    status = Text(fields={'key': Keyword()})
    progress_status = Text(fields={'key': Keyword()})
    is_viewed = Boolean()
    is_assigned = Boolean()
    partnership_id = Text(fields={'key': Keyword()})
    partnership_account_id = Text(fields={'key': Keyword()})
    type = Text(fields={'key': Keyword()})
    interaction_object = Object()
    created_at = Date(default_timezone='UTC')

    class Index:
        settings = {
            'number_of_shards': 5,
        }


class InteractionTask(Document):
    task_id = Text(fields={'key': Keyword()})
    is_viewed = Boolean()
    task_type = Text(fields={'key': Keyword()})
    created_at = Date(default_timezone='UTC')
    updated_at = Date(default_timezone='UTC')
    due_date = Date(default_timezone='UTC')
    partnership_id = Text(fields={'key': Keyword()})
    partnership_account_id = Text(fields={'key': Keyword()})
    status = Text(fields={'key': Keyword()})
    user_id = Text(fields={'key': Keyword()})
    action_user = Text(fields={'key': Keyword()})
    interaction_id = Text(fields={'key': Keyword()})

    class Index:
        settings = {
            'number_of_shards': 5,
        }