-
Notifications
You must be signed in to change notification settings - Fork 2
/
example_datacontract.yaml
117 lines (117 loc) · 3.09 KB
/
example_datacontract.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
dataContractSpecification: "0.9.3"
id: "shipment-data-contract"
info:
title: "Shipment Data Contract"
version: "1.0.0"
status: "active"
description: "Data contract for shipment information."
owner: "Logistics Team"
contact:
name: "Logistics Support"
email: "[email protected]"
servers:
S3:
type: "s3"
location: "s3://logistics-data/shipments"
format: "json"
models:
shipments:
description: "Details of each shipment."
type: "table"
fields:
shipment_id:
type: "string"
description: "Unique identifier for the shipment."
primary: true
required: true
sender:
type: "string"
description: "Name of the sender."
required: true
recipient:
type: "string"
description: "Name of the recipient."
required: true
origin:
type: "string"
description: "Origin location of the shipment."
required: true
destination:
type: "string"
description: "Destination location of the shipment."
required: true
weight:
type: "decimal"
description: "Weight of the shipment in kilograms."
precision: 10
scale: 2
required: true
shipped_date:
type: "timestamp"
description: "Date and time when the shipment was sent."
required: true
delivery_date:
type: "timestamp"
description: "Date and time when the shipment was delivered."
status:
type: "string"
description: "Current status of the shipment."
enum: ["pending", "shipped", "in_transit", "delivered", "canceled"]
required: true
examples:
- type: "json"
model: "shipments"
data:
- shipment_id: "SHIP12345"
sender: "Company A"
recipient: "Customer B"
origin: "New York, NY"
destination: "San Francisco, CA"
weight: 15.75
shipped_date: "2023-06-01T10:00:00Z"
delivery_date: "2023-06-03T15:30:00Z"
status: "delivered"
- type: "json"
model: "shipments"
data:
- shipment_id: "SHIP12346"
sender: "Company C"
recipient: "Customer D"
origin: "Los Angeles, CA"
destination: "Seattle, WA"
weight: 5.20
shipped_date: "2023-06-01T11:00:00Z"
status: "in_transit"
quality:
type: "SodaCL"
specification: |
checks for shipments:
- schema:
fail:
when required column missing:
- shipment_id
- sender
- recipient
- origin
- destination
- weight
- shipped_date
- status
- values in shipment_id:
must not be null:
fail:
count: 1
- values in weight:
must not be null:
fail:
count: 1
must be between 0 and 1000:
fail:
count: 1
- values in status:
must be in:
- pending
- shipped
- in_transit
- delivered
- canceled