@@ -212,81 +212,33 @@ public static class DataverseQueries
212
212
213
213
214
214
//Total Operational Spaces
215
- public const string TotalOperationSpaces = @$ "ofm_licence_details?fetchXml=
216
- <fetch aggregate=""true"">
217
- <entity name=""ofm_licence_detail"">
218
- <attribute name=""ofm_operational_spaces"" alias=""TotalSpaces"" aggregate=""sum"" />
219
- <filter>
220
- <condition attribute=""statecode"" operator=""eq"" value=""0"" />
221
- <condition attribute=""ofm_licence_type"" operator=""in"">
222
- <value>1</value>
223
- <value>2</value>
224
- <value>4</value>
225
- <value>5</value>
226
- <value>6</value>
227
- <value>12</value>
228
- <value>3</value>
229
- <value>7</value>
230
- <value>8</value>
231
- <value>9</value>
232
- <value>10</value>
233
- <value>11</value>
234
- <value>12</value>
235
- </condition>
236
- </filter>
237
- <link-entity name=""ofm_licence"" from=""ofm_licenceid"" to=""ofm_licence"" alias=""f"">
238
- <filter>
239
- <condition attribute=""ofm_facility"" operator=""eq"" value=""{{0}}"" />
240
- <condition attribute=""statecode"" operator=""eq"" value=""0"" />
241
- <filter type=""or"">
242
- <filter type=""and"">
243
- <condition attribute=""ofm_start_date"" operator=""on-or-before"" value=""{{1}}"" />
244
- <condition attribute=""ofm_end_date"" operator=""null"" />
245
- </filter>
246
- <filter type=""and"">
247
- <condition attribute=""ofm_start_date"" operator=""on-or-before"" value=""{{1}}"" />
248
- <condition attribute=""ofm_end_date"" operator=""on-or-after"" value=""{{1}}"" />
249
- </filter>
250
- </filter>
251
- </filter>
252
- </link-entity>
253
- </entity>
254
- </fetch>
255
- " ;
215
+ public const string TotalOperationSpaces = @$ "ofm_applications?fetchXml=
216
+ <fetch version=""1.0"" output-format=""xml-platform"" mapping=""logical"" distinct=""false"">
217
+ <entity name=""ofm_application"">
218
+ <attribute name=""ofm_applicationid"" />
219
+ <attribute name=""ofm_application"" />
220
+ <attribute name=""createdon"" />
221
+ <attribute name=""ofm_total_operational_spaces"" alias=""TotalSpaces"" />
222
+ <order attribute=""ofm_application"" descending=""false"" />
223
+ <filter type=""and"">
224
+ <condition attribute=""ofm_applicationid"" operator=""eq"" uitype=""ofm_application"" value=""{{0}}"" />
225
+ </filter>
226
+ </entity>
227
+ </fetch>" ;
256
228
////0-5 Age Group Childcare Category Operational Spaces
257
- public const string MaxChildSpaces = @$ "ofm_licence_details?fetchXml=
258
- <fetch aggregate=""true"">
259
- <entity name=""ofm_licence_detail"">
260
- <attribute name=""ofm_operational_spaces"" alias=""MaxSpaces"" aggregate=""sum"" />
261
- <filter>
262
- <condition attribute=""statecode"" operator=""eq"" value=""0"" />
263
- <condition attribute=""ofm_licence_type"" operator=""in"">
264
- <value>1</value>
265
- <value>2</value>
266
- <value>4</value>
267
- <value>5</value>
268
- <value>6</value>
269
- <value>12</value>
270
- </condition>
271
- </filter>
272
- <link-entity name=""ofm_licence"" from=""ofm_licenceid"" to=""ofm_licence"" alias=""f"">
273
- <filter>
274
- <condition attribute=""ofm_facility"" operator=""eq"" value=""{{0}}"" />
275
- <condition attribute=""statecode"" operator=""eq"" value=""0"" />
276
- <filter type=""or"">
277
- <filter type=""and"">
278
- <condition attribute=""ofm_start_date"" operator=""on-or-before"" value=""{{1}}"" />
279
- <condition attribute=""ofm_end_date"" operator=""null"" />
280
- </filter>
281
- <filter type=""and"">
282
- <condition attribute=""ofm_start_date"" operator=""on-or-before"" value=""{{1}}"" />
283
- <condition attribute=""ofm_end_date"" operator=""on-or-after"" value=""{{1}}"" />
284
- </filter>
285
- </filter>
286
- </filter>
287
- </link-entity>
288
- </entity>
289
- </fetch>" ;
229
+ public const string MaxChildSpaces = @$ "ofm_applications?fetchXml=
230
+ <fetch version=""1.0"" output-format=""xml-platform"" mapping=""logical"" distinct=""false"">
231
+ <entity name=""ofm_application"">
232
+ <attribute name=""ofm_applicationid"" />
233
+ <attribute name=""ofm_preschool_4_hours_op"" />
234
+ <attribute name=""ofm_group_child_care_30_months_school_age_op"" />
235
+ <attribute name=""ofm_group_child_care_under_36_months_op"" />
236
+ <order attribute=""ofm_application"" descending=""false"" />
237
+ <filter type=""and"">
238
+ <condition attribute=""ofm_applicationid"" operator=""eq"" uitype=""ofm_application"" value=""{{0}}"" />
239
+ </filter>
240
+ </entity>
241
+ </fetch>" ;
290
242
291
243
public static string AllSchoolDistrictQuery = $@ "ofm_school_districts?$select=ofm_school_district_fullname,ofm_school_district_number,ofm_school_district_name,ofm_postal_code,ofm_name&$filter=statecode eq 0 and _ofm_application_score_calculator_value eq '{{0}}'";
292
244
public static string AllScoreCategoryQuery = "ofm_application_score_categories?$filter=_ofm_application_score_calculator_value eq '{0}'&$select=ofm_name,ofm_maximum_score,ofm_description,ofm_category_display_name,ofm_application_score_group" ;
@@ -447,7 +399,7 @@ public LicenseSpaces(JsonObject data)
447
399
{
448
400
_data = data ?? throw new ArgumentNullException ( nameof ( data ) ) ;
449
401
}
450
- public decimal ? MaxPreSchoolChildCareSpaces => _data . GetPropertyValue < decimal > ( "MaxSpaces " ) ;
402
+ public decimal ? MaxPreSchoolChildCareSpaces => _data . GetPropertyValue < decimal > ( "ofm_group_child_care_under_36_months_op" ) + _data . GetPropertyValue < decimal > ( "ofm_preschool_4_hours_op" ) + _data . GetPropertyValue < decimal > ( "ofm_group_child_care_30_months_school_age_op ") ;
451
403
public decimal ? TotalChildCareSpaces => _data . GetPropertyValue < decimal > ( "TotalSpaces" ) ;
452
404
453
405
}
0 commit comments