Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add queries examples #90

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
AUTH_AUTH_AUTHORIZATION_HEADER="Bearer YQ=="
AUTH_AUTH_HASURA_SERVICE_TOKEN_SECRET="YQ=="
AUTH_AUTH_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
AUTH_AUTH_OTEL_SERVICE_NAME="auth_auth"
AUTH_AUTH_READ_URL="http://local.hasura.dev:6460"
AUTH_AUTH_WRITE_URL="http://local.hasura.dev:6460"
CUSTOMER_AURORA_AUTHORIZATION_HEADER="Bearer YQ=="
CUSTOMER_AURORA_HASURA_SERVICE_TOKEN_SECRET="YQ=="
CUSTOMER_AURORA_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
CUSTOMER_AURORA_OTEL_SERVICE_NAME="customer_aurora"
CUSTOMER_AURORA_READ_URL="http://local.hasura.dev:6742"
CUSTOMER_AURORA_WRITE_URL="http://local.hasura.dev:6742"
CUSTOMER_CONNECTOR_AUTHORIZATION_HEADER="Bearer YQ=="
CUSTOMER_CONNECTOR_HASURA_SERVICE_TOKEN_SECRET="YQ=="
CUSTOMER_CONNECTOR_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
CUSTOMER_CONNECTOR_OTEL_SERVICE_NAME="customer_connector"
CUSTOMER_CONNECTOR_READ_URL="http://local.hasura.dev:8365"
CUSTOMER_CONNECTOR_WRITE_URL="http://local.hasura.dev:8365"
CUSTOMER_LOGIC_AUTHORIZATION_HEADER="Bearer YQ=="
CUSTOMER_LOGIC_HASURA_CONNECTOR_PORT=6394
CUSTOMER_LOGIC_HASURA_SERVICE_TOKEN_SECRET="YQ=="
CUSTOMER_LOGIC_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
CUSTOMER_LOGIC_OTEL_SERVICE_NAME="customer_logic"
CUSTOMER_LOGIC_READ_URL="http://local.hasura.dev:6394"
CUSTOMER_LOGIC_WRITE_URL="http://local.hasura.dev:6394"
CUSTOMER_MONGO_AUTHORIZATION_HEADER="Bearer YQ=="
CUSTOMER_MONGO_HASURA_SERVICE_TOKEN_SECRET="YQ=="
CUSTOMER_MONGO_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
CUSTOMER_MONGO_OTEL_SERVICE_NAME="customer_mongo"
CUSTOMER_MONGO_READ_URL="http://local.hasura.dev:4038"
CUSTOMER_MONGO_WRITE_URL="http://local.hasura.dev:4038"
GLOBALS_GLOBAL_FUNCTIONS_AUTHORIZATION_HEADER="Bearer YQ=="
GLOBALS_GLOBAL_FUNCTIONS_HASURA_CONNECTOR_PORT=5756
GLOBALS_GLOBAL_FUNCTIONS_HASURA_SERVICE_TOKEN_SECRET="YQ=="
GLOBALS_GLOBAL_FUNCTIONS_OTEL_EXPORTER_OTLP_ENDPOINT="http://local.hasura.dev:4317"
GLOBALS_GLOBAL_FUNCTIONS_OTEL_SERVICE_NAME="globals_global_functions"
GLOBALS_GLOBAL_FUNCTIONS_READ_URL="http://local.hasura.dev:5756"
GLOBALS_GLOBAL_FUNCTIONS_WRITE_URL="http://local.hasura.dev:5756"
NETWORK_CLICKHOUSE_AUTHORIZATION_HEADER="Bearer YQ=="
NETWORK_CLICKHOUSE_HASURA_SERVICE_TOKEN_SECRET="YQ=="
NETWORK_CLICKHOUSE_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
NETWORK_CLICKHOUSE_OTEL_SERVICE_NAME="network_clickhouse"
NETWORK_CLICKHOUSE_READ_URL="http://local.hasura.dev:5052"
NETWORK_CLICKHOUSE_WRITE_URL="http://local.hasura.dev:5052"
NETWORK_KAFKA_SINK_AUTHORIZATION_HEADER="Bearer YQ=="
NETWORK_KAFKA_SINK_HASURA_SERVICE_TOKEN_SECRET="YQ=="
NETWORK_KAFKA_SINK_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
NETWORK_KAFKA_SINK_OTEL_SERVICE_NAME="network_kafka_sink"
NETWORK_KAFKA_SINK_READ_URL="http://local.hasura.dev:8034"
NETWORK_KAFKA_SINK_WRITE_URL="http://local.hasura.dev:8034"
SUPPORT_ATLAS_AUTHORIZATION_HEADER="Bearer YQ=="
SUPPORT_ATLAS_HASURA_SERVICE_TOKEN_SECRET="YQ=="
SUPPORT_ATLAS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
SUPPORT_ATLAS_OTEL_SERVICE_NAME="support_atlas"
SUPPORT_ATLAS_READ_URL="http://local.hasura.dev:7553"
SUPPORT_ATLAS_WRITE_URL="http://local.hasura.dev:7553"
SUPPORT_FUNCTIONS_AUTHORIZATION_HEADER="Bearer YQ=="
SUPPORT_FUNCTIONS_HASURA_CONNECTOR_PORT=8473
SUPPORT_FUNCTIONS_HASURA_SERVICE_TOKEN_SECRET="YQ=="
SUPPORT_FUNCTIONS_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
SUPPORT_FUNCTIONS_OTEL_SERVICE_NAME="support_functions"
SUPPORT_FUNCTIONS_READ_URL="http://local.hasura.dev:8473"
SUPPORT_FUNCTIONS_WRITE_URL="http://local.hasura.dev:8473"
SUPPORT_VECTOR_AUTHORIZATION_HEADER="Bearer YQ=="
SUPPORT_VECTOR_HASURA_SERVICE_TOKEN_SECRET="YQ=="
SUPPORT_VECTOR_OTEL_EXPORTER_OTLP_TRACES_ENDPOINT="http://local.hasura.dev:4317"
SUPPORT_VECTOR_OTEL_SERVICE_NAME="support_vector"
SUPPORT_VECTOR_READ_URL="http://local.hasura.dev:5644"
SUPPORT_VECTOR_WRITE_URL="http://local.hasura.dev:5644"
10 changes: 10 additions & 0 deletions .env.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
AUTH_AUTH_CONNECTION_URI="postgresql://postgres:[email protected]:5432/emergent_auth"
CUSTOMER_AURORA_CONNECTION_URI="postgres://postgres:[email protected]:5432/postgres"
CUSTOMER_MONGO_MONGODB_DATABASE_URI="mongodb://presales:[email protected]:27017/holotel"
JWT_SECRET="hasura-hs384-secret-vbD*K2y\[email protected]"
NETWORK_CLICKHOUSE_CLICKHOUSE_PASSWORD="hbGciOiJIUzI1NiIsInR5cCI6IkpX"
NETWORK_CLICKHOUSE_CLICKHOUSE_URL="http://local.hasura.dev:8123"
NETWORK_CLICKHOUSE_CLICKHOUSE_USERNAME="default"
NETWORK_KAFKA_SINK_CONNECTION_URI="postgresql://postgres:[email protected]:5432/emergent_holotel"
SUPPORT_ATLAS_MONGODB_DATABASE_URI="mongodb://presales:[email protected]:27017/holotel"
SUPPORT_VECTOR_CONNECTION_URI="postgresql://postgres:[email protected]:5433/postgres"
77 changes: 77 additions & 0 deletions collibra_import.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
File Name,Kind,Name,Description
"./auth/metadata/Users.hml","ObjectType","Users",""
"./auth/metadata/UpdateUsersById.hml","ObjectType","V2UpdateUsersByIdResponse","Responses from the 'v2_update_users_by_id' procedure"
"./auth/metadata/DeleteUsersById.hml","ObjectType","V2DeleteUsersByIdResponse","Responses from the 'v2_delete_users_by_id' procedure"
"./auth/metadata/InsertUsers.hml","ObjectType","V2InsertUsersResponse","Responses from the 'v2_insert_users' procedure"
"./network/metadata/UpdateTextsByTextid.hml","ObjectType","V2UpdateTextsByTextidResponse","Responses from the 'v2_update_texts_by_textid' procedure"
"./network/metadata/InsertCalls.hml","ObjectType","V2InsertCallsResponse","Responses from the 'v2_insert_calls' procedure"
"./network/metadata/DetailedUserActivityMv.hml","ObjectType","DetailedUserActivityMv",""
"./network/metadata/Texts.hml","ObjectType","Texts",""
"./network/metadata/DataUsage.hml","ObjectType","DataUsage",""
"./network/metadata/UpdateCallsByCallid.hml","ObjectType","V2UpdateCallsByCallidResponse","Responses from the 'v2_update_calls_by_callid' procedure"
"./network/metadata/DeleteTextsByTextid.hml","ObjectType","V2DeleteTextsByTextidResponse","Responses from the 'v2_delete_texts_by_textid' procedure"
"./network/metadata/NetworkPerformance.hml","ObjectType","NetworkPerformance",""
"./network/metadata/InsertTexts.hml","ObjectType","V2InsertTextsResponse","Responses from the 'v2_insert_texts' procedure"
"./network/metadata/Cdr.hml","ObjectType","Cdr",""
"./network/metadata/Calls.hml","ObjectType","Calls",""
"./network/metadata/DeleteCallsByCallid.hml","ObjectType","V2DeleteCallsByCallidResponse","Responses from the 'v2_delete_calls_by_callid' procedure"
"./support/metadata/UpdateDocumentEmbeddingsByDocumentUuid.hml","ObjectType","V2UpdateDocumentEmbeddingsByDocumentUuidResponse","Responses from the 'v2_update_document_embeddings_by_document_uuid' procedure"
"./support/metadata/DeleteDocumentsByUuid.hml","ObjectType","V2DeleteDocumentsByUuidResponse","Responses from the 'v2_delete_documents_by_uuid' procedure"
"./support/metadata/Documents.hml","ObjectType","Documents",""
"./support/metadata/DocumentEmbeddings.hml","ObjectType","DocumentEmbeddings",""
"./support/metadata/UpdateDocumentsByUuid.hml","ObjectType","V2UpdateDocumentsByUuidResponse","Responses from the 'v2_update_documents_by_uuid' procedure"
"./support/metadata/DeleteDocumentEmbeddingsByDocumentUuid.hml","ObjectType","V2DeleteDocumentEmbeddingsByDocumentUuidResponse","Responses from the 'v2_delete_document_embeddings_by_document_uuid' procedure"
"./support/metadata/InsertDocuments.hml","ObjectType","V2InsertDocumentsResponse","Responses from the 'v2_insert_documents' procedure"
"./support/metadata/UserProfiles.hml","ObjectType","UserProfiles","Object type for collection userProfiles"
"./support/metadata/InsertDocumentEmbeddings.hml","ObjectType","V2InsertDocumentEmbeddingsResponse","Responses from the 'v2_insert_document_embeddings' procedure"
"./customer/metadata-project-queries/CreditCards.hml","ObjectType","CreditCards",""
"./customer/metadata-project-queries/Billing.hml","ObjectType","Billing",""
"./customer/metadata-project-queries/Network.hml","ObjectType","Network",""
"./customer/metadata-project-queries/Customers.hml","ObjectType","Customers",""
"./customer/metadata-project-queries/CustomerLink.hml","ObjectType","CustomerLink",""
"./customer/metadata-project-queries/Deals.hml","ObjectType","Deals",""
"./customer/metadata-project-queries/Plans.hml","ObjectType","Plans",""
"./customer/metadata-project-queries/CustomerPlanDevices.hml","ObjectType","CustomerPlanDevices",""
"./customer/metadata-project-queries/Devices.hml","ObjectType","Devices",""
"./customer/metadata-project-queries/CustomerNetwork.hml","ObjectType","CustomerNetwork",""
"./customer/metadata-project-queries/CustomerPlans.hml","ObjectType","CustomerPlans",""
"./customer/metadata-project-mutations/DeleteNetworkByNodeId.hml","ObjectType","V2DeleteNetworkByNodeIdResponse","Responses from the 'v2_delete_network_by_node_id' procedure"
"./customer/metadata-project-mutations/DeleteBillingByBillingId.hml","ObjectType","V2DeleteBillingByBillingIdResponse","Responses from the 'v2_delete_billing_by_billing_id' procedure"
"./customer/metadata-project-mutations/InsertDevices.hml","ObjectType","V2InsertDevicesResponse","Responses from the 'v2_insert_devices' procedure"
"./customer/metadata-project-mutations/UpdateCustomerLinkById.hml","ObjectType","V2UpdateCustomerLinkByIdResponse","Responses from the 'v2_update_customer_link_by_id' procedure"
"./customer/metadata-project-mutations/InsertCustomerLink.hml","ObjectType","V2InsertCustomerLinkResponse","Responses from the 'v2_insert_customer_link' procedure"
"./customer/metadata-project-mutations/InsertCustomerNetwork.hml","ObjectType","V2InsertCustomerNetworkResponse","Responses from the 'v2_insert_customer_network' procedure"
"./customer/metadata-project-mutations/UpdateCustomerPlanDevicesByCustomerPlanIdAndDeviceId.hml","ObjectType","V2UpdateCustomerPlanDevicesByCustomerPlanIdAndDeviceIdResponse","Responses from the 'v2_update_customer_plan_devices_by_customer_plan_id_and_device_id' procedure"
"./customer/metadata-project-mutations/InsertCustomerPlanDevices.hml","ObjectType","V2InsertCustomerPlanDevicesResponse","Responses from the 'v2_insert_customer_plan_devices' procedure"
"./customer/metadata-project-mutations/DeleteCustomersByPhoneNumber.hml","ObjectType","V2DeleteCustomersByPhoneNumberResponse","Responses from the 'v2_delete_customers_by_phone_number' procedure"
"./customer/metadata-project-mutations/UpdateDealsByDealId.hml","ObjectType","V2UpdateDealsByDealIdResponse","Responses from the 'v2_update_deals_by_deal_id' procedure"
"./customer/metadata-project-mutations/DeleteCustomerLinkById.hml","ObjectType","V2DeleteCustomerLinkByIdResponse","Responses from the 'v2_delete_customer_link_by_id' procedure"
"./customer/metadata-project-mutations/InsertDeals.hml","ObjectType","V2InsertDealsResponse","Responses from the 'v2_insert_deals' procedure"
"./customer/metadata-project-mutations/UpdateCustomersByPhoneNumber.hml","ObjectType","V2UpdateCustomersByPhoneNumberResponse","Responses from the 'v2_update_customers_by_phone_number' procedure"
"./customer/metadata-project-mutations/DeleteCustomerPlanDevicesByCustomerPlanIdAndDeviceId.hml","ObjectType","V2DeleteCustomerPlanDevicesByCustomerPlanIdAndDeviceIdResponse","Responses from the 'v2_delete_customer_plan_devices_by_customer_plan_id_and_device_id' procedure"
"./customer/metadata-project-mutations/UpdateCustomersByCustomerId.hml","ObjectType","V2UpdateCustomersByCustomerIdResponse","Responses from the 'v2_update_customers_by_customer_id' procedure"
"./customer/metadata-project-mutations/InsertCreditCards.hml","ObjectType","V2InsertCreditCardsResponse","Responses from the 'v2_insert_credit_cards' procedure"
"./customer/metadata-project-mutations/UpdateCustomerNetworkByCustomerIdAndNodeId.hml","ObjectType","V2UpdateCustomerNetworkByCustomerIdAndNodeIdResponse","Responses from the 'v2_update_customer_network_by_customer_id_and_node_id' procedure"
"./customer/metadata-project-mutations/InsertPlans.hml","ObjectType","V2InsertPlansResponse","Responses from the 'v2_insert_plans' procedure"
"./customer/metadata-project-mutations/DeletePlansByPlanId.hml","ObjectType","V2DeletePlansByPlanIdResponse","Responses from the 'v2_delete_plans_by_plan_id' procedure"
"./customer/metadata-project-mutations/UpdatePlansByPlanName.hml","ObjectType","V2UpdatePlansByPlanNameResponse","Responses from the 'v2_update_plans_by_plan_name' procedure"
"./customer/metadata-project-mutations/DeleteCustomersByCustomerId.hml","ObjectType","V2DeleteCustomersByCustomerIdResponse","Responses from the 'v2_delete_customers_by_customer_id' procedure"
"./customer/metadata-project-mutations/UpdateCustomerLinkByCustomerId.hml","ObjectType","V2UpdateCustomerLinkByCustomerIdResponse","Responses from the 'v2_update_customer_link_by_customer_id' procedure"
"./customer/metadata-project-mutations/DeleteCustomerPlansByCustomerPlanId.hml","ObjectType","V2DeleteCustomerPlansByCustomerPlanIdResponse","Responses from the 'v2_delete_customer_plans_by_customer_plan_id' procedure"
"./customer/metadata-project-mutations/DeleteDevicesByDeviceId.hml","ObjectType","V2DeleteDevicesByDeviceIdResponse","Responses from the 'v2_delete_devices_by_device_id' procedure"
"./customer/metadata-project-mutations/UpdateNetworkByNodeId.hml","ObjectType","V2UpdateNetworkByNodeIdResponse","Responses from the 'v2_update_network_by_node_id' procedure"
"./customer/metadata-project-mutations/InsertNetwork.hml","ObjectType","V2InsertNetworkResponse","Responses from the 'v2_insert_network' procedure"
"./customer/metadata-project-mutations/DeleteCustomerNetworkByCustomerIdAndNodeId.hml","ObjectType","V2DeleteCustomerNetworkByCustomerIdAndNodeIdResponse","Responses from the 'v2_delete_customer_network_by_customer_id_and_node_id' procedure"
"./customer/metadata-project-mutations/UpdateCustomerPlansByCustomerPlanId.hml","ObjectType","V2UpdateCustomerPlansByCustomerPlanIdResponse","Responses from the 'v2_update_customer_plans_by_customer_plan_id' procedure"
"./customer/metadata-project-mutations/DeleteCustomerLinkByCustomerId.hml","ObjectType","V2DeleteCustomerLinkByCustomerIdResponse","Responses from the 'v2_delete_customer_link_by_customer_id' procedure"
"./customer/metadata-project-mutations/UpdateBillingByBillingId.hml","ObjectType","V2UpdateBillingByBillingIdResponse","Responses from the 'v2_update_billing_by_billing_id' procedure"
"./customer/metadata-project-mutations/InsertBilling.hml","ObjectType","V2InsertBillingResponse","Responses from the 'v2_insert_billing' procedure"
"./customer/metadata-project-mutations/DeleteCreditCardsByCreditCardId.hml","ObjectType","V2DeleteCreditCardsByCreditCardIdResponse","Responses from the 'v2_delete_credit_cards_by_credit_card_id' procedure"
"./customer/metadata-project-mutations/UpdateCreditCardsByCreditCardId.hml","ObjectType","V2UpdateCreditCardsByCreditCardIdResponse","Responses from the 'v2_update_credit_cards_by_credit_card_id' procedure"
"./customer/metadata-project-mutations/UpdateDevicesByDeviceId.hml","ObjectType","V2UpdateDevicesByDeviceIdResponse","Responses from the 'v2_update_devices_by_device_id' procedure"
"./customer/metadata-project-mutations/InsertCustomerPlans.hml","ObjectType","V2InsertCustomerPlansResponse","Responses from the 'v2_insert_customer_plans' procedure"
"./customer/metadata-project-mutations/DeletePlansByPlanName.hml","ObjectType","V2DeletePlansByPlanNameResponse","Responses from the 'v2_delete_plans_by_plan_name' procedure"
"./customer/metadata-project-mutations/DeleteDealsByDealId.hml","ObjectType","V2DeleteDealsByDealIdResponse","Responses from the 'v2_delete_deals_by_deal_id' procedure"
"./customer/metadata-project-mutations/InsertCustomers.hml","ObjectType","V2InsertCustomersResponse","Responses from the 'v2_insert_customers' procedure"
"./customer/metadata-project-mutations/UpdatePlansByPlanId.hml","ObjectType","V2UpdatePlansByPlanIdResponse","Responses from the 'v2_update_plans_by_plan_id' procedure"
"./customer/metadata-domain/CustomerPreferences.hml","ObjectType","CustomerPreferences","Object type for collection customerPreferences"
1 change: 1 addition & 0 deletions engine/build/auth_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"version":"v2","definition":{"mode":{"noAuth":{"role":"admin","sessionVariables":{}}}}}
1 change: 1 addition & 0 deletions engine/build/metadata.json

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions engine/build/open_dd.json

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions meta.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#!/bin/bash

