Skip to content

Adding Safeguarding Issues to the API docs #198

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions pages/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ endpoint_sections:
title: Reviews
id: reviews
layout: /reviews/reviews.yml
-
title: Safeguarding Issues
id: safeguarding-issues
layout: /safeguarding-issues/safeguarding-issues.yml
-
title: Services (Jobs)
id: services
Expand Down
61 changes: 61 additions & 0 deletions pages/safeguarding-issues/get-a-safeguarding-issue.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"id": 2,
"display_name": "SGI-2",
"status": "Unresolved",
"severity": "Severe",
"dt_raised": "2025-04-14T16:26:44.286782+01:00",
"dt_resolved": null,
"creator": {
"id": 58,
"first_name": "Diana",
"last_name": "Lafayette",
"email": "[email protected]"
},
"creator_role_type": "Tutor",
"service_recipient": {
"id": 10,
"first_name": "Archie",
"last_name": "Hoskins",
"email": "[email protected]",
"url": "http://localhost:8000/api/recipients/10/"
Copy link
Contributor

@Pager07 Pager07 Apr 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

noticed , we are use are using localhost here, else lgtm

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tbf, looks like we have used it else where as well; can ignore the commnet.

},
"contractor": {
"id": 58,
"first_name": "Diana",
"last_name": "Lafayette",
"email": "[email protected]",
"url": "http://localhost:8000/api/contractors/58/"
},
"service": {
"id": 54,
"name": "Mathematics",
"dft_charge_type": "hourly",
"created": "2025-04-14T16:26:19.877383+01:00",
"dft_charge_rate": "100.00",
"dft_contractor_rate": "75.00",
"last_updated": "2025-04-14T16:26:32.479636+01:00",
"status": "available",
"url": "http://localhost:8000/api/services/54/"
},
"appointment": {
"id": 586,
"start": "2025-04-14T17:26:00+01:00",
"finish": "2025-04-14T18:26:00+01:00",
"topic": "Lesson 1",
"status": "planned",
"service": {
"id": 54,
"name": "Mathematics",
"dft_charge_type": "hourly",
"created": "2025-04-14T16:26:19.877383+01:00",
"dft_charge_rate": "100.00",
"dft_contractor_rate": "75.00",
"last_updated": "2025-04-14T16:26:32.479636+01:00",
"status": "available",
"url": "http://localhost:8000/api/services/54/"
},
"url": "http://localhost:8000/api/appointments/586/"
},
"description": "This should be looked into urgently",
"resolution_note": ""
}
4 changes: 4 additions & 0 deletions pages/safeguarding-issues/get-a-safeguarding-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Get a Safeguarding Issue

Returns the details of an existing Safeguarding Issue. You only need to specify the unique `id` of
the Safeguarding Issue to get the correct details.
5 changes: 5 additions & 0 deletions pages/safeguarding-issues/get-a-safeguarding-issue.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
r = requests.get('https://secure.tutorcruncher.com/api/safeguarding_issues/<id>/', headers=headers)
pprint.pprint(r.json())
39 changes: 39 additions & 0 deletions pages/safeguarding-issues/list-all-safeguarding-issues.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"count": 2,
"next": null,
"previous": null,
"results": [
{
"id": 2,
"display_name": "SGI-2",
"status": "Unresolved",
"severity": "Severe",
"service_recipient": {
"id": 10,
"first_name": "Archie",
"last_name": "Hoskins",
"email": "[email protected]",
"url": "http://localhost:8000/api/recipients/10/"
},
"dt_raised": "2025-04-14T16:26:44.286782+01:00",
"dt_resolved": null,
"url": "http://localhost:8000/api/safeguarding_issues/2/"
},
{
"id": 1,
"display_name": "SGI-1",
"status": "Unresolved",
"severity": "Severe",
"service_recipient": {
"id": 47,
"first_name": "Jessica",
"last_name": "Coles",
"email": "[email protected]",
"url": "http://localhost:8000/api/recipients/47/"
},
"dt_raised": "2025-04-14T16:03:50.310174+01:00",
"dt_resolved": null,
"url": "http://localhost:8000/api/safeguarding_issues/1/"
}
]
}
3 changes: 3 additions & 0 deletions pages/safeguarding-issues/list-all-safeguarding-issues.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### List all Safeguarding Issues

Returns a list of all your Safeguarding Issues. The Safeguarding Issues are sorted by id, with the largest `id` first.
5 changes: 5 additions & 0 deletions pages/safeguarding-issues/list-all-safeguarding-issues.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import pprint, requests

headers = {'Authorization': 'token <API KEY>'}
r = requests.get('https://secure.tutorcruncher.com/api/safeguarding_issues/', headers=headers)
pprint.pprint(r.json())
4 changes: 4 additions & 0 deletions pages/safeguarding-issues/safeguarding-issue-object.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Safeguarding Issue Object

