-
Notifications
You must be signed in to change notification settings - Fork 8
/
Attendance-v1.0.0.yaml
740 lines (736 loc) · 25.1 KB
/
Attendance-v1.0.0.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
openapi: 3.0.0
info:
version: 1.0.0
title: Attendance Service
description: ''
paths:
/attendance/v1/_create:
post:
tags:
- Attendance Register
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceRegisterRequest'
responses:
'202':
description: Request to create a register has been accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/v1/_update:
post:
tags:
- Attendance Register
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceRegisterRequest'
responses:
'202':
description: Request to update the register has been accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/v1/_search:
post:
tags:
- Attendance Register
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RequestInfoWrapper'
parameters:
- name: tenantId
in: query
description: Unique id for a tenant.
required: true
schema:
type: string
- name: ids
description: List of register ids
in: query
schema:
type: array
items:
type: string
- name: registerNumber
description: Custom formatted Register id
in: query
schema:
type: string
- name: name
description: Name of the register
in: query
schema:
type: string
- name: referenceId
description: Reference Id
in: query
schema:
type: string
- name: serviceCode
description: Service Code
in: query
schema:
type: string
- name: fromDate
description: Return registers with any overlap in the given time period
in: query
schema:
type: number
- name: toDate
description: Return registers with any overlap in the given time period
in: query
schema:
type: number
- name: status
description: Status of the register. This can't be the only query param. It should be paired with some other search param.
in: query
schema:
type: string
- name: attendeeId
description: Get all the registers where the given Individual was registered.
in: query
schema:
type: string
- name: staffId
description: Get all the registers where the given staff was registered.
in: query
schema:
type: string
- name: sortBy
in: query
description: sort the search results by fields
schema:
type: string
enum:
- fromDate
- toDate
- lastModifiedTime
- name: sortOrder
in: query
description: sorting order of the search resulsts
schema:
type: string
enum:
- asc
- desc
- name: limit
in: query
description: limit on the resulsts
schema:
type: number
- name: offset
in: query
description: offset index of the overall search resulsts
schema:
type: number
responses:
'200':
description: Search results
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceRegisterResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/staff/v1/_create:
post:
description: Grant permission to a user to access and modify an attendance register. This user can enroll / denroll individuals. They will add attendance entries for the attendees.
tags:
- Register Permission
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StaffPermissionRequest'
responses:
'202':
description: Grant permission request accepted
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/staff/v1/_delete:
post:
description: Revoke permission to a user to access and modify an attendance register. This user can enroll / denroll individuals. They will add attendance entries for the attendees.
tags:
- Register Permission
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/StaffPermissionRequest'
responses:
'202':
description: Revoke permission request accepted
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/attendee/v1/_create:
post:
description: Users with permission to access the register can enroll / denroll attendees.
tags:
- Individual Enrollment
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendeeCreateRequest'
responses:
'202':
description: Attendee Create request accepted
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/attendee/v1/_delete:
post:
description: Users with permission to access the register can enroll / denroll attendees.
tags:
- Individual Enrollment
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendeeDeleteRequest'
responses:
'202':
description: Attendee Delete request accepted
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/log/v1/_create:
post:
tags:
- Attendance Log
description: It creates a new attendance record.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogRequest'
responses:
'202':
description: Attendance Records Create Request accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/log/v1/bulk/_create:
post:
tags:
- Attendance Log
description: It creates a new attendance record.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogRequest'
responses:
'202':
description: Attendance Records Create Request accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/log/v1/_update:
post:
tags:
- Attendance Log
description: It updates an attendance record.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogRequest'
responses:
'202':
description: Attendance Records Update Request accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/log/v1/bulk/_update:
post:
tags:
- Attendance Log
description: It updates an attendance record.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogRequest'
responses:
'202':
description: Attendance Records Update Request accepted.
content:
application/json:
schema:
$ref: '#/components/schemas/BulkAcceptedResponse'
'400':
description: Invalid input.
content:
'*/*':
schema:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ErrorRes
/attendance/log/v1/_search:
post:
tags:
- Attendance Log
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/RequestInfoWrapper'
parameters:
- name: tenantId
in: query
description: Unique id for a tenant.
required: true
schema:
type: string
- name: registerId
in: query
required: true
description: Id of the register
schema:
type: string
- name: fromTime
in: query
description: Starting time from which the attendance needs to be searched
schema:
type: number
- name: toTime
in: query
description: End time till which the attendance needs to be searched
schema:
type: number
- name: individualIds
in: query
description: List of individual ids
schema:
type: array
items:
type: string
- name: ids
in: query
description: List of ids
schema:
type: array
items:
type: string
- name: status
in: query
description: The status of the attendance log.
schema:
type: string
enum:
- ACTIVE
- INACTIVE
responses:
'200':
description: Complete table of attendance entries.
content:
application/json:
schema:
$ref: '#/components/schemas/AttendanceLogResponse'
components:
schemas:
BulkAcceptedResponse:
type: object
properties:
ResponseInfo:
$ref: >-
https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
required:
- ResponseInfo
clientReferenceIdForSearch:
$ref: https://raw.githubusercontent.com/digit-egov/health-api-specs/main/contracts/common.yaml#/definitions/clientReferenceIdForSearch
clientReferenceId:
$ref: https://raw.githubusercontent.com/digit-egov/health-api-specs/main/contracts/common.yaml#/definitions/clientReferenceId
tenantId:
$ref: https://raw.githubusercontent.com/digit-egov/health-api-specs/main/contracts/common.yaml#/definitions/tenantId
AttendanceRegister:
type: object
properties:
id:
type: string
format: uuid
example: 64e33343-7b4c-4353-9abf-4de8f5bcd732
description: System generated unique identifier of the register
readOnly: true
tenantId:
type: string
example: pb.amritsar
description: Tenant Id of the register
registerNumber:
type: string
example: REG/2022-23/001
description: System generated id with custom formatting
readOnly: true
name:
type: string
example: Class-10-E Physics
description: Name of the register
maxLength: 140
referenceId:
type: string
example: 64e33343-7b4c-4353-9abf-4de8f5bcd732
description: Id of the entity to which register is associated. Example ContractId
maxLength: 256
serviceCode:
type: string
example: WORKS-CONTRACT
description: Service to which register is associated.
maxLength: 64
startDate:
type: number
format: timestamp
example: 1665497225000
description: Timestamp of the start date in milliseconds
endDate:
type: number
format: timestamp
example: 1665497271000
description: Timestamp of the end date in milliseconds. After the end date no modifications will be allowed to the register.
status:
type: string
enum:
- ACTIVE
- INACTIVE
description: Stores if the register is active or not. Inactive registers can be archieved later.
staff:
readOnly: true
type: array
items:
allOf:
- $ref: '#/components/schemas/StaffPermission'
- description: Entries of the staff members of the register.
attendees:
readOnly: true
type: array
items:
allOf:
- $ref: '#/components/schemas/IndividualEntry'
- description: Entries of the attendees of the register.
auditDetails:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/AuditDetails
additionalDetails:
type: object
description: Any additional details of the register
required:
- tenantId
- name
- referenceId
- serviceCode
AttendanceRegisterRequest:
type: object
properties:
requestInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
attendanceRegister:
type: array
items:
allOf:
- $ref: '#/components/schemas/AttendanceRegister'
- description: Entries of the attendance register to be created.
AttendanceRegisterResponse:
type: object
properties:
responseInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
attendanceRegister:
type: array
items:
$ref: '#/components/schemas/AttendanceRegister'
IndividualEntry:
type: object
properties:
id:
type: string
format: uuid
example: 64e33343-7b4c-4353-9abf-4de8f5bcd732
description: Primary identifier of the enrollment record
readOnly: true
registerId:
type: string
format: uuid
example: 32e33343-7b4c-4353-9abf-4de8f5bcd764
description: This field will not be shown when this object is part of the register object. It is present so that we can reuse this object for enroll and denroll requests.
individualId:
type: string
format: uuid
example: 2bafdd8d-5673-4690-b3d0-e13d7ac0cf24
description: Reference from the Individual Registry
enrollmentDate:
type: number
description: The timestamp of the date on which the individual is enrolled onto the register. Defaults to current time.
denrollmentDate:
type: number
description: The timestamp of the date on which the individual is denrolled from the register. Defaults to current time.
tenantId:
type: string
example: pb.amritsar
description: Tenant Id
auditDetails:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/AuditDetails
AttendeeCreateRequest:
type: object
properties:
requestInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
attendees:
type: array
items:
allOf:
- $ref: '#/components/schemas/IndividualEntry'
- required:
- registerId
- individualId
- enrollmentDate
- tenantId
AttendeeCreateResponse:
type: object
properties:
responseInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
attendees:
type: array
items:
$ref: '#/components/schemas/IndividualEntry'
AttendeeDeleteRequest:
type: object
properties:
requestInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
attendees:
type: array
items:
allOf:
- $ref: '#/components/schemas/IndividualEntry'
- required:
- registerId
- individualId
- denrollmentDate
- tenantId
AttendeeDeleteResponse:
type: object
properties:
responseInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
attendees:
type: array
items:
$ref: '#/components/schemas/IndividualEntry'
StaffPermission:
type: object
properties:
id:
type: string
format: uuid
description: System generated unique identifier for the granted permission request
readOnly: true
registerId:
type: string
description: Identifier of the register. This field will not be shown when this object is part of the register object. It is present so that we can reuse this object for access permission requests.
userId:
type: string
description: Identifier of the user of the system
tenantId:
type: string
format: string
example: pb.amritsar
description: Tenant Id to which the staff belongs
enrollmentDate:
readOnly: true
type: number
description: The timestamp at which the permission is granted. It is set to the current time when the create api is called.
denrollmentDate:
readOnly: true
type: number
description: The timestamp at which the access permission is revoked. It is set to the current time when the delete api is called.
required:
- registerId
- userId
StaffPermissionRequest:
type: object
properties:
requestInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
staff:
type: array
items:
allOf:
- $ref: '#/components/schemas/StaffPermission'
- required:
- registerId
- userId
- tenantId
StaffPermissionResponse:
type: object
properties:
responseInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
staff:
type: array
items:
$ref: '#/components/schemas/StaffPermission'
AttendanceLog:
type: object
properties:
id:
type: string
format: uuid
description: System generated unique identifier for the entry
readOnly: true
clientReferenceId:
$ref: '#/components/schemas/clientReferenceId'
registerId:
type: string
description: Unique identifier of the register
individualId:
type: string
format: uuid
description: The individual for which the attendance is being marked
tenantId:
type: string
example: pb.amritsar
description: Tenant Id of the register
time:
type: number
format: timestamp
description: The timestamp at which the event has been recorded.
type:
type: string
description: Configurable in MDMS. [ENTRY/EXIT/...]
status:
type: string
enum:
- ACTIVE
- INACTIVE
description: The attendance log of the cancelled event can be marked as inactive.
additionalDetails:
type: object
auditDetails:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/AuditDetails
clientAuditDetails:
$ref: '#/components/schemas/AuditDetails'
documentIds:
description: Used to store file store ids. Need to verify validity of them using file store service.
type: array
items:
$ref: https://raw.githubusercontent.com/egovernments/DIGIT-OSS/bf02a2c7eb783bf9fdf4b173faa37f402e05e96e/core-services/docs/common-contract_v1-1.yml#/components/schemas/Document
required:
- registerId
- individualId
- tenantId
- time
- type
AttendanceLogRequest:
type: object
properties:
requestInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
attendance:
type: array
items:
$ref: '#/components/schemas/AttendanceLog'
AttendanceLogResponse:
type: object
properties:
responseInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/ResponseInfo
attendance:
type: array
items:
$ref: '#/components/schemas/AttendanceLog'
RequestInfoWrapper:
type: object
properties:
requestInfo:
$ref: https://raw.githubusercontent.com/egovernments/egov-services/master/docs/common/contracts/v1-1-1.yml#/definitions/RequestInfo
AuditDetails:
type: object
description: Collection of audit related fields used by most models
properties:
createdBy:
type: string
description: username (preferred) or userid of the user that created the object
lastModifiedBy:
type: string
description: username (preferred) or userid of the user that last modified the object
createdTime:
type: integer
format: int64
description: epoch of the time object is created
lastModifiedTime:
type: integer
format: int64
description: epoch of the time object is last modified