-
Notifications
You must be signed in to change notification settings - Fork 0
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
DanJezeph15
wants to merge
1
commit into
master
Choose a base branch
from
safeguarding-issues
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | ||
}, | ||
"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": "" | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
39
pages/safeguarding-issues/list-all-safeguarding-issues.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/" | ||
} | ||
] | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
159
pages/safeguarding-issues/safeguarding-issue-object.yml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.