Skip to content

Commit

Permalink
Merge branch 'add-userdata-backend-functionality' of github.com:ssciw…
Browse files Browse the repository at this point in the history
…r/mondey-frontend-prototype into add-userdata-backend-functionality
  • Loading branch information
MaHaWo committed Oct 21, 2024
2 parents 298528e + bd84321 commit fa7f35e
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 1 deletion.
49 changes: 49 additions & 0 deletions frontend/src/lib/client/schemas.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,55 @@ export const MilestoneTextPublicSchema = {
title: 'MilestoneTextPublic'
} as const;

export const ObserverSchema = {
properties: {
user_id: {
type: 'integer',
title: 'User Id'
},
year_of_birth: {
type: 'string',
maxLength: 255,
title: 'Year Of Birth'
},
gender: {
type: 'string',
maxLength: 255,
title: 'Gender'
},
education: {
type: 'string',
maxLength: 255,
title: 'Education'
},
working_hours: {
type: 'string',
maxLength: 255,
title: 'Working Hours'
},
income_per_year: {
type: 'string',
maxLength: 255,
title: 'Income Per Year'
},
profession: {
type: 'string',
maxLength: 255,
title: 'Profession'
}
},
type: 'object',
required: [
'year_of_birth',
'gender',
'education',
'working_hours',
'income_per_year',
'profession'
],
title: 'Observer'
} as const;

export const UserCreateSchema = {
properties: {
email: {
Expand Down
44 changes: 44 additions & 0 deletions frontend/src/lib/client/services.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ import type {
UsersDeleteUserData,
UsersDeleteUserError,
UsersDeleteUserResponse,
GetObserverError,
GetObserverResponse,
CreateObserverError,
CreateObserverResponse,
GetChildrenError,
GetChildrenResponse,
UpdateChildData,
UpdateChildError,
UpdateChildResponse,
Expand Down Expand Up @@ -549,6 +555,44 @@ export const usersDeleteUser = <ThrowOnError extends boolean = false>(
});
};

/**
* Get Observer
*/
export const getObserver = <ThrowOnError extends boolean = false>(
options?: Options<unknown, ThrowOnError>
) => {
return (options?.client ?? client).get<GetObserverResponse, GetObserverError, ThrowOnError>({
...options,
url: '/users/data/'
});
};

/**
* Create Observer
*/
export const createObserver = <ThrowOnError extends boolean = false>(
options?: Options<unknown, ThrowOnError>
) => {
return (options?.client ?? client).put<CreateObserverResponse, CreateObserverError, ThrowOnError>(
{
...options,
url: '/users/data/'
}
);
};

/**
* Get Children
*/
export const getChildren = <ThrowOnError extends boolean = false>(
options?: Options<unknown, ThrowOnError>
) => {
return (options?.client ?? client).get<GetChildrenResponse, GetChildrenError, ThrowOnError>({
...options,
url: '/users/children/'
});
};

/**
* Update Child
*/
Expand Down
22 changes: 22 additions & 0 deletions frontend/src/lib/client/types.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,16 @@ export type MilestoneTextPublic = {
help?: string;
};

export type Observer = {
user_id?: number;
year_of_birth: string;
gender: string;
education: string;
working_hours: string;
income_per_year: string;
profession: string;
};

export type UserCreate = {
email: string;
password: string;
Expand Down Expand Up @@ -442,6 +452,18 @@ export type UsersDeleteUserResponse = void;

export type UsersDeleteUserError = unknown | HTTPValidationError;

export type GetObserverResponse = Observer;

export type GetObserverError = unknown;

export type CreateObserverResponse = Observer;

export type CreateObserverError = unknown;

export type GetChildrenResponse = Array<ChildPublic>;

export type GetChildrenError = unknown;

export type UpdateChildData = {
body: ChildPublic;
};
Expand Down
2 changes: 1 addition & 1 deletion mondey_backend/openapi.json

Large diffs are not rendered by default.

0 comments on commit fa7f35e

Please sign in to comment.