-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
50 additions
and
11 deletions.
There are no files selected for viewing
10 changes: 10 additions & 0 deletions
10
apps/server/src/modules/school/controller/dto/school-query.params.ts
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { ApiPropertyOptional } from '@nestjs/swagger'; | ||
import { EntityId } from '@shared/domain'; | ||
import { IsMongoId, IsOptional } from 'class-validator'; | ||
|
||
export class SchoolQueryParams { | ||
@IsMongoId() | ||
@IsOptional() | ||
@ApiPropertyOptional() | ||
federalStateId?: EntityId; | ||
} |
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
3 changes: 2 additions & 1 deletion
3
apps/server/src/modules/school/domain/interface/school-repo.interface.ts
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
7 changes: 4 additions & 3 deletions
7
apps/server/src/modules/school/domain/service/school.service.ts
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { EntityId } from '@shared/domain'; | ||
|
||
export interface SchoolQuery { | ||
federalStateId?: EntityId; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { EntityId, SchoolEntity } from '@shared/domain'; | ||
import { Scope } from '@shared/repo'; | ||
|
||
export class SchoolScope extends Scope<SchoolEntity> { | ||
byFederalState(federalStateId?: EntityId) { | ||
if (federalStateId) { | ||
this.addQuery({ federalState: federalStateId }); | ||
} | ||
} | ||
} |