-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementing search for different entities (#31)
* Implementing search at `GET /<entitiy>` with query parameters * No written tests, just manual ones.
- Loading branch information
Showing
19 changed files
with
147 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import { z } from 'zod'; | ||
import { ZEducationType, ZStudyYear } from './general.validator'; | ||
import { ToLikeQuery, ZEducationType, ZStudyYear } from './general.validator'; | ||
|
||
export const ZStudyClass = z.object({ | ||
classId: z.string().max(6), | ||
studyYear: ZStudyYear.optional(), | ||
educationType: ZEducationType.optional(), | ||
}); | ||
|
||
export const ZStudyClassQuery = ZStudyClass.extend({ | ||
classId: ZStudyClass.shape.classId.transform((attrbiute) => | ||
ToLikeQuery(attrbiute) | ||
), | ||
}).partial(); | ||
|
||
export type ZStudyClassQuery = z.infer<typeof ZStudyClassQuery>; | ||
export type ZStudyClass = z.infer<typeof ZStudyClass>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,18 @@ | ||
import { z } from 'zod'; | ||
import { ZEducationType, ZStudyYear } from './general.validator'; | ||
import { ToLikeQuery, ZEducationType, ZStudyYear } from './general.validator'; | ||
|
||
export const ZSubject = z.object({ | ||
subjectId: z.string().max(6), | ||
name: z.string().max(64).optional(), | ||
studyYear: ZStudyYear, | ||
educationType: ZEducationType, | ||
}); | ||
|
||
export const ZSubjectQuery = ZSubject.extend({ | ||
subjectId: ZSubject.shape.studyYear.transform((attribute) => | ||
ToLikeQuery(attribute) | ||
), | ||
name: ZSubject.shape.name.transform((attribute) => ToLikeQuery(attribute)), | ||
}).partial(); | ||
export type ZSubject = z.infer<typeof ZSubject>; | ||
export type ZSubjectQuery = z.infer<typeof ZSubjectQuery>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.