dtcsVersion: "1.0.0"
id: "customer.normalize"
name: "Normalize Customer"
version: "0.1.0"

inputs:
  - id: "customer_raw"
    schema:
      fields:
        - name: "customer_id"
          type: "string"
          nullable: false
        - name: "email"
          type: "string"
          nullable: true

outputs:
  - id: "customer_clean"
    schema:
      fields:
        - name: "customer_id"
          type: "string"
          nullable: false
        - name: "email"
          type: "string"
          nullable: true

semanticActions:
  - id: "normalize_email"
    action: "dtcs:lowercase"
    target: "customer_raw.email"

rules:
  - id: "customer_id_required"
    rule: "dtcs:not_null"
    target: "customer_raw.customer_id"
    phase: "postcondition"

lineage:
  mappings:
    - output: "customer_clean"
      inputs: ["customer_raw"]
