← Voltar para templates
CRM
salesGerencie contatos, empresas e negócios no seu funil de vendas.
Coleções
Contacts
People and their contact information
Campos do Schema
name:stringemail:stringphone:stringcompany:stringtitle:stringsource:stringnotes:string
Companies
Organizations and accounts
Campos do Schema
name:stringdomain:stringindustry:stringsize:stringannual_revenue:number
Deals
Sales opportunities and pipeline
Campos do Schema
title:stringamount:numbercurrency:stringstage:stringclose_date:stringprobability:number
Relacionamentos
contacts
works_at
companiesContact works at companycontacts
owns_deal
dealsContact owns or is associated with dealConsultas de Exemplo
Consulte os dados deste template usando o endpoint SQL.
Pipeline by stage
Total deal value and count grouped by pipeline stage.
SELECT
data.stage.:String as stage,
count() as deal_count,
sum(CAST(data.amount, 'Float64')) as total_value
FROM records FINAL
WHERE workspace_id = {workspace_id:String}
AND collection = 'deals'
AND deleted = false
GROUP BY stage
ORDER BY total_value DESCWeighted pipeline
Calculate expected revenue by multiplying deal amounts by their close probability.
SELECT
data.title.:String as deal,
data.stage.:String as stage,
CAST(data.amount, 'Float64') as amount,
CAST(data.probability, 'Float64') as probability,
CAST(data.amount, 'Float64') * CAST(data.probability, 'Float64') / 100 as expected_revenue
FROM records FINAL
WHERE workspace_id = {workspace_id:String}
AND collection = 'deals'
AND deleted = false
AND data.stage.:String NOT IN ('closed_won', 'closed_lost')
ORDER BY expected_revenue DESCContacts by source
Count contacts grouped by acquisition source.
SELECT
data.source.:String as source,
count() as contact_count
FROM records FINAL
WHERE workspace_id = {workspace_id:String}
AND collection = 'contacts'
AND deleted = false
GROUP BY source
ORDER BY contact_count DESCDeals closing this month
Find deals with a close date in the current month.
SELECT
data.title.:String as deal,
data.stage.:String as stage,
CAST(data.amount, 'Float64') as amount,
data.close_date.:String as close_date
FROM records FINAL
WHERE workspace_id = {workspace_id:String}
AND collection = 'deals'
AND deleted = false
AND toYYYYMM(CAST(data.close_date.:String, 'Date')) = toYYYYMM(today())
ORDER BY close_date ASCInício Rápido
Crie as coleções usando o Rekor CLI:
rekor collections upsert contacts --workspace my-crm --schema @contacts.jsonSchema Completo (JSON)
Copie a definição completa do template:
{
"collections": [
{
"id": "contacts",
"name": "Contacts",
"description": "People and their contact information",
"icon": "user",
"color": "#3b82f6",
"json_schema": {
"type": "object",
"required": [
"name",
"email"
],
"properties": {
"name": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
},
"phone": {
"type": "string"
},
"company": {
"type": "string"
},
"title": {
"type": "string"
},
"source": {
"type": "string",
"enum": [
"inbound",
"outbound",
"referral",
"organic"
]
},
"notes": {
"type": "string"
}
}
}
},
{
"id": "companies",
"name": "Companies",
"description": "Organizations and accounts",
"icon": "building",
"color": "#8b5cf6",
"json_schema": {
"type": "object",
"required": [
"name"
],
"properties": {
"name": {
"type": "string"
},
"domain": {
"type": "string"
},
"industry": {
"type": "string"
},
"size": {
"type": "string",
"enum": [
"1-10",
"11-50",
"51-200",
"201-1000",
"1000+"
]
},
"annual_revenue": {
"type": "number"
}
}
}
},
{
"id": "deals",
"name": "Deals",
"description": "Sales opportunities and pipeline",
"icon": "dollar-sign",
"color": "#22c55e",
"json_schema": {
"type": "object",
"required": [
"title",
"amount",
"stage"
],
"properties": {
"title": {
"type": "string"
},
"amount": {
"type": "number",
"minimum": 0
},
"currency": {
"type": "string",
"enum": [
"USD",
"EUR",
"GBP",
"BRL"
],
"default": "USD"
},
"stage": {
"type": "string",
"enum": [
"lead",
"qualified",
"proposal",
"negotiation",
"closed_won",
"closed_lost"
]
},
"close_date": {
"type": "string",
"format": "date"
},
"probability": {
"type": "number",
"minimum": 0,
"maximum": 100
}
}
}
}
],
"relationships": [
{
"type": "works_at",
"source": "contacts",
"target": "companies",
"description": "Contact works at company"
},
{
"type": "owns_deal",
"source": "contacts",
"target": "deals",
"description": "Contact owns or is associated with deal"
}
]
}