Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added annotations and missing fields to UserAdditionalInfo #199

Merged
merged 5 commits into from
Mar 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions client/src/models/__generated__/schema.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

58 changes: 55 additions & 3 deletions server/src/data-layer/models/firebase.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,74 @@
import { Timestamp } from "firebase-admin/firestore"

export interface UserAdditionalInfo {
date_of_birth: Timestamp // Assuming this is a timestamp
/**
* @isDateTime Please Enter in the form dd/mm/yyyy
*/
date_of_birth: Timestamp
/**
* @isbool Please enter true or false
*/
does_freestyle: boolean
/**
* @isbool Please enter true or false
*/
does_racing: boolean
/**
* @isbool Please enter true or false
*/
does_ski: boolean
/**
* @isString Please enter your pronouns
*/
gender: string
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since you added a new field here, you will need to update the user mock (User.mock.ts) so the tests will pass

/**
* @isString Please enter a name
*/
emergency_name: string
/**
* @isString Please type in your Phone Number
*/
emergency_phone: string
/**
* @isString Please enter a name
*/
emergency_relation: string
/**
* @isString Please enter your First Name
*/
first_name: string
/**
* @isString Please enter your Second Name
*/
last_name: string
/**
* @isString Please enter either Admin or Member
*/
membership: "admin" | "member"
dietary_requirements: string | undefined
/**
* @isString Please write your dietary requirements
*/
dietary_requirements: string
/**
* @isString Please enter your faculty
*/
faculty: string | undefined
/**
* @isString Please enter your university
*/
university: string | undefined
/**
*@isString Please enter your student ID
*/
student_id: string | undefined
/**
* @isbool Please enter true or false
*/
returning: boolean
university_year: string | undefined
/**
* @isString Please enter your year of study
*/
university_year: string
}

export interface BookingSlot {
Expand Down
25 changes: 13 additions & 12 deletions server/src/middleware/__generated__/routes.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 7 additions & 1 deletion server/src/middleware/__generated__/swagger.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions server/src/test-config/mocks/User.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ export const additionalInfoMock: UserAdditionalInfo = {
does_freestyle: true,
does_racing: true,
does_ski: false,
gender: "non-binary",
emergency_name: "emergency",
emergency_phone: "111",
emergency_relation: "relation",
Expand Down
Loading