activefacts-examples 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +10 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +22 -0
  8. data/Rakefile +6 -0
  9. data/activefacts-examples.gemspec +26 -0
  10. data/cql/Address.cql +44 -0
  11. data/cql/Astronomy.cql +35 -0
  12. data/cql/Blog.cql +54 -0
  13. data/cql/CinemaBookings.cql +64 -0
  14. data/cql/CinemaTickets.cql +127 -0
  15. data/cql/CompanyDirectorEmployee.cql +56 -0
  16. data/cql/Death.cql +17 -0
  17. data/cql/Diplomacy.cql +48 -0
  18. data/cql/Genealogy.cql +98 -0
  19. data/cql/Health.cql +78 -0
  20. data/cql/Insurance.cql +320 -0
  21. data/cql/Marriage.cql +18 -0
  22. data/cql/Metamodel.cql +567 -0
  23. data/cql/Monogamy.cql +24 -0
  24. data/cql/MultiInheritance.cql +22 -0
  25. data/cql/MultipleSubtyping.cql +30 -0
  26. data/cql/NonRoleId.cql +14 -0
  27. data/cql/OddIdentifier.cql +18 -0
  28. data/cql/OilSupply.cql +53 -0
  29. data/cql/OneRoleNesting.cql +38 -0
  30. data/cql/OneToOnes.cql +17 -0
  31. data/cql/Orienteering.cql +111 -0
  32. data/cql/PartyModel.cql +38 -0
  33. data/cql/PersonPlaysGame.cql +18 -0
  34. data/cql/RedundantDependency.cql +34 -0
  35. data/cql/SchoolActivities.cql +33 -0
  36. data/cql/SeparateSubtype.cql +30 -0
  37. data/cql/ServiceDirector.cql +276 -0
  38. data/cql/SimplestUnary.cql +12 -0
  39. data/cql/Supervision.cql +34 -0
  40. data/cql/VenueSeating.cql +45 -0
  41. data/cql/WaiterTips.cql +33 -0
  42. data/cql/Warehousing.cql +101 -0
  43. data/cql/WindowInRoomInBldg.cql +28 -0
  44. data/cql/unit.cql +474 -0
  45. data/diagrams/json/Address.json +41 -0
  46. data/diagrams/json/Astronomy.json +31 -0
  47. data/diagrams/json/Blog.json +46 -0
  48. data/diagrams/json/CinemaBookings.json +53 -0
  49. data/diagrams/json/CinemaTickets.json +101 -0
  50. data/diagrams/json/CompanyDirectorEmployee.json +44 -0
  51. data/diagrams/json/Death.json +20 -0
  52. data/diagrams/json/Diplomacy.json +34 -0
  53. data/diagrams/json/Genealogy.json +78 -0
  54. data/diagrams/json/Insurance.json +259 -0
  55. data/diagrams/json/Marriage.json +21 -0
  56. data/diagrams/json/Metamodel.json +318 -0
  57. data/diagrams/json/Monogamy.json +22 -0
  58. data/diagrams/json/MultiInheritance.json +25 -0
  59. data/diagrams/json/MultipleSubtyping.json +22 -0
  60. data/diagrams/json/OilSupply.json +49 -0
  61. data/diagrams/json/OneRoleNesting.json +37 -0
  62. data/diagrams/json/Orienteering.json +94 -0
  63. data/diagrams/json/PersonPlaysGame.json +22 -0
  64. data/diagrams/json/RedundantDependency.json +33 -0
  65. data/diagrams/json/SchoolActivities.json +28 -0
  66. data/diagrams/json/SeparateSubtype.json +29 -0
  67. data/diagrams/json/SimplestUnary.json +15 -0
  68. data/diagrams/json/Supervision.json +27 -0
  69. data/diagrams/json/VenueSeating.json +40 -0
  70. data/diagrams/json/WaiterTips.json +29 -0
  71. data/diagrams/json/Warehousing.json +86 -0
  72. data/diagrams/json/WindowInRoomInBldg.json +31 -0
  73. data/images/Address.SQL.png +0 -0
  74. data/images/Address.png +0 -0
  75. data/images/Blog.png +0 -0
  76. data/images/CinemaBookings.png +0 -0
  77. data/images/CinemaTickets.png +0 -0
  78. data/images/CompanyDirectorEmployee.png +0 -0
  79. data/images/Death.png +0 -0
  80. data/images/Diplomacy.png +0 -0
  81. data/images/DumpMetamodel.bat +2 -0
  82. data/images/Genealogy.png +0 -0
  83. data/images/Insurance/Claim.png +0 -0
  84. data/images/Insurance/Insurance.png +0 -0
  85. data/images/Insurance/Person.png +0 -0
  86. data/images/Insurance/Policy.png +0 -0
  87. data/images/Insurance/Related.png +0 -0
  88. data/images/Insurance/VehicleIncident.png +0 -0
  89. data/images/Marriage.png +0 -0
  90. data/images/Metamodel/Concepts.png +0 -0
  91. data/images/Metamodel/Constraints.png +0 -0
  92. data/images/Metamodel/ContextNote.png +0 -0
  93. data/images/Metamodel/Diagrams.png +0 -0
  94. data/images/Metamodel/Language.png +0 -0
  95. data/images/Metamodel/Legacy.png +0 -0
  96. data/images/Metamodel/Objects.png +0 -0
  97. data/images/Metamodel/Populations.png +0 -0
  98. data/images/Metamodel/Query.png +0 -0
  99. data/images/Metamodel/Units.png +0 -0
  100. data/images/Metamodel/ValueConstraints.png +0 -0
  101. data/images/Metamodel/ValueTypes.png +0 -0
  102. data/images/MetamodelER.bcp +1 -0
  103. data/images/MetamodelER.pdf +0 -0
  104. data/images/MultiInheritance.png +0 -0
  105. data/images/NorthwindER.png +0 -0
  106. data/images/OilSupply.png +0 -0
  107. data/images/Orienteering/Administration.png +0 -0
  108. data/images/Orienteering/Registration.png +0 -0
  109. data/images/Orienteering/Scoring.png +0 -0
  110. data/images/PersonPlaysGame.png +0 -0
  111. data/images/RedundantDependency.png +0 -0
  112. data/images/SchoolActivities.png +0 -0
  113. data/images/SeparateSubtype.png +0 -0
  114. data/images/SimplestUnary.png +0 -0
  115. data/images/Supervision.png +0 -0
  116. data/images/VenueSeating.png +0 -0
  117. data/images/WaiterTips.png +0 -0
  118. data/images/Warehousing.png +0 -0
  119. data/images/WindowInRoomInBldg.png +0 -0
  120. data/metadata/json/Astronomy.json +175 -0
  121. data/metadata/json/CinemaBookings.json +354 -0
  122. data/metadata/json/CinemaTickets.json +768 -0
  123. data/metadata/json/CompanyDirectorEmployee.json +270 -0
  124. data/metadata/json/Diplomacy.json +186 -0
  125. data/metadata/json/Metamodel.json +3214 -0
  126. data/metadata/json/OilSupply.json +411 -0
  127. data/metadata/json/SeparateSubtype.json +157 -0
  128. data/metadata/json/Supervision.json +128 -0
  129. data/metadata/json/VenueSeating.json +209 -0
  130. data/orm/.gitignore +11 -0
  131. data/orm/Address.orm +1268 -0
  132. data/orm/Astronomy.orm +925 -0
  133. data/orm/Blog.orm +1711 -0
  134. data/orm/CinemaBookings.orm +1998 -0
  135. data/orm/CinemaTickets.orm +5060 -0
  136. data/orm/CompanyDirectorEmployee.orm +2094 -0
  137. data/orm/Death.orm +386 -0
  138. data/orm/Diplomacy.orm +1478 -0
  139. data/orm/ExampleModels2010.csproj +764 -0
  140. data/orm/ExampleModels2010.sln +16 -0
  141. data/orm/Genealogy.orm +3209 -0
  142. data/orm/Health.orm +2407 -0
  143. data/orm/Insurance.orm +12727 -0
  144. data/orm/Marriage.orm +493 -0
  145. data/orm/Metamodel.orm +20998 -0
  146. data/orm/Monogamy.orm +328 -0
  147. data/orm/MultiInheritance.orm +537 -0
  148. data/orm/MultipleSubtyping.orm +347 -0
  149. data/orm/OilSupply.orm +2533 -0
  150. data/orm/OneRoleNesting.orm +1237 -0
  151. data/orm/Orienteering.orm +3976 -0
  152. data/orm/PersonPlaysGame.orm +426 -0
  153. data/orm/RedundantDependency.orm +844 -0
  154. data/orm/SchoolActivities.orm +961 -0
  155. data/orm/SeparateSubtype.orm +821 -0
  156. data/orm/SimplestUnary.orm +172 -0
  157. data/orm/Supervision.orm +734 -0
  158. data/orm/VenueSeating.orm +1289 -0
  159. data/orm/WaiterTips.orm +789 -0
  160. data/orm/Warehousing.orm +3792 -0
  161. data/orm/WindowInRoomInBldg.orm +772 -0
  162. data/rails/models/Astronomy.models +17 -0
  163. data/rails/models/CinemaBookings.models +123 -0
  164. data/rails/models/CinemaTickets.models +192 -0
  165. data/rails/models/Diplomacy.models +126 -0
  166. data/rails/models/Metamodel.models +894 -0
  167. data/rails/models/OneRoleNesting.models +18 -0
  168. data/rails/models/SeparateSubtype.models +49 -0
  169. data/rails/models/VenueSeating.models +70 -0
  170. data/rails/schema/Astronomy.schema.rb +25 -0
  171. data/rails/schema/CinemaBookings.schema.rb +78 -0
  172. data/rails/schema/CinemaTickets.schema.rb +132 -0
  173. data/rails/schema/Diplomacy.schema.rb +74 -0
  174. data/rails/schema/Metamodel.schema.rb +538 -0
  175. data/rails/schema/OneRoleNesting.rb +20 -0
  176. data/rails/schema/SeparateSubtype.schema.rb +35 -0
  177. data/rails/schema/VenueSeating.schema.rb +46 -0
  178. data/rails/schema/Warehousing.schema.rb +145 -0
  179. data/ruby/Address.rb +68 -0
  180. data/ruby/Astronomy.rb +55 -0
  181. data/ruby/Blog.rb +84 -0
  182. data/ruby/CinemaBookings.rb +109 -0
  183. data/ruby/CinemaTickets.rb +218 -0
  184. data/ruby/CompanyDirectorEmployee.rb +73 -0
  185. data/ruby/Death.rb +26 -0
  186. data/ruby/Diplomacy.rb +59 -0
  187. data/ruby/Genealogy.rb +173 -0
  188. data/ruby/Insurance.rb +562 -0
  189. data/ruby/Marriage.rb +21 -0
  190. data/ruby/Metamodel.rb +621 -0
  191. data/ruby/Monogamy.rb +27 -0
  192. data/ruby/MultiInheritance.rb +38 -0
  193. data/ruby/OilSupply.rb +112 -0
  194. data/ruby/OneRoleNesting.rb +66 -0
  195. data/ruby/Orienteering.rb +216 -0
  196. data/ruby/PersonPlaysGame.rb +31 -0
  197. data/ruby/RedundantDependency.rb +53 -0
  198. data/ruby/SchoolActivities.rb +49 -0
  199. data/ruby/SeparateSubtype.rb +46 -0
  200. data/ruby/SimplestUnary.rb +10 -0
  201. data/ruby/Supervision.rb +33 -0
  202. data/ruby/TwoValues.rb +14 -0
  203. data/ruby/VenueSeating.rb +64 -0
  204. data/ruby/WaiterTips.rb +49 -0
  205. data/ruby/Warehousing.rb +167 -0
  206. data/ruby/WindowInRoomInBldg.rb +45 -0
  207. data/sql/server/Address.sql +40 -0
  208. data/sql/server/Astronomy.sql +36 -0
  209. data/sql/server/Blog.sql +78 -0
  210. data/sql/server/CinemaBookings.sql +95 -0
  211. data/sql/server/CinemaTickets.sql +191 -0
  212. data/sql/server/CompanyDirectorEmployee.sql +104 -0
  213. data/sql/server/Death.sql +11 -0
  214. data/sql/server/Diplomacy.sql +66 -0
  215. data/sql/server/Genealogy.sql +138 -0
  216. data/sql/server/Health.sql +169 -0
  217. data/sql/server/Insurance.sql +484 -0
  218. data/sql/server/Marriage.sql +30 -0
  219. data/sql/server/Metamodel.sql +1000 -0
  220. data/sql/server/Monogamy.sql +20 -0
  221. data/sql/server/MultiInheritance.sql +27 -0
  222. data/sql/server/OilSupply.sql +105 -0
  223. data/sql/server/OneRoleNesting.sql +29 -0
  224. data/sql/server/Orienteering.sql +186 -0
  225. data/sql/server/PersonPlaysGame.sql +9 -0
  226. data/sql/server/RedundantDependency.sql +54 -0
  227. data/sql/server/SchoolActivities.sql +30 -0
  228. data/sql/server/SeparateSubtype.sql +33 -0
  229. data/sql/server/SimplestUnary.sql +9 -0
  230. data/sql/server/Supervision.sql +30 -0
  231. data/sql/server/VenueSeating.sql +54 -0
  232. data/sql/server/WaiterTips.sql +31 -0
  233. data/sql/server/Warehousing.sql +203 -0
  234. data/sql/server/WindowInRoomInBldg.sql +13 -0
  235. data/transform/surrogate/Address.absorption +2 -0
  236. data/transform/surrogate/Blog.absorption +5 -0
  237. data/transform/surrogate/CinemaBookings.absorption +7 -0
  238. data/transform/surrogate/CompanyDirectorEmployee.absorption +7 -0
  239. data/transform/surrogate/Death.absorption +1 -0
  240. data/transform/surrogate/Diplomacy-revised.absorption +6 -0
  241. data/transform/surrogate/Diplomacy.absorption +6 -0
  242. data/transform/surrogate/Genealogy.absorption +8 -0
  243. data/transform/surrogate/Insurance.absorption +18 -0
  244. data/transform/surrogate/Marriage.absorption +2 -0
  245. data/transform/surrogate/Metamodel.absorption +25 -0
  246. data/transform/surrogate/Monogamy.absorption +1 -0
  247. data/transform/surrogate/MultiInheritance.absorption +1 -0
  248. data/transform/surrogate/MultipleSubtyping.absorption +1 -0
  249. data/transform/surrogate/OilSupply.absorption +8 -0
  250. data/transform/surrogate/OneRoleNesting.absorption +1 -0
  251. data/transform/surrogate/Orienteering.absorption +11 -0
  252. data/transform/surrogate/PersonPlaysGame.absorption +1 -0
  253. data/transform/surrogate/RedundantDependency.absorption +3 -0
  254. data/transform/surrogate/SchoolActivities.absorption +3 -0
  255. data/transform/surrogate/SeparateSubtype.absorption +3 -0
  256. data/transform/surrogate/SimplestUnary.absorption +1 -0
  257. data/transform/surrogate/Supervision.absorption +2 -0
  258. data/transform/surrogate/WaiterTips.absorption +3 -0
  259. data/transform/surrogate/Warehousing.absorption +12 -0
  260. data/transform/surrogate/WindowInRoomInBldg.absorption +1 -0
  261. data/transform/surrogate/unit.absorption +0 -0
  262. metadata +374 -0
