schema_version: 0.1.0
kind: source
id: source.nexuscrm.processinstanceworkitem_s3_snapshot
name: nexuscrm ProcessInstanceWorkitem S3 snapshot export
version: 0.1.0
owner:
  type: team
  name: data-platform
domain:
  name: crm
purpose: Source-faithful per-snapshot Parquet export of nexuscrm.ProcessInstanceWorkitem
  from TiDB Cloud Essential to S3, consumed by the lakehouse load stage.
usage:
  intended:
  - Bulk load into the raw lakehouse layer
  - Audit and provenance of exported snapshots
  prohibited:
  - Direct analytical querying (load into a contracted product first).
  - Treating a single snapshot as an intra-day event stream.
source:
  kind: database
  system: tidbcloud
  description: TiDB Cloud Essential nexuscrm.ProcessInstanceWorkitem
  identifiers:
    database: nexuscrm
    table: ProcessInstanceWorkitem
    cluster_id: '10996361222721502359'
assets:
- id: processinstanceworkitem_s3_snapshot
  kind: file
  ref: s3://pingcap-datalake-nexuscrm-export-247906201378-us-west-2/tidb-essential/snapshots/source=nexuscrm/
  materialization: external
  produced_by:
    kind: python
    ref: ingestion.extract.tidbcloud.engine.export
schema:
  kind: relational
  columns:
  - name: id
    type: varchar(255)
    nullable: false
  - name: processinstanceid
    type: varchar(255)
    nullable: false
  - name: actorid
    type: varchar(255)
    nullable: false
  - name: actorid_type
    type: varchar(255)
    nullable: true
  - name: originalactorid
    type: varchar(255)
    nullable: true
  - name: originalactorid_type
    type: varchar(255)
    nullable: true
  - name: comments
    type: text
    nullable: true
  - name: createddate
    type: datetime
    nullable: false
  - name: lastmodifieddate
    type: datetime
    nullable: false
freshness:
  max_age: PT48H
  degrade_after: PT30H
tests:
- id: processinstanceworkitem_source_smoke
  type: sql
  severity: informational
  description: Placeholder informational smoke check for the source contract of processinstanceworkitem.
    Replace with concrete row-count, freshness, or key-uniqueness assertions.
  sql: select 1
governance:
  classifications:
  - customer_data
  - restricted
  access:
    default: restricted
  retention:
    period: P7D
  audit:
    required: true
    events:
    - export
    - agent_action
agent_permissions:
  default: deny
compatibility:
  change_policy: semver
extensions:
  primary_key:
  - Id
  watermark_columns:
  - LastModifiedDate
  row_estimate: 0
  known_blind_spots:
  - Intra-snapshot changes are collapsed.
  - Insert-then-delete between snapshots is invisible.
  - Schema drift requires review before promotion.
