Skip to content

Commit 0173809

Browse files
committed
Adding Safeguarding Issues to the API docs
1 parent 3291c7d commit 0173809

10 files changed

+308
-0
lines changed

pages/api.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,10 @@ endpoint_sections:
122122
title: Reviews
123123
id: reviews
124124
layout: /reviews/reviews.yml
125+
-
126+
title: Safeguarding Issues
127+
id: safeguarding-issues
128+
layout: /safeguarding-issues/safeguarding-issues.yml
125129
-
126130
title: Services (Jobs)
127131
id: services
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"id": 2,
3+
"display_name": "SGI-2",
4+
"status": "Unresolved",
5+
"severity": "Severe",
6+
"dt_raised": "2025-04-14T16:26:44.286782+01:00",
7+
"dt_resolved": null,
8+
"creator": {
9+
"id": 58,
10+
"first_name": "Diana",
11+
"last_name": "Lafayette",
12+
"email": "[email protected]"
13+
},
14+
"creator_role_type": "Tutor",
15+
"service_recipient": {
16+
"id": 10,
17+
"first_name": "Archie",
18+
"last_name": "Hoskins",
19+
"email": "[email protected]",
20+
"url": "http://localhost:8000/api/recipients/10/"
21+
},
22+
"contractor": {
23+
"id": 58,
24+
"first_name": "Diana",
25+
"last_name": "Lafayette",
26+
"email": "[email protected]",
27+
"url": "http://localhost:8000/api/contractors/58/"
28+
},
29+
"service": {
30+
"id": 54,
31+
"name": "Mathematics",
32+
"dft_charge_type": "hourly",
33+
"created": "2025-04-14T16:26:19.877383+01:00",
34+
"dft_charge_rate": "100.00",
35+
"dft_contractor_rate": "75.00",
36+
"last_updated": "2025-04-14T16:26:32.479636+01:00",
37+
"status": "available",
38+
"url": "http://localhost:8000/api/services/54/"
39+
},
40+
"appointment": {
41+
"id": 586,
42+
"start": "2025-04-14T17:26:00+01:00",
43+
"finish": "2025-04-14T18:26:00+01:00",
44+
"topic": "Lesson 1",
45+
"status": "planned",
46+
"service": {
47+
"id": 54,
48+
"name": "Mathematics",
49+
"dft_charge_type": "hourly",
50+
"created": "2025-04-14T16:26:19.877383+01:00",
51+
"dft_charge_rate": "100.00",
52+
"dft_contractor_rate": "75.00",
53+
"last_updated": "2025-04-14T16:26:32.479636+01:00",
54+
"status": "available",
55+
"url": "http://localhost:8000/api/services/54/"
56+
},
57+
"url": "http://localhost:8000/api/appointments/586/"
58+
},
59+
"description": "This should be looked into urgently",
60+
"resolution_note": ""
61+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Get a Safeguarding Issue
2+
3+
Returns the details of an existing Safeguarding Issue. You only need to specify the unique `id` of
4+
the Safeguarding Issue to get the correct details.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pprint, requests
2+
3+
headers = {'Authorization': 'token <API KEY>'}
4+
r = requests.get('https://secure.tutorcruncher.com/api/safeguarding_issues/<id>/', headers=headers)
5+
pprint.pprint(r.json())
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"count": 2,
3+
"next": null,
4+
"previous": null,
5+
"results": [
6+
{
7+
"id": 2,
8+
"display_name": "SGI-2",
9+
"status": "Unresolved",
10+
"severity": "Severe",
11+
"service_recipient": {
12+
"id": 10,
13+
"first_name": "Archie",
14+
"last_name": "Hoskins",
15+
"email": "[email protected]",
16+
"url": "http://localhost:8000/api/recipients/10/"
17+
},
18+
"dt_raised": "2025-04-14T16:26:44.286782+01:00",
19+
"dt_resolved": null,
20+
"url": "http://localhost:8000/api/safeguarding_issues/2/"
21+
},
22+
{
23+
"id": 1,
24+
"display_name": "SGI-1",
25+
"status": "Unresolved",
26+
"severity": "Severe",
27+
"service_recipient": {
28+
"id": 47,
29+
"first_name": "Jessica",
30+
"last_name": "Coles",
31+
"email": "[email protected]",
32+
"url": "http://localhost:8000/api/recipients/47/"
33+
},
34+
"dt_raised": "2025-04-14T16:03:50.310174+01:00",
35+
"dt_resolved": null,
36+
"url": "http://localhost:8000/api/safeguarding_issues/1/"
37+
}
38+
]
39+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
### List all Safeguarding Issues
2+
3+
Returns a list of all your Safeguarding Issues. The Safeguarding Issues are sorted by id, with the largest `id` first.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import pprint, requests
2+
3+
headers = {'Authorization': 'token <API KEY>'}
4+
r = requests.get('https://secure.tutorcruncher.com/api/safeguarding_issues/', headers=headers)
5+
pprint.pprint(r.json())
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
### Safeguarding Issue Object
2+
3+
Safeguarding Issue objects will contain information about safeguarding issues that have been raised,
4+
including information about the related users.
Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
attributes:
2+
-
3+
name: id
4+
type: integer
5+
description: Unique identifier for the Safeguarding Issue.
6+
-
7+
name: display_name
8+
type: string
9+
description: The display name for the Safeguarding Issue.
10+
-
11+
name: status
12+
type: string
13+
description: The status of the Safeguarding Issue.
14+
-
15+
name: severity
16+
type: string
17+
description: The severity of the Safeguarding Issue.
18+
-
19+
name: dt_raised
20+
type: string
21+
description: The date the Safeguarding Issue was raised.
22+
-
23+
name: dt_resolved
24+
type: string
25+
description: The date the Safeguarding Issue was resolved.
26+
-
27+
name: creator
28+
type: object
29+
description: The Creator of the Safeguarding Issue.
30+
children:
31+
-
32+
name: id
33+
type: integer
34+
description: The ID of the Safeguarding Issue creator.
35+
-
36+
name: first_name
37+
type: string
38+
description: The first name of the Safeguarding Issue creator.
39+
-
40+
name: last_name
41+
type: string
42+
description: The last name of the Safeguarding Issue creator.
43+
-
44+
name: email
45+
type: string
46+
description: The email address of the Safeguarding Issue creator.
47+
-
48+
name: creator_role_type
49+
type: string
50+
description: The role type of the Safeguarding Issue creator.
51+
-
52+
name: service_recipient
53+
type: object
54+
description: The Student related to the Safeguarding Issue.
55+
children:
56+
- name: id
57+
type: integer
58+
description: The ID of the student related to the Safeguarding Issue.
59+
- name: first_name
60+
type: string
61+
description: The first name of the student related to the Safeguarding Issue.
62+
- name: last_name
63+
type: string
64+
description: The last name of the student related to the Safeguarding Issue.
65+
- name: email
66+
type: string
67+
description: The email address of the student related to the Safeguarding Issue.
68+
- name: url
69+
type: string
70+
description: URL to the Student's object.
71+
-
72+
name: contractor
73+
type: object
74+
description: The Tutor related to the Safeguarding Issue.
75+
children:
76+
- name: id
77+
type: integer
78+
description: The ID of the tutor related to the Safeguarding Issue.
79+
- name: first_name
80+
type: string
81+
description: The first name of the tutor related to the Safeguarding Issue.
82+
- name: last_name
83+
type: string
84+
description: The last name of the tutor related to the Safeguarding Issue.
85+
- name: email
86+
type: string
87+
description: The email address of the tutor related to the Safeguarding Issue.
88+
- name: url
89+
type: string
90+
description: URL to the Tutor's object.
91+
-
92+
name: service
93+
type: object
94+
description: The Service the Safeguarding Issue is related to.
95+
children:
96+
-
97+
name: id
98+
type: integer
99+
description: Unique identifier for the object.
100+
-
101+
name: name
102+
type: string
103+
description: Service's name.
104+
-
105+
name: dft_charge_type
106+
type: string
107+
description: |
108+
Service's default charge type. Check out [Service Object](#service-object) for the types of choices.
109+
-
110+
name: created
111+
type: string
112+
description: Date and time the Service was created.
113+
-
114+
name: dft_charge_rate
115+
type: string
116+
description: Service's default amount Clients will be charged.
117+
-
118+
name: dft_contractor_rate
119+
type: string
120+
description: Service's default amount Contractors will be paided.
121+
-
122+
name: status
123+
type: string
124+
description: Status of the Service. Check out [Service Object](#service-object) for the types of statuses.
125+
-
126+
name: url
127+
type: string
128+
description: URL to the Service object.
129+
-
130+
name: appointment
131+
type: object
132+
description: The Appointment related to the Safeguarding Issue.
133+
children:
134+
- name: id
135+
type: integer
136+
description: Unique identifier for the object.
137+
- name: start
138+
type: string
139+
description: Start date and time for the Appointment.
140+
- name: finish
141+
type: string
142+
description: Finish date and time for the Appointment.
143+
- name: topic
144+
type: string
145+
description: Topic for the Appointment.
146+
- name: status
147+
type: integer
148+
description: |
149+
The status for the Appointment, the status types are `planned`, `awaiting-report`, `complete`, `cancelled`,
150+
and `cancelled-chargeable`.
151+
- name: service
152+
type: object
153+
description: |
154+
Object that contains information about the Service. Attributes in the object are `id`, `name`,
155+
`dft_charge_type`, `created`, `dft_charge_rate`, `dft_conractor_rate`, `last_updated`, `status`, `url`.
156+
- name: url
157+
type: string
158+
description: URL to the Appointment object.
159+
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
sections:
2+
-
3+
title: Safeguarding Issue Object
4+
id: safeguarding-issue-object
5+
description: /safeguarding-issues/safeguarding-issue-object.md
6+
attributes: /safeguarding-issues/safeguarding-issue-object.yml
7+
response: /safeguarding-issues/get-a-safeguarding-issue.json
8+
response_title: OBJECT
9+
-
10+
title: List all Safeguarding Issues
11+
id: list-all-safeguarding-issues
12+
description: /safeguarding-issues/list-all-safeguarding-issues.md
13+
code: /safeguarding-issues/list-all-safeguarding-issues.py
14+
code_type: GET
15+
code_url: /api/safeguarding_issues/
16+
response: /safeguarding-issues/list-all-safeguarding-issues.json
17+
-
18+
title: Get a Safeguarding Issue
19+
id: get-a-safeguarding-issue
20+
description: /safeguarding-issues/get-a-safeguarding-issue.md
21+
code: /safeguarding-issues/get-a-safeguarding-issue.py
22+
code_type: GET
23+
code_url: /api/safeguarding_issues/<id>/
24+
response: /safeguarding-issues/get-a-safeguarding-issue.json

0 commit comments

Comments
 (0)