# Define the directory to search
SEARCH_DIR=${1:-.}

# Output CSV file
OUTPUT_FILE="collibra_import.csv"

# Initialize CSV header
echo "File Name,Kind,Name,Description" > "$OUTPUT_FILE"

# Find all .hml files and process them
find "$SEARCH_DIR" -type f -name "*.hml" | while read -r FILE; do
# Extract YAML fragments containing 'kind: ObjectType'
YAML_FRAGMENT=$(sed -n '/kind: ObjectType/,/^\s*$/p' "$FILE")

# If a fragment was found, process it
if [ -n "$YAML_FRAGMENT" ]; then
# Convert YAML to JSON and extract relevant fields using yq or python (assuming yq is installed)
JSON_FRAGMENT=$(echo "$YAML_FRAGMENT" | yq eval -j - 2>/dev/null)

if [ $? -ne 0 ]; then
# Use python if yq is not available
JSON_FRAGMENT=$(echo "$YAML_FRAGMENT" | python3 -c 'import sys, yaml, json; print(json.dumps(yaml.safe_load(sys.stdin)))')
fi

# Extract fields from JSON using jq or python (assuming jq is installed)
NAME=$(echo "$JSON_FRAGMENT" | jq -r '.definition.name // empty')
KIND=$(echo "$JSON_FRAGMENT" | jq -r '.kind // empty')
DESCRIPTION=$(echo "$JSON_FRAGMENT" | jq -r '.definition.description // empty')

