Skip to content

Commit adc798d

Browse files
committed
openapi: add parent_bbehaviour
1 parent 0b5a85b commit adc798d

File tree

13 files changed

+223
-48
lines changed

13 files changed

+223
-48
lines changed

astro.config.mjs

Lines changed: 38 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,24 @@ export default defineConfig({
127127
label: "[POST] Change Password",
128128
link: "/parent-client-api/operations/change-password",
129129
},
130+
{
131+
label: "Parent Behaviour",
132+
collapsed: true,
133+
items: [
134+
{
135+
label: "[GET] List Point Types",
136+
link: "/parent-client-api/operations/list-parent-behaviour",
137+
},
138+
{
139+
label: "[POST] Delete Point",
140+
link: "/parent-client-api/operations/delete-parent-behaviour",
141+
},
142+
{
143+
label: "[POST] Add Point",
144+
link: "/parent-client-api/operations/add-parent-behaviour",
145+
},
146+
],
147+
},
130148
],
131149
},
132150
{
@@ -177,20 +195,26 @@ export default defineConfig({
177195
link: "/client-api/operations/get-academic-report",
178196
},
179197
{
180-
label: "[POST] List Report Cards",
181-
link: "/client-api/operations/list-on-report-cards",
182-
},
183-
{
184-
label: "[GET] Get Report Card",
185-
link: "/client-api/operations/get-on-report-card",
186-
},
187-
{
188-
label: "[GET] Get Report Card Summary",
189-
link: "/client-api/operations/get-on-report-card-summary-comment",
190-
},
191-
{
192-
label: "[GET] Get Report Card Target",
193-
link: "/client-api/operations/get-on-report-card-target",
198+
label: "Report Cards",
199+
collapsed: true,
200+
items: [
201+
{
202+
label: "[GET] List Cards",
203+
link: "/client-api/operations/list-on-report-cards",
204+
},
205+
{
206+
label: "[GET] Get Card",
207+
link: "/client-api/operations/get-on-report-card",
208+
},
209+
{
210+
label: "[GET] Get Card Summary",
211+
link: "/client-api/operations/get-on-report-card-summary-comment",
212+
},
213+
{
214+
label: "[GET] Get Card Target",
215+
link: "/client-api/operations/get-on-report-card-target",
216+
},
217+
],
194218
},
195219
],
196220
},

openapi/parentclientapi.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,98 @@ paths:
5959
schema:
6060
$ref: "./schemas/_common/error_response.yaml"
6161

62+
/parentbehaviours/{studentId}:
63+
post:
64+
operationId: list-parent-behaviour
65+
summary: List Parent Behaviour
66+
description: >
67+
Lists the behaviour points for a pupil.
68+
parameters:
69+
- name: studentId
70+
in: path
71+
required: true
72+
schema:
73+
type: integer
74+
responses:
75+
"200":
76+
description: List of behaviour points
77+
content:
78+
application/json:
79+
schema:
80+
$ref: "./schemas/parent_behaviour/list_response.yaml"
81+
"401":
82+
description: Unauthorized
83+
content:
84+
application/json:
85+
schema:
86+
$ref: "./schemas/_common/error_response.yaml"
87+
88+
/deleteparentbehaviour/{studentId}:
89+
post:
90+
operationId: delete-parent-behaviour
91+
summary: Delete Parent Behaviour Point
92+
description: >
93+
Adds a behaviour point to a pupil's record.
94+
requestBody:
95+
required: true
96+
content:
97+
application/x-www-form-urlencoded:
98+
schema:
99+
$ref: "./schemas/parent_behaviour/delete_request.yaml"
100+
parameters:
101+
- name: studentId
102+
in: path
103+
required: true
104+
schema:
105+
type: integer
106+
responses:
107+
"200":
108+
description: Behaviour point deleted
109+
content:
110+
application/json:
111+
schema:
112+
$ref: "./schemas/_common/empty_response.yaml"
113+
"401":
114+
description: Unauthorized
115+
content:
116+
application/json:
117+
schema:
118+
$ref: "./schemas/_common/error_response.yaml"
119+
120+
/addparentbehaviour/{studentId}:
121+
post:
122+
operationId: add-parent-behaviour
123+
summary: Add Parent Behaviour Point
124+
description: >
125+
Adds a behaviour point to a pupil's record.
126+
requestBody:
127+
required: true
128+
content:
129+
application/x-www-form-urlencoded:
130+
schema:
131+
$ref: "./schemas/parent_behaviour/add_request.yaml"
132+
parameters:
133+
- name: studentId
134+
in: path
135+
required: true
136+
schema:
137+
type: integer
138+
responses:
139+
"200":
140+
description: Behaviour point added or Daily limit reached
141+
content:
142+
application/json:
143+
schema:
144+
oneOf:
145+
- $ref: "./schemas/parent_behaviour/add_response.yaml"
146+
- $ref: "./schemas/parent_behaviour/add_limit_error_response.yaml"
147+
"401":
148+
description: Unauthorized
149+
content:
150+
application/json:
151+
schema:
152+
$ref: "./schemas/_common/error_response.yaml"
153+
62154
/login:
63155
post:
64156
operationId: login
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
type: object
2+
properties:
3+
meta:
4+
nullable: true
5+
success:
6+
type: integer
7+
example: 0
8+
expired:
9+
type: integer
10+
example: 0
11+
error:
12+
type: string
13+
example: "You have reached the daily limit awarding this behaviour"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type: object
2+
properties:
3+
behaviour_id:
4+
type: integer
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
type: object
2+
properties:
3+
meta:
4+
type: array
5+
items: {}
6+
success:
7+
type: integer
8+
example: 1
9+
data:
10+
type: array
11+
items:
12+
$ref: "./point.yaml"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
type: object
2+
properties:
3+
behaviour_id:
4+
type: integer
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
type: object
2+
properties:
3+
data:
4+
type: array
5+
items:
6+
$ref: "./point.yaml"
7+
meta:
8+
type: array
9+
items: {}
10+
success:
11+
type: integer
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
type: object
2+
properties:
3+
id:
4+
type: integer
5+
example: 436310
6+
name:
7+
type: string
8+
example: "Remarkable Reader"
9+
icon_url:
10+
type: string
11+
example: "https:\/\/www.classcharts.com\/img\/behaveicons\/good\/+reading2.png"
12+
is_daily_limit_reached:
13+
type: boolean
14+
example: false

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
"@pagefind/default-ui": "^1.1.0",
2121
"astro": "^4.8.6",
2222
"sharp": "^0.32.5",
23-
"starlight-openapi": "^0.6.3",
23+
"starlight-openapi": "^0.6.4",
2424
"tailwindcss": "^3.4.3",
2525
"typescript": "^5.4.5"
2626
},

0 commit comments

Comments
 (0)