52dd4c58a8337ae200c502eba4e0210c3e48e3dc
Integration.md
... | ... | @@ -76,93 +76,50 @@ Schema definition is [here](https://brave-sack.surge.sh/). |
76 | 76 | * 2021-10-26 Modified implementation of 'booking' object to better handle casual bookings |
77 | 77 | * 2021-07-31 Added Contacts list to child object |
78 | 78 | |
79 | -#### Planned Changes |
|
80 | 79 | |
81 | -We are working on introducing a SmartSync option sometime during November/December 2021. SmartSync will be based on publish/subscribe model and allow integrators to receive real time notifications of an object change. |
|
82 | 80 | |
83 | -The basic concept is that integrators can subscribe to a topic of interest (eg 'enrolments' ) and receive notifications when an individual enrolment changes , then get the information for that enrolment that's relevant to them. |
|
84 | 81 | |
85 | -The advantage of this process is that for data that changes infrequently (eg child's contact details, bookings etc.) the speed of updating into downstream systems can be enhanced and the frequency of 'get all' operations decreased, reducing load at both ends and enhancing customer experience. |
|
86 | - |
|
87 | -SmartSync will be rolled out for enrolments first, hence the addition in this release of support for querying an individual enrolment in preparation. |
|
88 | - |
|
89 | -The changes will be NON DESTRUCTIVE and INCREMENTAL ie it is entirely optional to implement SmartSync when it becomes available, the current implementations will still work. |
|
90 | - |
|
91 | -The mechanism for subscribing and delivering notifications is yet to be determined. Check back here for further updates or contact us directly. |
|
92 | - |
|
93 | -### Sample Query 1 |
|
82 | +### Get a list of enrolments |
|
94 | 83 | |
95 | 84 | ``` |
96 | 85 | { |
97 | 86 | "query": "{ |
98 | 87 | service(id: 1) { |
99 | 88 | id |
100 | - enrolments { |
|
101 | - child { |
|
102 | - id |
|
103 | - firstName |
|
104 | - lastName |
|
105 | - } |
|
106 | - parent1 { |
|
107 | - id |
|
108 | - firstName |
|
109 | - lastName |
|
110 | - email |
|
111 | - } |
|
112 | - parent2 { |
|
113 | - id |
|
114 | - firstName |
|
115 | - lastName |
|
116 | - email |
|
117 | - } |
|
118 | - startDate |
|
119 | - status |
|
120 | - bookings { |
|
121 | - day |
|
122 | - room |
|
123 | - } |
|
124 | - } |
|
89 | + enrolments { |
|
90 | + id |
|
91 | + status |
|
92 | + startDate |
|
93 | + } |
|
125 | 94 | } |
126 | 95 | }" |
127 | 96 | } |
128 | 97 | ``` |
129 | 98 | |
130 | -### Sample Query 2 |
|
99 | +### Get a single enrolment with details |
|
100 | + |
|
131 | 101 | ``` |
132 | 102 | { |
133 | 103 | "query": "{ |
134 | - service(id: 472) { |
|
104 | + service(id: 1) { |
|
135 | 105 | id |
136 | - enrolments { |
|
106 | + enrolments(id: \"sfdev_22020\") { |
|
107 | + id |
|
108 | + status |
|
109 | + startDate |
|
137 | 110 | child { |
138 | - id |
|
139 | - firstName |
|
140 | - lastName |
|
111 | + dateOfBirth |
|
112 | + contacts { |
|
113 | + firstName |
|
114 | + } |
|
141 | 115 | } |
142 | 116 | parent1 { |
143 | - id |
|
144 | 117 | firstName |
145 | - lastName |
|
146 | 118 | email |
147 | 119 | } |
148 | 120 | parent2 { |
149 | - id |
|
150 | - firstName |
|
151 | 121 | lastName |
152 | - email |
|
153 | - } |
|
154 | - startDate |
|
155 | - status |
|
156 | - endDate |
|
157 | - bookings { |
|
158 | - day |
|
159 | - room |
|
160 | - } |
|
161 | - sessions(date: \"2020-08-06T17:00:01Z\") { |
|
162 | - room |
|
163 | - startTime |
|
164 | - endTime |
|
165 | - absent |
|
122 | + phone |
|
166 | 123 | } |
167 | 124 | } |
168 | 125 | } |
... | ... | @@ -170,79 +127,41 @@ The mechanism for subscribing and delivering notifications is yet to be determin |
170 | 127 | } |
171 | 128 | ``` |
172 | 129 | |
173 | -### Sample Query 3 |
|
130 | +### Who attended on a particular date? (Actual sessions) |
|
174 | 131 | |
175 | 132 | ``` |
176 | 133 | { |
177 | - |
|
178 | 134 | "query": "{ |
179 | - |
|
180 | - service(id: 979) { |
|
135 | + service(id: 472) { |
|
181 | 136 | id |
182 | - sessions(date: \"2020-08-11\") { |
|
183 | - enrolmentId |
|
137 | + sessions(date: \"2020-08-06\") { |
|
184 | 138 | room |
139 | + enrolmentId |
|
140 | + fee |
|
185 | 141 | startTime |
186 | 142 | endTime |
187 | 143 | absent |
188 | 144 | } |
189 | - |
|
190 | - enrolments { |
|
191 | - id |
|
192 | - child { |
|
193 | - id |
|
194 | - firstName |
|
195 | - lastName |
|
196 | - dateOfBirth |
|
197 | - } |
|
198 | - } |
|
199 | 145 | } |
200 | 146 | }" |
201 | 147 | } |
202 | 148 | ``` |
203 | 149 | |
204 | -### Sample Query 4 |
|
150 | +### How many children are present at a certain time? |
|
151 | + |
|
205 | 152 | |
206 | 153 | ``` |
207 | 154 | { |
208 | - |
|
209 | 155 | "query": "{ |
210 | - service(id: 979) { |
|
156 | + service(id: 472) { |
|
211 | 157 | id |
212 | - sessions(date: \"2020-08-11\") { |
|
213 | - enrolmentId |
|
214 | - room |
|
215 | - startTime |
|
216 | - endTime |
|
217 | - absent |
|
218 | - } |
|
219 | - enrolments { |
|
220 | - id |
|
221 | - child { |
|
222 | - id |
|
223 | - firstName |
|
224 | - lastName |
|
225 | - dateOfBirth |
|
226 | - } |
|
227 | - parent1 { |
|
228 | - id |
|
229 | - firstName |
|
230 | - lastName |
|
231 | - email |
|
232 | - phone |
|
233 | - } |
|
234 | - parent2 { |
|
235 | - id |
|
236 | - firstName |
|
237 | - lastName |
|
238 | - email |
|
239 | - phone |
|
240 | - } |
|
158 | + sessions(date: \"2020-08-06T17:00:01Z\") { |
|
159 | + room |
|
160 | + absent |
|
241 | 161 | } |
242 | 162 | } |
243 | 163 | }" |
244 | 164 | } |
245 | - |
|
246 | 165 | ``` |
247 | 166 | |
248 | 167 |