-
Notifications
You must be signed in to change notification settings - Fork 1
/
lifecoach.xsd
executable file
·194 lines (168 loc) · 7.59 KB
/
lifecoach.xsd
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<!-- Contains all types of data elements used in lifecoach application-->
<xs:element name="lifecoach">
<xs:complexType>
<xs:all>
<xs:element ref="users" minOccurs="0" />
<xs:element ref="products" minOccurs="0" />
<xs:element ref="quotes" minOccurs="0" />
</xs:all>
</xs:complexType>
</xs:element>
<!-- List of users. Each user element contains the goals, measures, schedules and mealLogs related to the user -->
<xs:element name="users">
<xs:complexType>
<xs:sequence>
<xs:element ref="user" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- List of food products -->
<xs:element name="products">
<xs:complexType>
<xs:sequence>
<xs:element name="product" type="product" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- List of quotes -->
<xs:element name="quotes">
<xs:complexType>
<xs:sequence>
<xs:element ref="quote" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<!-- local source -->
<xs:element name="datapoint" type="datapoint"/>
<xs:element name="goal" type="goal"/>
<xs:element name="mealLog" type="mealLog"/>
<xs:element name="measure" type="measure"/>
<xs:element name="schedule" type="schedule"/>
<xs:element name="user" type="user"/>
<!-- external source -->
<xs:element name="product" type="product"/>
<xs:element name="productScore" type="productScore"/>
<xs:element name="nutrient" type="nutrient"/>
<xs:element name="quote" type="quote_type"/>
<!-- Local database schema objects -->
<xs:complexType name="user">
<xs:sequence>
<xs:element name="name" type="xs:string"/>
<xs:element name="username" type="xs:string"/>
<xs:element name="accessToken" type="xs:string" minOccurs="0"/>
<xs:element name="password" type="xs:string"/>
<xs:element name="status" type="xs:boolean"/>
<xs:element name="gender" type="xs:string" minOccurs="0"/>
<xs:element name="dateOfBirth" type="xs:long" minOccurs="0"/>
<xs:element name="location" type="xs:string" minOccurs="0"/>
<xs:element name="mobileNum" type="xs:string" minOccurs="0"/>
<xs:element name="email" type="xs:string" />
<xs:element name="profilePhoto" type="xs:string" minOccurs="0"/>
<xs:element name="goals" type="goal" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="mealLogs" type="mealLog" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="measures" type="measure" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="schedules" type="schedule" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="goal">
<xs:sequence>
<xs:element name="id" type="xs:long"/>
<xs:element name="title" type="xs:string"/>
<xs:element name="status" type="xs:string"/>
<xs:element name="goalType" type="xs:string" />
<xs:element name="goalDate" type="xs:long"/>
<xs:element name="goalTag" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="goalValue" type="xs:double"/>
<xs:element name="goalValueUnit" type="xs:string"/>
<xs:element name="initialValue" type="xs:double"/>
<xs:element name="initialValueUnit" type="xs:string"/>
<xs:element name="plannedDirection" type="xs:int"/>
<xs:element name="rate" type="xs:double"/>
<xs:element name="rateType" type="xs:string"/>
<xs:element name="rateUnit" type="xs:string"/>
<xs:element name="measures" type="measure" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="datapoints" type="datapoint" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="updatedTime" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="datapoint">
<xs:sequence>
<xs:element name="id" type="xs:long"/>
<xs:element name="value" type="xs:double"/>
<xs:element name="valueUnit" type="xs:string"/>
<xs:element name="timestamp" type="xs:long"/>
<xs:element name="comment" type="xs:string" minOccurs="0"/>
<xs:element name="updatedTime" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="mealLog">
<xs:sequence>
<xs:element name="id" type="xs:long"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="calories" type="xs:int"/>
<xs:element name="typeOfMeal" type="xs:string" minOccurs="0"/>
<xs:element name="servingSize" type="xs:double" minOccurs="0"/>
<xs:element name="servingSizeUnit" type="xs:string" minOccurs="0"/>
<xs:element name="servingTime" type="xs:string" />
<xs:element name="updatedTime" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="measure">
<xs:sequence>
<xs:element name="id" type="xs:long"/>
<xs:element name="name" type="xs:string"/>
<xs:element name="value" type="xs:double"/>
<xs:element name="valueUnit" type="xs:string"/>
<xs:element name="datapoints" type="datapoint" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="updateTime" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="schedule">
<xs:sequence>
<xs:element name="id" type="xs:long"/>
<xs:element name="title" type="xs:string"/>
<xs:element name="desc" type="xs:string" minOccurs="0"/>
<xs:element name="startTime" type="xs:long"/>
<xs:element name="endTime" type="xs:long" minOccurs="0"/>
<xs:element name="type" type="xs:string" minOccurs="0"/>
<xs:element name="updatedTime" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<!-- Objects retrieved from external sources using adapters -->
<!-- From FoodEssentials API -->
<xs:complexType name="product">
<xs:sequence>
<xs:element name="upc" type="xs:string" minOccurs="0"/>
<xs:element name="prodName" type="xs:string" minOccurs="0"/>
<xs:element name="description" type="xs:string" minOccurs="0"/>
<xs:element name="brand" type="xs:string" minOccurs="0"/>
<xs:element name="manufacturer" type="xs:string" minOccurs="0"/>
<xs:element name="prodSize" type="xs:string" minOccurs="0"/>
<xs:element ref="productScore" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="productScore">
<xs:sequence>
<xs:element name="upc" type="xs:string" minOccurs="0"/>
<xs:element name="nutrients" type="nutrient" nillable="true" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="score" type="xs:long"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="nutrient">
<xs:sequence>
<xs:element name="nutrientName" type="xs:string" minOccurs="0"/>
<xs:element name="nutrientValue" type="xs:string" minOccurs="0"/>
<xs:element name="nutrientUom" type="xs:string" minOccurs="0"/>
<xs:element name="nutrientFeLevel" type="xs:string" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<!-- From www.stands4.com quotes API -->
<xs:complexType name="quote_type">
<xs:sequence>
<xs:element name="text" type="xs:string"/>
<xs:element name="author" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>