-
Notifications
You must be signed in to change notification settings - Fork 1
Feat/add mentor backend #701
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
base: main
Are you sure you want to change the base?
Conversation
…dge so that it will run on apple silicon macs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Files not reviewed (1)
- backend/Api/appsettings.Local.json.template: Language not supported
sigridge
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ting ser bra ut! Men har noen kommentarer som jeg gjerne vil drøfte 😄
backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs
Outdated
Show resolved
Hide resolved
backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs
Outdated
Show resolved
Hide resolved
56e35b2 to
0c7e340
Compare
0c7e340 to
344860a
Compare
344860a to
64e1244
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements backend functionality for mentor and personnel team features by adding new models, migrations, endpoints, and repository methods.
- Adds mentor capability by introducing a MentorId field on Consultant and creating a new Mentors table
- Introduces personnel team management with endpoints and associated repository methods, models, and migrations
- Updates test container initialization and docker-compose configuration for consistency
Reviewed Changes
Copilot reviewed 18 out of 20 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| docker-compose.yml | Updates port syntax to a consistent style |
| TestContainersFactory.cs | Refactors container setup using a generic container builder |
| ConsultantDbRepository.cs | Adds personnel team related repository methods |
| Migrations/* | Creates migrations for PersonnelTeams and Mentors tables |
| ApplicationContext.cs | Registers new DbSets for PersonnelTeam and PersonnelTeamByConsultant |
| PersonnelTeamController.cs | Adds endpoints managing personnel teams and their members |
| ConsultantController.cs | Adds endpoint to update personnel team association for a consultant |
| PersonnelTeamReadModel.cs | Introduces a read model for personnel team data |
Files not reviewed (2)
- backend/Api/appsettings.Local.json.template: Language not supported
- backend/Infrastructure/Infrastructure.csproj: Language not supported
Comments suppressed due to low confidence (1)
backend/Api/Consultants/PersonnelTeamController.cs:91
- The DeletePersonnelTeam endpoint returns a Task<Task> which causes unnecessary double-awaiting. It is recommended to update the method signature to return Task directly.
public async Task<Task<IResult>> DeletePersonnelTeam([FromRoute(Name = "personnelTeamId")] int personnelTeamId, CancellationToken cancellationToken)
backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs
Outdated
Show resolved
Hide resolved
astride
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Noe pirk, noen forslag, noen undringer 😊
backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs
Outdated
Show resolved
Hide resolved
backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs
Show resolved
Hide resolved
backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs
Outdated
Show resolved
Hide resolved
c1e7c63 to
0b03ddc
Compare
|
nå er de pushet! :D
On 30/04/2025 13:34:29, Astrid Eldhuset ***@***.***> wrote:
@astride commented on this pull request.
In backend/Infrastructure/Repositories/Consultants/ConsultantDbRepository.cs [#701 (comment)]:
+ }; + + var savedPersonnelTeam = await context.PersonnelTeams.AddAsync(personnelTeam, cancellationToken); + + await context.SaveChangesAsync(cancellationToken); + return savedPersonnelTeam.Entity.Id; + } + + public async Task<IResult> UpdatePersonnelTeamByConsultantId(int consultantId, int? personnelTeamId, CancellationToken cancellationToken) + { + var affectedRows = await context.PersonnelTeamByConsultants + .Where(c => c.ConsultantId == consultantId) + .ExecuteDeleteAsync(cancellationToken); + if (affectedRows == 0) + { + return Results.NotFound($"Could not find consultant with id {consultantId}");
Hmm, har du pushet oppdateringene? 👀
—
Reply to this email directly, view it on GitHub [#701 (comment)], or unsubscribe [https://github.com/notifications/unsubscribe-auth/AQQM3BQXUQGDK6SMF5MR45L24CYMJAVCNFSM6AAAAAB3IDPZEWVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDQMBWG42TGMBSGE].
You are receiving this because you were assigned.Message ID: ***@***.***>
[bf4364ea-108d-4c30-ac1d-debf7611a411]
|
Added model, migration and endpoints for mentor feature (personalleder).
I'm probably forgetting some endpoint that'll be needed, and would also like to add some tests to this.
Comments are very welcome as I'm pretty new to the .NET world of things! 😆