Skip to content

Commit 7fb4c5c

Browse files
committed
feat: add main table
1 parent 8100931 commit 7fb4c5c

File tree

12 files changed

+6346
-457
lines changed

12 files changed

+6346
-457
lines changed

.editorconfig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root = true
2+
3+
[*]
4+
indent_style = space
5+
indent_size = 2

web/api/gql/generated.ts

Lines changed: 365 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,365 @@
1+
import type { UseQueryOptions } from '@tanstack/react-query'
2+
import { useQuery } from '@tanstack/react-query'
3+
import { fetcher } from './fetcher'
4+
export type Maybe<T> = T | null;
5+
export type InputMaybe<T> = Maybe<T>;
6+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
7+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
8+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
9+
export type MakeEmpty<T extends { [key: string]: unknown }, K extends keyof T> = { [_ in K]?: never };
10+
export type Incremental<T> = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never };
11+
/** All built-in and custom scalars, mapped to their actual values */
12+
export type Scalars = {
13+
ID: { input: string, output: string },
14+
String: { input: string, output: string },
15+
Boolean: { input: boolean, output: boolean },
16+
Int: { input: number, output: number },
17+
Float: { input: number, output: number },
18+
Date: { input: any, output: any },
19+
DateTime: { input: any, output: any },
20+
};
21+
22+
export type CreateLocationNodeInput = {
23+
kind: LocationType,
24+
parentId?: InputMaybe<Scalars['ID']['input']>,
25+
title: Scalars['String']['input'],
26+
};
27+
28+
export type CreatePatientInput = {
29+
assignedLocationId?: InputMaybe<Scalars['ID']['input']>,
30+
birthdate: Scalars['Date']['input'],
31+
firstname: Scalars['String']['input'],
32+
gender: Gender,
33+
lastname: Scalars['String']['input'],
34+
properties?: InputMaybe<Array<PropertyValueInput>>,
35+
};
36+
37+
export type CreatePropertyDefinitionInput = {
38+
allowedEntities: Array<PropertyEntity>,
39+
description?: InputMaybe<Scalars['String']['input']>,
40+
fieldType: FieldType,
41+
isActive?: Scalars['Boolean']['input'],
42+
name: Scalars['String']['input'],
43+
options?: InputMaybe<Array<Scalars['String']['input']>>,
44+
};
45+
46+
export type CreateTaskInput = {
47+
assigneeId?: InputMaybe<Scalars['ID']['input']>,
48+
description?: InputMaybe<Scalars['String']['input']>,
49+
patientId: Scalars['ID']['input'],
50+
previousTaskIds?: InputMaybe<Array<Scalars['ID']['input']>>,
51+
properties?: InputMaybe<Array<PropertyValueInput>>,
52+
title: Scalars['String']['input'],
53+
};
54+
55+
export enum FieldType {
56+
FieldTypeCheckbox = 'FIELD_TYPE_CHECKBOX',
57+
FieldTypeDate = 'FIELD_TYPE_DATE',
58+
FieldTypeDateTime = 'FIELD_TYPE_DATE_TIME',
59+
FieldTypeMultiSelect = 'FIELD_TYPE_MULTI_SELECT',
60+
FieldTypeNumber = 'FIELD_TYPE_NUMBER',
61+
FieldTypeSelect = 'FIELD_TYPE_SELECT',
62+
FieldTypeText = 'FIELD_TYPE_TEXT',
63+
FieldTypeUnspecified = 'FIELD_TYPE_UNSPECIFIED'
64+
}
65+
66+
export enum Gender {
67+
Female = 'FEMALE',
68+
Male = 'MALE',
69+
Unknown = 'UNKNOWN'
70+
}
71+
72+
export type LocationNodeType = {
73+
__typename?: 'LocationNodeType',
74+
children: Array<LocationNodeType>,
75+
id: Scalars['ID']['output'],
76+
kind: LocationType,
77+
parent?: Maybe<LocationNodeType>,
78+
parentId?: Maybe<Scalars['ID']['output']>,
79+
title: Scalars['String']['output'],
80+
};
81+
82+
export enum LocationType {
83+
Bed = 'BED',
84+
Clinic = 'CLINIC',
85+
Other = 'OTHER',
86+
Room = 'ROOM',
87+
Team = 'TEAM',
88+
Ward = 'WARD'
89+
}
90+
91+
export type Mutation = {
92+
__typename?: 'Mutation',
93+
createLocationNode: LocationNodeType,
94+
createPatient: PatientType,
95+
createPropertyDefinition: PropertyDefinitionType,
96+
createTask: TaskType,
97+
deleteLocationNode: Scalars['Boolean']['output'],
98+
deletePatient: Scalars['Boolean']['output'],
99+
deletePropertyDefinition: Scalars['Boolean']['output'],
100+
deleteTask: Scalars['Boolean']['output'],
101+
updateLocationNode: LocationNodeType,
102+
updatePatient: PatientType,
103+
updatePropertyDefinition: PropertyDefinitionType,
104+
updateTask: TaskType,
105+
};
106+
107+
108+
export type MutationCreateLocationNodeArgs = {
109+
data: CreateLocationNodeInput,
110+
};
111+
112+
113+
export type MutationCreatePatientArgs = {
114+
data: CreatePatientInput,
115+
};
116+
117+
118+
export type MutationCreatePropertyDefinitionArgs = {
119+
data: CreatePropertyDefinitionInput,
120+
};
121+
122+
123+
export type MutationCreateTaskArgs = {
124+
data: CreateTaskInput,
125+
};
126+
127+
128+
export type MutationDeleteLocationNodeArgs = {
129+
id: Scalars['ID']['input'],
130+
};
131+
132+
133+
export type MutationDeletePatientArgs = {
134+
id: Scalars['ID']['input'],
135+
};
136+
137+
138+
export type MutationDeletePropertyDefinitionArgs = {
139+
id: Scalars['ID']['input'],
140+
};
141+
142+
143+
export type MutationDeleteTaskArgs = {
144+
id: Scalars['ID']['input'],
145+
};
146+
147+
148+
export type MutationUpdateLocationNodeArgs = {
149+
data: UpdateLocationNodeInput,
150+
id: Scalars['ID']['input'],
151+
};
152+
153+
154+
export type MutationUpdatePatientArgs = {
155+
data: UpdatePatientInput,
156+
id: Scalars['ID']['input'],
157+
};
158+
159+
160+
export type MutationUpdatePropertyDefinitionArgs = {
161+
data: UpdatePropertyDefinitionInput,
162+
id: Scalars['ID']['input'],
163+
};
164+
165+
166+
export type MutationUpdateTaskArgs = {
167+
data: UpdateTaskInput,
168+
id: Scalars['ID']['input'],
169+
};
170+
171+
export type PatientType = {
172+
__typename?: 'PatientType',
173+
age: Scalars['Int']['output'],
174+
assignedLocation?: Maybe<LocationNodeType>,
175+
assignedLocationId?: Maybe<Scalars['ID']['output']>,
176+
birthdate: Scalars['Date']['output'],
177+
firstname: Scalars['String']['output'],
178+
gender: Gender,
179+
id: Scalars['ID']['output'],
180+
lastname: Scalars['String']['output'],
181+
name: Scalars['String']['output'],
182+
properties: Array<PropertyValueType>,
183+
tasks: Array<TaskType>,
184+
};
185+
186+
187+
export type PatientTypeTasksArgs = {
188+
done?: InputMaybe<Scalars['Boolean']['input']>,
189+
};
190+
191+
export type PropertyDefinitionType = {
192+
__typename?: 'PropertyDefinitionType',
193+
allowedEntities: Array<PropertyEntity>,
194+
description?: Maybe<Scalars['String']['output']>,
195+
fieldType: FieldType,
196+
id: Scalars['ID']['output'],
197+
isActive: Scalars['Boolean']['output'],
198+
name: Scalars['String']['output'],
199+
options: Array<Scalars['String']['output']>,
200+
};
201+
202+
export enum PropertyEntity {
203+
Patient = 'PATIENT',
204+
Task = 'TASK'
205+
}
206+
207+
export type PropertyValueInput = {
208+
booleanValue?: InputMaybe<Scalars['Boolean']['input']>,
209+
dateTimeValue?: InputMaybe<Scalars['DateTime']['input']>,
210+
dateValue?: InputMaybe<Scalars['Date']['input']>,
211+
definitionId: Scalars['ID']['input'],
212+
multiSelectValues?: InputMaybe<Array<Scalars['String']['input']>>,
213+
numberValue?: InputMaybe<Scalars['Float']['input']>,
214+
selectValue?: InputMaybe<Scalars['String']['input']>,
215+
textValue?: InputMaybe<Scalars['String']['input']>,
216+
};
217+
218+
export type PropertyValueType = {
219+
__typename?: 'PropertyValueType',
220+
booleanValue?: Maybe<Scalars['Boolean']['output']>,
221+
dateTimeValue?: Maybe<Scalars['DateTime']['output']>,
222+
dateValue?: Maybe<Scalars['Date']['output']>,
223+
definition: PropertyDefinitionType,
224+
multiSelectValues?: Maybe<Array<Scalars['String']['output']>>,
225+
numberValue?: Maybe<Scalars['Float']['output']>,
226+
selectValue?: Maybe<Scalars['String']['output']>,
227+
textValue?: Maybe<Scalars['String']['output']>,
228+
};
229+
230+
export type Query = {
231+
__typename?: 'Query',
232+
locationNode?: Maybe<LocationNodeType>,
233+
locationRoots: Array<LocationNodeType>,
234+
patient?: Maybe<PatientType>,
235+
patients: Array<PatientType>,
236+
propertyDefinitions: Array<PropertyDefinitionType>,
237+
task?: Maybe<TaskType>,
238+
tasks: Array<TaskType>,
239+
};
240+
241+
242+
export type QueryLocationNodeArgs = {
243+
id: Scalars['ID']['input'],
244+
};
245+
246+
247+
export type QueryPatientArgs = {
248+
id: Scalars['ID']['input'],
249+
};
250+
251+
252+
export type QueryPatientsArgs = {
253+
locationNodeId?: InputMaybe<Scalars['ID']['input']>,
254+
};
255+
256+
257+
export type QueryTaskArgs = {
258+
id: Scalars['ID']['input'],
259+
};
260+
261+
262+
export type QueryTasksArgs = {
263+
patientId?: InputMaybe<Scalars['ID']['input']>,
264+
};
265+
266+
export type Subscription = {
267+
__typename?: 'Subscription',
268+
patientCreated: Scalars['ID']['output'],
269+
};
270+
271+
export type TaskType = {
272+
__typename?: 'TaskType',
273+
assignee?: Maybe<UserType>,
274+
assigneeId?: Maybe<Scalars['ID']['output']>,
275+
creationDate: Scalars['DateTime']['output'],
276+
description?: Maybe<Scalars['String']['output']>,
277+
done: Scalars['Boolean']['output'],
278+
id: Scalars['ID']['output'],
279+
properties: Array<PropertyValueType>,
280+
title: Scalars['String']['output'],
281+
updateDate?: Maybe<Scalars['DateTime']['output']>,
282+
};
283+
284+
export type UpdateLocationNodeInput = {
285+
kind?: InputMaybe<LocationType>,
286+
parentId?: InputMaybe<Scalars['ID']['input']>,
287+
title?: InputMaybe<Scalars['String']['input']>,
288+
};
289+
290+
export type UpdatePatientInput = {
291+
assignedLocationId?: InputMaybe<Scalars['ID']['input']>,
292+
birthdate?: InputMaybe<Scalars['Date']['input']>,
293+
firstname?: InputMaybe<Scalars['String']['input']>,
294+
gender?: InputMaybe<Gender>,
295+
lastname?: InputMaybe<Scalars['String']['input']>,
296+
properties?: InputMaybe<Array<PropertyValueInput>>,
297+
};
298+
299+
export type UpdatePropertyDefinitionInput = {
300+
allowedEntities?: InputMaybe<Array<PropertyEntity>>,
301+
description?: InputMaybe<Scalars['String']['input']>,
302+
isActive?: InputMaybe<Scalars['Boolean']['input']>,
303+
name?: InputMaybe<Scalars['String']['input']>,
304+
options?: InputMaybe<Array<Scalars['String']['input']>>,
305+
};
306+
307+
export type UpdateTaskInput = {
308+
assigneeId?: InputMaybe<Scalars['ID']['input']>,
309+
description?: InputMaybe<Scalars['String']['input']>,
310+
done?: InputMaybe<Scalars['Boolean']['input']>,
311+
previousTaskIds?: InputMaybe<Array<Scalars['ID']['input']>>,
312+
properties?: InputMaybe<Array<PropertyValueInput>>,
313+
title?: InputMaybe<Scalars['String']['input']>,
314+
};
315+
316+
export type UserType = {
317+
__typename?: 'UserType',
318+
avatarUrl?: Maybe<Scalars['String']['output']>,
319+
firstname?: Maybe<Scalars['String']['output']>,
320+
id: Scalars['ID']['output'],
321+
lastname?: Maybe<Scalars['String']['output']>,
322+
name: Scalars['String']['output'],
323+
title?: Maybe<Scalars['String']['output']>,
324+
};
325+
326+
export type MyQueryQueryVariables = Exact<{ [key: string]: never }>;
327+
328+
329+
export type MyQueryQuery = { __typename?: 'Query', tasks: Array<{ __typename?: 'TaskType', creationDate: any, description?: string | null, done: boolean, id: string, title: string, updateDate?: any | null, assignee?: { __typename?: 'UserType', avatarUrl?: string | null, id: string, name: string } | null }> };
330+
331+
332+
333+
export const MyQueryDocument = `
334+
query MyQuery {
335+
tasks(patientId: "") {
336+
assignee {
337+
avatarUrl
338+
id
339+
name
340+
}
341+
creationDate
342+
description
343+
done
344+
id
345+
title
346+
updateDate
347+
}
348+
}
349+
`
350+
351+
export const useMyQueryQuery = <
352+
TData = MyQueryQuery,
353+
TError = unknown
354+
>(
355+
variables?: MyQueryQueryVariables,
356+
options?: Omit<UseQueryOptions<MyQueryQuery, TError, TData>, 'queryKey'> & { queryKey?: UseQueryOptions<MyQueryQuery, TError, TData>['queryKey'] }
357+
) => {
358+
359+
return useQuery<MyQueryQuery, TError, TData>(
360+
{
361+
queryKey: variables === undefined ? ['MyQuery'] : ['MyQuery', variables],
362+
queryFn: fetcher<MyQueryQuery, MyQueryQueryVariables>(MyQueryDocument, variables),
363+
...options
364+
}
365+
)}

web/api/graphql/test.graphql

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
query MyQuery {
2+
tasks(patientId: "") {
3+
assignee {
4+
avatarUrl
5+
id
6+
name
7+
}
8+
creationDate
9+
description
10+
done
11+
id
12+
title
13+
updateDate
14+
}
15+
}

0 commit comments

Comments
 (0)