# If jq is not installed, fallback to using python for JSON parsing
if [ $? -ne 0 ]; then
NAME=$(echo "$JSON_FRAGMENT" | python3 -c 'import sys, json; print(json.loads(sys.stdin.read()).get("definition", {}).get("name", ""))')
KIND=$(echo "$JSON_FRAGMENT" | python3 -c 'import sys, json; print(json.loads(sys.stdin.read()).get("kind", ""))')
DESCRIPTION=$(echo "$JSON_FRAGMENT" | python3 -c 'import sys, json; print(json.loads(sys.stdin.read()).get("definition", {}).get("description", ""))')
fi

# Append to the CSV file
echo "\"$FILE\",\"$KIND\",\"$NAME\",\"$DESCRIPTION\"" >> "$OUTPUT_FILE"
fi
done

# Output final CSV file location
echo "CSV file created: $OUTPUT_FILE"
97 changes: 97 additions & 0 deletions queries/customer-behaviour-analysis.gql
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
query CustomerBehaviorAnalysis($customerId: Customer_Int4) {
# First get the customer guid
customerLink(where: { customerId: { _eq: $customerId } }) {
customerGuid
# Then use it in a nested query for all the data
customer {
firstName
lastName
segment
email

customerPlans {
cellNumber
startDate
plan {
planName
monthlyFee
}
customerPlanDevices {
device {
brand
model
}
}
}

customerNetworks {
network {
nodeName
status
latitude
longitude
capacity
}
}
}

# Network metrics directly from the link
NetworkPerformance {
downloadSpeed
uploadSpeed
latency
timestamp
}

DataUsage {
dataUsage
timestamp
}

CDR {
callDuration
callType
timestamp
}

# User profile through the guid
supportDB {
accountDetails {
accountNumber
registrationDate
}
supportHistory {
ticketId
issue
status
resolutionNotes
date
}
usageStats {
appUsage {
name
usage
}
callStats {
totalMinutes
internationalMinutes
}
dataUsage {
currentMonth
total
}
}
}
}

# Billing history
billing(
where: { customerId: { _eq: $customerId } }
order_by: { billingDate: Desc }
limit: 6
) {
billingDate
totalAmount
paymentStatus
}
}
Loading
Loading