Skip to content

Commit 1c1c134

Browse files
committed
feat: implement schemes router
1 parent 2ef49bf commit 1c1c134

File tree

4 files changed

+499
-1
lines changed

4 files changed

+499
-1
lines changed

src/main/kotlin/com/ctrlhub/core/governance/schemes/SchemesRouter.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class SchemesRouter(httpClient: HttpClient) : Router(httpClient) {
2828
/**
2929
* Retrieve a list of all schemes
3030
*
31-
* @param organisationId String The organisation ID to retrieve all equipment items for
31+
* @param organisationId String The organisation ID to retrieve all schemes for
3232
* @param requestParameters RequestParameters An instance of SchemeRequestParameters, capturing sorting, filtering and pagination based request params
3333
*
3434
* @return A list of all schemes
Lines changed: 233 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,233 @@
1+
{
2+
"data": [
3+
{
4+
"id": "a4c7c451-bb82-45e2-b1f1-b45a66adf5de",
5+
"type": "schemes",
6+
"attributes": {
7+
"code": "sunflower",
8+
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
9+
"end_date": null,
10+
"labels": [],
11+
"name": "Sunflower",
12+
"start_date": null
13+
},
14+
"relationships": {
15+
"work_orders": {
16+
"data": [
17+
{
18+
"id": "e9b90656-3794-4e52-b04d-bd68b039b918",
19+
"type": "work-orders"
20+
}
21+
]
22+
}
23+
},
24+
"meta": {
25+
"completeness": {
26+
"percentage": {
27+
"completed": 0,
28+
"aborted": 0,
29+
"unknown": 100,
30+
"cancelled": 0
31+
},
32+
"counts": {
33+
"completed": 0,
34+
"aborted": 0,
35+
"unknown": 2,
36+
"cancelled": 0
37+
}
38+
},
39+
"counts": {
40+
"properties": 0,
41+
"streets": 0,
42+
"work_orders": 1,
43+
"operations": 2
44+
},
45+
"created_at": "2025-02-14T18:14:04Z",
46+
"updated_at": "2025-02-16T16:37:46Z",
47+
"modified_at": "2025-03-14T10:04:18Z"
48+
}
49+
},
50+
{
51+
"id": "f21679fc-e6d1-42e2-8ad7-7de8a22d857d",
52+
"type": "schemes",
53+
"attributes": {
54+
"code": "DA-EAGA244123",
55+
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
56+
"end_date": "2024-10-01T00:00:00Z",
57+
"labels": [
58+
{
59+
"key": "Network",
60+
"value": "EEIOM"
61+
},
62+
{
63+
"key": "Sales Order No",
64+
"value": "N/A"
65+
},
66+
{
67+
"key": "CMO",
68+
"value": "West Midlands"
69+
}
70+
],
71+
"name": "EAGA244123",
72+
"start_date": "2024-05-17T00:00:00Z"
73+
},
74+
"relationships": {
75+
"work_orders": {
76+
"data": [
77+
{
78+
"id": "d50852d8-94bb-4772-b1db-b0133cd4f3f1",
79+
"type": "work-orders"
80+
},
81+
{
82+
"id": "6e990285-4c8c-4f70-88ff-71c1ebcd8f0f",
83+
"type": "work-orders"
84+
},
85+
{
86+
"id": "635fa40c-83d0-44e9-b344-111fb60240b0",
87+
"type": "work-orders"
88+
},
89+
{
90+
"id": "dd43652e-65d1-4b07-81f7-ff5fae1ab142",
91+
"type": "work-orders"
92+
}
93+
]
94+
}
95+
},
96+
"meta": {
97+
"completeness": {
98+
"percentage": {
99+
"completed": 50,
100+
"aborted": 13.157894736842104,
101+
"unknown": 36.84210526315789,
102+
"cancelled": 10.526315789473683
103+
},
104+
"counts": {
105+
"completed": 19,
106+
"aborted": 5,
107+
"unknown": 14,
108+
"cancelled": 4
109+
}
110+
},
111+
"counts": {
112+
"properties": 0,
113+
"streets": 0,
114+
"work_orders": 4,
115+
"operations": 42
116+
},
117+
"created_at": "2023-11-15T10:00:00Z",
118+
"updated_at": "2025-02-16T16:38:15Z",
119+
"modified_at": "2025-02-16T16:38:15Z"
120+
}
121+
},
122+
{
123+
"id": "314ca53a-2278-4877-bda7-34e94b60c2f7",
124+
"type": "schemes",
125+
"attributes": {
126+
"code": "DA-EMGA222117",
127+
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
128+
"end_date": "2024-10-01T00:00:00Z",
129+
"labels": [
130+
{
131+
"key": "Network",
132+
"value": "EEIOM"
133+
},
134+
{
135+
"key": "Scheme WBS",
136+
"value": "DPR/F4075"
137+
},
138+
{
139+
"key": "Sales Order No",
140+
"value": "N/A"
141+
}
142+
],
143+
"name": "EMGA222117",
144+
"start_date": "2024-05-17T00:00:00Z"
145+
},
146+
"relationships": {
147+
"work_orders": {
148+
"data": [
149+
{
150+
"id": "db3e9b72-6264-4066-b581-d5f3efb8b4d2",
151+
"type": "work-orders"
152+
},
153+
{
154+
"id": "520adbf4-df4b-4788-9860-71e31bb1157f",
155+
"type": "work-orders"
156+
},
157+
{
158+
"id": "9d07b420-7122-4f47-a4b1-728a3d508220",
159+
"type": "work-orders"
160+
}
161+
]
162+
}
163+
},
164+
"meta": {
165+
"completeness": {
166+
"percentage": {
167+
"completed": 0,
168+
"aborted": 0,
169+
"unknown": 100,
170+
"cancelled": 0
171+
},
172+
"counts": {
173+
"completed": 0,
174+
"aborted": 0,
175+
"unknown": 7,
176+
"cancelled": 0
177+
}
178+
},
179+
"counts": {
180+
"properties": 0,
181+
"streets": 0,
182+
"work_orders": 3,
183+
"operations": 7
184+
},
185+
"created_at": "2023-11-15T10:00:00Z",
186+
"updated_at": "2025-02-16T16:38:19Z",
187+
"modified_at": "2025-02-16T16:38:19Z"
188+
}
189+
}
190+
],
191+
"meta": {
192+
"features": {
193+
"params": {
194+
"include": {
195+
"options": null
196+
},
197+
"sort": {
198+
"default": "name",
199+
"options": [
200+
"name",
201+
"created_at"
202+
]
203+
},
204+
"filter": {
205+
"options": null
206+
}
207+
}
208+
},
209+
"count": 3,
210+
"pagination": {
211+
"current_page": 1,
212+
"counts": {
213+
"resources": 3,
214+
"pages": 1
215+
},
216+
"requested": {
217+
"offset": 0,
218+
"limit": 100
219+
},
220+
"offsets": {
221+
"previous": null,
222+
"next": null
223+
}
224+
}
225+
},
226+
"jsonapi": {
227+
"version": "1.0",
228+
"meta": {}
229+
},
230+
"links": {
231+
"self": "https://api.ctrl-hub.dev/v3/orgs/ef0fcfd6-2a18-4c27-b2c2-b2563859b3b1/governance/schemes?include=work_orders?limit=1"
232+
}
233+
}

0 commit comments

Comments
 (0)