Safeguarding Issue objects will contain information about safeguarding issues that have been raised,
including information about the related users.
159 changes: 159 additions & 0 deletions pages/safeguarding-issues/safeguarding-issue-object.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
attributes:
-
name: id
type: integer
description: Unique identifier for the Safeguarding Issue.
-
name: display_name
type: string
description: The display name for the Safeguarding Issue.
-
name: status
type: string
description: The status of the Safeguarding Issue.
-
name: severity
type: string
description: The severity of the Safeguarding Issue.
-
name: dt_raised
type: string
description: The date the Safeguarding Issue was raised.
-
name: dt_resolved
type: string
description: The date the Safeguarding Issue was resolved.
-
name: creator
type: object
description: The Creator of the Safeguarding Issue.
children:
-
name: id
type: integer
description: The ID of the Safeguarding Issue creator.
-
name: first_name
type: string
description: The first name of the Safeguarding Issue creator.
-
name: last_name
type: string
description: The last name of the Safeguarding Issue creator.
-
name: email
type: string
description: The email address of the Safeguarding Issue creator.
-
name: creator_role_type
type: string
description: The role type of the Safeguarding Issue creator.
-
name: service_recipient
type: object
description: The Student related to the Safeguarding Issue.
children:
- name: id
type: integer
description: The ID of the student related to the Safeguarding Issue.
- name: first_name
type: string
description: The first name of the student related to the Safeguarding Issue.
- name: last_name
type: string
description: The last name of the student related to the Safeguarding Issue.
- name: email
type: string
description: The email address of the student related to the Safeguarding Issue.
- name: url
type: string
description: URL to the Student's object.
-
name: contractor
type: object
description: The Tutor related to the Safeguarding Issue.
children:
- name: id
type: integer
description: The ID of the tutor related to the Safeguarding Issue.
- name: first_name
type: string
description: The first name of the tutor related to the Safeguarding Issue.
- name: last_name
type: string
description: The last name of the tutor related to the Safeguarding Issue.
- name: email
type: string
description: The email address of the tutor related to the Safeguarding Issue.
- name: url
type: string
description: URL to the Tutor's object.
-
name: service
type: object
description: The Service the Safeguarding Issue is related to.
children:
-
name: id
type: integer
description: Unique identifier for the object.
-
name: name
type: string
description: Service's name.
-
name: dft_charge_type
type: string
description: |
Service's default charge type. Check out [Service Object](#service-object) for the types of choices.
-
name: created
type: string
description: Date and time the Service was created.
-
name: dft_charge_rate
type: string
description: Service's default amount Clients will be charged.
-
name: dft_contractor_rate
type: string
description: Service's default amount Contractors will be paided.
-
name: status
type: string
description: Status of the Service. Check out [Service Object](#service-object) for the types of statuses.
-
name: url
type: string
description: URL to the Service object.
-
name: appointment
type: object
description: The Appointment related to the Safeguarding Issue.
children:
- name: id
type: integer
description: Unique identifier for the object.
- name: start
type: string
description: Start date and time for the Appointment.
- name: finish
type: string
description: Finish date and time for the Appointment.
- name: topic
type: string
description: Topic for the Appointment.
- name: status
type: integer
description: |
The status for the Appointment, the status types are `planned`, `awaiting-report`, `complete`, `cancelled`,
and `cancelled-chargeable`.
- name: service
type: object
description: |
Object that contains information about the Service. Attributes in the object are `id`, `name`,
`dft_charge_type`, `created`, `dft_charge_rate`, `dft_conractor_rate`, `last_updated`, `status`, `url`.
- name: url
type: string
description: URL to the Appointment object.

24 changes: 24 additions & 0 deletions pages/safeguarding-issues/safeguarding-issues.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
sections:
-
title: Safeguarding Issue Object
id: safeguarding-issue-object
description: /safeguarding-issues/safeguarding-issue-object.md
attributes: /safeguarding-issues/safeguarding-issue-object.yml
response: /safeguarding-issues/get-a-safeguarding-issue.json
response_title: OBJECT
-
title: List all Safeguarding Issues
id: list-all-safeguarding-issues
description: /safeguarding-issues/list-all-safeguarding-issues.md
code: /safeguarding-issues/list-all-safeguarding-issues.py
code_type: GET
code_url: /api/safeguarding_issues/
response: /safeguarding-issues/list-all-safeguarding-issues.json
-
title: Get a Safeguarding Issue
id: get-a-safeguarding-issue
description: /safeguarding-issues/get-a-safeguarding-issue.md
code: /safeguarding-issues/get-a-safeguarding-issue.py
code_type: GET
code_url: /api/safeguarding_issues/<id>/
response: /safeguarding-issues/get-a-safeguarding-issue.json