create-dql-app 1.6.0 → 1.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -13
- package/bin/create-dql-app.mjs +16 -8
- package/package.json +2 -2
- package/templates/starter/README.md +55 -0
- package/templates/starter/gitignore +17 -0
- package/templates/starter/notebooks/welcome.dqlnb +35 -0
- package/templates/{jaffle-shop → starter}/package.json +7 -4
- package/templates/acme-bank/.dql/skills/mei.chen@acme-bank.com/cards-fraud.skill.md +0 -15
- package/templates/acme-bank/.dql/skills/sara.fitch@acme-bank.com/cfo-weekly.skill.md +0 -15
- package/templates/acme-bank/README.md +0 -75
- package/templates/acme-bank/apps/cards-ops/README.md +0 -9
- package/templates/acme-bank/apps/cards-ops/dashboards/daily-ops.dqld +0 -65
- package/templates/acme-bank/apps/cards-ops/dashboards/fraud-watch.dqld +0 -37
- package/templates/acme-bank/apps/cards-ops/dql.app.json +0 -89
- package/templates/acme-bank/apps/cards-ops/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/cards-ops/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/apps/executive-cockpit/README.md +0 -9
- package/templates/acme-bank/apps/executive-cockpit/dashboards/bank-overview.dqld +0 -57
- package/templates/acme-bank/apps/executive-cockpit/dql.app.json +0 -82
- package/templates/acme-bank/apps/executive-cockpit/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/executive-cockpit/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/apps/retail-deposits/README.md +0 -9
- package/templates/acme-bank/apps/retail-deposits/dashboards/deposit-growth.dqld +0 -48
- package/templates/acme-bank/apps/retail-deposits/dql.app.json +0 -59
- package/templates/acme-bank/apps/retail-deposits/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/retail-deposits/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/apps/risk-office/README.md +0 -8
- package/templates/acme-bank/apps/risk-office/dashboards/credit-risk.dqld +0 -48
- package/templates/acme-bank/apps/risk-office/dql.app.json +0 -57
- package/templates/acme-bank/apps/risk-office/drafts/.gitkeep +0 -1
- package/templates/acme-bank/apps/risk-office/notebooks/.gitkeep +0 -1
- package/templates/acme-bank/blocks/cards/card_approval_rate.dql +0 -24
- package/templates/acme-bank/blocks/cards/daily_transaction_volume.dql +0 -34
- package/templates/acme-bank/blocks/cards/fraud_alerts_by_region.dql +0 -33
- package/templates/acme-bank/blocks/cards/fraud_by_merchant_recent.dql +0 -33
- package/templates/acme-bank/blocks/deposits/branch_deposit_leaders.dql +0 -30
- package/templates/acme-bank/blocks/deposits/deposit_trend.dql +0 -30
- package/templates/acme-bank/blocks/deposits/deposits_by_segment.dql +0 -33
- package/templates/acme-bank/blocks/executive/bank_health_scorecard.dql +0 -34
- package/templates/acme-bank/blocks/lending/high_risk_loan_exposure.dql +0 -31
- package/templates/acme-bank/blocks/lending/loan_delinquency_by_region.dql +0 -32
- package/templates/acme-bank/data/customers.csv +0 -12
- package/templates/acme-bank/data/deposits.csv +0 -22
- package/templates/acme-bank/data/fraud_alerts.csv +0 -9
- package/templates/acme-bank/data/loans.csv +0 -11
- package/templates/acme-bank/data/merchants.csv +0 -10
- package/templates/acme-bank/data/transactions.csv +0 -20
- package/templates/acme-bank/dql.config.json +0 -21
- package/templates/acme-bank/notebooks/cards_fraud_ops.dqlnb +0 -47
- package/templates/acme-bank/notebooks/credit_risk_review.dqlnb +0 -42
- package/templates/acme-bank/notebooks/executive_weekly_review.dqlnb +0 -47
- package/templates/acme-bank/notebooks/retail_deposits_review.dqlnb +0 -42
- package/templates/acme-bank/notebooks/welcome.dqlnb +0 -44
- package/templates/acme-bank/package.json +0 -18
- package/templates/acme-bank/semantic-layer/dimensions/banking.yaml +0 -36
- package/templates/acme-bank/semantic-layer/metrics/banking.yaml +0 -37
- package/templates/empty/README.md +0 -19
- package/templates/empty/dql.config.json +0 -13
- package/templates/empty/notebooks/welcome.dqlnb +0 -21
- package/templates/empty/package.json +0 -13
- package/templates/jaffle-shop/README.md +0 -48
- package/templates/jaffle-shop/blocks/revenue_by_segment.dql +0 -26
- package/templates/jaffle-shop/dashboards/overview.dql +0 -27
- package/templates/jaffle-shop/notebooks/welcome.dqlnb +0 -33
- package/templates/jaffle-shop/semantic-layer/dimensions/customer.yaml +0 -14
- package/templates/jaffle-shop/semantic-layer/metrics/revenue.yaml +0 -9
- /package/templates/{jaffle-shop → starter}/dql.config.json +0 -0
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "executive-cockpit",
|
|
4
|
-
"name": "Executive Cockpit",
|
|
5
|
-
"description": "CXO scorecard that summarizes cards, fraud, deposits, and lending risk.",
|
|
6
|
-
"domain": "executive",
|
|
7
|
-
"owners": ["sara.fitch@acme-bank.com"],
|
|
8
|
-
"tags": ["executive", "cxo", "scorecard", "audience:cxo"],
|
|
9
|
-
"members": [
|
|
10
|
-
{
|
|
11
|
-
"userId": "sara.fitch@acme-bank.com",
|
|
12
|
-
"displayName": "Sara Fitch - CFO",
|
|
13
|
-
"roles": ["owner"],
|
|
14
|
-
"attributes": { "department": "finance" }
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"userId": "nora.evans@acme-bank.com",
|
|
18
|
-
"displayName": "Nora Evans - COO",
|
|
19
|
-
"roles": ["viewer"],
|
|
20
|
-
"attributes": { "department": "operations" }
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"roles": [
|
|
24
|
-
{ "id": "owner", "displayName": "Owner", "description": "Full App configuration and execution." },
|
|
25
|
-
{ "id": "analyst", "displayName": "Analyst", "description": "Can execute dashboards and review proposed blocks." },
|
|
26
|
-
{ "id": "viewer", "displayName": "Viewer", "description": "Can view and run certified dashboard tiles." }
|
|
27
|
-
],
|
|
28
|
-
"policies": [
|
|
29
|
-
{
|
|
30
|
-
"id": "executive-dashboard-execute",
|
|
31
|
-
"domain": "executive",
|
|
32
|
-
"minClassification": "internal",
|
|
33
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
34
|
-
"accessLevel": "execute",
|
|
35
|
-
"enabled": true
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "executive-cards-readthrough",
|
|
39
|
-
"domain": "cards",
|
|
40
|
-
"minClassification": "internal",
|
|
41
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
42
|
-
"accessLevel": "execute",
|
|
43
|
-
"enabled": true
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "executive-deposits-readthrough",
|
|
47
|
-
"domain": "deposits",
|
|
48
|
-
"minClassification": "internal",
|
|
49
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
50
|
-
"accessLevel": "execute",
|
|
51
|
-
"enabled": true
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"id": "executive-lending-readthrough",
|
|
55
|
-
"domain": "lending",
|
|
56
|
-
"minClassification": "internal",
|
|
57
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
58
|
-
"accessLevel": "execute",
|
|
59
|
-
"enabled": true
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"id": "executive-owner-admin",
|
|
63
|
-
"domain": "executive",
|
|
64
|
-
"minClassification": "restricted",
|
|
65
|
-
"allowedRoles": ["owner"],
|
|
66
|
-
"accessLevel": "admin",
|
|
67
|
-
"enabled": true
|
|
68
|
-
}
|
|
69
|
-
],
|
|
70
|
-
"rlsBindings": [],
|
|
71
|
-
"schedules": [
|
|
72
|
-
{
|
|
73
|
-
"id": "monday-cxo-scorecard",
|
|
74
|
-
"cron": "0 7 * * 1",
|
|
75
|
-
"dashboard": "bank-overview",
|
|
76
|
-
"deliver": [{ "kind": "slack", "channel": "#cxo-weekly" }],
|
|
77
|
-
"description": "Monday morning CXO scorecard.",
|
|
78
|
-
"enabled": true
|
|
79
|
-
}
|
|
80
|
-
],
|
|
81
|
-
"homepage": { "type": "dashboard", "id": "bank-overview" }
|
|
82
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
# Retail Deposits
|
|
2
|
-
|
|
3
|
-
Audience: retail banking leaders tracking deposit growth and branch leaders.
|
|
4
|
-
|
|
5
|
-
Homepage dashboard: `dashboards/deposit-growth.dqld`
|
|
6
|
-
|
|
7
|
-
Certified blocks stay in root `blocks/deposits/`. This App packages the
|
|
8
|
-
deposit growth dashboard with programmable OSS governance.
|
|
9
|
-
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "deposit-growth",
|
|
4
|
-
"metadata": {
|
|
5
|
-
"title": "Deposit Growth",
|
|
6
|
-
"description": "Certified deposit growth dashboard by segment, branch, and snapshot date.",
|
|
7
|
-
"domain": "deposits",
|
|
8
|
-
"tags": ["deposits", "growth", "retail"]
|
|
9
|
-
},
|
|
10
|
-
"layout": {
|
|
11
|
-
"kind": "grid",
|
|
12
|
-
"cols": 12,
|
|
13
|
-
"rowHeight": 80,
|
|
14
|
-
"items": [
|
|
15
|
-
{
|
|
16
|
-
"i": "deposit-trend",
|
|
17
|
-
"x": 0,
|
|
18
|
-
"y": 0,
|
|
19
|
-
"w": 12,
|
|
20
|
-
"h": 3,
|
|
21
|
-
"block": { "blockId": "deposit_trend" },
|
|
22
|
-
"viz": { "type": "line" },
|
|
23
|
-
"title": "Total Deposit Trend"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"i": "segment-balance",
|
|
27
|
-
"x": 0,
|
|
28
|
-
"y": 3,
|
|
29
|
-
"w": 6,
|
|
30
|
-
"h": 3,
|
|
31
|
-
"block": { "blockId": "deposits_by_segment" },
|
|
32
|
-
"viz": { "type": "bar" },
|
|
33
|
-
"title": "Deposits by Segment"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"i": "branch-leaders",
|
|
37
|
-
"x": 6,
|
|
38
|
-
"y": 3,
|
|
39
|
-
"w": 6,
|
|
40
|
-
"h": 4,
|
|
41
|
-
"block": { "blockId": "branch_deposit_leaders" },
|
|
42
|
-
"viz": { "type": "table" },
|
|
43
|
-
"title": "Branch Leaders"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "retail-deposits",
|
|
4
|
-
"name": "Retail Deposits",
|
|
5
|
-
"description": "Deposit growth and branch leaderboard App for retail banking leaders.",
|
|
6
|
-
"domain": "deposits",
|
|
7
|
-
"owners": ["diego.ramos@acme-bank.com"],
|
|
8
|
-
"tags": ["deposits", "retail", "growth", "audience:retail-leaders"],
|
|
9
|
-
"members": [
|
|
10
|
-
{
|
|
11
|
-
"userId": "diego.ramos@acme-bank.com",
|
|
12
|
-
"displayName": "Diego Ramos - Retail Analytics",
|
|
13
|
-
"roles": ["owner", "analyst"],
|
|
14
|
-
"attributes": { "department": "retail" }
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"userId": "nora.evans@acme-bank.com",
|
|
18
|
-
"displayName": "Nora Evans - Retail COO",
|
|
19
|
-
"roles": ["viewer"],
|
|
20
|
-
"attributes": { "department": "retail" }
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"roles": [
|
|
24
|
-
{ "id": "owner", "displayName": "Owner", "description": "Full App configuration and execution." },
|
|
25
|
-
{ "id": "analyst", "displayName": "Analyst", "description": "Can execute dashboards and review proposed blocks." },
|
|
26
|
-
{ "id": "viewer", "displayName": "Viewer", "description": "Can view and run certified dashboard tiles." }
|
|
27
|
-
],
|
|
28
|
-
"policies": [
|
|
29
|
-
{
|
|
30
|
-
"id": "deposits-dashboard-view",
|
|
31
|
-
"domain": "deposits",
|
|
32
|
-
"minClassification": "internal",
|
|
33
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
34
|
-
"accessLevel": "execute",
|
|
35
|
-
"enabled": true
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "deposits-owner-admin",
|
|
39
|
-
"domain": "deposits",
|
|
40
|
-
"minClassification": "restricted",
|
|
41
|
-
"allowedRoles": ["owner"],
|
|
42
|
-
"accessLevel": "admin",
|
|
43
|
-
"enabled": true
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
"rlsBindings": [],
|
|
47
|
-
"schedules": [
|
|
48
|
-
{
|
|
49
|
-
"id": "weekly-deposit-growth",
|
|
50
|
-
"cron": "0 9 * * 1",
|
|
51
|
-
"dashboard": "deposit-growth",
|
|
52
|
-
"deliver": [{ "kind": "slack", "channel": "#retail-deposits" }],
|
|
53
|
-
"description": "Weekly deposits growth digest.",
|
|
54
|
-
"enabled": true
|
|
55
|
-
}
|
|
56
|
-
],
|
|
57
|
-
"homepage": { "type": "dashboard", "id": "deposit-growth" }
|
|
58
|
-
}
|
|
59
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "credit-risk",
|
|
4
|
-
"metadata": {
|
|
5
|
-
"title": "Credit Risk",
|
|
6
|
-
"description": "Certified lending risk dashboard for delinquency and high-risk exposure.",
|
|
7
|
-
"domain": "lending",
|
|
8
|
-
"tags": ["risk", "lending", "credit-risk"]
|
|
9
|
-
},
|
|
10
|
-
"layout": {
|
|
11
|
-
"kind": "grid",
|
|
12
|
-
"cols": 12,
|
|
13
|
-
"rowHeight": 80,
|
|
14
|
-
"items": [
|
|
15
|
-
{
|
|
16
|
-
"i": "delinquency-region",
|
|
17
|
-
"x": 0,
|
|
18
|
-
"y": 0,
|
|
19
|
-
"w": 6,
|
|
20
|
-
"h": 3,
|
|
21
|
-
"block": { "blockId": "loan_delinquency_by_region" },
|
|
22
|
-
"viz": { "type": "bar" },
|
|
23
|
-
"title": "Delinquency by Region"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"i": "high-risk-exposure",
|
|
27
|
-
"x": 6,
|
|
28
|
-
"y": 0,
|
|
29
|
-
"w": 6,
|
|
30
|
-
"h": 4,
|
|
31
|
-
"block": { "blockId": "high_risk_loan_exposure" },
|
|
32
|
-
"viz": { "type": "table" },
|
|
33
|
-
"title": "High-Risk Loan Exposure"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"i": "merchant-fraud",
|
|
37
|
-
"x": 0,
|
|
38
|
-
"y": 4,
|
|
39
|
-
"w": 6,
|
|
40
|
-
"h": 3,
|
|
41
|
-
"block": { "blockId": "fraud_by_merchant_recent" },
|
|
42
|
-
"viz": { "type": "bar" },
|
|
43
|
-
"title": "Merchant Fraud Watch"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"id": "risk-office",
|
|
4
|
-
"name": "Risk Office",
|
|
5
|
-
"description": "Credit and fraud exposure App for risk management leaders.",
|
|
6
|
-
"domain": "lending",
|
|
7
|
-
"owners": ["anika.shah@acme-bank.com"],
|
|
8
|
-
"tags": ["risk", "lending", "fraud", "audience:risk-committee"],
|
|
9
|
-
"members": [
|
|
10
|
-
{
|
|
11
|
-
"userId": "anika.shah@acme-bank.com",
|
|
12
|
-
"displayName": "Anika Shah - Chief Risk Officer",
|
|
13
|
-
"roles": ["owner"],
|
|
14
|
-
"attributes": { "department": "risk" }
|
|
15
|
-
},
|
|
16
|
-
{
|
|
17
|
-
"userId": "omar.ali@acme-bank.com",
|
|
18
|
-
"displayName": "Omar Ali - Risk Analyst",
|
|
19
|
-
"roles": ["analyst"],
|
|
20
|
-
"attributes": { "department": "risk" }
|
|
21
|
-
}
|
|
22
|
-
],
|
|
23
|
-
"roles": [
|
|
24
|
-
{ "id": "owner", "displayName": "Owner", "description": "Full App configuration and execution." },
|
|
25
|
-
{ "id": "analyst", "displayName": "Analyst", "description": "Can execute dashboards and review proposed blocks." },
|
|
26
|
-
{ "id": "viewer", "displayName": "Viewer", "description": "Can view and run certified dashboard tiles." }
|
|
27
|
-
],
|
|
28
|
-
"policies": [
|
|
29
|
-
{
|
|
30
|
-
"id": "risk-dashboard-execute",
|
|
31
|
-
"domain": "lending",
|
|
32
|
-
"minClassification": "internal",
|
|
33
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
34
|
-
"accessLevel": "execute",
|
|
35
|
-
"enabled": true
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
"id": "risk-fraud-readthrough",
|
|
39
|
-
"domain": "cards",
|
|
40
|
-
"minClassification": "internal",
|
|
41
|
-
"allowedRoles": ["viewer", "analyst", "owner"],
|
|
42
|
-
"accessLevel": "execute",
|
|
43
|
-
"enabled": true
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"id": "risk-admin",
|
|
47
|
-
"domain": "lending",
|
|
48
|
-
"minClassification": "restricted",
|
|
49
|
-
"allowedRoles": ["owner"],
|
|
50
|
-
"accessLevel": "admin",
|
|
51
|
-
"enabled": true
|
|
52
|
-
}
|
|
53
|
-
],
|
|
54
|
-
"rlsBindings": [],
|
|
55
|
-
"schedules": [],
|
|
56
|
-
"homepage": { "type": "dashboard", "id": "credit-risk" }
|
|
57
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
block "card_approval_rate" {
|
|
4
|
-
domain = "cards"
|
|
5
|
-
type = "custom"
|
|
6
|
-
status = "certified"
|
|
7
|
-
description = "Card approval rate across the seeded card transaction stream."
|
|
8
|
-
tags = ["cards", "kpi", "approval-rate", "ops"]
|
|
9
|
-
owner = "mei.chen@acme-bank.com"
|
|
10
|
-
llmContext = "Use this single-value KPI when stakeholders ask about card approval rate or transaction decline pressure."
|
|
11
|
-
examples = [{ question = "What is our card approval rate?" }]
|
|
12
|
-
invariants = ["approval_rate_pct >= 0", "approval_rate_pct <= 100"]
|
|
13
|
-
query = """
|
|
14
|
-
SELECT
|
|
15
|
-
ROUND(100.0 * SUM(CASE WHEN status = 'approved' THEN 1 ELSE 0 END) / COUNT(*), 2) AS approval_rate_pct
|
|
16
|
-
FROM read_csv_auto('./data/transactions.csv')
|
|
17
|
-
"""
|
|
18
|
-
visualization {
|
|
19
|
-
chart = "single_value"
|
|
20
|
-
}
|
|
21
|
-
tests {
|
|
22
|
-
assert row_count == 1
|
|
23
|
-
}
|
|
24
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
@rls("region", "{user.region}")
|
|
4
|
-
@rls("branch_id", "{user.branch}")
|
|
5
|
-
block "daily_transaction_volume" {
|
|
6
|
-
domain = "cards"
|
|
7
|
-
type = "custom"
|
|
8
|
-
status = "certified"
|
|
9
|
-
description = "Daily approved and declined card transaction volume."
|
|
10
|
-
tags = ["cards", "volume", "daily", "ops"]
|
|
11
|
-
owner = "mei.chen@acme-bank.com"
|
|
12
|
-
llmContext = "Use for daily card transaction count, card spend volume, and approval or decline trend questions."
|
|
13
|
-
examples = [{ question = "What was card volume this week?" }, { question = "Show transaction volume by day." }]
|
|
14
|
-
invariants = ["volume_usd >= 0", "txn_count >= 0"]
|
|
15
|
-
query = """
|
|
16
|
-
SELECT
|
|
17
|
-
CAST(txn_ts AS DATE) AS day,
|
|
18
|
-
region,
|
|
19
|
-
branch_id,
|
|
20
|
-
COUNT(*) AS txn_count,
|
|
21
|
-
ROUND(SUM(amount_usd), 2) AS volume_usd
|
|
22
|
-
FROM read_csv_auto('./data/transactions.csv')
|
|
23
|
-
GROUP BY 1, 2, 3
|
|
24
|
-
ORDER BY 1, 2, 3
|
|
25
|
-
"""
|
|
26
|
-
visualization {
|
|
27
|
-
chart = "line"
|
|
28
|
-
x = "day"
|
|
29
|
-
y = "volume_usd"
|
|
30
|
-
}
|
|
31
|
-
tests {
|
|
32
|
-
assert row_count > 0
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
@rls("region", "{user.region}")
|
|
4
|
-
@rls("branch_id", "{user.branch}")
|
|
5
|
-
block "fraud_alerts_by_region" {
|
|
6
|
-
domain = "cards"
|
|
7
|
-
type = "custom"
|
|
8
|
-
status = "certified"
|
|
9
|
-
description = "Confirmed and review fraud exposure by region and branch."
|
|
10
|
-
tags = ["fraud", "cards", "ops", "risk"]
|
|
11
|
-
owner = "mei.chen@acme-bank.com"
|
|
12
|
-
llmContext = "Use this block for card fraud exposure, fraud alert counts, and branch-level fraud monitoring. It supports persona RLS on region and branch_id."
|
|
13
|
-
examples = [{ question = "Which regions have the most card fraud exposure?" }, { question = "Show fraud alerts for my branch." }]
|
|
14
|
-
invariants = ["exposure_usd >= 0", "alert_count >= 0"]
|
|
15
|
-
query = """
|
|
16
|
-
SELECT
|
|
17
|
-
region,
|
|
18
|
-
branch_id,
|
|
19
|
-
COUNT(*) AS alert_count,
|
|
20
|
-
ROUND(SUM(amount_usd), 2) AS exposure_usd
|
|
21
|
-
FROM read_csv_auto('./data/fraud_alerts.csv')
|
|
22
|
-
GROUP BY 1, 2
|
|
23
|
-
ORDER BY exposure_usd DESC
|
|
24
|
-
"""
|
|
25
|
-
visualization {
|
|
26
|
-
chart = "bar"
|
|
27
|
-
x = "region"
|
|
28
|
-
y = "exposure_usd"
|
|
29
|
-
}
|
|
30
|
-
tests {
|
|
31
|
-
assert row_count >= 0
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
block "fraud_by_merchant_recent" {
|
|
4
|
-
domain = "cards"
|
|
5
|
-
type = "custom"
|
|
6
|
-
status = "certified"
|
|
7
|
-
description = "Fraud exposure grouped by merchant and merchant risk band."
|
|
8
|
-
tags = ["fraud", "merchant", "cards", "risk"]
|
|
9
|
-
owner = "mei.chen@acme-bank.com"
|
|
10
|
-
llmContext = "Use this block when users ask which merchants are driving fraud, merchant risk, blocklist exposure, or card fraud concentration."
|
|
11
|
-
examples = [{ question = "Which merchants are driving card fraud?" }, { question = "Show fraud exposure by merchant risk band." }]
|
|
12
|
-
invariants = ["exposure_usd >= 0", "alerts >= 0"]
|
|
13
|
-
query = """
|
|
14
|
-
SELECT
|
|
15
|
-
m.merchant_name,
|
|
16
|
-
m.merchant_category,
|
|
17
|
-
m.risk_band,
|
|
18
|
-
COUNT(*) AS alerts,
|
|
19
|
-
ROUND(SUM(f.amount_usd), 2) AS exposure_usd
|
|
20
|
-
FROM read_csv_auto('./data/fraud_alerts.csv') f
|
|
21
|
-
JOIN read_csv_auto('./data/merchants.csv') m USING (merchant_id)
|
|
22
|
-
GROUP BY 1, 2, 3
|
|
23
|
-
ORDER BY exposure_usd DESC
|
|
24
|
-
"""
|
|
25
|
-
visualization {
|
|
26
|
-
chart = "bar"
|
|
27
|
-
x = "merchant_name"
|
|
28
|
-
y = "exposure_usd"
|
|
29
|
-
}
|
|
30
|
-
tests {
|
|
31
|
-
assert row_count > 0
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
block "branch_deposit_leaders" {
|
|
4
|
-
domain = "deposits"
|
|
5
|
-
type = "custom"
|
|
6
|
-
status = "certified"
|
|
7
|
-
description = "Branches ranked by current deposit balance and weekly net-new deposits."
|
|
8
|
-
tags = ["deposits", "branch", "leaderboard", "retail"]
|
|
9
|
-
owner = "diego.ramos@acme-bank.com"
|
|
10
|
-
llmContext = "Use this block for branch deposit leaderboards, branch ranking, and regional retail growth conversations."
|
|
11
|
-
examples = [{ question = "Which branches lead deposits?" }]
|
|
12
|
-
invariants = ["balance_usd >= 0"]
|
|
13
|
-
query = """
|
|
14
|
-
SELECT
|
|
15
|
-
region,
|
|
16
|
-
branch_id,
|
|
17
|
-
ROUND(SUM(balance_usd), 2) AS balance_usd,
|
|
18
|
-
ROUND(SUM(net_new_usd), 2) AS net_new_usd
|
|
19
|
-
FROM read_csv_auto('./data/deposits.csv')
|
|
20
|
-
WHERE as_of_date = (SELECT MAX(as_of_date) FROM read_csv_auto('./data/deposits.csv'))
|
|
21
|
-
GROUP BY 1, 2
|
|
22
|
-
ORDER BY balance_usd DESC
|
|
23
|
-
"""
|
|
24
|
-
visualization {
|
|
25
|
-
chart = "table"
|
|
26
|
-
}
|
|
27
|
-
tests {
|
|
28
|
-
assert row_count > 0
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
block "deposit_trend" {
|
|
4
|
-
domain = "deposits"
|
|
5
|
-
type = "custom"
|
|
6
|
-
status = "certified"
|
|
7
|
-
description = "Total deposit balance trend by snapshot date."
|
|
8
|
-
tags = ["deposits", "trend", "growth", "retail"]
|
|
9
|
-
owner = "diego.ramos@acme-bank.com"
|
|
10
|
-
llmContext = "Use for total deposit trend, retail deposit growth, and balance movement over time."
|
|
11
|
-
examples = [{ question = "Are deposits growing?" }, { question = "Show deposit balance trend." }]
|
|
12
|
-
invariants = ["balance_usd >= 0"]
|
|
13
|
-
query = """
|
|
14
|
-
SELECT
|
|
15
|
-
as_of_date,
|
|
16
|
-
ROUND(SUM(balance_usd), 2) AS balance_usd,
|
|
17
|
-
ROUND(SUM(net_new_usd), 2) AS net_new_usd
|
|
18
|
-
FROM read_csv_auto('./data/deposits.csv')
|
|
19
|
-
GROUP BY 1
|
|
20
|
-
ORDER BY 1
|
|
21
|
-
"""
|
|
22
|
-
visualization {
|
|
23
|
-
chart = "line"
|
|
24
|
-
x = "as_of_date"
|
|
25
|
-
y = "balance_usd"
|
|
26
|
-
}
|
|
27
|
-
tests {
|
|
28
|
-
assert row_count > 0
|
|
29
|
-
}
|
|
30
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
@rls("region", "{user.region}")
|
|
4
|
-
block "deposits_by_segment" {
|
|
5
|
-
domain = "deposits"
|
|
6
|
-
type = "custom"
|
|
7
|
-
status = "certified"
|
|
8
|
-
description = "Current deposit balance and net-new deposits by customer segment."
|
|
9
|
-
tags = ["deposits", "retail", "segment", "balance"]
|
|
10
|
-
owner = "diego.ramos@acme-bank.com"
|
|
11
|
-
llmContext = "Use for deposit balances, net-new deposits, and segment mix questions in the retail deposits domain."
|
|
12
|
-
examples = [{ question = "Which customer segments hold the most deposits?" }, { question = "How much net-new deposit growth did we see?" }]
|
|
13
|
-
invariants = ["balance_usd >= 0"]
|
|
14
|
-
query = """
|
|
15
|
-
SELECT
|
|
16
|
-
segment,
|
|
17
|
-
region,
|
|
18
|
-
ROUND(SUM(balance_usd), 2) AS balance_usd,
|
|
19
|
-
ROUND(SUM(net_new_usd), 2) AS net_new_usd
|
|
20
|
-
FROM read_csv_auto('./data/deposits.csv')
|
|
21
|
-
WHERE as_of_date = (SELECT MAX(as_of_date) FROM read_csv_auto('./data/deposits.csv'))
|
|
22
|
-
GROUP BY 1, 2
|
|
23
|
-
ORDER BY balance_usd DESC
|
|
24
|
-
"""
|
|
25
|
-
visualization {
|
|
26
|
-
chart = "bar"
|
|
27
|
-
x = "segment"
|
|
28
|
-
y = "balance_usd"
|
|
29
|
-
}
|
|
30
|
-
tests {
|
|
31
|
-
assert row_count > 0
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
block "bank_health_scorecard" {
|
|
4
|
-
domain = "executive"
|
|
5
|
-
type = "custom"
|
|
6
|
-
status = "certified"
|
|
7
|
-
description = "Executive scorecard with cards volume, fraud exposure, deposits, and high-risk lending exposure."
|
|
8
|
-
tags = ["executive", "cxo", "scorecard", "bank-health"]
|
|
9
|
-
owner = "sara.fitch@acme-bank.com"
|
|
10
|
-
llmContext = "Use for CXO questions about overall Acme Bank health across cards, fraud, deposits, and lending risk."
|
|
11
|
-
examples = [{ question = "Give me the bank health scorecard." }, { question = "What should the CFO review this week?" }]
|
|
12
|
-
invariants = ["metric_value >= 0"]
|
|
13
|
-
query = """
|
|
14
|
-
SELECT 'card_volume_usd' AS metric, ROUND(SUM(amount_usd), 2) AS metric_value
|
|
15
|
-
FROM read_csv_auto('./data/transactions.csv')
|
|
16
|
-
UNION ALL
|
|
17
|
-
SELECT 'fraud_exposure_usd' AS metric, ROUND(SUM(amount_usd), 2) AS metric_value
|
|
18
|
-
FROM read_csv_auto('./data/fraud_alerts.csv')
|
|
19
|
-
UNION ALL
|
|
20
|
-
SELECT 'current_deposits_usd' AS metric, ROUND(SUM(balance_usd), 2) AS metric_value
|
|
21
|
-
FROM read_csv_auto('./data/deposits.csv')
|
|
22
|
-
WHERE as_of_date = (SELECT MAX(as_of_date) FROM read_csv_auto('./data/deposits.csv'))
|
|
23
|
-
UNION ALL
|
|
24
|
-
SELECT 'high_risk_loans_usd' AS metric, ROUND(SUM(outstanding_usd), 2) AS metric_value
|
|
25
|
-
FROM read_csv_auto('./data/loans.csv')
|
|
26
|
-
WHERE risk_grade IN ('C', 'D')
|
|
27
|
-
"""
|
|
28
|
-
visualization {
|
|
29
|
-
chart = "table"
|
|
30
|
-
}
|
|
31
|
-
tests {
|
|
32
|
-
assert row_count == 4
|
|
33
|
-
}
|
|
34
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
block "high_risk_loan_exposure" {
|
|
4
|
-
domain = "lending"
|
|
5
|
-
type = "custom"
|
|
6
|
-
status = "certified"
|
|
7
|
-
description = "High-risk loan exposure for risk grades C and D."
|
|
8
|
-
tags = ["lending", "credit-risk", "exposure", "risk"]
|
|
9
|
-
owner = "anika.shah@acme-bank.com"
|
|
10
|
-
llmContext = "Use for high-risk loan exposure, watchlist balances, risk grades C and D, and credit-risk committee reviews."
|
|
11
|
-
examples = [{ question = "How much exposure is in high-risk loans?" }, { question = "Show the credit watchlist." }]
|
|
12
|
-
invariants = ["outstanding_usd >= 0"]
|
|
13
|
-
query = """
|
|
14
|
-
SELECT
|
|
15
|
-
risk_grade,
|
|
16
|
-
product,
|
|
17
|
-
COUNT(*) AS loans,
|
|
18
|
-
ROUND(SUM(outstanding_usd), 2) AS outstanding_usd,
|
|
19
|
-
ROUND(AVG(probability_default), 4) AS avg_probability_default
|
|
20
|
-
FROM read_csv_auto('./data/loans.csv')
|
|
21
|
-
WHERE risk_grade IN ('C', 'D')
|
|
22
|
-
GROUP BY 1, 2
|
|
23
|
-
ORDER BY outstanding_usd DESC
|
|
24
|
-
"""
|
|
25
|
-
visualization {
|
|
26
|
-
chart = "table"
|
|
27
|
-
}
|
|
28
|
-
tests {
|
|
29
|
-
assert row_count > 0
|
|
30
|
-
}
|
|
31
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
// dql-format: 1
|
|
2
|
-
|
|
3
|
-
@rls("region", "{user.region}")
|
|
4
|
-
block "loan_delinquency_by_region" {
|
|
5
|
-
domain = "lending"
|
|
6
|
-
type = "custom"
|
|
7
|
-
status = "certified"
|
|
8
|
-
description = "Loan delinquency exposure by region."
|
|
9
|
-
tags = ["lending", "credit-risk", "delinquency", "risk"]
|
|
10
|
-
owner = "anika.shah@acme-bank.com"
|
|
11
|
-
llmContext = "Use for delinquent loan exposure, days-past-due summaries, and regional lending risk questions."
|
|
12
|
-
examples = [{ question = "Which regions have the most delinquent loan exposure?" }, { question = "Show credit risk by region." }]
|
|
13
|
-
invariants = ["delinquent_balance_usd >= 0"]
|
|
14
|
-
query = """
|
|
15
|
-
SELECT
|
|
16
|
-
region,
|
|
17
|
-
COUNT(*) AS loan_count,
|
|
18
|
-
ROUND(SUM(CASE WHEN days_past_due >= 30 THEN outstanding_usd ELSE 0 END), 2) AS delinquent_balance_usd,
|
|
19
|
-
ROUND(AVG(probability_default), 4) AS avg_probability_default
|
|
20
|
-
FROM read_csv_auto('./data/loans.csv')
|
|
21
|
-
GROUP BY 1
|
|
22
|
-
ORDER BY delinquent_balance_usd DESC
|
|
23
|
-
"""
|
|
24
|
-
visualization {
|
|
25
|
-
chart = "bar"
|
|
26
|
-
x = "region"
|
|
27
|
-
y = "delinquent_balance_usd"
|
|
28
|
-
}
|
|
29
|
-
tests {
|
|
30
|
-
assert row_count > 0
|
|
31
|
-
}
|
|
32
|
-
}
|