From d0944170ea4be8ac1594ac499e22d62cbcc74fb1 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Mon, 7 Apr 2025 18:14:31 +0100 Subject: [PATCH 01/12] contractors skill docs --- pages/api.yml | 4 + .../contractor-skills-object.json | 23 ++++++ .../contractor-skills-object.md | 5 ++ .../contractor-skills-object.yml | 76 +++++++++++++++++++ pages/contractor-skills/contractor-skills.yml | 39 ++++++++++ .../delete-a-contractor-skill.md | 7 ++ .../delete-a-contractor-skill.py | 5 ++ .../get-a-contractor-skill.json | 23 ++++++ .../get-a-contractor-skill.md | 5 ++ .../get-a-contractor-skill.py | 5 ++ .../list-all-contractor-skills.json | 30 ++++++++ .../list-all-contractor-skills.md | 5 ++ .../list-all-contractor-skills.py | 5 ++ .../skill-add-to-a-contractor.json | 23 ++++++ .../skill-add-to-a-contractor.md | 9 +++ .../skill-add-to-a-contractor.py | 10 +++ 16 files changed, 274 insertions(+) create mode 100644 pages/contractor-skills/contractor-skills-object.json create mode 100644 pages/contractor-skills/contractor-skills-object.md create mode 100644 pages/contractor-skills/contractor-skills-object.yml create mode 100644 pages/contractor-skills/contractor-skills.yml create mode 100644 pages/contractor-skills/delete-a-contractor-skill.md create mode 100644 pages/contractor-skills/delete-a-contractor-skill.py create mode 100644 pages/contractor-skills/get-a-contractor-skill.json create mode 100644 pages/contractor-skills/get-a-contractor-skill.md create mode 100644 pages/contractor-skills/get-a-contractor-skill.py create mode 100644 pages/contractor-skills/list-all-contractor-skills.json create mode 100644 pages/contractor-skills/list-all-contractor-skills.md create mode 100644 pages/contractor-skills/list-all-contractor-skills.py create mode 100644 pages/contractor-skills/skill-add-to-a-contractor.json create mode 100644 pages/contractor-skills/skill-add-to-a-contractor.md create mode 100644 pages/contractor-skills/skill-add-to-a-contractor.py diff --git a/pages/api.yml b/pages/api.yml index 3d23ff4..325e991 100644 --- a/pages/api.yml +++ b/pages/api.yml @@ -66,6 +66,10 @@ endpoint_sections: title: Contractors (Tutors) id: contractors layout: /contractors/contractors.yml + - + title: Contractor Skills + id: contractor-skills + layout: /contractor-skills/contractor-skills.yml - title: Countries id: countries diff --git a/pages/contractor-skills/contractor-skills-object.json b/pages/contractor-skills/contractor-skills-object.json new file mode 100644 index 0000000..dd01e65 --- /dev/null +++ b/pages/contractor-skills/contractor-skills-object.json @@ -0,0 +1,23 @@ +{ + "id": 2, + "contractor": { + "id": 52, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@testagency.example.com", + "url": "http://localhost:8000/api/contractors/52/" + }, + "subject": { + "id": 159, + "name": "PGCE", + "category_id": 15, + "category_name": "Teaching Skill", + "custom_to_branch": null + }, + "qual_level": { + "id": 14, + "name": "BA", + "ranking": 50.0, + "custom_to_branch": null + } +} diff --git a/pages/contractor-skills/contractor-skills-object.md b/pages/contractor-skills/contractor-skills-object.md new file mode 100644 index 0000000..93fd686 --- /dev/null +++ b/pages/contractor-skills/contractor-skills-object.md @@ -0,0 +1,5 @@ +### Contractor Skills Object + +A Contractor Skills object represents the relationship between a Contractor and a Skill. A Skill is defined by a combination of a [Subject](#subjects) and a [Qualification Level](#qual-level). For example, a Skill might be "Mathematics (A Level)" where "Mathematics" is the Subject and "A Level" is the Qualification Level. + +When you retrieve a Contractor Skill, you'll get the full details of the Contractor, along with the associated Subject and Qualification Level information. This allows you to see not just which skills a Contractor has, but also the specific Qualification Levels for each subject they can teach. diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml new file mode 100644 index 0000000..1ac93f8 --- /dev/null +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -0,0 +1,76 @@ +attributes: + - + name: id + type: integer + description: Unique identifier for the contractor skill object. + - + name: contractor + type: object + description: The contractor this skill is associated with. + children: + - + name: id + type: integer + description: Unique identifier for the contractor. + - + name: first_name + type: string + description: The contractor's first name. + - + name: last_name + type: string + description: The contractor's last name. + - + name: email + type: string + description: The contractor's email address. + - + name: url + type: string + description: API URL for the full contractor details. + - + name: subject + type: object + description: The subject/skill details. + children: + - + name: id + type: integer + description: Unique identifier for the subject. + - + name: name + type: string + description: Name of the subject. + - + name: category_id + type: integer + description: ID of the subject category. + - + name: category_name + type: string + description: Name of the subject category. + - + name: custom_to_branch + type: integer + description: Branch ID if subject is custom to a branch, null otherwise. + - + name: qual_level + type: object + description: The qualification level details. + children: + - + name: id + type: integer + description: Unique identifier for the qualification level. + - + name: name + type: string + description: Name of the qualification level. + - + name: ranking + type: decimal + description: Numerical ranking of the qualification level. + - + name: custom_to_branch + type: integer + description: Branch ID if qualification level is custom to a branch, null otherwise. diff --git a/pages/contractor-skills/contractor-skills.yml b/pages/contractor-skills/contractor-skills.yml new file mode 100644 index 0000000..f40f57d --- /dev/null +++ b/pages/contractor-skills/contractor-skills.yml @@ -0,0 +1,39 @@ +sections: + - + title: Contractor Skills Object + id: contractor-skills-object + description: /contractor-skills/contractor-skills-object.md + attributes: /contractor-skills/contractor-skills-object.yml + response: /contractor-skills/contractor-skills-object.json + response_title: OBJECT + - + title: List all Contractor Skills + id: list-all-contractor-skills + description: /contractor-skills/list-all-contractor-skills.md + code: /contractor-skills/list-all-contractor-skills.py + code_type: GET + code_url: /api/contractor-skills/ + response: /contractor-skills/list-all-contractor-skills.json + - + title: Get a Contractor Skill + id: get-a-contractor-skill + description: /contractor-skills/get-a-contractor-skill.md + code: /contractor-skills/get-a-contractor-skill.py + code_type: GET + code_url: /api/contractor-skills// + response: /contractor-skills/get-a-contractor-skill.json + - + title: Create a Contractor Skill + id: skill-add-to-a-contractor + description: /contractor-skills/skill-add-to-a-contractor.md + code: /contractor-skills/skill-add-to-a-contractor.py + code_type: POST + code_url: /api/contractor-skills/ + response: /contractor-skills/skill-add-to-a-contractor.json + - + title: Delete a Contractor Skill + id: delete-a-contractor-skill + description: /contractor-skills/delete-a-contractor-skill.md + code: /contractor-skills/delete-a-contractor-skill.py + code_type: DELETE + code_url: /api/contractor-skills// \ No newline at end of file diff --git a/pages/contractor-skills/delete-a-contractor-skill.md b/pages/contractor-skills/delete-a-contractor-skill.md new file mode 100644 index 0000000..e3292e4 --- /dev/null +++ b/pages/contractor-skills/delete-a-contractor-skill.md @@ -0,0 +1,7 @@ +### Delete a Contractor Skill + +Deletes an existing Contractor Skill. You only need to specify the unique `id` of the Contractor Skill. + +If the specified Contractor Skill ID does not exist, a 404 response will be returned. + +A successful deletion returns a 204 response with no content. \ No newline at end of file diff --git a/pages/contractor-skills/delete-a-contractor-skill.py b/pages/contractor-skills/delete-a-contractor-skill.py new file mode 100644 index 0000000..5bd5efe --- /dev/null +++ b/pages/contractor-skills/delete-a-contractor-skill.py @@ -0,0 +1,5 @@ +import pprint, requests + +headers = {'Authorization': 'token '} +r = requests.delete('https://secure.tutorcruncher.com/api/contractor-skills/1/', headers=headers) +# Returns 204 on success \ No newline at end of file diff --git a/pages/contractor-skills/get-a-contractor-skill.json b/pages/contractor-skills/get-a-contractor-skill.json new file mode 100644 index 0000000..c215b2d --- /dev/null +++ b/pages/contractor-skills/get-a-contractor-skill.json @@ -0,0 +1,23 @@ +{ + "id": 2, + "contractor": { + "id": 52, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@testagency.example.com", + "url": "https://secure.tutorcruncher.com/api/contractors/52/" + }, + "subject": { + "id": 159, + "name": "PGCE", + "category_id": 15, + "category_name": "Teaching Skill", + "custom_to_branch": null + }, + "qual_level": { + "id": 14, + "name": "BA", + "ranking": 50.0, + "custom_to_branch": null + } +} \ No newline at end of file diff --git a/pages/contractor-skills/get-a-contractor-skill.md b/pages/contractor-skills/get-a-contractor-skill.md new file mode 100644 index 0000000..4ae4bf6 --- /dev/null +++ b/pages/contractor-skills/get-a-contractor-skill.md @@ -0,0 +1,5 @@ +### Get a Contractor Skill + +Returns the details of an existing Contractor Skill. You only need to specify the unique `id` of the Contractor Skill to get the correct details. + +The response includes the full Contractor Skill object including the Contractor details, [Subject](#subjects) and [Qualification Level](#qual-level). \ No newline at end of file diff --git a/pages/contractor-skills/get-a-contractor-skill.py b/pages/contractor-skills/get-a-contractor-skill.py new file mode 100644 index 0000000..7a9a9d6 --- /dev/null +++ b/pages/contractor-skills/get-a-contractor-skill.py @@ -0,0 +1,5 @@ +import pprint, requests + +headers = {'Authorization': 'token '} +r = requests.get('https://secure.tutorcruncher.com/api/contractor-skills/2/', headers=headers) +pprint.pprint(r.json()) \ No newline at end of file diff --git a/pages/contractor-skills/list-all-contractor-skills.json b/pages/contractor-skills/list-all-contractor-skills.json new file mode 100644 index 0000000..9652352 --- /dev/null +++ b/pages/contractor-skills/list-all-contractor-skills.json @@ -0,0 +1,30 @@ +{ + "count": 2, + "next": null, + "previous": null, + "results": [ + { + "id": 2, + "contractor": { + "id": 52, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@testagency.example.com", + "url": "https://secure.tutorcruncher.com/api/contractors/52/" + }, + "subject": { + "id": 159, + "name": "PGCE", + "category_id": 15, + "category_name": "Teaching Skill", + "custom_to_branch": null + }, + "qual_level": { + "id": 14, + "name": "BA", + "ranking": 50.0, + "custom_to_branch": null + } + } + ] +} \ No newline at end of file diff --git a/pages/contractor-skills/list-all-contractor-skills.md b/pages/contractor-skills/list-all-contractor-skills.md new file mode 100644 index 0000000..670b29f --- /dev/null +++ b/pages/contractor-skills/list-all-contractor-skills.md @@ -0,0 +1,5 @@ +### List all Contractor Skills + +Returns a list of Contractor Skills. Each Contractor Skill represents a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). + +The response includes the full details of each Contractor Skill including Contractor information, Subject details, and Qualification Level data. \ No newline at end of file diff --git a/pages/contractor-skills/list-all-contractor-skills.py b/pages/contractor-skills/list-all-contractor-skills.py new file mode 100644 index 0000000..21b6aad --- /dev/null +++ b/pages/contractor-skills/list-all-contractor-skills.py @@ -0,0 +1,5 @@ +import pprint, requests + +headers = {'Authorization': 'token '} +r = requests.get('https://secure.tutorcruncher.com/api/contractor-skills/', headers=headers) +pprint.pprint(r.json()) \ No newline at end of file diff --git a/pages/contractor-skills/skill-add-to-a-contractor.json b/pages/contractor-skills/skill-add-to-a-contractor.json new file mode 100644 index 0000000..067ce12 --- /dev/null +++ b/pages/contractor-skills/skill-add-to-a-contractor.json @@ -0,0 +1,23 @@ +{ + "id": 2, + "contractor": { + "id": 52, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@testagency.example.com", + "url": "http://localhost:8000/api/contractors/52/" + }, + "subject": { + "id": 159, + "name": "PGCE", + "category_id": 15, + "category_name": "Teaching Skill", + "custom_to_branch": null + }, + "qual_level": { + "id": 14, + "name": "BA", + "ranking": 50.0, + "custom_to_branch": null + } +} \ No newline at end of file diff --git a/pages/contractor-skills/skill-add-to-a-contractor.md b/pages/contractor-skills/skill-add-to-a-contractor.md new file mode 100644 index 0000000..b1940b7 --- /dev/null +++ b/pages/contractor-skills/skill-add-to-a-contractor.md @@ -0,0 +1,9 @@ +### Create a Contractor Skill + +Associates a Skill with a Contractor by specifying the Contractor ID, Subject ID (see [Subjects](#subjects)), and Qualification Level ID (see [Qualification Levels](#qual-level)). + +If a Skill with the specified Subject and Qualification Level does not exist, a new Skill will be created. + +If you add a Skill that has already been associated with a Contractor, a new Contractor Skill will not be created and you will get a normal 200 response. + +The response will include the full Contractor Skill relationship object including the Contractor details, Subject information, and Qualification Level. diff --git a/pages/contractor-skills/skill-add-to-a-contractor.py b/pages/contractor-skills/skill-add-to-a-contractor.py new file mode 100644 index 0000000..7abe0ea --- /dev/null +++ b/pages/contractor-skills/skill-add-to-a-contractor.py @@ -0,0 +1,10 @@ +import pprint, requests + +headers = {'Authorization': 'token '} +data = { + 'contractor': 69, + 'subject': '51', + 'qual_level': 13 +} +r = requests.post('https://secure.tutorcruncher.com/api/contractor-skills/', json=data, headers=headers) +pprint.pprint(r.json()) \ No newline at end of file From 9228c221e24421c84f3d9c01e14705f14c7de847 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Tue, 8 Apr 2025 09:54:03 +0100 Subject: [PATCH 02/12] updated the custom_to_branch description --- pages/contractor-skills/contractor-skills-object.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml index 1ac93f8..47ea4e7 100644 --- a/pages/contractor-skills/contractor-skills-object.yml +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -51,8 +51,8 @@ attributes: description: Name of the subject category. - name: custom_to_branch - type: integer - description: Branch ID if subject is custom to a branch, null otherwise. + type: bool + description: Indicates whether the Subject is custom to a specific branch (True) or not (null). - name: qual_level type: object @@ -72,5 +72,5 @@ attributes: description: Numerical ranking of the qualification level. - name: custom_to_branch - type: integer - description: Branch ID if qualification level is custom to a branch, null otherwise. + type: bool + description: Indicates whether the Qualification Level is custom to a specific branch (True) or not (null). From 222457d360a15acab5c9b92aaf4576d2f775d5f9 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Tue, 8 Apr 2025 16:12:48 +0100 Subject: [PATCH 03/12] updated doc strings --- .../contractor-skills-object.yml | 6 ++--- pages/contractor-skills/contractor-skills.yml | 10 ++++---- .../create-a-contractor-skill.json | 23 +++++++++++++++++++ .../create-a-contractor-skill.md | 3 +++ .../create-a-contractor-skill.py | 5 ++++ .../delete-a-contractor-skill.md | 6 +---- .../get-a-contractor-skill.md | 3 +-- .../list-all-contractor-skills.md | 4 +--- .../skill-add-to-a-contractor.json | 23 ------------------- .../skill-add-to-a-contractor.md | 9 -------- .../skill-add-to-a-contractor.py | 10 -------- 11 files changed, 42 insertions(+), 60 deletions(-) create mode 100644 pages/contractor-skills/create-a-contractor-skill.json create mode 100644 pages/contractor-skills/create-a-contractor-skill.md create mode 100644 pages/contractor-skills/create-a-contractor-skill.py delete mode 100644 pages/contractor-skills/skill-add-to-a-contractor.json delete mode 100644 pages/contractor-skills/skill-add-to-a-contractor.md delete mode 100644 pages/contractor-skills/skill-add-to-a-contractor.py diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml index 47ea4e7..655a563 100644 --- a/pages/contractor-skills/contractor-skills-object.yml +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -31,7 +31,7 @@ attributes: - name: subject type: object - description: The subject/skill details. + description: The subject details. children: - name: id @@ -52,7 +52,7 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Subject is custom to a specific branch (True) or not (null). + description: Indicates whether the Subject is custom to the API key's Branch (True), or shared across all Branches (null). - name: qual_level type: object @@ -73,4 +73,4 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Qualification Level is custom to a specific branch (True) or not (null). + description: Indicates whether the Qualification Level is custom to the API key's Branch (True), or shared across all Branches (null). diff --git a/pages/contractor-skills/contractor-skills.yml b/pages/contractor-skills/contractor-skills.yml index f40f57d..9986411 100644 --- a/pages/contractor-skills/contractor-skills.yml +++ b/pages/contractor-skills/contractor-skills.yml @@ -24,16 +24,16 @@ sections: response: /contractor-skills/get-a-contractor-skill.json - title: Create a Contractor Skill - id: skill-add-to-a-contractor - description: /contractor-skills/skill-add-to-a-contractor.md - code: /contractor-skills/skill-add-to-a-contractor.py + id: create-a-contractor-skills + description: /contractor-skills/create-a-contractor-skill.md + code: /contractor-skills/create-a-contractor-skill.py code_type: POST code_url: /api/contractor-skills/ - response: /contractor-skills/skill-add-to-a-contractor.json + response: /contractor-skills/create-a-contractor-skill.json - title: Delete a Contractor Skill id: delete-a-contractor-skill description: /contractor-skills/delete-a-contractor-skill.md code: /contractor-skills/delete-a-contractor-skill.py code_type: DELETE - code_url: /api/contractor-skills// \ No newline at end of file + code_url: /api/contractor-skills// diff --git a/pages/contractor-skills/create-a-contractor-skill.json b/pages/contractor-skills/create-a-contractor-skill.json new file mode 100644 index 0000000..8243103 --- /dev/null +++ b/pages/contractor-skills/create-a-contractor-skill.json @@ -0,0 +1,23 @@ +{ + "id": 135, + "contractor": { + "id": 69, + "first_name": "Billy", + "last_name": "Holiday", + "email": null, + "url": "http://localhost:8000/api/contractors/69/" + }, + "subject": { + "id": 51, + "name": "Religious Studies", + "category_id": 8, + "category_name": "Humanities", + "custom_to_branch": null + }, + "qual_level": { + "id": 13, + "name": "Key Stage 5", + "ranking": 35.0, + "custom_to_branch": null + } +} diff --git a/pages/contractor-skills/create-a-contractor-skill.md b/pages/contractor-skills/create-a-contractor-skill.md new file mode 100644 index 0000000..50dc505 --- /dev/null +++ b/pages/contractor-skills/create-a-contractor-skill.md @@ -0,0 +1,3 @@ +### Add a Contractor Skill + +Creates a new Contractor Skill, representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). You need to provide the `contractor`, `subject`, and `qual_level` IDs in the request body. Subjects or Qualification Levels custom to another branch, hidden for the branch, or added specifically by the Contractor cannot be used. For more information about what “custom to branch” means, see [Subject](#subjects) and [Qualification Level](#qual-levels). diff --git a/pages/contractor-skills/create-a-contractor-skill.py b/pages/contractor-skills/create-a-contractor-skill.py new file mode 100644 index 0000000..715f2b5 --- /dev/null +++ b/pages/contractor-skills/create-a-contractor-skill.py @@ -0,0 +1,5 @@ +import pprint, requests +data = {"contractor": 69,"subject": 51,"qual_level": 13} +headers = {'Authorization': 'token '} +r = requests.post('https://secure.tutorcruncher.com/api/contractor-skills/',json=data, headers=headers) +pprint.pprint(r.json()) diff --git a/pages/contractor-skills/delete-a-contractor-skill.md b/pages/contractor-skills/delete-a-contractor-skill.md index e3292e4..b6d0918 100644 --- a/pages/contractor-skills/delete-a-contractor-skill.md +++ b/pages/contractor-skills/delete-a-contractor-skill.md @@ -1,7 +1,3 @@ ### Delete a Contractor Skill -Deletes an existing Contractor Skill. You only need to specify the unique `id` of the Contractor Skill. - -If the specified Contractor Skill ID does not exist, a 404 response will be returned. - -A successful deletion returns a 204 response with no content. \ No newline at end of file +Deletes a Contractor Skill using its unique ID. Only Contractor Skills associated with the API key's Branch can be deleted. Attempts to delete a skill that belongs to a different Branch or references a Subject or Qualification Level hidden or restricted for the Branch will result in a `400 Bad Request` response. For more information about Branch-specific restrictions, see [Subject](#subjects) and [Qualification Level](#qual-levels). diff --git a/pages/contractor-skills/get-a-contractor-skill.md b/pages/contractor-skills/get-a-contractor-skill.md index 4ae4bf6..1008d04 100644 --- a/pages/contractor-skills/get-a-contractor-skill.md +++ b/pages/contractor-skills/get-a-contractor-skill.md @@ -1,5 +1,4 @@ ### Get a Contractor Skill Returns the details of an existing Contractor Skill. You only need to specify the unique `id` of the Contractor Skill to get the correct details. - -The response includes the full Contractor Skill object including the Contractor details, [Subject](#subjects) and [Qualification Level](#qual-level). \ No newline at end of file +The response includes the full Contractor Skill object including the Contractor details, [Subject](#subjects) and [Qualification Level](#qual-level). diff --git a/pages/contractor-skills/list-all-contractor-skills.md b/pages/contractor-skills/list-all-contractor-skills.md index 670b29f..128501e 100644 --- a/pages/contractor-skills/list-all-contractor-skills.md +++ b/pages/contractor-skills/list-all-contractor-skills.md @@ -1,5 +1,3 @@ ### List all Contractor Skills +Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). The results include only skills that are custom to the API key's Branch, exclude skills with hidden Subjects or Qualification Levels for the Branch, and include skills specifically added by the Contractor. If no skills match the filtering criteria, the response will return an empty results array. For more information about what "custom to branch" means, see [Subject](#subjects) and [Qualification Level](#qual-levels). -Returns a list of Contractor Skills. Each Contractor Skill represents a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). - -The response includes the full details of each Contractor Skill including Contractor information, Subject details, and Qualification Level data. \ No newline at end of file diff --git a/pages/contractor-skills/skill-add-to-a-contractor.json b/pages/contractor-skills/skill-add-to-a-contractor.json deleted file mode 100644 index 067ce12..0000000 --- a/pages/contractor-skills/skill-add-to-a-contractor.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "id": 2, - "contractor": { - "id": 52, - "first_name": "James", - "last_name": "Higgins", - "email": "james_higgins@testagency.example.com", - "url": "http://localhost:8000/api/contractors/52/" - }, - "subject": { - "id": 159, - "name": "PGCE", - "category_id": 15, - "category_name": "Teaching Skill", - "custom_to_branch": null - }, - "qual_level": { - "id": 14, - "name": "BA", - "ranking": 50.0, - "custom_to_branch": null - } -} \ No newline at end of file diff --git a/pages/contractor-skills/skill-add-to-a-contractor.md b/pages/contractor-skills/skill-add-to-a-contractor.md deleted file mode 100644 index b1940b7..0000000 --- a/pages/contractor-skills/skill-add-to-a-contractor.md +++ /dev/null @@ -1,9 +0,0 @@ -### Create a Contractor Skill - -Associates a Skill with a Contractor by specifying the Contractor ID, Subject ID (see [Subjects](#subjects)), and Qualification Level ID (see [Qualification Levels](#qual-level)). - -If a Skill with the specified Subject and Qualification Level does not exist, a new Skill will be created. - -If you add a Skill that has already been associated with a Contractor, a new Contractor Skill will not be created and you will get a normal 200 response. - -The response will include the full Contractor Skill relationship object including the Contractor details, Subject information, and Qualification Level. diff --git a/pages/contractor-skills/skill-add-to-a-contractor.py b/pages/contractor-skills/skill-add-to-a-contractor.py deleted file mode 100644 index 7abe0ea..0000000 --- a/pages/contractor-skills/skill-add-to-a-contractor.py +++ /dev/null @@ -1,10 +0,0 @@ -import pprint, requests - -headers = {'Authorization': 'token '} -data = { - 'contractor': 69, - 'subject': '51', - 'qual_level': 13 -} -r = requests.post('https://secure.tutorcruncher.com/api/contractor-skills/', json=data, headers=headers) -pprint.pprint(r.json()) \ No newline at end of file From 701e040cafe5a673074df563812a261fcacf0420 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Tue, 8 Apr 2025 16:15:27 +0100 Subject: [PATCH 04/12] updated role v2 objects to reflect new skills objects --- pages/contractors/contractor-object-v2.json | 52 +++++++++++++++++--- pages/contractors/create-a-contractor.json | 54 +++++++++++++++++---- pages/contractors/get-a-contractor.json | 54 +++++++++++++++++---- pages/contractors/update-a-contractor.json | 52 +++++++++++++++++--- 4 files changed, 178 insertions(+), 34 deletions(-) diff --git a/pages/contractors/contractor-object-v2.json b/pages/contractors/contractor-object-v2.json index 736387d..6979d85 100644 --- a/pages/contractors/contractor-object-v2.json +++ b/pages/contractors/contractor-object-v2.json @@ -20,15 +20,51 @@ "qualifications": [], "skills": [ { - "id": 1436, - "subject": "American Studies", - "qual_level": "Key Stage 5" - }, + "id": 145, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 98, + "name": "General Maths & Science", + "category_id": 11, + "category_name": "Other", + "custom_to_branch": null + }, + "qual_level": { + "id": 3, + "name": "Common Entrance", + "ranking": 12.0, + "custom_to_branch": null + } + }, { - "id": 4082, - "subject": "American Studies", - "qual_level": "A Level" - } + "id": 141, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 135, + "name": "Geology", + "category_id": 14, + "category_name": "Science", + "custom_to_branch": null + }, + "qual_level": { + "id": 5, + "name": "GCSE", + "ranking": 14.0, + "custom_to_branch": null + } + } ], "institutions": [], "receive_service_notifications": true, diff --git a/pages/contractors/create-a-contractor.json b/pages/contractors/create-a-contractor.json index 8fe66cf..c30802f 100644 --- a/pages/contractors/create-a-contractor.json +++ b/pages/contractors/create-a-contractor.json @@ -19,16 +19,52 @@ "default_rate": null, "qualifications": [], "skills": [ + { + "id": 145, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 98, + "name": "General Maths & Science", + "category_id": 11, + "category_name": "Other", + "custom_to_branch": null + }, + "qual_level": { + "id": 3, + "name": "Common Entrance", + "ranking": 12.0, + "custom_to_branch": null + } + }, { - "id": 1436, - "subject": "American Studies", - "qual_level": "Key Stage 5" - }, - { - "id": 4082, - "subject": "American Studies", - "qual_level": "A Level" - } + "id": 141, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 135, + "name": "Geology", + "category_id": 14, + "category_name": "Science", + "custom_to_branch": null + }, + "qual_level": { + "id": 5, + "name": "GCSE", + "ranking": 14.0, + "custom_to_branch": null + } + } ], "institutions": [], "receive_service_notifications": true, diff --git a/pages/contractors/get-a-contractor.json b/pages/contractors/get-a-contractor.json index cbfee07..60d9f01 100644 --- a/pages/contractors/get-a-contractor.json +++ b/pages/contractors/get-a-contractor.json @@ -19,16 +19,52 @@ "default_rate": null, "qualifications": [], "skills": [ + { + "id": 145, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 98, + "name": "General Maths & Science", + "category_id": 11, + "category_name": "Other", + "custom_to_branch": null + }, + "qual_level": { + "id": 3, + "name": "Common Entrance", + "ranking": 12.0, + "custom_to_branch": null + } + }, { - "id": 1436, - "subject": "American Studies", - "qual_level": "Key Stage 5" - }, - { - "id": 4082, - "subject": "American Studies", - "qual_level": "A Level" - } + "id": 141, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 135, + "name": "Geology", + "category_id": 14, + "category_name": "Science", + "custom_to_branch": null + }, + "qual_level": { + "id": 5, + "name": "GCSE", + "ranking": 14.0, + "custom_to_branch": null + } + } ], "institutions": [], "receive_service_notifications": true, diff --git a/pages/contractors/update-a-contractor.json b/pages/contractors/update-a-contractor.json index 53b826a..822a49d 100644 --- a/pages/contractors/update-a-contractor.json +++ b/pages/contractors/update-a-contractor.json @@ -20,15 +20,51 @@ "qualifications": [], "skills": [ { - "id": 1436, - "subject": "American Studies", - "qual_level": "Key Stage 5" - }, + "id": 145, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 98, + "name": "General Maths & Science", + "category_id": 11, + "category_name": "Other", + "custom_to_branch": null + }, + "qual_level": { + "id": 3, + "name": "Common Entrance", + "ranking": 12.0, + "custom_to_branch": null + } + }, { - "id": 4082, - "subject": "American Studies", - "qual_level": "A Level" - } + "id": 141, + "contractor": { + "id": 568433, + "first_name": "James", + "last_name": "Higgins", + "email": "james_higgins@example.com", + "url": "https://secure.tutorcruncher.com/api/568433/" + }, + "subject": { + "id": 135, + "name": "Geology", + "category_id": 14, + "category_name": "Science", + "custom_to_branch": null + }, + "qual_level": { + "id": 5, + "name": "GCSE", + "ranking": 14.0, + "custom_to_branch": null + } + } ], "institutions": [], "receive_service_notifications": true, From 2c286ffccfde5101494f9ad84c76e1896ba4a496 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 14:37:05 +0100 Subject: [PATCH 05/12] dan comments --- pages/contractor-skills/contractor-skills-object.yml | 4 ++-- pages/contractor-skills/delete-a-contractor-skill.md | 2 +- pages/contractor-skills/list-all-contractor-skills.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml index 655a563..e77c953 100644 --- a/pages/contractor-skills/contractor-skills-object.yml +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -52,7 +52,7 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Subject is custom to the API key's Branch (True), or shared across all Branches (null). + description: Indicates whether the Subject is custom to your Branch (True), or shared across all Branches (null). - name: qual_level type: object @@ -73,4 +73,4 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Qualification Level is custom to the API key's Branch (True), or shared across all Branches (null). + description: Indicates whether the Qualification Level is custom to your Branch (True), or shared across all Branches (null). diff --git a/pages/contractor-skills/delete-a-contractor-skill.md b/pages/contractor-skills/delete-a-contractor-skill.md index b6d0918..171b1d4 100644 --- a/pages/contractor-skills/delete-a-contractor-skill.md +++ b/pages/contractor-skills/delete-a-contractor-skill.md @@ -1,3 +1,3 @@ ### Delete a Contractor Skill -Deletes a Contractor Skill using its unique ID. Only Contractor Skills associated with the API key's Branch can be deleted. Attempts to delete a skill that belongs to a different Branch or references a Subject or Qualification Level hidden or restricted for the Branch will result in a `400 Bad Request` response. For more information about Branch-specific restrictions, see [Subject](#subjects) and [Qualification Level](#qual-levels). +Deletes a Contractor Skill using its unique ID. Only Contractor Skills associated with your Branch can be deleted. Attempts to delete a skill that belongs to a different Branch or references a Subject or Qualification Level hidden or restricted for the Branch will result in a `400 Bad Request` response. For more information about Branch-specific restrictions, see [Subject](#subjects) and [Qualification Level](#qual-levels). diff --git a/pages/contractor-skills/list-all-contractor-skills.md b/pages/contractor-skills/list-all-contractor-skills.md index 128501e..9c5d181 100644 --- a/pages/contractor-skills/list-all-contractor-skills.md +++ b/pages/contractor-skills/list-all-contractor-skills.md @@ -1,3 +1,3 @@ ### List all Contractor Skills -Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). The results include only skills that are custom to the API key's Branch, exclude skills with hidden Subjects or Qualification Levels for the Branch, and include skills specifically added by the Contractor. If no skills match the filtering criteria, the response will return an empty results array. For more information about what "custom to branch" means, see [Subject](#subjects) and [Qualification Level](#qual-levels). +Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). From 8d32f53010eac4d13aa91b5743f2caa0a04fd1d1 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 14:47:40 +0100 Subject: [PATCH 06/12] dan comments --- pages/contractor-skills/list-all-contractor-skills.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/contractor-skills/list-all-contractor-skills.md b/pages/contractor-skills/list-all-contractor-skills.md index 9c5d181..128501e 100644 --- a/pages/contractor-skills/list-all-contractor-skills.md +++ b/pages/contractor-skills/list-all-contractor-skills.md @@ -1,3 +1,3 @@ ### List all Contractor Skills -Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). +Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). The results include only skills that are custom to the API key's Branch, exclude skills with hidden Subjects or Qualification Levels for the Branch, and include skills specifically added by the Contractor. If no skills match the filtering criteria, the response will return an empty results array. For more information about what "custom to branch" means, see [Subject](#subjects) and [Qualification Level](#qual-levels). From ca8bd0219bf4da83251917d7ee0e8618358d2130 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 14:52:07 +0100 Subject: [PATCH 07/12] dan comments --- pages/contractor-skills/list-all-contractor-skills.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/contractor-skills/list-all-contractor-skills.md b/pages/contractor-skills/list-all-contractor-skills.md index 128501e..32dd9bc 100644 --- a/pages/contractor-skills/list-all-contractor-skills.md +++ b/pages/contractor-skills/list-all-contractor-skills.md @@ -1,3 +1,3 @@ ### List all Contractor Skills -Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels). The results include only skills that are custom to the API key's Branch, exclude skills with hidden Subjects or Qualification Levels for the Branch, and include skills specifically added by the Contractor. If no skills match the filtering criteria, the response will return an empty results array. For more information about what "custom to branch" means, see [Subject](#subjects) and [Qualification Level](#qual-levels). +Returns a list of Contractor Skills, each representing a relationship between a Contractor and a combination of [Subject](#subjects) and [Qualification Level](#qual-levels) custom to your Branch. It also includes skills specifically added by the Contractor. If no skills match the filtering criteria, the response will return an empty results array. From 66ffe63f1841848372d6dd4c4140b73fa31dde3f Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:30:14 +0100 Subject: [PATCH 08/12] henrys comment about duplication --- pages/contractor-skills/contractor-skills-object.md | 2 +- pages/contractor-skills/contractor-skills-object.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/contractor-skills/contractor-skills-object.md b/pages/contractor-skills/contractor-skills-object.md index 93fd686..32e8a55 100644 --- a/pages/contractor-skills/contractor-skills-object.md +++ b/pages/contractor-skills/contractor-skills-object.md @@ -2,4 +2,4 @@ A Contractor Skills object represents the relationship between a Contractor and a Skill. A Skill is defined by a combination of a [Subject](#subjects) and a [Qualification Level](#qual-level). For example, a Skill might be "Mathematics (A Level)" where "Mathematics" is the Subject and "A Level" is the Qualification Level. -When you retrieve a Contractor Skill, you'll get the full details of the Contractor, along with the associated Subject and Qualification Level information. This allows you to see not just which skills a Contractor has, but also the specific Qualification Levels for each subject they can teach. +When you retrieve a Contractor Skill, you'll get the basic details of the Contractor, along with the associated Subject and Qualification Level information. This allows you to see not just which skills a Contractor has, but also the specific Qualification Levels for each subject they can teach. diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml index e77c953..8123f7c 100644 --- a/pages/contractor-skills/contractor-skills-object.yml +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -52,7 +52,7 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Subject is custom to your Branch (True), or shared across all Branches (null). + description: Indicates whether the Subject is custom to your Branch (True), or is a default subject (null). - name: qual_level type: object @@ -73,4 +73,4 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Qualification Level is custom to your Branch (True), or shared across all Branches (null). + description: Indicates whether the Qualification Level is custom to your Branch (True), or is a default subject (null). From 9dc98edc245c2eb3ee4397e2f3de02d2b9c006f8 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:52:47 +0100 Subject: [PATCH 09/12] extra changes --- pages/contractor-skills/contractor-skills-object.json | 2 +- pages/contractor-skills/create-a-contractor-skill.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/contractor-skills/contractor-skills-object.json b/pages/contractor-skills/contractor-skills-object.json index dd01e65..6f3b7c2 100644 --- a/pages/contractor-skills/contractor-skills-object.json +++ b/pages/contractor-skills/contractor-skills-object.json @@ -5,7 +5,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@testagency.example.com", - "url": "http://localhost:8000/api/contractors/52/" + "url": "https://secure.tutorcruncher.com/api/52/" }, "subject": { "id": 159, diff --git a/pages/contractor-skills/create-a-contractor-skill.json b/pages/contractor-skills/create-a-contractor-skill.json index 8243103..b7f8b25 100644 --- a/pages/contractor-skills/create-a-contractor-skill.json +++ b/pages/contractor-skills/create-a-contractor-skill.json @@ -5,7 +5,7 @@ "first_name": "Billy", "last_name": "Holiday", "email": null, - "url": "http://localhost:8000/api/contractors/69/" + "url": "https://secure.tutorcruncher.com/api/69/" }, "subject": { "id": 51, From b0ef416b24aa1dcb3fdedb84e4ae73615cb00b78 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:55:30 +0100 Subject: [PATCH 10/12] updated the url string --- pages/contractor-skills/contractor-skills-object.json | 2 +- pages/contractors/contractor-object-v2.json | 4 ++-- pages/contractors/create-a-contractor.json | 4 ++-- pages/contractors/get-a-contractor.json | 4 ++-- pages/contractors/update-a-contractor.json | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pages/contractor-skills/contractor-skills-object.json b/pages/contractor-skills/contractor-skills-object.json index 6f3b7c2..3eb672f 100644 --- a/pages/contractor-skills/contractor-skills-object.json +++ b/pages/contractor-skills/contractor-skills-object.json @@ -5,7 +5,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@testagency.example.com", - "url": "https://secure.tutorcruncher.com/api/52/" + "url": "https://secure.tutorcruncher.com/api/contractors/52/" }, "subject": { "id": 159, diff --git a/pages/contractors/contractor-object-v2.json b/pages/contractors/contractor-object-v2.json index 6979d85..00bfe0b 100644 --- a/pages/contractors/contractor-object-v2.json +++ b/pages/contractors/contractor-object-v2.json @@ -26,7 +26,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 98, @@ -49,7 +49,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 135, diff --git a/pages/contractors/create-a-contractor.json b/pages/contractors/create-a-contractor.json index c30802f..b89aa09 100644 --- a/pages/contractors/create-a-contractor.json +++ b/pages/contractors/create-a-contractor.json @@ -26,7 +26,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 98, @@ -49,7 +49,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 135, diff --git a/pages/contractors/get-a-contractor.json b/pages/contractors/get-a-contractor.json index 60d9f01..4b6b997 100644 --- a/pages/contractors/get-a-contractor.json +++ b/pages/contractors/get-a-contractor.json @@ -26,7 +26,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 98, @@ -49,7 +49,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 135, diff --git a/pages/contractors/update-a-contractor.json b/pages/contractors/update-a-contractor.json index 822a49d..6998384 100644 --- a/pages/contractors/update-a-contractor.json +++ b/pages/contractors/update-a-contractor.json @@ -26,7 +26,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 98, @@ -49,7 +49,7 @@ "first_name": "James", "last_name": "Higgins", "email": "james_higgins@example.com", - "url": "https://secure.tutorcruncher.com/api/568433/" + "url": "https://secure.tutorcruncher.com/api/contractors/568433/" }, "subject": { "id": 135, From 460c1f03c5f5bf8154d0b91c91ea3fa5dba9ab84 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:57:14 +0100 Subject: [PATCH 11/12] updated the url string --- pages/contractor-skills/contractor-skills-object.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml index 8123f7c..8b08ab4 100644 --- a/pages/contractor-skills/contractor-skills-object.yml +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -52,7 +52,7 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Subject is custom to your Branch (True), or is a default subject (null). + description: Indicates whether the Subject is custom to your Branch (True), or is a default Subject (null). - name: qual_level type: object @@ -73,4 +73,4 @@ attributes: - name: custom_to_branch type: bool - description: Indicates whether the Qualification Level is custom to your Branch (True), or is a default subject (null). + description: Indicates whether the Qualification Level is custom to your Branch (True), or is a default Qualification Level (null). From 2a21a3f8a6af6e03f142b7dd0aaa84d8f28ab9d2 Mon Sep 17 00:00:00 2001 From: Sandeep Date: Thu, 10 Apr 2025 16:58:53 +0100 Subject: [PATCH 12/12] update the qual_level descritpions --- pages/contractor-skills/contractor-skills-object.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/pages/contractor-skills/contractor-skills-object.yml b/pages/contractor-skills/contractor-skills-object.yml index 8b08ab4..0f3a6bb 100644 --- a/pages/contractor-skills/contractor-skills-object.yml +++ b/pages/contractor-skills/contractor-skills-object.yml @@ -74,3 +74,4 @@ attributes: name: custom_to_branch type: bool description: Indicates whether the Qualification Level is custom to your Branch (True), or is a default Qualification Level (null). +