1{
2 "name": "Scan",
3 "entityCode": "0016",
4 "description": "To scan a barcode or QR code",
5 "tag": [
6 {
7 "name": "usage",
8 "value": "Utility"
9 }
10 ],
11 "inputs": {
12 "type": "object",
13 "properties": {
14 "defaultERC": {
15 "title": "Default Event Reason Code",
16 "type": "object",
17 "description": "This attribute is used for determining the Unscanned shipments.",
18 "required": ["eventCode", "reasonCode"],
19 "properties": {
20 "eventCode": {
21 "title": "Event Code",
22 "description": "This attribute is used to enable the developer to set default event code.",
23 "type": "string"
24 },
25 "reasonCode": {
26 "title": "Reason Code",
27 "description": "This attribute is used to enable the developer to set default reason code",
28 "type": "string"
29 }
30 }
31 },
32 "ercSelector": {
33 "title": "Event/Reason Code Selector",
34 "description": "FE will select the ERC (Event and Reason Code) from the dropdown displayed and using this attribute developer can enable an FE to do so.",
35 "type": "array",
36 "items": {
37 "type": "object",
38 "required": ["eventCode", "reasonCode"],
39 "properties": {
40 "eventCode": {
41 "title": "Event Code",
42 "description": "This attribute is used to enable the developer to set default event code.",
43 "type": "string"
44 },
45 "reasonCode": {
46 "title": "Reason Code",
47 "description": "This attribute is used to enable the developer to set default reason code",
48 "type": "array",
49 "items": {
50 "type": "string"
51 },
52 "uniqueItems": true
53 }
54 }
55 }
56 },
57 "scannedInput": {
58 "title": "Scanned Input",
59 "type": "object",
60 "description": "This attribute is used by developers to set the type for scanned inputs. The type of scan to be expected.",
61 "properties": {
62 "scanType": {
63 "title": "Scan Type",
64 "description": "Type of scan",
65 "type": "array",
66 "uniqueItems": true,
67 "items": {
68 "type": "string",
69 "enum": [
70 "QRCODE",
71 "aztec",
72 "codabar",
73 "code39",
74 "code93",
75 "code128",
76 "datamatrix",
77 "ean13",
78 "ean8",
79 "itf14",
80 "pdf417",
81 "upc_e"
82 ]
83 }
84 }
85 },
86 "required": ["scanType"]
87 },
88 "scanMode": {
89 "title": "Scan Mode",
90 "description": "Using this attribute developers can help the user to select the scan mode of Shipments to be delivered/Picked.",
91 "type": "string",
92 "enum": ["SINGLE", "MULTI"]
93 },
94 "scanCountLimit": {
95 "title": "Max scan count",
96 "type": "number",
97 "description": "This attributes helps the developers to set the maximum limit of the items to be scanned in multi-scan mode.",
98 "minimum": 1
99 },
100 "validation": {
101 "title": "Validation",
102 "type": "object",
103 "description": "Regex to validate scanned strings",
104 "properties": {
105 "selectedIndex": {
106 "title": "Selected Index",
107 "description": "This attribute helps the developers to define the type of index selection that can be used.",
108 "type": "number",
109 "default": 0,
110 "minimum": 0,
111 "maximum": 2
112 },
113 "logic": {
114 "title": "Validation Logic",
115 "description": "This attribute is used by the developers to provide the logic for the selected index.",
116 "anyOf": [
117 {
118 "title": "Scans",
119 "minItems": 1,
120 "maxItems": 100,
121 "uniqueItems": true,
122 "type": "array",
123 "description": "List of items to be scanned",
124 "items": {
125 "type": "string",
126 "description": "ID of items to be scanned"
127 }
128 },
129 {
130 "title": "Validation Regex",
131 "type": "string",
132 "description": "Regex to validate scanned strings"
133 },
134 {
135 "title": "Validation API",
136 "type": "object",
137 "description": "API to validate scanned items from.",
138 "properties": {
139 "uri": {
140 "type": "string",
141 "title": "URI",
142 "description": "HTTP API url"
143 },
144 "timeout": {
145 "type": "number",
146 "title": "Timeout for API",
147 "description": "The time after which request will be canceled",
148 "default": 15
149 },
150 "httpMethod": {
151 "title": "HTTP Method",
152 "description": "HTTP Method",
153 "type": "string",
154 "enum": ["PUT", "POST", "GET"]
155 },
156 "headers": {
157 "type": "array",
158 "title": "Headers",
159 "description": "API headers",
160 "items": {
161 "type": "object",
162 "properties": {
163 "key": {
164 "type": "string",
165 "title": "Header key"
166 },
167 "value": {
168 "type": "string",
169 "title": "Header value"
170 }
171 }
172 }
173 },
174 "requestBody": {
175 "type": "object",
176 "title": "HTTP Request Body",
177 "description": "request body object"
178 },
179 "queryParams": {
180 "type": "array",
181 "title": "HTTP Query param",
182 "description": "Query param for request",
183 "items": {
184 "type": "object",
185 "properties": {
186 "key": {
187 "type": "string",
188 "title": "Query key"
189 },
190 "value": {
191 "type": "string",
192 "title": "Query value"
193 }
194 }
195 }
196 },
197 "pathParams": {
198 "type": "array",
199 "title": "HTTP Path param",
200 "description": "Path param for request",
201 "items": {
202 "type": "object",
203 "properties": {
204 "key": {
205 "type": "string",
206 "title": "Path key"
207 },
208 "value": {
209 "type": "string",
210 "title": "Path value"
211 }
212 }
213 }
214 },
215 "responseJsonLogic": {
216 "type": "object",
217 "title": "JSON logic",
218 "description": "Json path to extract the required output from API response"
219 },
220 "errorJsonLogic": {
221 "type": "object",
222 "title": "Json Path",
223 "description": "Json path to extract the required error response"
224 }
225 },
226 "required": [
227 "uri",
228 "httpMethod",
229 "responseJsonLogic",
230 "errorJsonLogic"
231 ]
232 }
233 ]
234 }
235 },
236 "required": ["selectedIndex", "logic"]
237 },
238 "exitOnError": {
239 "title": "Exit on Error",
240 "type": "boolean",
241 "description": "This attribute can be used by the developer to drop the workflow if the scan fails."
242 },
243 "title": {
244 "title": "Title",
245 "type": "string",
246 "description": "Title for the message to be displayed to the FE."
247 },
248 "message": {
249 "title": "Message",
250 "type": "string",
251 "description": "Message of instruction"
252 },
253 "canGoBack": {
254 "title": "Can go back",
255 "type": "boolean",
256 "description": "Can go back"
257 },
258 "applicableReasons": {
259 "title": "Applicable reasons",
260 "description": "applicable reason codes",
261 "type": "object"
262 },
263 "additionalMultiConfig": {
264 "title": "Additional MultiConfig",
265 "description": "This attribute holds additional inputs for developer to provide with exitOnError attribute.",
266 "type": "object",
267 "properties": {
268 "validationType": {
269 "title": "Validation Type",
270 "description": "This attribute can be used by developer to set the validation type for the FE before the FE moves to next ET.",
271 "type": "string",
272 "enum": ["ALL_OR_NONE", "SUBSET_OF_LIST"]
273 }
274 },
275 "required": ["validationType"]
276 }
277 },
278 "required": [
279 "defaultERC",
280 "scannedInput",
281 "scanMode",
282 "title",
283 "applicableReasons",
284 "validation"
285 ]
286 },
287 "output": {
288 "type": "object",
289 "properties": {
290 "success": {
291 "description": "Success flag for the operation performed by user",
292 "type": "boolean"
293 },
294 "eventCode": {
295 "type": "string",
296 "description": "Event code"
297 },
298 "reasonCode": {
299 "type": "string",
300 "description": "Reason code"
301 },
302 "scans": {
303 "type": "array",
304 "description": "Array of scan objects",
305 "items": {
306 "type": "object",
307 "description": "Object to describe details of single scan",
308 "properties": {
309 "value": {
310 "type": "string",
311 "description": "Value of scanned item"
312 },
313 "validated": {
314 "type": "boolean",
315 "description": "Boolean to denote if scan was validate successfully"
316 },
317 "timestamp": {
318 "type": "number",
319 "description": "Epoch timestamp for the scan"
320 }
321 },
322 "required": ["value", "timestamp"]
323 }
324 },
325 "meta": {
326 "type": "object",
327 "description": "Meta data related to execution of task",
328 "properties": {
329 "startTime": {
330 "type": "number",
331 "description": "Epoch timestamp for the start of task"
332 },
333 "endTime": {
334 "type": "number",
335 "description": "Epoch timestamp for the end of task"
336 },
337 "location": {
338 "type": "object",
339 "description": "Location at start of task",
340 "properties": {
341 "latitude": {
342 "type": "string",
343 "description": "Latitude"
344 },
345 "longitude": {
346 "type": "string",
347 "description": "Longitude"
348 }
349 }
350 },
351 "userDetails": {
352 "type": "string",
353 "description": "Unique identifier of user performing the action"
354 }
355 }
356 }
357 },
358 "required": ["success", "scans"]
359 },
360 "canMerge": false,
361 "meta": {
362 "allowFailureFlow": false
363 }
364}