data/ruby/Insurance.rb ADDED
@@ -0,0 +1,562 @@
1
+ require 'activefacts/api'
2
+
3
+ module ::Insurance
4
+
5
+ class Alias < Char
6
+ value_type :length => 3
7
+ one_to_one :product # See Product.alias
8
+ end
9
+
10
+ class ApplicationNr < SignedInteger
11
+ value_type :length => 32
12
+ one_to_one :application # See Application.application_nr
13
+ end
14
+
15
+ class AssetID < AutoCounter
16
+ value_type
17
+ one_to_one :asset # See Asset.asset_id
18
+ end
19
+
20
+ class Badge < String
21
+ value_type
22
+ end
23
+
24
+ class Charge < String
25
+ value_type
26
+ end
27
+
28
+ class City < String
29
+ value_type
30
+ end
31
+
32
+ class ClaimID < AutoCounter
33
+ value_type
34
+ one_to_one :claim # See Claim.claim_id
35
+ end
36
+
37
+ class ClaimSequence < UnsignedInteger
38
+ value_type :length => 32
39
+ restrict 1..999
40
+ end
41
+
42
+ class Colour < String
43
+ value_type
44
+ end
45
+
46
+ class ContactMethod < Char
47
+ value_type :length => 1
48
+ restrict 'B', 'H', 'M'
49
+ end
50
+
51
+ class Count < UnsignedInteger
52
+ value_type :length => 32
53
+ end
54
+
55
+ class CoverTypeCode < Char
56
+ value_type
57
+ one_to_one :cover_type # See CoverType.cover_type_code
58
+ end
59
+
60
+ class CoverTypeName < String
61
+ value_type
62
+ one_to_one :cover_type # See CoverType.cover_type_name
63
+ end
64
+
65
+ class Date < ::Date
66
+ value_type
67
+ end
68
+
69
+ class DateTime < ::DateTime
70
+ value_type
71
+ end
72
+
73
+ class Description < String
74
+ value_type :length => 1024
75
+ one_to_one :product # See Product.description
76
+ end
77
+
78
+ class Email < String
79
+ value_type
80
+ end
81
+
82
+ class EngineNumber < String
83
+ value_type
84
+ end
85
+
86
+ class HospitalName < String
87
+ value_type
88
+ one_to_one :hospital # See Hospital.hospital_name
89
+ end
90
+
91
+ class ITCClaimed < Decimal
92
+ value_type :length => 18, :scale => 2
93
+ restrict 0.0..100.0
94
+ end
95
+
96
+ class Intoxication < String
97
+ value_type
98
+ end
99
+
100
+ class LiabilityCode < Char
101
+ value_type :length => 1
102
+ restrict 'D', 'L', 'R', 'U'
103
+ one_to_one :liability, :restrict => ['D', 'L', 'R', 'U'] # See Liability.liability_code
104
+ end
105
+
106
+ class LicenseNumber < String
107
+ value_type
108
+ one_to_one :license # See License.license_number
109
+ end
110
+
111
+ class LicenseType < String
112
+ value_type
113
+ end
114
+
115
+ class Location < String
116
+ value_type
117
+ end
118
+
119
+ class LossTypeCode < Char
120
+ value_type
121
+ one_to_one :loss_type # See LossType.loss_type_code
122
+ end
123
+
124
+ class LostItemNr < SignedInteger
125
+ value_type :length => 32
126
+ end
127
+
128
+ class Make < String
129
+ value_type
130
+ end
131
+
132
+ class Model < String
133
+ value_type
134
+ end
135
+
136
+ class Name < String
137
+ value_type :length => 256
138
+ end
139
+
140
+ class Occupation < String
141
+ value_type
142
+ end
143
+
144
+ class PartyID < AutoCounter
145
+ value_type
146
+ one_to_one :party # See Party.party_id
147
+ end
148
+
149
+ class PhoneNr < String
150
+ value_type
151
+ one_to_one :phone # See Phone.phone_nr
152
+ end
153
+
154
+ class Place < String
155
+ value_type
156
+ end
157
+
158
+ class PolicySerial < UnsignedInteger
159
+ value_type :length => 32
160
+ restrict 1..99999
161
+ end
162
+
163
+ class PolicyWordingText < String
164
+ value_type
165
+ one_to_one :policy_wording # See PolicyWording.policy_wording_text
166
+ end
167
+
168
+ class Postcode < String
169
+ value_type
170
+ end
171
+
172
+ class Price < Decimal
173
+ value_type :length => 18, :scale => 2
174
+ end
175
+
176
+ class ProductCode < UnsignedInteger
177
+ value_type :length => 8
178
+ restrict 1..99
179
+ one_to_one :product # See Product.product_code
180
+ end
181
+
182
+ class Reason < String
183
+ value_type
184
+ end
185
+
186
+ class RegistrationNr < Char
187
+ value_type :length => 8
188
+ one_to_one :registration # See Registration.registration_nr
189
+ end
190
+
191
+ class ReportNr < SignedInteger
192
+ value_type :length => 32
193
+ end
194
+
195
+ class StateCode < UnsignedInteger
196
+ value_type :length => 8
197
+ restrict 0..9
198
+ one_to_one :state # See State.state_code
199
+ end
200
+
201
+ class StateName < String
202
+ value_type :length => 256
203
+ one_to_one :state # See State.state_name
204
+ end
205
+
206
+ class Street < String
207
+ value_type :length => 256
208
+ end
209
+
210
+ class TestResult < String
211
+ value_type
212
+ end
213
+
214
+ class Text < String
215
+ value_type
216
+ one_to_one :underwriting_question # See UnderwritingQuestion.text
217
+ end
218
+
219
+ class Time < ::Time
220
+ value_type
221
+ end
222
+
223
+ class Title < String
224
+ value_type
225
+ end
226
+
227
+ class UnderwritingQuestionID < AutoCounter
228
+ value_type
229
+ one_to_one :underwriting_question # See UnderwritingQuestion.underwriting_question_id
230
+ end
231
+
232
+ class VIN < UnsignedInteger
233
+ value_type :length => 32
234
+ one_to_one :vehicle # See Vehicle.vin
235
+ end
236
+
237
+ class YearNr < SignedInteger
238
+ value_type :length => 32
239
+ one_to_one :year # See Year.year_nr
240
+ end
241
+
242
+ class Application
243
+ identified_by :application_nr
244
+ one_to_one :application_nr, :mandatory => true # See ApplicationNr.application
245
+ end
246
+
247
+ class Asset
248
+ identified_by :asset_id
249
+ one_to_one :asset_id, :class => AssetID, :mandatory => true # See AssetID.asset
250
+ end
251
+
252
+ class Claim
253
+ identified_by :claim_id
254
+ one_to_one :claim_id, :class => ClaimID, :mandatory => true # See ClaimID.claim
255
+ has_one :p_sequence, :class => ClaimSequence, :mandatory => true # See ClaimSequence.all_claim_as_p_sequence
256
+ has_one :policy, :mandatory => true # See Policy.all_claim
257
+ end
258
+
259
+ class CoverType
260
+ identified_by :cover_type_code
261
+ one_to_one :cover_type_code, :mandatory => true # See CoverTypeCode.cover_type
262
+ one_to_one :cover_type_name, :mandatory => true # See CoverTypeName.cover_type
263
+ end
264
+
265
+ class Hospital
266
+ identified_by :hospital_name
267
+ one_to_one :hospital_name, :mandatory => true # See HospitalName.hospital
268
+ end
269
+
270
+ class Incident
271
+ identified_by :claim
272
+ has_one :address, :mandatory => true # See Address.all_incident
273
+ one_to_one :claim, :mandatory => true # See Claim.incident
274
+ has_one :date_time, :mandatory => true # See DateTime.all_incident
275
+ end
276
+
277
+ class Liability
278
+ identified_by :liability_code
279
+ one_to_one :liability_code, :mandatory => true # See LiabilityCode.liability
280
+ end
281
+
282
+ class LossType
283
+ identified_by :loss_type_code
284
+ maybe :involves_driving
285
+ maybe :is_single_vehicle_incident
286
+ has_one :liability # See Liability.all_loss_type
287
+ one_to_one :loss_type_code, :mandatory => true # See LossTypeCode.loss_type
288
+ end
289
+
290
+ class LostItem
291
+ identified_by :incident, :lost_item_nr
292
+ has_one :description, :mandatory => true # See Description.all_lost_item
293
+ has_one :incident, :mandatory => true # See Incident.all_lost_item
294
+ has_one :lost_item_nr, :mandatory => true # See LostItemNr.all_lost_item
295
+ has_one :purchase_date, :class => Date # See Date.all_lost_item_as_purchase_date
296
+ has_one :purchase_place, :class => Place # See Place.all_lost_item_as_purchase_place
297
+ has_one :purchase_price, :class => Price # See Price.all_lost_item_as_purchase_price
298
+ end
299
+
300
+ class Party
301
+ identified_by :party_id
302
+ maybe :is_a_company
303
+ one_to_one :party_id, :class => PartyID, :mandatory => true # See PartyID.party
304
+ has_one :postal_address, :class => "Address" # See Address.all_party_as_postal_address
305
+ end
306
+
307
+ class Person < Party
308
+ has_one :address # See Address.all_person
309
+ has_one :birth_date, :class => Date # See Date.all_person_as_birth_date
310
+ has_one :family_name, :class => Name, :mandatory => true # See Name.all_person_as_family_name
311
+ has_one :given_name, :class => Name, :mandatory => true # See Name.all_person_as_given_name
312
+ has_one :occupation # See Occupation.all_person
313
+ has_one :title, :mandatory => true # See Title.all_person
314
+ end
315
+
316
+ class Phone
317
+ identified_by :phone_nr
318
+ one_to_one :phone_nr, :mandatory => true # See PhoneNr.phone
319
+ end
320
+
321
+ class PoliceReport
322
+ identified_by :incident
323
+ one_to_one :incident, :mandatory => true # See Incident.police_report
324
+ has_one :officer_name, :class => Name # See Name.all_police_report_as_officer_name
325
+ has_one :police_report_nr, :class => ReportNr # See ReportNr.all_police_report_as_police_report_nr
326
+ has_one :report_date_time, :class => DateTime # See DateTime.all_police_report_as_report_date_time
327
+ has_one :reporter_name, :class => Name # See Name.all_police_report_as_reporter_name
328
+ has_one :station_name, :class => Name # See Name.all_police_report_as_station_name
329
+ end
330
+
331
+ class PolicyWording
332
+ identified_by :policy_wording_text
333
+ one_to_one :policy_wording_text, :mandatory => true # See PolicyWordingText.policy_wording
334
+ end
335
+
336
+ class Product
337
+ identified_by :product_code
338
+ one_to_one :alias # See Alias.product
339
+ one_to_one :description # See Description.product
340
+ one_to_one :product_code, :mandatory => true # See ProductCode.product
341
+ end
342
+
343
+ class Registration
344
+ identified_by :registration_nr
345
+ one_to_one :registration_nr, :mandatory => true # See RegistrationNr.registration
346
+ end
347
+
348
+ class State
349
+ identified_by :state_code
350
+ one_to_one :state_code, :mandatory => true # See StateCode.state
351
+ one_to_one :state_name # See StateName.state
352
+ end
353
+
354
+ class UnderwritingQuestion
355
+ identified_by :underwriting_question_id
356
+ one_to_one :text, :mandatory => true # See Text.underwriting_question
357
+ one_to_one :underwriting_question_id, :class => UnderwritingQuestionID, :mandatory => true # See UnderwritingQuestionID.underwriting_question
358
+ end
359
+
360
+ class Vehicle < Asset
361
+ identified_by :vin
362
+ has_one :colour # See Colour.all_vehicle
363
+ has_one :dealer # See Dealer.all_vehicle
364
+ has_one :engine_number # See EngineNumber.all_vehicle
365
+ has_one :finance_institution # See FinanceInstitution.all_vehicle
366
+ maybe :has_commercial_registration
367
+ has_one :model_year, :class => "Year", :mandatory => true # See Year.all_vehicle_as_model_year
368
+ has_one :registration, :mandatory => true # See Registration.all_vehicle
369
+ has_one :vehicle_type, :mandatory => true # See VehicleType.all_vehicle
370
+ one_to_one :vin, :class => VIN, :mandatory => true # See VIN.vehicle
371
+ end
372
+
373
+ class VehicleIncident < Incident
374
+ has_one :description # See Description.all_vehicle_incident
375
+ has_one :loss_type # See LossType.all_vehicle_incident
376
+ maybe :occurred_while_being_driven
377
+ has_one :previous_damage_description, :class => Description # See Description.all_vehicle_incident_as_previous_damage_description
378
+ has_one :reason # See Reason.all_vehicle_incident
379
+ has_one :towed_location, :class => Location # See Location.all_vehicle_incident_as_towed_location
380
+ has_one :weather_description, :class => Description # See Description.all_vehicle_incident_as_weather_description
381
+ end
382
+
383
+ class VehicleType
384
+ identified_by :make, :model, :badge
385
+ has_one :badge # See Badge.all_vehicle_type
386
+ has_one :make, :mandatory => true # See Make.all_vehicle_type
387
+ has_one :model, :mandatory => true # See Model.all_vehicle_type
388
+ end
389
+
390
+ class Witness
391
+ identified_by :incident, :name
392
+ has_one :address # See Address.all_witness
393
+ has_one :contact_phone, :class => Phone # See Phone.all_witness_as_contact_phone
394
+ has_one :incident, :mandatory => true # See Incident.all_witness
395
+ has_one :name, :mandatory => true # See Name.all_witness
396
+ end
397
+
398
+ class Year
399
+ identified_by :year_nr
400
+ one_to_one :year_nr, :mandatory => true # See YearNr.year
401
+ end
402
+
403
+ class Address
404
+ identified_by :street, :city, :postcode, :state
405
+ has_one :city, :mandatory => true # See City.all_address
406
+ has_one :postcode # See Postcode.all_address
407
+ has_one :state # See State.all_address
408
+ has_one :street, :mandatory => true # See Street.all_address
409
+ end
410
+
411
+ class AuthorisedRep < Party
412
+ end
413
+
414
+ class Company < Party
415
+ has_one :contact_person, :class => Person, :mandatory => true # See Person.all_company_as_contact_person
416
+ end
417
+
418
+ class ContactMethods
419
+ identified_by :person
420
+ has_one :business_phone, :class => Phone # See Phone.all_contact_methods_as_business_phone
421
+ has_one :contact_time, :class => Time # See Time.all_contact_methods_as_contact_time
422
+ has_one :email # See Email.all_contact_methods
423
+ has_one :home_phone, :class => Phone # See Phone.all_contact_methods_as_home_phone
424
+ has_one :mobile_phone, :class => Phone # See Phone.all_contact_methods_as_mobile_phone
425
+ one_to_one :person, :mandatory => true # See Person.contact_methods
426
+ has_one :preferred_contact_method, :class => ContactMethod # See ContactMethod.all_contact_methods_as_preferred_contact_method
427
+ end
428
+
429
+ class Contractor < Company
430
+ end
431
+
432
+ class ContractorAppointment
433
+ identified_by :claim, :contractor
434
+ has_one :claim, :mandatory => true # See Claim.all_contractor_appointment
435
+ has_one :contractor, :mandatory => true # See Contractor.all_contractor_appointment
436
+ end
437
+
438
+ class CoverWording
439
+ identified_by :cover_type, :policy_wording, :start_date
440
+ has_one :cover_type, :mandatory => true # See CoverType.all_cover_wording
441
+ has_one :policy_wording, :mandatory => true # See PolicyWording.all_cover_wording
442
+ has_one :start_date, :class => Date, :mandatory => true # See Date.all_cover_wording_as_start_date
443
+ end
444
+
445
+ class Dealer < Party
446
+ end
447
+
448
+ class Driving
449
+ identified_by :vehicle_incident
450
+ one_to_one :vehicle_incident, :mandatory => true # See VehicleIncident.driving
451
+ has_one :breath_test_result, :class => TestResult # See TestResult.all_driving_as_breath_test_result
452
+ has_one :intoxication # See Intoxication.all_driving
453
+ has_one :nonconsent_reason, :class => Reason # See Reason.all_driving_as_nonconsent_reason
454
+ has_one :person, :mandatory => true # See Person.all_driving
455
+ has_one :unlicensed_reason, :class => Reason # See Reason.all_driving_as_unlicensed_reason
456
+ end
457
+
458
+ class DrivingCharge
459
+ identified_by :driving
460
+ has_one :charge, :mandatory => true # See Charge.all_driving_charge
461
+ one_to_one :driving, :mandatory => true # See Driving.driving_charge
462
+ maybe :is_a_warning
463
+ end
464
+
465
+ class FinanceInstitution < Company
466
+ end
467
+
468
+ class Hospitalization
469
+ identified_by :driving
470
+ one_to_one :driving, :mandatory => true # See Driving.hospitalization
471
+ has_one :hospital, :mandatory => true # See Hospital.all_hospitalization
472
+ has_one :blood_test_result, :class => TestResult # See TestResult.all_hospitalization_as_blood_test_result
473
+ end
474
+
475
+ class Insured < Party
476
+ end
477
+
478
+ class Insurer < Company
479
+ end
480
+
481
+ class Investigator < Contractor
482
+ end
483
+
484
+ class License
485
+ identified_by :person
486
+ maybe :is_international
487
+ one_to_one :license_number, :mandatory => true # See LicenseNumber.license
488
+ has_one :license_type, :mandatory => true # See LicenseType.all_license
489
+ one_to_one :person, :mandatory => true # See Person.license
490
+ has_one :year # See Year.all_license
491
+ end
492
+
493
+ class Lodgement
494
+ identified_by :claim
495
+ one_to_one :claim, :mandatory => true # See Claim.lodgement
496
+ has_one :person, :mandatory => true # See Person.all_lodgement
497
+ has_one :date_time # See DateTime.all_lodgement
498
+ end
499
+
500
+ class Policy
501
+ identified_by :p_year, :p_product, :p_state, :p_serial
502
+ has_one :application, :mandatory => true # See Application.all_policy
503
+ has_one :authorised_rep # See AuthorisedRep.all_policy
504
+ has_one :insured, :mandatory => true # See Insured.all_policy
505
+ has_one :itc_claimed, :class => ITCClaimed # See ITCClaimed.all_policy
506
+ has_one :p_product, :class => Product, :mandatory => true # See Product.all_policy_as_p_product
507
+ has_one :p_serial, :class => PolicySerial, :mandatory => true # See PolicySerial.all_policy_as_p_serial
508
+ has_one :p_state, :class => State, :mandatory => true # See State.all_policy_as_p_state
509
+ has_one :p_year, :class => Year, :mandatory => true # See Year.all_policy_as_p_year
510
+ end
511
+
512
+ class PropertyDamage
513
+ identified_by :incident, :address
514
+ has_one :address, :mandatory => true # See Address.all_property_damage
515
+ has_one :incident # See Incident.all_property_damage
516
+ has_one :owner_name, :class => Name # See Name.all_property_damage_as_owner_name
517
+ has_one :phone # See Phone.all_property_damage
518
+ end
519
+
520
+ class Repairer < Contractor
521
+ end
522
+
523
+ class Solicitor < Contractor
524
+ end
525
+
526
+ class ThirdParty
527
+ identified_by :person, :vehicle_incident
528
+ has_one :person, :mandatory => true # See Person.all_third_party
529
+ has_one :vehicle_incident, :mandatory => true # See VehicleIncident.all_third_party
530
+ has_one :insurer # See Insurer.all_third_party
531
+ has_one :model_year, :class => Year # See Year.all_third_party_as_model_year
532
+ has_one :vehicle_registration, :class => Registration # See Registration.all_third_party_as_vehicle_registration
533
+ has_one :vehicle_type # See VehicleType.all_third_party
534
+ end
535
+
536
+ class UnderwritingDemerit
537
+ identified_by :vehicle_incident, :underwriting_question
538
+ has_one :occurrence_count, :class => Count # See Count.all_underwriting_demerit_as_occurrence_count
539
+ has_one :underwriting_question, :mandatory => true # See UnderwritingQuestion.all_underwriting_demerit
540
+ has_one :vehicle_incident, :mandatory => true # See VehicleIncident.all_underwriting_demerit
541
+ end
542
+
543
+ class Assessor < Contractor
544
+ end
545
+
546
+ class Cover
547
+ identified_by :policy, :cover_type, :asset
548
+ has_one :asset, :mandatory => true # See Asset.all_cover
549
+ has_one :cover_type, :mandatory => true # See CoverType.all_cover
550
+ has_one :policy, :mandatory => true # See Policy.all_cover
551
+ end
552
+
553
+ class MotorPolicy < Policy
554
+ end
555
+
556
+ class SingleMotorPolicy < MotorPolicy
557
+ end
558
+
559
+ class MotorFleetPolicy < MotorPolicy
560
+ end
561
+
562
+ end
data/ruby/Marriage.rb ADDED
@@ -0,0 +1,21 @@
1
+ require 'activefacts/api'
2
+
3
+ module ::Marriage
4
+
5
+ class Name < String
6
+ value_type
7
+ end
8
+
9
+ class Person
10
+ identified_by :given_name, :family_name
11
+ has_one :family_name, :class => Name, :mandatory => true # See Name.all_person_as_family_name
12
+ has_one :given_name, :class => Name, :mandatory => true # See Name.all_person_as_given_name
13
+ end
14
+
15
+ class Marriage
16
+ identified_by :husband, :wife
17
+ has_one :husband, :class => Person, :mandatory => true # See Person.all_marriage_as_husband
18
+ has_one :wife, :class => Person, :mandatory => true # See Person.all_marriage_as_wife
19
+ end
20
+
21
+ end