Merge pull request #22971 from eileenmcnaughton/pay_later
[civicrm-core.git] / xml / schema / Event / Participant.xml
1 <?xml version="1.0" encoding="iso-8859-1" ?>
2
3 <table>
4 <base>CRM/Event</base>
5 <class>Participant</class>
6 <name>civicrm_participant</name>
7 <description>Records of contacts' attendance and roles in events.</description>
8 <add>1.7</add>
9 <log>true</log>
10 <icon>fa-ticket</icon>
11 <component>CiviEvent</component>
12 <field>
13 <name>id</name>
14 <uniqueName>participant_id</uniqueName>
15 <title>Participant ID</title>
16 <type>int unsigned</type>
17 <required>true</required>
18 <comment>Participant ID</comment>
19 <import>true</import>
20 <headerPattern>/(^(participant(.)?)?id$)/i</headerPattern>
21 <html>
22 <type>Number</type>
23 </html>
24 <add>1.7</add>
25 </field>
26 <primaryKey>
27 <name>id</name>
28 <autoincrement>true</autoincrement>
29 </primaryKey>
30 <field>
31 <name>contact_id</name>
32 <uniqueName>participant_contact_id</uniqueName>
33 <type>int unsigned</type>
34 <title>Contact ID</title>
35 <headerPattern>/contact(.?id)?/i</headerPattern>
36 <import>true</import>
37 <required>true</required>
38 <comment>FK to Contact ID</comment>
39 <html>
40 <label>Contact</label>
41 </html>
42 <add>1.7</add>
43 </field>
44 <foreignKey>
45 <name>contact_id</name>
46 <table>civicrm_contact</table>
47 <key>id</key>
48 <onDelete>CASCADE</onDelete>
49 </foreignKey>
50 <field>
51 <name>event_id</name>
52 <type>int unsigned</type>
53 <title>Event ID</title>
54 <import>true</import>
55 <headerPattern>/event id$/i</headerPattern>
56 <required>true</required>
57 <comment>FK to Event ID</comment>
58 <html>
59 <label>Event</label>
60 </html>
61 <add>1.7</add>
62 </field>
63 <foreignKey>
64 <name>event_id</name>
65 <table>civicrm_event</table>
66 <key>id</key>
67 <onDelete>CASCADE</onDelete>
68 </foreignKey>
69 <field>
70 <name>status_id</name>
71 <uniqueName>participant_status_id</uniqueName>
72 <title>Status ID</title>
73 <headerPattern>/(participant.)?(status)$/i</headerPattern>
74 <import>true</import>
75 <type>int unsigned</type>
76 <export>true</export>
77 <required>true</required>
78 <default>1</default>
79 <comment>Participant status ID. FK to civicrm_participant_status_type. Default of 1 should map to status = Registered.</comment>
80 <add>1.7</add>
81 <pseudoconstant>
82 <table>civicrm_participant_status_type</table>
83 <keyColumn>id</keyColumn>
84 <labelColumn>label</labelColumn>
85 </pseudoconstant>
86 <html>
87 <type>Select</type>
88 <label>Status</label>
89 </html>
90 </field>
91 <foreignKey>
92 <name>status_id</name>
93 <table>civicrm_participant_status_type</table>
94 <key>id</key>
95 <add>3.0</add>
96 </foreignKey>
97 <index>
98 <name>index_status_id</name>
99 <fieldName>status_id</fieldName>
100 <add>1.8</add>
101 </index>
102 <field>
103 <name>role_id</name>
104 <uniqueName>participant_role_id</uniqueName>
105 <title>Participant Role ID</title>
106 <pseudoconstant>
107 <optionGroupName>participant_role</optionGroupName>
108 </pseudoconstant>
109 <html>
110 <type>Select</type>
111 <multiple>1</multiple>
112 <label>Participant Role</label>
113 </html>
114 <serialize>SEPARATOR_TRIMMED</serialize>
115 <headerPattern>/(participant.)?(role)$/i</headerPattern>
116 <import>true</import>
117 <type>varchar</type>
118 <length>128</length>
119 <export>true</export>
120 <default>NULL</default>
121 <comment>Participant role ID. Implicit FK to civicrm_option_value where option_group = participant_role.</comment>
122 <add>1.7</add>
123 </field>
124 <index>
125 <name>index_role_id</name>
126 <fieldName>role_id</fieldName>
127 <add>1.8</add>
128 </index>
129 <field>
130 <name>register_date</name>
131 <uniqueName>participant_register_date</uniqueName>
132 <title>Register date</title>
133 <headerPattern>/^(r(egister\s)?date)$/i</headerPattern>
134 <import>true</import>
135 <type>datetime</type>
136 <comment>When did contact register for event?</comment>
137 <add>1.7</add>
138 <html>
139 <type>Select Date</type>
140 <formatType>activityDateTime</formatType>
141 </html>
142 </field>
143 <field>
144 <name>source</name>
145 <uniqueName>participant_source</uniqueName>
146 <title>Participant Source</title>
147 <headerPattern>/(participant.)?(source)$/i</headerPattern>
148 <import>true</import>
149 <type>varchar</type>
150 <length>128</length>
151 <comment>Source of this event registration.</comment>
152 <html>
153 <type>Text</type>
154 </html>
155 <add>1.7</add>
156 </field>
157 <field>
158 <name>fee_level</name>
159 <uniqueName>participant_fee_level</uniqueName>
160 <title>Fee level</title>
161 <headerPattern>/^(f(ee\s)?level)$/i</headerPattern>
162 <type>text</type>
163 <import>true</import>
164 <serialize>SEPARATOR_BOOKEND</serialize>
165 <comment>Populate with the label (text) associated with a fee level for paid events with multiple levels. Note that
166 we store the label value and not the key</comment>
167 <add>1.7</add>
168 </field>
169 <field>
170 <name>is_test</name>
171 <uniqueName>participant_is_test</uniqueName>
172 <title>Test</title>
173 <type>boolean</type>
174 <default>0</default>
175 <import>true</import>
176 <add>1.7</add>
177 </field>
178 <field>
179 <name>is_pay_later</name>
180 <uniqueName>participant_is_pay_later</uniqueName>
181 <title>Is Pay Later</title>
182 <type>boolean</type>
183 <default>0</default>
184 <import>true</import>
185 <headerPattern>/(is.)?(pay(.)?later)$/i</headerPattern>
186 <add>2.1</add>
187 </field>
188
189 <field>
190 <name>fee_amount</name>
191 <uniqueName>participant_fee_amount</uniqueName>
192 <title>Fee Amount</title>
193 <type>decimal</type>
194 <import>true</import>
195 <headerPattern>/fee(.?am(ou)?nt)?/i</headerPattern>
196 <dataPattern>/^\d+(\.\d{2})?$/</dataPattern>
197 <comment>actual processor fee if known - may be 0.</comment>
198 <add>2.1</add>
199 </field>
200 <field>
201 <name>registered_by_id</name>
202 <uniqueName>participant_registered_by_id</uniqueName>
203 <type>int unsigned</type>
204 <title>Registered By Participant ID</title>
205 <import>true</import>
206 <default>NULL</default>
207 <comment>FK to Participant ID</comment>
208 <html>
209 <label>Registered By</label>
210 </html>
211 <add>2.1</add>
212 <export>true</export>
213 </field>
214 <foreignKey>
215 <name>registered_by_id</name>
216 <table>civicrm_participant</table>
217 <key>id</key>
218 <add>2.1</add>
219 <onDelete>SET NULL</onDelete>
220 </foreignKey>
221 <field>
222 <name>discount_id</name>
223 <uniqueName>participant_discount_id</uniqueName>
224 <type>int unsigned</type>
225 <title>Discount ID</title>
226 <default>NULL</default>
227 <comment>FK to Discount ID</comment>
228 <html>
229 <label>Discount</label>
230 </html>
231 <add>2.1</add>
232 </field>
233 <foreignKey>
234 <name>discount_id</name>
235 <table>civicrm_discount</table>
236 <key>id</key>
237 <add>2.1</add>
238 <onDelete>SET NULL</onDelete>
239 </foreignKey>
240 <field>
241 <name>fee_currency</name>
242 <uniqueName>participant_fee_currency</uniqueName>
243 <title>Fee Currency</title>
244 <type>varchar</type>
245 <length>3</length>
246 <default>NULL</default>
247 <import>true</import>
248 <headerPattern>/(fee)?.?cur(rency)?/i</headerPattern>
249 <dataPattern>/^[A-Z]{3}$/i</dataPattern>
250 <comment>3 character string, value derived from config setting.</comment>
251 <add>3.0</add>
252 <pseudoconstant>
253 <table>civicrm_currency</table>
254 <keyColumn>name</keyColumn>
255 <labelColumn>full_name</labelColumn>
256 <nameColumn>name</nameColumn>
257 <abbrColumn>symbol</abbrColumn>
258 </pseudoconstant>
259 <html>
260 <type>Select</type>
261 </html>
262 </field>
263 <field>
264 <name>campaign_id</name>
265 <component>CiviCampaign</component>
266 <uniqueName>participant_campaign_id</uniqueName>
267 <type>int unsigned</type>
268 <title>Campaign ID</title>
269 <import>true</import>
270 <comment>The campaign for which this participant has been registered.</comment>
271 <html>
272 <type>EntityRef</type>
273 <label>Campaign</label>
274 </html>
275 <add>3.4</add>
276 <pseudoconstant>
277 <table>civicrm_campaign</table>
278 <keyColumn>id</keyColumn>
279 <labelColumn>title</labelColumn>
280 <prefetch>FALSE</prefetch>
281 </pseudoconstant>
282 </field>
283 <foreignKey>
284 <name>campaign_id</name>
285 <table>civicrm_campaign</table>
286 <key>id</key>
287 <onDelete>SET NULL</onDelete>
288 </foreignKey>
289 <field>
290 <name>discount_amount</name>
291 <type>int unsigned</type>
292 <title>Discount Amount</title>
293 <comment>Discount Amount</comment>
294 <add>4.1</add>
295 </field>
296 <field>
297 <name>cart_id</name>
298 <type>int unsigned</type>
299 <title>Event Cart ID</title>
300 <comment>FK to civicrm_event_carts</comment>
301 <html>
302 <label>Event Cart</label>
303 </html>
304 <add>4.1</add>
305 </field>
306 <foreignKey>
307 <name>cart_id</name>
308 <table>civicrm_event_carts</table>
309 <key>id</key>
310 <onDelete>SET NULL</onDelete>
311 </foreignKey>
312 <field>
313 <name>must_wait</name>
314 <type>int</type>
315 <title>Must Wait on List</title>
316 <comment>On Waiting List</comment>
317 <add>4.1</add>
318 </field>
319 <field>
320 <name>transferred_to_contact_id</name>
321 <uniqueName>transferred_to_contact_id</uniqueName>
322 <type>int unsigned</type>
323 <default>NULL</default>
324 <title>Transferred to Contact ID</title>
325 <headerPattern>/transfer(.?id)?/i</headerPattern>
326 <import>true</import>
327 <comment>FK to Contact ID</comment>
328 <html>
329 <label>Transferred to</label>
330 </html>
331 <add>4.7</add>
332 </field>
333 <foreignKey>
334 <name>transferred_to_contact_id</name>
335 <table>civicrm_contact</table>
336 <key>id</key>
337 <onDelete>SET NULL</onDelete>
338 </foreignKey>
339 </table>