# Quotation Semantic Layer - Data Flow DAG
# SAP Source -> Snowflake -> dbt Transforms -> Semantic Views -> Cortex -> Chatbot Output
graph LR
SAP["🗄️ SAP ERP System
(Sales & Discount Data)"]
EXT["📥 Snowflake
External Stage"]
RAW["raw.quotations
raw.discount_conditions"]
STG["STAGING Layer
stg_quotes
stg_discount_conditions
stg_product_master"]
TRF["TRANSFORM Layer
trf_quotation
trf_chatbot_quotation"]
DIM["Reference Dimensions
dim_customer_discount_policy
dim_product_portfolio
fct_agreement_discounts"]
SEMA["SEMANTIC LAYER
sv_quotation
sv_chatbot_quotation"]
CORTEX["Cortex Analytics
Guardrails & Information Protection
Access Control
Freshness Contract"]
UI["Snowflake UI
(BI Dashboard)"]
CHAT["🤖 Internal Workspace
(Chatbot)"]
SAP -->|Daily Batch 05:00 UTC| EXT
EXT -->|Load| RAW
RAW -->|Column mapping
Type casting| STG
STG -->|Join dimensions
Calculate discounts
Apply governance flags| TRF
DIM -->|Enrich with policies| TRF
TRF -->|Expose semantic
business logic
Hide implementation| SEMA
SEMA -->|Apply guardrails
Protect sensitive information
Enforce freshness| CORTEX
CORTEX -->|Query & Visualize| UI
CORTEX -->|LLM consumption
Prompt engineering layer| CHAT
CHAT -->|<1 min
Quote Answers| USER["👤 Sales & Ops
Team"]
UI -->|Dashboard
Reporting| OPS["📊 Operations
Team"]
SEMA -.->|Data Contract
Lineage| AUDIT["🔒 Audit & Compliance
- Access logs
- Policy changes
- Exception escalations"]
style SAP fill:#d4a574
style CORTEX fill:#ff9999
style SEMA fill:#99ccff
style CHAT fill:#99ff99
style USER fill:#ffcc99
style AUDIT fill:#cc99ff
classDef layer_raw fill:#e1e4e8
classDef layer_stg fill:#d0d7de
classDef layer_trf fill:#adb8c1
classDef layer_sema fill:#6e7681
class RAW layer_raw
class STG layer_stg
class TRF layer_trf
class SEMA layer_sema