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.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +22 -0
- data/Rakefile +6 -0
- data/activefacts-examples.gemspec +26 -0
- data/cql/Address.cql +44 -0
- data/cql/Astronomy.cql +35 -0
- data/cql/Blog.cql +54 -0
- data/cql/CinemaBookings.cql +64 -0
- data/cql/CinemaTickets.cql +127 -0
- data/cql/CompanyDirectorEmployee.cql +56 -0
- data/cql/Death.cql +17 -0
- data/cql/Diplomacy.cql +48 -0
- data/cql/Genealogy.cql +98 -0
- data/cql/Health.cql +78 -0
- data/cql/Insurance.cql +320 -0
- data/cql/Marriage.cql +18 -0
- data/cql/Metamodel.cql +567 -0
- data/cql/Monogamy.cql +24 -0
- data/cql/MultiInheritance.cql +22 -0
- data/cql/MultipleSubtyping.cql +30 -0
- data/cql/NonRoleId.cql +14 -0
- data/cql/OddIdentifier.cql +18 -0
- data/cql/OilSupply.cql +53 -0
- data/cql/OneRoleNesting.cql +38 -0
- data/cql/OneToOnes.cql +17 -0
- data/cql/Orienteering.cql +111 -0
- data/cql/PartyModel.cql +38 -0
- data/cql/PersonPlaysGame.cql +18 -0
- data/cql/RedundantDependency.cql +34 -0
- data/cql/SchoolActivities.cql +33 -0
- data/cql/SeparateSubtype.cql +30 -0
- data/cql/ServiceDirector.cql +276 -0
- data/cql/SimplestUnary.cql +12 -0
- data/cql/Supervision.cql +34 -0
- data/cql/VenueSeating.cql +45 -0
- data/cql/WaiterTips.cql +33 -0
- data/cql/Warehousing.cql +101 -0
- data/cql/WindowInRoomInBldg.cql +28 -0
- data/cql/unit.cql +474 -0
- data/diagrams/json/Address.json +41 -0
- data/diagrams/json/Astronomy.json +31 -0
- data/diagrams/json/Blog.json +46 -0
- data/diagrams/json/CinemaBookings.json +53 -0
- data/diagrams/json/CinemaTickets.json +101 -0
- data/diagrams/json/CompanyDirectorEmployee.json +44 -0
- data/diagrams/json/Death.json +20 -0
- data/diagrams/json/Diplomacy.json +34 -0
- data/diagrams/json/Genealogy.json +78 -0
- data/diagrams/json/Insurance.json +259 -0
- data/diagrams/json/Marriage.json +21 -0
- data/diagrams/json/Metamodel.json +318 -0
- data/diagrams/json/Monogamy.json +22 -0
- data/diagrams/json/MultiInheritance.json +25 -0
- data/diagrams/json/MultipleSubtyping.json +22 -0
- data/diagrams/json/OilSupply.json +49 -0
- data/diagrams/json/OneRoleNesting.json +37 -0
- data/diagrams/json/Orienteering.json +94 -0
- data/diagrams/json/PersonPlaysGame.json +22 -0
- data/diagrams/json/RedundantDependency.json +33 -0
- data/diagrams/json/SchoolActivities.json +28 -0
- data/diagrams/json/SeparateSubtype.json +29 -0
- data/diagrams/json/SimplestUnary.json +15 -0
- data/diagrams/json/Supervision.json +27 -0
- data/diagrams/json/VenueSeating.json +40 -0
- data/diagrams/json/WaiterTips.json +29 -0
- data/diagrams/json/Warehousing.json +86 -0
- data/diagrams/json/WindowInRoomInBldg.json +31 -0
- data/images/Address.SQL.png +0 -0
- data/images/Address.png +0 -0
- data/images/Blog.png +0 -0
- data/images/CinemaBookings.png +0 -0
- data/images/CinemaTickets.png +0 -0
- data/images/CompanyDirectorEmployee.png +0 -0
- data/images/Death.png +0 -0
- data/images/Diplomacy.png +0 -0
- data/images/DumpMetamodel.bat +2 -0
- data/images/Genealogy.png +0 -0
- data/images/Insurance/Claim.png +0 -0
- data/images/Insurance/Insurance.png +0 -0
- data/images/Insurance/Person.png +0 -0
- data/images/Insurance/Policy.png +0 -0
- data/images/Insurance/Related.png +0 -0
- data/images/Insurance/VehicleIncident.png +0 -0
- data/images/Marriage.png +0 -0
- data/images/Metamodel/Concepts.png +0 -0
- data/images/Metamodel/Constraints.png +0 -0
- data/images/Metamodel/ContextNote.png +0 -0
- data/images/Metamodel/Diagrams.png +0 -0
- data/images/Metamodel/Language.png +0 -0
- data/images/Metamodel/Legacy.png +0 -0
- data/images/Metamodel/Objects.png +0 -0
- data/images/Metamodel/Populations.png +0 -0
- data/images/Metamodel/Query.png +0 -0
- data/images/Metamodel/Units.png +0 -0
- data/images/Metamodel/ValueConstraints.png +0 -0
- data/images/Metamodel/ValueTypes.png +0 -0
- data/images/MetamodelER.bcp +1 -0
- data/images/MetamodelER.pdf +0 -0
- data/images/MultiInheritance.png +0 -0
- data/images/NorthwindER.png +0 -0
- data/images/OilSupply.png +0 -0
- data/images/Orienteering/Administration.png +0 -0
- data/images/Orienteering/Registration.png +0 -0
- data/images/Orienteering/Scoring.png +0 -0
- data/images/PersonPlaysGame.png +0 -0
- data/images/RedundantDependency.png +0 -0
- data/images/SchoolActivities.png +0 -0
- data/images/SeparateSubtype.png +0 -0
- data/images/SimplestUnary.png +0 -0
- data/images/Supervision.png +0 -0
- data/images/VenueSeating.png +0 -0
- data/images/WaiterTips.png +0 -0
- data/images/Warehousing.png +0 -0
- data/images/WindowInRoomInBldg.png +0 -0
- data/metadata/json/Astronomy.json +175 -0
- data/metadata/json/CinemaBookings.json +354 -0
- data/metadata/json/CinemaTickets.json +768 -0
- data/metadata/json/CompanyDirectorEmployee.json +270 -0
- data/metadata/json/Diplomacy.json +186 -0
- data/metadata/json/Metamodel.json +3214 -0
- data/metadata/json/OilSupply.json +411 -0
- data/metadata/json/SeparateSubtype.json +157 -0
- data/metadata/json/Supervision.json +128 -0
- data/metadata/json/VenueSeating.json +209 -0
- data/orm/.gitignore +11 -0
- data/orm/Address.orm +1268 -0
- data/orm/Astronomy.orm +925 -0
- data/orm/Blog.orm +1711 -0
- data/orm/CinemaBookings.orm +1998 -0
- data/orm/CinemaTickets.orm +5060 -0
- data/orm/CompanyDirectorEmployee.orm +2094 -0
- data/orm/Death.orm +386 -0
- data/orm/Diplomacy.orm +1478 -0
- data/orm/ExampleModels2010.csproj +764 -0
- data/orm/ExampleModels2010.sln +16 -0
- data/orm/Genealogy.orm +3209 -0
- data/orm/Health.orm +2407 -0
- data/orm/Insurance.orm +12727 -0
- data/orm/Marriage.orm +493 -0
- data/orm/Metamodel.orm +20998 -0
- data/orm/Monogamy.orm +328 -0
- data/orm/MultiInheritance.orm +537 -0
- data/orm/MultipleSubtyping.orm +347 -0
- data/orm/OilSupply.orm +2533 -0
- data/orm/OneRoleNesting.orm +1237 -0
- data/orm/Orienteering.orm +3976 -0
- data/orm/PersonPlaysGame.orm +426 -0
- data/orm/RedundantDependency.orm +844 -0
- data/orm/SchoolActivities.orm +961 -0
- data/orm/SeparateSubtype.orm +821 -0
- data/orm/SimplestUnary.orm +172 -0
- data/orm/Supervision.orm +734 -0
- data/orm/VenueSeating.orm +1289 -0
- data/orm/WaiterTips.orm +789 -0
- data/orm/Warehousing.orm +3792 -0
- data/orm/WindowInRoomInBldg.orm +772 -0
- data/rails/models/Astronomy.models +17 -0
- data/rails/models/CinemaBookings.models +123 -0
- data/rails/models/CinemaTickets.models +192 -0
- data/rails/models/Diplomacy.models +126 -0
- data/rails/models/Metamodel.models +894 -0
- data/rails/models/OneRoleNesting.models +18 -0
- data/rails/models/SeparateSubtype.models +49 -0
- data/rails/models/VenueSeating.models +70 -0
- data/rails/schema/Astronomy.schema.rb +25 -0
- data/rails/schema/CinemaBookings.schema.rb +78 -0
- data/rails/schema/CinemaTickets.schema.rb +132 -0
- data/rails/schema/Diplomacy.schema.rb +74 -0
- data/rails/schema/Metamodel.schema.rb +538 -0
- data/rails/schema/OneRoleNesting.rb +20 -0
- data/rails/schema/SeparateSubtype.schema.rb +35 -0
- data/rails/schema/VenueSeating.schema.rb +46 -0
- data/rails/schema/Warehousing.schema.rb +145 -0
- data/ruby/Address.rb +68 -0
- data/ruby/Astronomy.rb +55 -0
- data/ruby/Blog.rb +84 -0
- data/ruby/CinemaBookings.rb +109 -0
- data/ruby/CinemaTickets.rb +218 -0
- data/ruby/CompanyDirectorEmployee.rb +73 -0
- data/ruby/Death.rb +26 -0
- data/ruby/Diplomacy.rb +59 -0
- data/ruby/Genealogy.rb +173 -0
- data/ruby/Insurance.rb +562 -0
- data/ruby/Marriage.rb +21 -0
- data/ruby/Metamodel.rb +621 -0
- data/ruby/Monogamy.rb +27 -0
- data/ruby/MultiInheritance.rb +38 -0
- data/ruby/OilSupply.rb +112 -0
- data/ruby/OneRoleNesting.rb +66 -0
- data/ruby/Orienteering.rb +216 -0
- data/ruby/PersonPlaysGame.rb +31 -0
- data/ruby/RedundantDependency.rb +53 -0
- data/ruby/SchoolActivities.rb +49 -0
- data/ruby/SeparateSubtype.rb +46 -0
- data/ruby/SimplestUnary.rb +10 -0
- data/ruby/Supervision.rb +33 -0
- data/ruby/TwoValues.rb +14 -0
- data/ruby/VenueSeating.rb +64 -0
- data/ruby/WaiterTips.rb +49 -0
- data/ruby/Warehousing.rb +167 -0
- data/ruby/WindowInRoomInBldg.rb +45 -0
- data/sql/server/Address.sql +40 -0
- data/sql/server/Astronomy.sql +36 -0
- data/sql/server/Blog.sql +78 -0
- data/sql/server/CinemaBookings.sql +95 -0
- data/sql/server/CinemaTickets.sql +191 -0
- data/sql/server/CompanyDirectorEmployee.sql +104 -0
- data/sql/server/Death.sql +11 -0
- data/sql/server/Diplomacy.sql +66 -0
- data/sql/server/Genealogy.sql +138 -0
- data/sql/server/Health.sql +169 -0
- data/sql/server/Insurance.sql +484 -0
- data/sql/server/Marriage.sql +30 -0
- data/sql/server/Metamodel.sql +1000 -0
- data/sql/server/Monogamy.sql +20 -0
- data/sql/server/MultiInheritance.sql +27 -0
- data/sql/server/OilSupply.sql +105 -0
- data/sql/server/OneRoleNesting.sql +29 -0
- data/sql/server/Orienteering.sql +186 -0
- data/sql/server/PersonPlaysGame.sql +9 -0
- data/sql/server/RedundantDependency.sql +54 -0
- data/sql/server/SchoolActivities.sql +30 -0
- data/sql/server/SeparateSubtype.sql +33 -0
- data/sql/server/SimplestUnary.sql +9 -0
- data/sql/server/Supervision.sql +30 -0
- data/sql/server/VenueSeating.sql +54 -0
- data/sql/server/WaiterTips.sql +31 -0
- data/sql/server/Warehousing.sql +203 -0
- data/sql/server/WindowInRoomInBldg.sql +13 -0
- data/transform/surrogate/Address.absorption +2 -0
- data/transform/surrogate/Blog.absorption +5 -0
- data/transform/surrogate/CinemaBookings.absorption +7 -0
- data/transform/surrogate/CompanyDirectorEmployee.absorption +7 -0
- data/transform/surrogate/Death.absorption +1 -0
- data/transform/surrogate/Diplomacy-revised.absorption +6 -0
- data/transform/surrogate/Diplomacy.absorption +6 -0
- data/transform/surrogate/Genealogy.absorption +8 -0
- data/transform/surrogate/Insurance.absorption +18 -0
- data/transform/surrogate/Marriage.absorption +2 -0
- data/transform/surrogate/Metamodel.absorption +25 -0
- data/transform/surrogate/Monogamy.absorption +1 -0
- data/transform/surrogate/MultiInheritance.absorption +1 -0
- data/transform/surrogate/MultipleSubtyping.absorption +1 -0
- data/transform/surrogate/OilSupply.absorption +8 -0
- data/transform/surrogate/OneRoleNesting.absorption +1 -0
- data/transform/surrogate/Orienteering.absorption +11 -0
- data/transform/surrogate/PersonPlaysGame.absorption +1 -0
- data/transform/surrogate/RedundantDependency.absorption +3 -0
- data/transform/surrogate/SchoolActivities.absorption +3 -0
- data/transform/surrogate/SeparateSubtype.absorption +3 -0
- data/transform/surrogate/SimplestUnary.absorption +1 -0
- data/transform/surrogate/Supervision.absorption +2 -0
- data/transform/surrogate/WaiterTips.absorption +3 -0
- data/transform/surrogate/Warehousing.absorption +12 -0
- data/transform/surrogate/WindowInRoomInBldg.absorption +1 -0
- data/transform/surrogate/unit.absorption +0 -0
- metadata +374 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
require 'activefacts/api'
|
|
2
|
+
|
|
3
|
+
module ::CinemaTickets
|
|
4
|
+
|
|
5
|
+
class AddressText < Text
|
|
6
|
+
value_type
|
|
7
|
+
one_to_one :address # See Address.address_text
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class BookingNr < SignedInteger
|
|
11
|
+
value_type :length => 32
|
|
12
|
+
one_to_one :booking # See Booking.booking_nr
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class CinemaID < AutoCounter
|
|
16
|
+
value_type
|
|
17
|
+
one_to_one :cinema # See Cinema.cinema_id
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class CollectionCode < SignedInteger
|
|
21
|
+
value_type :length => 32
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
class Day < SignedInteger
|
|
25
|
+
value_type :length => 32
|
|
26
|
+
restrict 1..31
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class EncryptedPassword < String
|
|
30
|
+
value_type
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
class FilmID < AutoCounter
|
|
34
|
+
value_type
|
|
35
|
+
one_to_one :film # See Film.film_id
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
class HighDemand < Boolean
|
|
39
|
+
value_type
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class Hour < SignedInteger
|
|
43
|
+
value_type :length => 32
|
|
44
|
+
restrict 0..23
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
class Minute < SignedInteger
|
|
48
|
+
value_type :length => 32
|
|
49
|
+
restrict 0..59
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class MonthNr < SignedInteger
|
|
53
|
+
value_type :length => 32
|
|
54
|
+
restrict 1..12
|
|
55
|
+
one_to_one :month # See Month.month_nr
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class Name < String
|
|
59
|
+
value_type
|
|
60
|
+
one_to_one :cinema # See Cinema.name
|
|
61
|
+
one_to_one :person, :counterpart => :login_name # See Person.login_name
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
class Number < UnsignedInteger
|
|
65
|
+
value_type :length => 16
|
|
66
|
+
restrict 1..Infinity
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
class PaymentMethodCode < String
|
|
70
|
+
value_type
|
|
71
|
+
one_to_one :payment_method, :restrict => ['Card', 'Cash', 'Gift Voucher', 'Loyalty Voucher'] # See PaymentMethod.payment_method_code
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
class PersonID < AutoCounter
|
|
75
|
+
value_type
|
|
76
|
+
one_to_one :person # See Person.person_id
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class Price < Money
|
|
80
|
+
value_type
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
class RowNr < Char
|
|
84
|
+
value_type :length => 2
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
class SeatNumber < UnsignedInteger
|
|
88
|
+
value_type :length => 16
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
class SectionName < String
|
|
92
|
+
value_type
|
|
93
|
+
one_to_one :section # See Section.section_name
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
class YearNr < SignedInteger
|
|
97
|
+
value_type :length => 32
|
|
98
|
+
restrict 1900..9999
|
|
99
|
+
one_to_one :year # See Year.year_nr
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
class Address
|
|
103
|
+
identified_by :address_text
|
|
104
|
+
one_to_one :address_text, :mandatory => true # See AddressText.address
|
|
105
|
+
end
|
|
106
|
+
|
|
107
|
+
class Cinema
|
|
108
|
+
identified_by :cinema_id
|
|
109
|
+
one_to_one :cinema_id, :class => CinemaID, :mandatory => true # See CinemaID.cinema
|
|
110
|
+
one_to_one :name, :mandatory => true # See Name.cinema
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
class Film
|
|
114
|
+
identified_by :film_id
|
|
115
|
+
one_to_one :film_id, :class => FilmID, :mandatory => true # See FilmID.film
|
|
116
|
+
has_one :name, :mandatory => true # See Name.all_film
|
|
117
|
+
has_one :year # See Year.all_film
|
|
118
|
+
end
|
|
119
|
+
|
|
120
|
+
class Month
|
|
121
|
+
identified_by :month_nr
|
|
122
|
+
one_to_one :month_nr, :mandatory => true # See MonthNr.month
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
class PaymentMethod
|
|
126
|
+
identified_by :payment_method_code
|
|
127
|
+
one_to_one :payment_method_code, :mandatory => true # See PaymentMethodCode.payment_method
|
|
128
|
+
end
|
|
129
|
+
|
|
130
|
+
class Person
|
|
131
|
+
identified_by :person_id
|
|
132
|
+
has_one :encrypted_password # See EncryptedPassword.all_person
|
|
133
|
+
one_to_one :login_name, :class => Name # See Name.person_as_login_name
|
|
134
|
+
one_to_one :person_id, :class => PersonID, :mandatory => true # See PersonID.person
|
|
135
|
+
end
|
|
136
|
+
|
|
137
|
+
class Row
|
|
138
|
+
identified_by :cinema, :row_nr
|
|
139
|
+
has_one :cinema, :mandatory => true # See Cinema.all_row
|
|
140
|
+
has_one :row_nr, :mandatory => true # See RowNr.all_row
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
class Seat
|
|
144
|
+
identified_by :row, :seat_number
|
|
145
|
+
has_one :row, :mandatory => true # See Row.all_seat
|
|
146
|
+
has_one :seat_number, :mandatory => true # See SeatNumber.all_seat
|
|
147
|
+
has_one :section # See Section.all_seat
|
|
148
|
+
end
|
|
149
|
+
|
|
150
|
+
class Section
|
|
151
|
+
identified_by :section_name
|
|
152
|
+
one_to_one :section_name, :mandatory => true # See SectionName.section
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
class Year
|
|
156
|
+
identified_by :year_nr
|
|
157
|
+
one_to_one :year_nr, :mandatory => true # See YearNr.year
|
|
158
|
+
end
|
|
159
|
+
|
|
160
|
+
class AllocatableCinemaSection
|
|
161
|
+
identified_by :cinema, :section
|
|
162
|
+
has_one :cinema, :mandatory => true # See Cinema.all_allocatable_cinema_section
|
|
163
|
+
has_one :section, :mandatory => true # See Section.all_allocatable_cinema_section
|
|
164
|
+
end
|
|
165
|
+
|
|
166
|
+
class SessionTime
|
|
167
|
+
identified_by :year, :month, :day, :hour, :minute
|
|
168
|
+
has_one :day, :mandatory => true # See Day.all_session_time
|
|
169
|
+
has_one :hour, :mandatory => true # See Hour.all_session_time
|
|
170
|
+
has_one :minute, :mandatory => true # See Minute.all_session_time
|
|
171
|
+
has_one :month, :mandatory => true # See Month.all_session_time
|
|
172
|
+
has_one :year, :mandatory => true # See Year.all_session_time
|
|
173
|
+
end
|
|
174
|
+
|
|
175
|
+
class TicketPricing
|
|
176
|
+
identified_by :session_time, :cinema, :section, :high_demand
|
|
177
|
+
has_one :cinema, :mandatory => true # See Cinema.all_ticket_pricing
|
|
178
|
+
has_one :high_demand, :mandatory => true # See HighDemand.all_ticket_pricing
|
|
179
|
+
has_one :price, :mandatory => true # See Price.all_ticket_pricing
|
|
180
|
+
has_one :section, :mandatory => true # See Section.all_ticket_pricing
|
|
181
|
+
has_one :session_time, :mandatory => true # See SessionTime.all_ticket_pricing
|
|
182
|
+
end
|
|
183
|
+
|
|
184
|
+
class Session
|
|
185
|
+
identified_by :cinema, :session_time
|
|
186
|
+
has_one :cinema, :mandatory => true # See Cinema.all_session
|
|
187
|
+
has_one :film, :mandatory => true # See Film.all_session
|
|
188
|
+
has_one :session_time, :mandatory => true # See SessionTime.all_session
|
|
189
|
+
maybe :is_high_demand
|
|
190
|
+
maybe :uses_allocated_seating
|
|
191
|
+
end
|
|
192
|
+
|
|
193
|
+
class Booking
|
|
194
|
+
identified_by :booking_nr
|
|
195
|
+
has_one :number, :mandatory => true # See Number.all_booking
|
|
196
|
+
has_one :person, :mandatory => true # See Person.all_booking
|
|
197
|
+
has_one :session, :mandatory => true # See Session.all_booking
|
|
198
|
+
has_one :address # See Address.all_booking
|
|
199
|
+
one_to_one :booking_nr, :mandatory => true # See BookingNr.booking
|
|
200
|
+
has_one :collection_code # See CollectionCode.all_booking
|
|
201
|
+
has_one :section # See Section.all_booking
|
|
202
|
+
maybe :tickets_for_have_been_issued
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
class PlacesPaid
|
|
206
|
+
identified_by :booking, :payment_method
|
|
207
|
+
has_one :booking, :mandatory => true # See Booking.all_places_paid
|
|
208
|
+
has_one :number, :mandatory => true # See Number.all_places_paid
|
|
209
|
+
has_one :payment_method, :mandatory => true # See PaymentMethod.all_places_paid
|
|
210
|
+
end
|
|
211
|
+
|
|
212
|
+
class SeatAllocation
|
|
213
|
+
identified_by :booking, :allocated_seat
|
|
214
|
+
has_one :allocated_seat, :class => Seat, :mandatory => true # See Seat.all_seat_allocation_as_allocated_seat
|
|
215
|
+
has_one :booking, :mandatory => true # See Booking.all_seat_allocation
|
|
216
|
+
end
|
|
217
|
+
|
|
218
|
+
end
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
require 'activefacts/api'
|
|
2
|
+
|
|
3
|
+
module ::CompanyDirectorEmployee
|
|
4
|
+
|
|
5
|
+
class CompanyName < String
|
|
6
|
+
value_type :length => 48
|
|
7
|
+
one_to_one :company # See Company.company_name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class Date < ::Date
|
|
11
|
+
value_type
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class EmployeeNr < SignedInteger
|
|
15
|
+
value_type :length => 32
|
|
16
|
+
one_to_one :employee # See Employee.employee_nr
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
class Name < String
|
|
20
|
+
value_type :length => 48
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
class Company
|
|
24
|
+
identified_by :company_name
|
|
25
|
+
one_to_one :company_name, :mandatory => true # See CompanyName.company
|
|
26
|
+
maybe :is_listed
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
class Employee
|
|
30
|
+
identified_by :employee_nr
|
|
31
|
+
has_one :company, :mandatory => true # See Company.all_employee
|
|
32
|
+
one_to_one :employee_nr, :mandatory => true # See EmployeeNr.employee
|
|
33
|
+
has_one :manager # See Manager.all_employee
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
class Manager < Employee
|
|
37
|
+
maybe :is_ceo
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
class Meeting
|
|
41
|
+
identified_by :company, :date, :is_board_meeting
|
|
42
|
+
has_one :company, :mandatory => true # See Company.all_meeting
|
|
43
|
+
has_one :date, :mandatory => true # See Date.all_meeting
|
|
44
|
+
maybe :is_board_meeting
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
class Person
|
|
48
|
+
identified_by :given_name, :family_name
|
|
49
|
+
has_one :birth_date, :class => Date # See Date.all_person_as_birth_date
|
|
50
|
+
has_one :family_name, :class => Name # See Name.all_person_as_family_name
|
|
51
|
+
has_one :given_name, :class => Name, :mandatory => true # See Name.all_person_as_given_name
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
class Attendance
|
|
55
|
+
identified_by :attendee, :meeting
|
|
56
|
+
has_one :attendee, :class => Person, :mandatory => true # See Person.all_attendance_as_attendee
|
|
57
|
+
has_one :meeting, :mandatory => true # See Meeting.all_attendance
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
class Directorship
|
|
61
|
+
identified_by :director, :company
|
|
62
|
+
has_one :company, :mandatory => true # See Company.all_directorship
|
|
63
|
+
has_one :director, :class => Person, :mandatory => true # See Person.all_directorship_as_director
|
|
64
|
+
has_one :appointment_date, :class => Date, :mandatory => true # See Date.all_directorship_as_appointment_date
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
class Employment
|
|
68
|
+
identified_by :person, :employee
|
|
69
|
+
has_one :employee, :mandatory => true # See Employee.all_employment
|
|
70
|
+
has_one :person, :mandatory => true # See Person.all_employment
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
end
|
data/ruby/Death.rb
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
require 'activefacts/api'
|
|
2
|
+
|
|
3
|
+
module ::Death
|
|
4
|
+
|
|
5
|
+
class CauseOfDeath < String
|
|
6
|
+
value_type
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class PersonName < String
|
|
10
|
+
value_type :length => 40
|
|
11
|
+
one_to_one :person # See Person.person_name
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
class Person
|
|
15
|
+
identified_by :person_name
|
|
16
|
+
maybe :is_dead
|
|
17
|
+
one_to_one :person_name, :mandatory => true # See PersonName.person
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class Death
|
|
21
|
+
identified_by :person
|
|
22
|
+
one_to_one :person, :mandatory => true # See Person.death
|
|
23
|
+
has_one :cause_of_death # See CauseOfDeath.all_death
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
data/ruby/Diplomacy.rb
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
require 'activefacts/api'
|
|
2
|
+
|
|
3
|
+
module ::Diplomacy
|
|
4
|
+
|
|
5
|
+
class CountryName < String
|
|
6
|
+
value_type
|
|
7
|
+
one_to_one :country # See Country.country_name
|
|
8
|
+
end
|
|
9
|
+
|
|
10
|
+
class DiplomatName < String
|
|
11
|
+
value_type
|
|
12
|
+
one_to_one :diplomat # See Diplomat.diplomat_name
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
class LanguageName < String
|
|
16
|
+
value_type
|
|
17
|
+
one_to_one :language # See Language.language_name
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
class Country
|
|
21
|
+
identified_by :country_name
|
|
22
|
+
one_to_one :country_name, :mandatory => true # See CountryName.country
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
class Diplomat
|
|
26
|
+
identified_by :diplomat_name
|
|
27
|
+
one_to_one :diplomat_name, :mandatory => true # See DiplomatName.diplomat
|
|
28
|
+
has_one :represented_country, :class => Country, :mandatory => true # See Country.all_diplomat_as_represented_country
|
|
29
|
+
has_one :served_country, :class => Country, :mandatory => true # See Country.all_diplomat_as_served_country
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
class Language
|
|
33
|
+
identified_by :language_name
|
|
34
|
+
one_to_one :language_name, :mandatory => true # See LanguageName.language
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class LanguageUse
|
|
38
|
+
identified_by :language, :country
|
|
39
|
+
has_one :country, :mandatory => true # See Country.all_language_use
|
|
40
|
+
has_one :language, :mandatory => true # See Language.all_language_use
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
class Ambassador < Diplomat
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
class Fluency
|
|
47
|
+
identified_by :diplomat, :language
|
|
48
|
+
has_one :diplomat, :mandatory => true # See Diplomat.all_fluency
|
|
49
|
+
has_one :language, :mandatory => true # See Language.all_fluency
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
class Representation
|
|
53
|
+
identified_by :represented_country, :country
|
|
54
|
+
has_one :ambassador, :mandatory => true # See Ambassador.all_representation
|
|
55
|
+
has_one :country, :mandatory => true # See Country.all_representation
|
|
56
|
+
has_one :represented_country, :class => Country, :mandatory => true # See Country.all_representation_as_represented_country
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
end
|
data/ruby/Genealogy.rb
ADDED
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
require 'activefacts/api'
|
|
2
|
+
|
|
3
|
+
module ::Genealogy
|
|
4
|
+
|
|
5
|
+
class Address < String
|
|
6
|
+
value_type :length => 128
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
class Certificate < String
|
|
10
|
+
value_type :length => 64
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
class Day < UnsignedInteger
|
|
14
|
+
value_type :length => 32
|
|
15
|
+
restrict 1..31
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
class Email < String
|
|
19
|
+
value_type :length => 64
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
class EventID < AutoCounter
|
|
23
|
+
value_type
|
|
24
|
+
one_to_one :event # See Event.event_id
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
class EventLocation < String
|
|
28
|
+
value_type :length => 128
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
class EventRoleName < String
|
|
32
|
+
value_type
|
|
33
|
+
restrict 'Celebrant', 'Father', 'Husband', 'Mother', 'Subject', 'Wife'
|
|
34
|
+
one_to_one :role # See Role.event_role_name
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
class EventTypeID < AutoCounter
|
|
38
|
+
value_type
|
|
39
|
+
one_to_one :event_type # See EventType.event_type_id
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
class EventTypeName < String
|
|
43
|
+
value_type :length => 16
|
|
44
|
+
restrict 'Birth', 'Burial', 'Christening', 'Death', 'Divorce', 'Marriage'
|
|
45
|
+
one_to_one :event_type # See EventType.event_type_name
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
class Gender < Char
|
|
49
|
+
value_type :length => 1
|
|
50
|
+
restrict 'F', 'M'
|
|
51
|
+
end
|
|
52
|
+
|
|
53
|
+
class Month < UnsignedInteger
|
|
54
|
+
value_type :length => 32
|
|
55
|
+
restrict 1..12
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
class Name < String
|
|
59
|
+
value_type :length => 128
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
class Occupation < String
|
|
63
|
+
value_type :length => 128
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
class Official < String
|
|
67
|
+
value_type :length => 64
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
class PersonID < AutoCounter
|
|
71
|
+
value_type
|
|
72
|
+
one_to_one :person # See Person.person_id
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
class Picture < Image
|
|
76
|
+
value_type
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
class RoleID < AutoCounter
|
|
80
|
+
value_type
|
|
81
|
+
one_to_one :role # See Role.role_id
|
|
82
|
+
end
|
|
83
|
+
|
|
84
|
+
class SourceID < AutoCounter
|
|
85
|
+
value_type
|
|
86
|
+
one_to_one :source # See Source.source_id
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
class SourceName < String
|
|
90
|
+
value_type :length => 128
|
|
91
|
+
one_to_one :source # See Source.source_name
|
|
92
|
+
end
|
|
93
|
+
|
|
94
|
+
class UserID < AutoCounter
|
|
95
|
+
value_type
|
|
96
|
+
one_to_one :user # See User.user_id
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
class Year < UnsignedInteger
|
|
100
|
+
value_type :length => 32
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
class Event
|
|
104
|
+
identified_by :event_id
|
|
105
|
+
has_one :certificate # See Certificate.all_event
|
|
106
|
+
has_one :event_date # See EventDate.all_event
|
|
107
|
+
one_to_one :event_id, :class => EventID, :mandatory => true # See EventID.event
|
|
108
|
+
has_one :event_location # See EventLocation.all_event
|
|
109
|
+
has_one :event_type # See EventType.all_event
|
|
110
|
+
has_one :official # See Official.all_event
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
class EventDate
|
|
114
|
+
identified_by :min_year, :max_year, :month, :day
|
|
115
|
+
has_one :day # See Day.all_event_date
|
|
116
|
+
has_one :max_year, :class => Year # See Year.all_event_date_as_max_year
|
|
117
|
+
has_one :min_year, :class => Year # See Year.all_event_date_as_min_year
|
|
118
|
+
has_one :month # See Month.all_event_date
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
class EventType
|
|
122
|
+
identified_by :event_type_id
|
|
123
|
+
one_to_one :event_type_id, :class => EventTypeID, :mandatory => true # See EventTypeID.event_type
|
|
124
|
+
one_to_one :event_type_name, :mandatory => true # See EventTypeName.event_type
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
class Person
|
|
128
|
+
identified_by :person_id
|
|
129
|
+
has_one :address # See Address.all_person
|
|
130
|
+
has_one :email # See Email.all_person
|
|
131
|
+
has_one :family_name, :class => Name # See Name.all_person_as_family_name
|
|
132
|
+
has_one :gender # See Gender.all_person
|
|
133
|
+
has_one :given_name, :class => Name # See Name.all_person_as_given_name
|
|
134
|
+
has_one :occupation # See Occupation.all_person
|
|
135
|
+
one_to_one :person_id, :class => PersonID, :mandatory => true # See PersonID.person
|
|
136
|
+
has_one :preferred_picture, :class => Picture # See Picture.all_person_as_preferred_picture
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
class Role
|
|
140
|
+
identified_by :role_id
|
|
141
|
+
one_to_one :event_role_name, :mandatory => true # See EventRoleName.role
|
|
142
|
+
one_to_one :role_id, :class => RoleID, :mandatory => true # See RoleID.role
|
|
143
|
+
end
|
|
144
|
+
|
|
145
|
+
class Source
|
|
146
|
+
identified_by :source_id
|
|
147
|
+
one_to_one :source_id, :class => SourceID, :mandatory => true # See SourceID.source
|
|
148
|
+
one_to_one :source_name, :mandatory => true # See SourceName.source
|
|
149
|
+
has_one :user, :mandatory => true # See User.all_source
|
|
150
|
+
end
|
|
151
|
+
|
|
152
|
+
class User
|
|
153
|
+
identified_by :user_id
|
|
154
|
+
has_one :email # See Email.all_user
|
|
155
|
+
one_to_one :user_id, :class => UserID, :mandatory => true # See UserID.user
|
|
156
|
+
end
|
|
157
|
+
|
|
158
|
+
class Friendship
|
|
159
|
+
identified_by :user, :other_user
|
|
160
|
+
has_one :other_user, :class => User, :mandatory => true # See User.all_friendship_as_other_user
|
|
161
|
+
has_one :user, :mandatory => true # See User.all_friendship
|
|
162
|
+
maybe :is_confirmed
|
|
163
|
+
end
|
|
164
|
+
|
|
165
|
+
class Participation
|
|
166
|
+
identified_by :person, :role, :event, :source
|
|
167
|
+
has_one :event, :mandatory => true # See Event.all_participation
|
|
168
|
+
has_one :person, :mandatory => true # See Person.all_participation
|
|
169
|
+
has_one :role, :mandatory => true # See Role.all_participation
|
|
170
|
+
has_one :source, :mandatory => true # See Source.all_participation
|
|
171
|
+
end
|
|
172
|
+
|
|
173
|
+
end
|