Compare commits
No commits in common. "master" and "coursesManagement" have entirely different histories.
master
...
coursesMan
@ -25,193 +25,6 @@
|
|||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"name": "GetInternshipManagementList",
|
|
||||||
"request": {
|
|
||||||
"auth": {
|
|
||||||
"type": "bearer",
|
|
||||||
"bearer": [
|
|
||||||
{
|
|
||||||
"key": "token",
|
|
||||||
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjY2MzcxLCJleHAiOjE2MTAzNTI3NzEsImlhdCI6MTYxMDI2NjM3MX0.PDrMjCHJlpN2FApL6rC-UAoH1ZWAnUImwWfTDhvB5wI",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"method": "GET",
|
|
||||||
"header": [
|
|
||||||
{
|
|
||||||
"key": "Authorization",
|
|
||||||
"type": "text",
|
|
||||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "Content-Type",
|
|
||||||
"type": "text",
|
|
||||||
"value": "application/json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"url": {
|
|
||||||
"raw": "http://localhost:8080/management/internship?OrderByField=InternshipState&SortOrder=Asc",
|
|
||||||
"protocol": "http",
|
|
||||||
"host": [
|
|
||||||
"localhost"
|
|
||||||
],
|
|
||||||
"port": "8080",
|
|
||||||
"path": [
|
|
||||||
"management",
|
|
||||||
"internship"
|
|
||||||
],
|
|
||||||
"query": [
|
|
||||||
{
|
|
||||||
"key": "OrderByField",
|
|
||||||
"value": "InternshipState"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "SortOrder",
|
|
||||||
"value": "Asc"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "GetInternshipManagement",
|
|
||||||
"request": {
|
|
||||||
"auth": {
|
|
||||||
"type": "bearer",
|
|
||||||
"bearer": [
|
|
||||||
{
|
|
||||||
"key": "token",
|
|
||||||
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjY2MzcxLCJleHAiOjE2MTAzNTI3NzEsImlhdCI6MTYxMDI2NjM3MX0.PDrMjCHJlpN2FApL6rC-UAoH1ZWAnUImwWfTDhvB5wI",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"method": "GET",
|
|
||||||
"header": [
|
|
||||||
{
|
|
||||||
"key": "Authorization",
|
|
||||||
"type": "text",
|
|
||||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "Content-Type",
|
|
||||||
"type": "text",
|
|
||||||
"value": "application/json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"url": {
|
|
||||||
"raw": "http://localhost:8080/management/internship/1",
|
|
||||||
"protocol": "http",
|
|
||||||
"host": [
|
|
||||||
"localhost"
|
|
||||||
],
|
|
||||||
"port": "8080",
|
|
||||||
"path": [
|
|
||||||
"management",
|
|
||||||
"internship",
|
|
||||||
"1"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "GetInternshipManagementAccept",
|
|
||||||
"request": {
|
|
||||||
"auth": {
|
|
||||||
"type": "bearer",
|
|
||||||
"bearer": [
|
|
||||||
{
|
|
||||||
"key": "token",
|
|
||||||
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjY2MzcxLCJleHAiOjE2MTAzNTI3NzEsImlhdCI6MTYxMDI2NjM3MX0.PDrMjCHJlpN2FApL6rC-UAoH1ZWAnUImwWfTDhvB5wI",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"method": "PUT",
|
|
||||||
"header": [
|
|
||||||
{
|
|
||||||
"key": "Authorization",
|
|
||||||
"type": "text",
|
|
||||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "Content-Type",
|
|
||||||
"type": "text",
|
|
||||||
"value": "application/json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"body": {
|
|
||||||
"mode": "raw",
|
|
||||||
"raw": "\"\""
|
|
||||||
},
|
|
||||||
"url": {
|
|
||||||
"raw": "http://localhost:8080/management/internship/accept/1",
|
|
||||||
"protocol": "http",
|
|
||||||
"host": [
|
|
||||||
"localhost"
|
|
||||||
],
|
|
||||||
"port": "8080",
|
|
||||||
"path": [
|
|
||||||
"management",
|
|
||||||
"internship",
|
|
||||||
"accept",
|
|
||||||
"1"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": []
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"name": "GetInternshipManagementReject",
|
|
||||||
"request": {
|
|
||||||
"auth": {
|
|
||||||
"type": "bearer",
|
|
||||||
"bearer": [
|
|
||||||
{
|
|
||||||
"key": "token",
|
|
||||||
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjY2MzcxLCJleHAiOjE2MTAzNTI3NzEsImlhdCI6MTYxMDI2NjM3MX0.PDrMjCHJlpN2FApL6rC-UAoH1ZWAnUImwWfTDhvB5wI",
|
|
||||||
"type": "string"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"method": "PUT",
|
|
||||||
"header": [
|
|
||||||
{
|
|
||||||
"key": "Authorization",
|
|
||||||
"type": "text",
|
|
||||||
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key": "Content-Type",
|
|
||||||
"type": "text",
|
|
||||||
"value": "application/json"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"body": {
|
|
||||||
"mode": "raw",
|
|
||||||
"raw": "\"Co żeś odrąbał andzeju\""
|
|
||||||
},
|
|
||||||
"url": {
|
|
||||||
"raw": "http://localhost:8080/management/internship/reject/1",
|
|
||||||
"protocol": "http",
|
|
||||||
"host": [
|
|
||||||
"localhost"
|
|
||||||
],
|
|
||||||
"port": "8080",
|
|
||||||
"path": [
|
|
||||||
"management",
|
|
||||||
"internship",
|
|
||||||
"reject",
|
|
||||||
"1"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"response": []
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"name": "loginEdition",
|
"name": "loginEdition",
|
||||||
"request": {
|
"request": {
|
||||||
@ -863,5 +676,6 @@
|
|||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
}
|
}
|
||||||
]
|
],
|
||||||
|
"protocolProfileBehavior": {}
|
||||||
}
|
}
|
49
README.MD
49
README.MD
@ -1,49 +0,0 @@
|
|||||||
# Uruchomienie
|
|
||||||
|
|
||||||
Aby uruchomić środowisko deweloperskie wystarczy
|
|
||||||
|
|
||||||
```bash
|
|
||||||
docker build -f ./InternshipSystem.Api/Dockerfile -t internship.api .
|
|
||||||
docker-compose -f ./.docker/docker-compose.yaml --build --volumes
|
|
||||||
```
|
|
||||||
|
|
||||||
# Opis struktury
|
|
||||||
|
|
||||||
Opis struktury projektu
|
|
||||||
|
|
||||||
## src/
|
|
||||||
|
|
||||||
zawiera kod podzielony na 3 projekty
|
|
||||||
|
|
||||||
- Api - Definicja interfejsu wystawianego dla częsci frontendowej
|
|
||||||
- Core - Logika biznesowa aplikacji, definicja domeny.
|
|
||||||
- Repository - Definicja repozytorium EFCore
|
|
||||||
|
|
||||||
## test/
|
|
||||||
|
|
||||||
Zawiera testy jednostkowe projektu. Przy pisaniu wykorzystano Machine-Specification
|
|
||||||
|
|
||||||
## .build/
|
|
||||||
|
|
||||||
Folder zawierający pliki definiujące CI/CD projektu
|
|
||||||
|
|
||||||
## .docker/
|
|
||||||
|
|
||||||
Folder zawiera pliki docker-compose przeznaczone do uruchamiania środowiska deweloperskiego, stanowiące również dokumentacje zmiennych środowiskowych konfigurujących projekt
|
|
||||||
|
|
||||||
```yaml
|
|
||||||
CONNECTIONSTRINGS__INTERNSHIPDATABASE: "Host=db.postgres;Port=5432;Database=postgres;Username=postgres;Password=password"
|
|
||||||
ASPNETCORE_ENVIRONMENT: Development
|
|
||||||
ASPNETCORE_URLS: http://+:80
|
|
||||||
SECURITYOPTIONS__SECRET: secret
|
|
||||||
SECURITYOPTIONS__EXPIRATION: 1440 # 24h in minutes
|
|
||||||
SECURITYOPTIONS__BASEURL: https://logowanie.pg.edu.pl
|
|
||||||
SECURITYOPTIONS__TOKENPATH: /oauth2.0/accessToken
|
|
||||||
SECURITYOPTIONS__PROFILEPATH: /oauth2.0/profile
|
|
||||||
SECURITYOPTIONS__CLIENTID: PraktykiClientId
|
|
||||||
SECURITYOPTIONS__REDIRECTURL: https://system-praktyk.net/user/login/check/pg
|
|
||||||
```
|
|
||||||
|
|
||||||
## props/
|
|
||||||
|
|
||||||
Folder ze współdzieloną konfiguracją dla grup projektów, np. wersji bibliotek używanych przy pisaniu testów.
|
|
5
global.json
Normal file
5
global.json
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"sdk": {
|
||||||
|
"version": "3.1.301"
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,6 @@ using AutoMapper;
|
|||||||
using InternshipSystem.Api.Queries;
|
using InternshipSystem.Api.Queries;
|
||||||
using InternshipSystem.Api.Result;
|
using InternshipSystem.Api.Result;
|
||||||
using InternshipSystem.Core;
|
using InternshipSystem.Core;
|
||||||
using InternshipSystem.Core.Entity;
|
|
||||||
using InternshipSystem.Core.Entity.Internship;
|
using InternshipSystem.Core.Entity.Internship;
|
||||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||||
|
|
||||||
@ -21,7 +20,7 @@ namespace InternshipSystem.Api
|
|||||||
opt => opt.MapFrom(edition => edition.IsOpen ? "Open" : "Archival"));
|
opt => opt.MapFrom(edition => edition.IsOpen ? "Open" : "Archival"));
|
||||||
|
|
||||||
CreateMap<Edition, EditionManagementResult>();
|
CreateMap<Edition, EditionManagementResult>();
|
||||||
|
|
||||||
CreateMap<Edition, EditionDetailsResult>();
|
CreateMap<Edition, EditionDetailsResult>();
|
||||||
|
|
||||||
CreateMap<Edition, EditionConfigurationResult>();
|
CreateMap<Edition, EditionConfigurationResult>();
|
||||||
@ -34,11 +33,6 @@ namespace InternshipSystem.Api
|
|||||||
CreateMap<EditionInternshipType, InternshipType>()
|
CreateMap<EditionInternshipType, InternshipType>()
|
||||||
.IncludeMembers(eit => eit.InternshipType);
|
.IncludeMembers(eit => eit.InternshipType);
|
||||||
|
|
||||||
CreateMap<ReportFieldEdition, ReportField>()
|
|
||||||
.IncludeMembers(e => e.Field);
|
|
||||||
|
|
||||||
CreateMap<ReportField, ReportField>();
|
|
||||||
|
|
||||||
CreateMap<InternshipType, InternshipType>();
|
CreateMap<InternshipType, InternshipType>();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,110 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using InternshipSystem.Api.Security;
|
|
||||||
using InternshipSystem.Core;
|
|
||||||
using InternshipSystem.Repository;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Controllers
|
|
||||||
{
|
|
||||||
|
|
||||||
[ApiController]
|
|
||||||
[Route("management/document")]
|
|
||||||
public class DocumentManagementController : ControllerBase
|
|
||||||
{
|
|
||||||
private InternshipDbContext Context { get; }
|
|
||||||
|
|
||||||
public DocumentManagementController(InternshipDbContext context)
|
|
||||||
{
|
|
||||||
Context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpDelete("{documentId}/delete")]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> DeleteDocument(long documentId, CancellationToken ct)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.FirstOrDefaultAsync(i => i.Documentation.Any(d => d.Id.Equals(documentId)), ct);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
internship.RemoveDocument(documentId);
|
|
||||||
|
|
||||||
await Context.SaveChangesAsync(ct);
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("{documentId}/accept")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> AcceptDocument(long documentId, [FromBody] string comment, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.FirstOrDefaultAsync(i => i.Documentation.Any(d => d.Id.Equals(documentId)), token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
var document = internship.Documentation
|
|
||||||
.FirstOrDefault(d => d.Id.Equals(documentId));
|
|
||||||
|
|
||||||
if (document == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
document.State = DocumentState.Accepted;
|
|
||||||
document.ChangeStateComment = string.IsNullOrEmpty(comment) ? null : comment;
|
|
||||||
|
|
||||||
await Context.SaveChangesAsync(token);
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("{documentId}/reject")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> RejectDocument(long documentId, [FromBody] string comment, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.FirstOrDefaultAsync(i => i.Documentation.Any(d => d.Id.Equals(documentId)), token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
var document = internship.Documentation
|
|
||||||
.FirstOrDefault(d => d.Id.Equals(documentId));
|
|
||||||
|
|
||||||
if (document == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
document.State = DocumentState.Rejected;
|
|
||||||
document.ChangeStateComment = string.IsNullOrEmpty(comment) ? null : comment;
|
|
||||||
|
|
||||||
await Context.SaveChangesAsync(token);
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -99,8 +99,6 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
var edition =
|
var edition =
|
||||||
await Context.Editions
|
await Context.Editions
|
||||||
.Include(e => e.AvailableSubjects)
|
.Include(e => e.AvailableSubjects)
|
||||||
.Include(e => e.ReportSchema)
|
|
||||||
.ThenInclude(e => e.Field)
|
|
||||||
.Include(e => e.Course)
|
.Include(e => e.Course)
|
||||||
.Where(e => e.Id == user.EditionId)
|
.Where(e => e.Id == user.EditionId)
|
||||||
.ProjectTo<EditionConfigurationResult>(Mapper.ConfigurationProvider)
|
.ProjectTo<EditionConfigurationResult>(Mapper.ConfigurationProvider)
|
||||||
|
@ -43,8 +43,6 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
.Skip(searchQuery.Page * searchQuery.PerPage)
|
.Skip(searchQuery.Page * searchQuery.PerPage)
|
||||||
.Take(searchQuery.PerPage)
|
.Take(searchQuery.PerPage)
|
||||||
.ToListAsync(token);
|
.ToListAsync(token);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
[HttpGet("{editionId}")]
|
[HttpGet("{editionId}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
@ -59,8 +57,6 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
.ThenInclude(s => s.Subject)
|
.ThenInclude(s => s.Subject)
|
||||||
.Include(e => e.AvailableInternshipTypes)
|
.Include(e => e.AvailableInternshipTypes)
|
||||||
.ThenInclude(i => i.InternshipType)
|
.ThenInclude(i => i.InternshipType)
|
||||||
.Include(e => e.ReportSchema)
|
|
||||||
.ThenInclude(er => er.Field)
|
|
||||||
.Where(e => e.Id == editionId)
|
.Where(e => e.Id == editionId)
|
||||||
.ProjectTo<EditionDetailsResult>(Mapper.ConfigurationProvider)
|
.ProjectTo<EditionDetailsResult>(Mapper.ConfigurationProvider)
|
||||||
.FirstOrDefaultAsync(token);
|
.FirstOrDefaultAsync(token);
|
||||||
@ -72,7 +68,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
|
|
||||||
return Ok(edition);
|
return Ok(edition);
|
||||||
}
|
}
|
||||||
|
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
@ -94,7 +90,6 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
var editionToUpdate = await Context.Editions
|
var editionToUpdate = await Context.Editions
|
||||||
.Include(e => e.AvailableSubjects)
|
.Include(e => e.AvailableSubjects)
|
||||||
.Include(e => e.AvailableInternshipTypes)
|
.Include(e => e.AvailableInternshipTypes)
|
||||||
.Include(e => e.ReportSchema)
|
|
||||||
.FirstOrDefaultAsync(e => e.Id == editionForm.Id.Value, token);
|
.FirstOrDefaultAsync(e => e.Id == editionForm.Id.Value, token);
|
||||||
|
|
||||||
if (editionToUpdate == null)
|
if (editionToUpdate == null)
|
||||||
@ -103,7 +98,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
}
|
}
|
||||||
|
|
||||||
editionToUpdate.UpdateEdition(editionForm.EditionStart, editionForm.EditionFinish, editionForm.ReportingStart,
|
editionToUpdate.UpdateEdition(editionForm.EditionStart, editionForm.EditionFinish, editionForm.ReportingStart,
|
||||||
editionForm.Course, editionForm.AvailableSubjectsIds, editionForm.AvailableInternshipTypesIds, editionForm.ReportSchema);
|
editionForm.Course, editionForm.AvailableSubjectsIds, editionForm.AvailableInternshipTypesIds);
|
||||||
|
|
||||||
if (!editionToUpdate.IsValidDates)
|
if (!editionToUpdate.IsValidDates)
|
||||||
{
|
{
|
||||||
@ -114,7 +109,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
{
|
{
|
||||||
var newEdition =
|
var newEdition =
|
||||||
Edition.CreateEdition(editionForm.EditionStart.Value, editionForm.EditionFinish.Value, editionForm.ReportingStart.Value,
|
Edition.CreateEdition(editionForm.EditionStart.Value, editionForm.EditionFinish.Value, editionForm.ReportingStart.Value,
|
||||||
editionForm.Course, editionForm.AvailableSubjectsIds, editionForm.AvailableInternshipTypesIds, editionForm.ReportSchema);
|
editionForm.Course, editionForm.AvailableSubjectsIds, editionForm.AvailableInternshipTypesIds);
|
||||||
|
|
||||||
if (!newEdition.IsValidDates)
|
if (!newEdition.IsValidDates)
|
||||||
{
|
{
|
||||||
@ -140,7 +135,6 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
var editionToDelete = await Context.Editions
|
var editionToDelete = await Context.Editions
|
||||||
.Include(e => e.AvailableSubjects)
|
.Include(e => e.AvailableSubjects)
|
||||||
.Include(e => e.AvailableInternshipTypes)
|
.Include(e => e.AvailableInternshipTypes)
|
||||||
.Include(e => e.ReportSchema)
|
|
||||||
.FirstOrDefaultAsync(e => e.Id.Equals(editionId), token);
|
.FirstOrDefaultAsync(e => e.Id.Equals(editionId), token);
|
||||||
|
|
||||||
if (editionToDelete == null)
|
if (editionToDelete == null)
|
||||||
|
@ -1,190 +0,0 @@
|
|||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using InternshipSystem.Api.Queries.SearchQuery;
|
|
||||||
using InternshipSystem.Api.Security;
|
|
||||||
using InternshipSystem.Core;
|
|
||||||
using InternshipSystem.Core.Entity.Internship;
|
|
||||||
using InternshipSystem.Repository;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Http;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Controllers
|
|
||||||
{
|
|
||||||
[ApiController]
|
|
||||||
[Route("management/internship")]
|
|
||||||
public class InternshipManagementController : ControllerBase
|
|
||||||
{
|
|
||||||
private InternshipDbContext Context { get; }
|
|
||||||
|
|
||||||
public InternshipManagementController(InternshipDbContext context)
|
|
||||||
{
|
|
||||||
Context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult<IReadOnlyCollection<Internship>>> GetInternships([FromQuery] InternshipSearchQuery searchQuery, CancellationToken token)
|
|
||||||
{
|
|
||||||
var query =
|
|
||||||
Context.Internships
|
|
||||||
.Include(i => i.Edition)
|
|
||||||
.Include(i => i.InternshipRegistration)
|
|
||||||
.Include(i => i.InternshipRegistration.Type)
|
|
||||||
.Include(i => i.Student)
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.Include(i => i.Report)
|
|
||||||
.Where(i => !searchQuery.EditionId.HasValue || i.Edition.Id == searchQuery.EditionId)
|
|
||||||
.Where(i => !searchQuery.InternshipState.HasValue || i.InternshipRegistration.State == searchQuery.InternshipState)
|
|
||||||
.Where(i => !searchQuery.InternshipState.HasValue || i.Report.State == searchQuery.ReportState)
|
|
||||||
.Where(i => !searchQuery.StudentAlbumNumber.HasValue || i.Student.AlbumNumber == searchQuery.StudentAlbumNumber)
|
|
||||||
.Where(i => string.IsNullOrEmpty(searchQuery.StudentFirstName) || i.Student.FirstName.ToLower().Contains(searchQuery.StudentFirstName.ToLower()))
|
|
||||||
.Where(i => string.IsNullOrEmpty(searchQuery.StudentLastName) || i.Student.LastName.ToLower().Contains(searchQuery.StudentLastName.ToLower()))
|
|
||||||
.Where(i => !searchQuery.DocumentWithState.HasValue || i.Documentation.Any(d => d.State == searchQuery.DocumentWithState))
|
|
||||||
.Skip(searchQuery.Page * searchQuery.PerPage)
|
|
||||||
.Take(searchQuery.PerPage);
|
|
||||||
|
|
||||||
if (searchQuery.OrderByField.ToLower().Equals("date"))
|
|
||||||
{
|
|
||||||
query = searchQuery.SortOrder.Equals(SortOrder.Desc) ?
|
|
||||||
query.OrderByDescending(i => i.InternshipRegistration.SubmissionDate) :
|
|
||||||
query.OrderBy(i => i.InternshipRegistration.SubmissionDate);
|
|
||||||
}
|
|
||||||
else if (searchQuery.OrderByField.ToLower().Equals("internshipstate"))
|
|
||||||
{
|
|
||||||
query = searchQuery.SortOrder.Equals(SortOrder.Desc) ?
|
|
||||||
query.OrderByDescending(i => i.InternshipRegistration.State) :
|
|
||||||
query.OrderBy(i => i.InternshipRegistration.State);
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = await query.ToListAsync(token);
|
|
||||||
|
|
||||||
return Ok(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("{internshipId}")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult<Internship>> GetInternship(long internshipId, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.Student)
|
|
||||||
.Include(i => i.InternshipRegistration)
|
|
||||||
.Include(i => i.InternshipRegistration.Company)
|
|
||||||
.Include(i => i.InternshipRegistration.BranchAddress)
|
|
||||||
.Include(i => i.InternshipRegistration.Type)
|
|
||||||
.Include(i => i.InternshipRegistration.Subjects)
|
|
||||||
.ThenInclude(subject => subject.Subject)
|
|
||||||
.Include(i => i.InternshipRegistration.Mentor)
|
|
||||||
.Include(i => i.Report)
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.Include(i => i.Edition)
|
|
||||||
.Where(i => i.Id.Equals(internshipId))
|
|
||||||
.FirstOrDefaultAsync(token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(internship);
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("{internshipId}/status")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> GetInternshipStatus(long internshipId, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.InternshipRegistration)
|
|
||||||
.Include(i => i.Report)
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.FirstOrDefaultAsync(i => i.Id.Equals(internshipId), token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
return new JsonResult(new { Errors = internship.ValidateStatus() });
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("{internshipId}/grade")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> GradeInternship(long internshipId, [FromBody] float grade, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.FirstOrDefaultAsync(i => i.Id.Equals(internshipId), token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
internship.Grade = grade;
|
|
||||||
await Context.SaveChangesAsync(token);
|
|
||||||
|
|
||||||
return new JsonResult(new { Errors = internship.ValidateStatus() });
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("{internshipId}/registration/accept")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> AcceptInternshipRegistration(long internshipId, [FromBody] string comment, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.InternshipRegistration)
|
|
||||||
.FirstOrDefaultAsync(i => i.Id.Equals(internshipId), token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
internship.InternshipRegistration.State = DocumentState.Accepted;
|
|
||||||
internship.InternshipRegistration.ChangeStateComment = string.IsNullOrEmpty(comment) ? null : comment;
|
|
||||||
|
|
||||||
await Context.SaveChangesAsync(token);
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPut("{internshipId}/registration/reject")]
|
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> RejectInternshipRegistration(long internshipId, [FromBody] string comment, CancellationToken token)
|
|
||||||
{
|
|
||||||
var internship = await Context.Internships
|
|
||||||
.Include(i => i.InternshipRegistration)
|
|
||||||
.FirstOrDefaultAsync(i => i.Id.Equals(internshipId), token);
|
|
||||||
|
|
||||||
if (internship == null)
|
|
||||||
{
|
|
||||||
return NotFound();
|
|
||||||
}
|
|
||||||
|
|
||||||
internship.InternshipRegistration.State = DocumentState.Rejected;
|
|
||||||
internship.InternshipRegistration.ChangeStateComment = string.IsNullOrEmpty(comment) ? null : comment;
|
|
||||||
|
|
||||||
await Context.SaveChangesAsync(token);
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -47,7 +47,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
.ThenInclude(t => t.Subject)
|
.ThenInclude(t => t.Subject)
|
||||||
.FirstAsync(e => e.Id == user.EditionId, cancellationToken);
|
.FirstAsync(e => e.Id == user.EditionId, cancellationToken);
|
||||||
|
|
||||||
var internship =
|
var internshipRegistration =
|
||||||
await _context
|
await _context
|
||||||
.Entry(edition)
|
.Entry(edition)
|
||||||
.Collection(e => e.Internships)
|
.Collection(e => e.Internships)
|
||||||
@ -62,11 +62,12 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
.ThenInclude(c => c.Type)
|
.ThenInclude(c => c.Type)
|
||||||
.Include(i => i.InternshipRegistration)
|
.Include(i => i.InternshipRegistration)
|
||||||
.ThenInclude(c => c.Subjects)
|
.ThenInclude(c => c.Subjects)
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.Where(i => i.Student.Id == user.PersonNumber)
|
.Where(i => i.Student.Id == user.PersonNumber)
|
||||||
|
.Select(i => i.InternshipRegistration)
|
||||||
.FirstAsync(cancellationToken);
|
.FirstAsync(cancellationToken);
|
||||||
|
|
||||||
var useCase = new UpdateInternshipRegistrationUseCase(_context, internship, edition, user);
|
|
||||||
|
var useCase = new UpdateInternshipRegistrationUseCase(_context, internshipRegistration, edition, user);
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using InternshipSystem.Api.Security;
|
|
||||||
using InternshipSystem.Core.ValueObject;
|
|
||||||
using InternshipSystem.Repository;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Newtonsoft.Json;
|
|
||||||
using Newtonsoft.Json.Linq;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Controllers
|
|
||||||
{
|
|
||||||
[Route("internship/report")]
|
|
||||||
public class ReportController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly InternshipDbContext _context;
|
|
||||||
|
|
||||||
public ReportController(InternshipDbContext context)
|
|
||||||
{
|
|
||||||
_context = context;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
[Authorize(Policy = Policies.RegisteredOnly)]
|
|
||||||
public async Task<ActionResult> PostReport([FromBody] JObject reportValue, [FromServices] User user, CancellationToken ct)
|
|
||||||
{
|
|
||||||
var edition = await _context.Editions
|
|
||||||
.FindAsync(user.EditionId);
|
|
||||||
|
|
||||||
var internship = await _context.Entry(edition)
|
|
||||||
.Collection(e => e.Internships)
|
|
||||||
.Query()
|
|
||||||
.Include(i => i.Report)
|
|
||||||
.Include(i => i.Documentation)
|
|
||||||
.SingleAsync(i => i.Student.Id == user.PersonNumber, ct);
|
|
||||||
|
|
||||||
internship.Report.UpdateReport(reportValue.ToString(Formatting.None));
|
|
||||||
internship.AddNewDocument("", DocumentType.InternshipEvaluation);
|
|
||||||
|
|
||||||
await _context.SaveChangesAsync(ct);
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet]
|
|
||||||
[Authorize(Policy = Policies.RegisteredOnly)]
|
|
||||||
public async Task<ActionResult> GetReport([FromServices] User user, CancellationToken ct)
|
|
||||||
{
|
|
||||||
var edition = await _context.Editions
|
|
||||||
.FindAsync(user.EditionId);
|
|
||||||
|
|
||||||
var internship = await _context.Entry(edition)
|
|
||||||
.Collection(e => e.Internships)
|
|
||||||
.Query()
|
|
||||||
.Include(i => i.Report)
|
|
||||||
.SingleAsync(i => i.Student.Id == user.PersonNumber, ct);
|
|
||||||
|
|
||||||
return Ok(JsonConvert.DeserializeObject(internship.Report.Value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,90 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Threading;
|
|
||||||
using System.Threading.Tasks;
|
|
||||||
using AutoMapper;
|
|
||||||
using InternshipSystem.Api.Queries.SearchQuery;
|
|
||||||
using InternshipSystem.Api.Security;
|
|
||||||
using InternshipSystem.Core;
|
|
||||||
using InternshipSystem.Core.Entity;
|
|
||||||
using InternshipSystem.Repository;
|
|
||||||
using Microsoft.AspNetCore.Authorization;
|
|
||||||
using Microsoft.AspNetCore.Mvc;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Controllers
|
|
||||||
{
|
|
||||||
[Route("management/report")]
|
|
||||||
public class ReportFieldsController : ControllerBase
|
|
||||||
{
|
|
||||||
private readonly InternshipDbContext _context;
|
|
||||||
private readonly IMapper _mapper;
|
|
||||||
|
|
||||||
public ReportFieldsController(InternshipDbContext context, IMapper mapper)
|
|
||||||
{
|
|
||||||
_context = context;
|
|
||||||
_mapper = mapper;
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpGet("fields")]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<IEnumerable<ReportField>> GetFields(FieldSearchQuery searchQuery, CancellationToken ct) =>
|
|
||||||
await _context.ReportFields
|
|
||||||
.Where(c => c.Label.ToLower().Contains(searchQuery.Label.ToLower()))
|
|
||||||
.OrderBy(o => o.Label)
|
|
||||||
.Skip(searchQuery.Page * searchQuery.PerPage)
|
|
||||||
.Take(searchQuery.PerPage)
|
|
||||||
.ToListAsync(ct);
|
|
||||||
|
|
||||||
[HttpPost("fields")]
|
|
||||||
[Authorize(Policy = Policies.IsOverseer)]
|
|
||||||
public async Task<ActionResult> CreateField([FromBody] FieldCreateRequest request, CancellationToken ct)
|
|
||||||
{
|
|
||||||
ReportField field;
|
|
||||||
|
|
||||||
switch (request.FieldType)
|
|
||||||
{
|
|
||||||
case FieldType.LongText:
|
|
||||||
case FieldType.ShortText:
|
|
||||||
field = new ReportField(request.Label, request.LabelEng, request.Description, request.DescriptionEng, request.FieldType);
|
|
||||||
break;
|
|
||||||
case FieldType.Select:
|
|
||||||
case FieldType.Radial:
|
|
||||||
case FieldType.Checkbox:
|
|
||||||
field = new ReportChoiceField(request.Label, request.LabelEng, request.Description, request.DescriptionEng, request.FieldType, request.Choices);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return BadRequest("Unknown field type");
|
|
||||||
}
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
await _context.ReportFields.AddAsync(field, ct);
|
|
||||||
await _context.SaveChangesAsync(ct);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
return BadRequest("Failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FieldSearchQuery : SearchQuery
|
|
||||||
{
|
|
||||||
public string Label { get; set; } = "";
|
|
||||||
}
|
|
||||||
|
|
||||||
public class FieldCreateRequest
|
|
||||||
{
|
|
||||||
public long? Id { get; set; }
|
|
||||||
public string Label { get; set; }
|
|
||||||
public string LabelEng { get; set; }
|
|
||||||
public string Description { get; set; }
|
|
||||||
public string DescriptionEng { get; set; }
|
|
||||||
public FieldType FieldType { get; set; }
|
|
||||||
public string[] Choices { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -16,7 +16,6 @@ namespace InternshipSystem.Api.Queries
|
|||||||
public Course Course { get; set; }
|
public Course Course { get; set; }
|
||||||
public List<long> AvailableSubjectsIds { get; set; } = new List<long>();
|
public List<long> AvailableSubjectsIds { get; set; } = new List<long>();
|
||||||
public List<long> AvailableInternshipTypesIds { get; set; } = new List<long>();
|
public List<long> AvailableInternshipTypesIds { get; set; } = new List<long>();
|
||||||
public List<long> ReportSchema { get; set; } = new List<long>();
|
|
||||||
|
|
||||||
public class Validator : AbstractValidator<EditionForm>
|
public class Validator : AbstractValidator<EditionForm>
|
||||||
{
|
{
|
||||||
|
@ -1,22 +0,0 @@
|
|||||||
using System;
|
|
||||||
using InternshipSystem.Core;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Queries.SearchQuery
|
|
||||||
{
|
|
||||||
public class InternshipSearchQuery : SearchQuery
|
|
||||||
{
|
|
||||||
public Guid? EditionId { get; set; } = null;
|
|
||||||
public DocumentState? InternshipState { get; set; } = null;
|
|
||||||
public DocumentState? ReportState { get; set; }
|
|
||||||
public int? StudentAlbumNumber { get; set; } = null;
|
|
||||||
public string StudentFirstName { get; set; } = "";
|
|
||||||
public string StudentLastName { get; set; } = "";
|
|
||||||
/// <summary>
|
|
||||||
/// SortValue: Date, InternshipState
|
|
||||||
/// </summary>
|
|
||||||
public string OrderByField { get; set; } = "";
|
|
||||||
public SortOrder SortOrder { get; set; } = SortOrder.None;
|
|
||||||
|
|
||||||
public DocumentState? DocumentWithState { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,9 +0,0 @@
|
|||||||
namespace InternshipSystem.Api.Queries.SearchQuery
|
|
||||||
{
|
|
||||||
public enum SortOrder
|
|
||||||
{
|
|
||||||
Asc,
|
|
||||||
Desc,
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,7 +10,6 @@ namespace InternshipSystem.Api.Result
|
|||||||
public class EditionConfigurationResult
|
public class EditionConfigurationResult
|
||||||
{
|
{
|
||||||
public List<InternshipSubject> AvailableSubjects { get; set; }
|
public List<InternshipSubject> AvailableSubjects { get; set; }
|
||||||
public List<ReportField> ReportSchema { get; set; }
|
|
||||||
public Course Course { get; set; }
|
public Course Course { get; set; }
|
||||||
public DateTime EditionStart { get; set; }
|
public DateTime EditionStart { get; set; }
|
||||||
public DateTime EditionFinish { get; set; }
|
public DateTime EditionFinish { get; set; }
|
||||||
|
@ -15,6 +15,5 @@ namespace InternshipSystem.Api.Result
|
|||||||
public Course Course { get; set; }
|
public Course Course { get; set; }
|
||||||
public List<InternshipSubject> AvailableSubjects { get; set; }
|
public List<InternshipSubject> AvailableSubjects { get; set; }
|
||||||
public List<InternshipType> AvailableInternshipTypes { get; set; }
|
public List<InternshipType> AvailableInternshipTypes { get; set; }
|
||||||
public List<ReportField> ReportSchema { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,7 +9,6 @@ using InternshipSystem.Api.Security;
|
|||||||
using InternshipSystem.Core;
|
using InternshipSystem.Core;
|
||||||
using InternshipSystem.Core.Entity.Internship;
|
using InternshipSystem.Core.Entity.Internship;
|
||||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||||
using InternshipSystem.Core.ValueObject;
|
|
||||||
using InternshipSystem.Repository;
|
using InternshipSystem.Repository;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
@ -18,27 +17,25 @@ namespace InternshipSystem.Api.UseCases
|
|||||||
public class UpdateInternshipRegistrationUseCase
|
public class UpdateInternshipRegistrationUseCase
|
||||||
{
|
{
|
||||||
private readonly InternshipDbContext _dbContext;
|
private readonly InternshipDbContext _dbContext;
|
||||||
private readonly Internship _internship;
|
|
||||||
private readonly Edition _edition;
|
private readonly Edition _edition;
|
||||||
private readonly User _user;
|
private readonly User _user;
|
||||||
private readonly InternshipRegistration subjectRegistration;
|
private readonly InternshipRegistration subjectRegistration;
|
||||||
|
|
||||||
public UpdateInternshipRegistrationUseCase(InternshipDbContext dbContext,
|
public UpdateInternshipRegistrationUseCase(InternshipDbContext dbContext,
|
||||||
Internship internship, Edition edition, User user)
|
InternshipRegistration internshipRegistration, Edition edition, User user)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_dbContext = dbContext;
|
||||||
_internship = internship;
|
|
||||||
_edition = edition;
|
_edition = edition;
|
||||||
_user = user;
|
_user = user;
|
||||||
_internship = internship;
|
subjectRegistration = internshipRegistration;
|
||||||
subjectRegistration = internship.InternshipRegistration;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<(DocumentState State, IEnumerable<ErrorDescription>)> UpdateInternshipRegistration(
|
public async Task<(DocumentState State, IEnumerable<ErrorDescription>)> UpdateInternshipRegistration(
|
||||||
UpdateRegistrationForm registrationCommand,
|
UpdateRegistrationForm registrationCommand,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
UpdateTimeFrame(registrationCommand);
|
subjectRegistration.Start = registrationCommand.Start ?? subjectRegistration.Start;
|
||||||
|
subjectRegistration.End = registrationCommand.End ?? subjectRegistration.End;
|
||||||
subjectRegistration.DeclaredHours = registrationCommand.Hours ?? subjectRegistration.DeclaredHours;
|
subjectRegistration.DeclaredHours = registrationCommand.Hours ?? subjectRegistration.DeclaredHours;
|
||||||
|
|
||||||
if (registrationCommand.Type.HasValue)
|
if (registrationCommand.Type.HasValue)
|
||||||
@ -64,43 +61,9 @@ namespace InternshipSystem.Api.UseCases
|
|||||||
return subjectRegistration.ValidateStatus(_edition);
|
return subjectRegistration.ValidateStatus(_edition);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void UpdateTimeFrame(UpdateRegistrationForm registrationCommand)
|
|
||||||
{
|
|
||||||
subjectRegistration.Start = registrationCommand.Start ?? subjectRegistration.Start;
|
|
||||||
subjectRegistration.End = registrationCommand.End ?? subjectRegistration.End;
|
|
||||||
|
|
||||||
if (!_edition.IsDateDuringEdition(subjectRegistration.Start, subjectRegistration.End))
|
|
||||||
{
|
|
||||||
_internship.AddNewDocument("", DocumentType.OutsideTermApproval);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_internship.RemoveDocument(DocumentType.OutsideTermApproval);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateInternshipType(long typeId)
|
private void UpdateInternshipType(long typeId)
|
||||||
{
|
{
|
||||||
var editionInternshipType = _edition.AvailableInternshipTypes.FirstOrDefault(i => i.InternshipTypeId == typeId);
|
var editionInternshipType = _edition.AvailableInternshipTypes.FirstOrDefault(i => i.InternshipTypeId == typeId);
|
||||||
|
|
||||||
if (editionInternshipType?.InternshipType.RequireDeansApproval == true)
|
|
||||||
{
|
|
||||||
_internship.AddNewDocument("", DocumentType.InternshipTypeApproval);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_internship.RemoveDocument(DocumentType.InternshipTypeApproval);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (editionInternshipType?.InternshipType.RequireInsurance == true)
|
|
||||||
{
|
|
||||||
_internship.AddNewDocument("", DocumentType.NnwInsurance);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_internship.RemoveDocument(DocumentType.NnwInsurance);
|
|
||||||
}
|
|
||||||
|
|
||||||
subjectRegistration.Type = editionInternshipType?.InternshipType ?? subjectRegistration.Type;
|
subjectRegistration.Type = editionInternshipType?.InternshipType ?? subjectRegistration.Type;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,7 +9,7 @@ namespace InternshipSystem.Core
|
|||||||
public DocumentScan Scan { get; set; }
|
public DocumentScan Scan { get; set; }
|
||||||
public DocumentType Type { get; set; }
|
public DocumentType Type { get; set; }
|
||||||
public DocumentState State { get; set; }
|
public DocumentState State { get; set; }
|
||||||
public string ChangeStateComment { get; set; }
|
public string RejectionReason { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DocumentScan
|
public class DocumentScan
|
||||||
|
@ -17,12 +17,11 @@ namespace InternshipSystem.Core
|
|||||||
public List<Internship> Internships { get; set; }
|
public List<Internship> Internships { get; set; }
|
||||||
public List<EditionSubject> AvailableSubjects { get; set; }
|
public List<EditionSubject> AvailableSubjects { get; set; }
|
||||||
public List<EditionInternshipType> AvailableInternshipTypes { get; set; }
|
public List<EditionInternshipType> AvailableInternshipTypes { get; set; }
|
||||||
public List<ReportFieldEdition> ReportSchema { get; set; }
|
|
||||||
|
|
||||||
public bool IsOpen => EditionFinish < DateTime.Today;
|
public bool IsOpen => EditionFinish < DateTime.Today;
|
||||||
|
|
||||||
public static Edition CreateEdition(DateTime start, DateTime end, DateTime reportingStart, Course course,
|
public static Edition CreateEdition(DateTime start, DateTime end, DateTime reportingStart, Course course,
|
||||||
IEnumerable<long> subjectsIds, IEnumerable<long> internshipTypesIds, IEnumerable<long> reportFieldIds)
|
IEnumerable<long> subjectsIds, IEnumerable<long> internshipTypesIds)
|
||||||
{
|
{
|
||||||
var newEdition = CreateEdition(start, end, reportingStart, course);
|
var newEdition = CreateEdition(start, end, reportingStart, course);
|
||||||
|
|
||||||
@ -43,15 +42,6 @@ namespace InternshipSystem.Core
|
|||||||
InternshipTypeId = i,
|
InternshipTypeId = i,
|
||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
newEdition.ReportSchema =
|
|
||||||
reportFieldIds
|
|
||||||
.Select(i => new ReportFieldEdition
|
|
||||||
{
|
|
||||||
Edition = newEdition,
|
|
||||||
ReportFieldId = i,
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
|
|
||||||
return newEdition;
|
return newEdition;
|
||||||
}
|
}
|
||||||
@ -66,12 +56,11 @@ namespace InternshipSystem.Core
|
|||||||
Course = course,
|
Course = course,
|
||||||
AvailableSubjects = new List<EditionSubject>(),
|
AvailableSubjects = new List<EditionSubject>(),
|
||||||
AvailableInternshipTypes = new List<EditionInternshipType>(),
|
AvailableInternshipTypes = new List<EditionInternshipType>(),
|
||||||
ReportSchema = new List<ReportFieldEdition>()
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateEdition(DateTime? start, DateTime? end, DateTime? reportingStart, Course course,
|
public void UpdateEdition(DateTime? start, DateTime? end, DateTime? reportingStart, Course course,
|
||||||
IEnumerable<long> subjectsIds, IEnumerable<long> internshipTypesIds, IEnumerable<long> reportFieldIds)
|
IEnumerable<long> subjectsIds, IEnumerable<long> internshipTypesIds)
|
||||||
{
|
{
|
||||||
EditionStart = start ?? EditionStart;
|
EditionStart = start ?? EditionStart;
|
||||||
EditionFinish = end ?? EditionFinish;
|
EditionFinish = end ?? EditionFinish;
|
||||||
@ -99,17 +88,6 @@ namespace InternshipSystem.Core
|
|||||||
})
|
})
|
||||||
.ToList();
|
.ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (reportFieldIds != null)
|
|
||||||
{
|
|
||||||
ReportSchema =
|
|
||||||
reportFieldIds
|
|
||||||
.Select(i => new ReportFieldEdition
|
|
||||||
{
|
|
||||||
ReportFieldId = i,
|
|
||||||
})
|
|
||||||
.ToList();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RegisterInternship(Student student)
|
public void RegisterInternship(Student student)
|
||||||
@ -120,7 +98,7 @@ namespace InternshipSystem.Core
|
|||||||
}
|
}
|
||||||
|
|
||||||
var internship = Internship.CreateStudentsInternship(student);
|
var internship = Internship.CreateStudentsInternship(student);
|
||||||
|
|
||||||
Internships.Add(internship);
|
Internships.Add(internship);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation;
|
|
||||||
using InternshipSystem.Core.ValueObject;
|
using InternshipSystem.Core.ValueObject;
|
||||||
|
|
||||||
namespace InternshipSystem.Core.Entity.Internship
|
namespace InternshipSystem.Core.Entity.Internship
|
||||||
@ -13,6 +12,7 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
public InternshipRegistration InternshipRegistration { get; set; }
|
public InternshipRegistration InternshipRegistration { get; set; }
|
||||||
public Report Report { get; set; }
|
public Report Report { get; set; }
|
||||||
public List<Document> Documentation { get; set; }
|
public List<Document> Documentation { get; set; }
|
||||||
|
|
||||||
public Edition Edition { get; set; }
|
public Edition Edition { get; set; }
|
||||||
|
|
||||||
public float? Grade { get; set; }
|
public float? Grade { get; set; }
|
||||||
@ -27,19 +27,14 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
internship.Report = Report.Create();
|
internship.Report = Report.Create();
|
||||||
internship.Documentation = new List<Document>();
|
internship.Documentation = new List<Document>();
|
||||||
|
|
||||||
if (student.Semester != 6)
|
|
||||||
{
|
|
||||||
internship.AddNewDocument("", DocumentType.OutsideSemesterApproval);
|
|
||||||
}
|
|
||||||
|
|
||||||
return internship;
|
return internship;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void AddNewDocument(string description, DocumentType type)
|
public void AddNewDocument(string description, DocumentType type)
|
||||||
{
|
{
|
||||||
if (type != DocumentType.Other && Documentation.Any(d => d.Type == type))
|
if (Documentation.Any(d => d.Type == type))
|
||||||
{
|
{
|
||||||
return;
|
throw new ArgumentException("Internship already has a document of given type");
|
||||||
}
|
}
|
||||||
|
|
||||||
var document = new Document
|
var document = new Document
|
||||||
@ -52,54 +47,12 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
Documentation.Add(document);
|
Documentation.Add(document);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void RemoveDocument(DocumentType documentType)
|
public void UpdateDocumentScan(long documentId, byte[] documentScan)
|
||||||
{
|
{
|
||||||
if (documentType == DocumentType.Other)
|
var document = Documentation.First(d => d.Id == documentId);
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var doc = Documentation.FirstOrDefault(d => d.Type == documentType);
|
|
||||||
|
|
||||||
if (doc != null)
|
// document.Scan = documentScan;
|
||||||
{
|
// document.State = DocumentState.Submitted;
|
||||||
Documentation.Remove(doc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void RemoveDocument(long id)
|
|
||||||
{
|
|
||||||
var doc = Documentation.FirstOrDefault(d => d.Id == id);
|
|
||||||
|
|
||||||
if (doc != null)
|
|
||||||
{
|
|
||||||
Documentation.Remove(doc);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<ErrorDescription> ValidateStatus()
|
|
||||||
{
|
|
||||||
var validator = new Validator();
|
|
||||||
|
|
||||||
var result = validator.Validate(this);
|
|
||||||
|
|
||||||
return result.ToErrorDescription();
|
|
||||||
}
|
|
||||||
|
|
||||||
private class Validator : AbstractValidator<Internship>
|
|
||||||
{
|
|
||||||
public Validator()
|
|
||||||
{
|
|
||||||
RuleFor(i => i.Report)
|
|
||||||
.Must(r => r.State == DocumentState.Accepted)
|
|
||||||
.WithMessage("error.report.not_accepted");
|
|
||||||
RuleFor(i => i.InternshipRegistration)
|
|
||||||
.Must(r => r.State == DocumentState.Accepted)
|
|
||||||
.WithMessage("error.registration.not_accepted");
|
|
||||||
RuleForEach(i => i.Documentation)
|
|
||||||
.Must(d => d.State == DocumentState.Accepted)
|
|
||||||
.WithMessage("error.documentation.not_accepted");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,9 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
|
using FluentValidation.Results;
|
||||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||||
|
|
||||||
namespace InternshipSystem.Core.Entity.Internship
|
namespace InternshipSystem.Core.Entity.Internship
|
||||||
@ -11,15 +13,14 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public Company Company { get; set; }
|
public Company Company { get; set; }
|
||||||
public BranchOffice BranchAddress { get; set; }
|
public BranchOffice BranchAddress { get; set; }
|
||||||
public DateTime SubmissionDate { get; set; }
|
|
||||||
public DateTime Start { get; set; }
|
public DateTime Start { get; set; }
|
||||||
public DateTime End { get; set; }
|
public DateTime End { get; set; }
|
||||||
public Mentor Mentor { get; set; }
|
public Mentor Mentor { get; set; }
|
||||||
public List<ProgramSubject> Subjects { get; set; }
|
public List<ProgramSubject> Subjects { get; set; }
|
||||||
public InternshipType Type { get; set; }
|
public InternshipType Type { get; set; }
|
||||||
|
|
||||||
public int DeclaredHours { get; set; }
|
public int DeclaredHours { get; set; }
|
||||||
public DocumentState State { get; set; }
|
public DocumentState State { get; set; }
|
||||||
public string ChangeStateComment { get; set; }
|
|
||||||
|
|
||||||
public static InternshipRegistration Create()
|
public static InternshipRegistration Create()
|
||||||
{
|
{
|
||||||
@ -35,8 +36,6 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
|
|
||||||
State = result.IsValid ? DocumentState.Submitted : DocumentState.Draft;
|
State = result.IsValid ? DocumentState.Submitted : DocumentState.Draft;
|
||||||
|
|
||||||
SubmissionDate = DocumentState.Submitted.Equals(State) ? DateTime.UtcNow.AddHours(1) : SubmissionDate;
|
|
||||||
|
|
||||||
return (State, result.ToErrorDescription());
|
return (State, result.ToErrorDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,9 +61,13 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
.Must(edition.IsTypeAvailable)
|
.Must(edition.IsTypeAvailable)
|
||||||
.WithMessage("error.type.not_available");
|
.WithMessage("error.type.not_available");
|
||||||
RuleFor(x => x.Start)
|
RuleFor(x => x.Start)
|
||||||
|
.GreaterThanOrEqualTo(edition.EditionStart)
|
||||||
|
.LessThan(x => x.End)
|
||||||
.NotEmpty()
|
.NotEmpty()
|
||||||
.WithMessage("error.start_date.empty");
|
.WithMessage("error.start_date.empty");
|
||||||
RuleFor(x => x.End)
|
RuleFor(x => x.End)
|
||||||
|
.LessThanOrEqualTo(edition.EditionFinish)
|
||||||
|
.GreaterThan(x => x.Start)
|
||||||
.NotEmpty()
|
.NotEmpty()
|
||||||
.WithMessage("error.end_date.empty");
|
.WithMessage("error.end_date.empty");
|
||||||
RuleFor(x => x.DeclaredHours)
|
RuleFor(x => x.DeclaredHours)
|
||||||
|
@ -7,7 +7,5 @@
|
|||||||
public string LabelEng { get; set; }
|
public string LabelEng { get; set; }
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
public string DescriptionEng { get; set; }
|
public string DescriptionEng { get; set; }
|
||||||
public bool RequireDeansApproval { get; set; }
|
|
||||||
public bool RequireInsurance { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,17 +6,12 @@ namespace InternshipSystem.Core
|
|||||||
{
|
{
|
||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public DocumentState State { get; set; }
|
public DocumentState State { get; set; }
|
||||||
public string Value { get; set; }
|
public RangeOfActivity Range { get; set; }
|
||||||
|
public Uri SiteAddress { get; set; }
|
||||||
|
|
||||||
public static Report Create()
|
public static Report Create()
|
||||||
{
|
{
|
||||||
return new Report();
|
return new Report();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateReport(string reportValue)
|
|
||||||
{
|
|
||||||
Value = reportValue;
|
|
||||||
State = DocumentState.Submitted;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,49 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Core.Entity
|
|
||||||
{
|
|
||||||
public class ReportField
|
|
||||||
{
|
|
||||||
public ReportField()
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public ReportField(string label, string labelEng, string description, string descriptionEng, FieldType fieldType)
|
|
||||||
{
|
|
||||||
Label = label;
|
|
||||||
LabelEng = labelEng;
|
|
||||||
Description = description;
|
|
||||||
DescriptionEng = descriptionEng;
|
|
||||||
FieldType = fieldType;
|
|
||||||
}
|
|
||||||
|
|
||||||
public long Id { get; set; }
|
|
||||||
public string Label { get; set; }
|
|
||||||
public string LabelEng { get; set; }
|
|
||||||
public string Description { get; set; }
|
|
||||||
public string DescriptionEng { get; set; }
|
|
||||||
public FieldType FieldType { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum FieldType
|
|
||||||
{
|
|
||||||
LongText,
|
|
||||||
ShortText,
|
|
||||||
Select,
|
|
||||||
Radial,
|
|
||||||
Checkbox
|
|
||||||
}
|
|
||||||
|
|
||||||
public class ReportChoiceField : ReportField
|
|
||||||
{
|
|
||||||
public ReportChoiceField(string label, string labelEng, string description, string descriptionEng,
|
|
||||||
FieldType fieldType, string[] choices) : base(label, labelEng, description, descriptionEng, fieldType)
|
|
||||||
{
|
|
||||||
Choices = choices;
|
|
||||||
}
|
|
||||||
|
|
||||||
public string[] Choices { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,13 +0,0 @@
|
|||||||
using System;
|
|
||||||
using InternshipSystem.Core.Entity;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Core.UglyOrmArtifacts
|
|
||||||
{
|
|
||||||
public class ReportFieldEdition
|
|
||||||
{
|
|
||||||
public Guid EditionId { get; set; }
|
|
||||||
public Edition Edition { get; set; }
|
|
||||||
public long ReportFieldId { get; set; }
|
|
||||||
public ReportField Field { get; set; }
|
|
||||||
}
|
|
||||||
}
|
|
@ -3,11 +3,7 @@
|
|||||||
public enum DocumentType
|
public enum DocumentType
|
||||||
{
|
{
|
||||||
IppScan,
|
IppScan,
|
||||||
OutsideTermApproval,
|
DeanConsent,
|
||||||
InternshipTypeApproval,
|
NnwIsurance
|
||||||
OutsideSemesterApproval,
|
|
||||||
NnwInsurance,
|
|
||||||
InternshipEvaluation,
|
|
||||||
Other
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,7 +6,6 @@ using InternshipSystem.Core;
|
|||||||
using InternshipSystem.Core.Entity;
|
using InternshipSystem.Core.Entity;
|
||||||
using InternshipSystem.Core.Entity.Internship;
|
using InternshipSystem.Core.Entity.Internship;
|
||||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||||
using InternshipSystem.Core.ValueObject;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace InternshipSystem.Repository
|
namespace InternshipSystem.Repository
|
||||||
@ -120,7 +119,6 @@ namespace InternshipSystem.Repository
|
|||||||
LabelEng = "Internship agreement",
|
LabelEng = "Internship agreement",
|
||||||
Description = "Praktyka bezpłatna",
|
Description = "Praktyka bezpłatna",
|
||||||
DescriptionEng = "Free internship",
|
DescriptionEng = "Free internship",
|
||||||
RequireInsurance = true
|
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
@ -131,7 +129,6 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Label = "Umowa o staż bezpłatny",
|
Label = "Umowa o staż bezpłatny",
|
||||||
LabelEng = "Free apprenticeship agreement",
|
LabelEng = "Free apprenticeship agreement",
|
||||||
RequireInsurance = true
|
|
||||||
},
|
},
|
||||||
new InternshipType
|
new InternshipType
|
||||||
{
|
{
|
||||||
@ -161,7 +158,6 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Label = "Umowa zlecenia (w tym B2B)",
|
Label = "Umowa zlecenia (w tym B2B)",
|
||||||
LabelEng = "Contract of mandate (including B2B)",
|
LabelEng = "Contract of mandate (including B2B)",
|
||||||
RequireDeansApproval = true
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
await Context.InternshipTypes.AddRangeAsync(internshipTypes);
|
await Context.InternshipTypes.AddRangeAsync(internshipTypes);
|
||||||
@ -298,14 +294,6 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
new Internship
|
new Internship
|
||||||
{
|
{
|
||||||
Documentation = new List<Document>
|
|
||||||
{
|
|
||||||
new Document
|
|
||||||
{
|
|
||||||
Description = "doc",
|
|
||||||
Type = DocumentType.IppScan
|
|
||||||
}
|
|
||||||
},
|
|
||||||
Student = new Student
|
Student = new Student
|
||||||
{
|
{
|
||||||
FirstName = "Jan",
|
FirstName = "Jan",
|
||||||
@ -317,7 +305,6 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Company = Context.Companies.First(c => c.Name.Equals("Intel")),
|
Company = Context.Companies.First(c => c.Name.Equals("Intel")),
|
||||||
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa o pracę")),
|
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa o pracę")),
|
||||||
SubmissionDate = new DateTime(2000, 6, 2),
|
|
||||||
Start = new DateTime(2000, 7, 1),
|
Start = new DateTime(2000, 7, 1),
|
||||||
End = new DateTime(2000, 8, 30),
|
End = new DateTime(2000, 8, 30),
|
||||||
State = DocumentState.Submitted,
|
State = DocumentState.Submitted,
|
||||||
@ -350,7 +337,6 @@ namespace InternshipSystem.Repository
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Report = Report.Create()
|
|
||||||
},
|
},
|
||||||
new Internship
|
new Internship
|
||||||
{
|
{
|
||||||
@ -365,7 +351,6 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Company = Context.Companies.First(c => c.Name.Equals("Asseco Poland")),
|
Company = Context.Companies.First(c => c.Name.Equals("Asseco Poland")),
|
||||||
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa zlecenia (w tym B2B)")),
|
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa zlecenia (w tym B2B)")),
|
||||||
SubmissionDate = new DateTime(2000, 6, 1),
|
|
||||||
Start = new DateTime(2000, 7, 1),
|
Start = new DateTime(2000, 7, 1),
|
||||||
End = new DateTime(2000, 8, 30),
|
End = new DateTime(2000, 8, 30),
|
||||||
State = DocumentState.Submitted,
|
State = DocumentState.Submitted,
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
using System;
|
|
||||||
using System.Linq;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using InternshipSystem.Core;
|
using InternshipSystem.Core;
|
||||||
using InternshipSystem.Core.Entity;
|
using InternshipSystem.Core.Entity;
|
||||||
@ -16,9 +14,6 @@ namespace InternshipSystem.Repository
|
|||||||
public DbSet<InternshipType> InternshipTypes { get; set; }
|
public DbSet<InternshipType> InternshipTypes { get; set; }
|
||||||
public DbSet<Student> Students { get; set; }
|
public DbSet<Student> Students { get; set; }
|
||||||
public DbSet<Course> Courses { get; set; }
|
public DbSet<Course> Courses { get; set; }
|
||||||
public DbSet<Internship> Internships { get; set; }
|
|
||||||
|
|
||||||
public DbSet<ReportField> ReportFields { get; set; }
|
|
||||||
|
|
||||||
public InternshipDbContext(DbContextOptions<InternshipDbContext> options)
|
public InternshipDbContext(DbContextOptions<InternshipDbContext> options)
|
||||||
: base(options)
|
: base(options)
|
||||||
@ -95,37 +90,6 @@ namespace InternshipSystem.Repository
|
|||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey(subject => subject.InternshipSubjectId);
|
.HasForeignKey(subject => subject.InternshipSubjectId);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity<ReportFieldEdition>(builder =>
|
|
||||||
{
|
|
||||||
builder
|
|
||||||
.HasKey(e => new {e.EditionId, e.ReportFieldId});
|
|
||||||
|
|
||||||
builder
|
|
||||||
.HasOne(e => e.Edition)
|
|
||||||
.WithMany(edition => edition.ReportSchema)
|
|
||||||
.HasForeignKey(r => r.EditionId);
|
|
||||||
|
|
||||||
builder
|
|
||||||
.HasOne(e => e.Field)
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey(r => r.ReportFieldId);
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity<ReportField>()
|
|
||||||
.HasDiscriminator<string>("field_discrimnator")
|
|
||||||
.HasValue<ReportField>("single")
|
|
||||||
.HasValue<ReportChoiceField>("choice");
|
|
||||||
|
|
||||||
modelBuilder.Entity<ReportChoiceField>()
|
|
||||||
.Property(r => r.Choices)
|
|
||||||
.HasConversion(
|
|
||||||
a => string.Join('#', a),
|
|
||||||
s => s.Split('#', StringSplitOptions.RemoveEmptyEntries));
|
|
||||||
|
|
||||||
modelBuilder.Entity<Report>()
|
|
||||||
.Property(r => r.Value)
|
|
||||||
.HasColumnType("jsonb");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -20,4 +20,8 @@
|
|||||||
<ProjectReference Include="..\InternshipSystem.Core\InternshipSystem.Core.csproj" />
|
<ProjectReference Include="..\InternshipSystem.Core\InternshipSystem.Core.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<Folder Include="Migrations" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -10,8 +10,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
namespace InternshipSystem.Repository.Migrations
|
namespace InternshipSystem.Repository.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(InternshipDbContext))]
|
[DbContext(typeof(InternshipDbContext))]
|
||||||
[Migration("20210110210810_Init")]
|
[Migration("20201128203805_init")]
|
||||||
partial class Init
|
partial class init
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
@ -80,10 +80,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnType("bigint")
|
.HasColumnType("bigint")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("ChangeStateComment")
|
|
||||||
.HasColumnName("change_state_comment")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.HasColumnName("description")
|
.HasColumnName("description")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@ -92,6 +88,10 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("internship_id")
|
.HasColumnName("internship_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("RejectionReason")
|
||||||
|
.HasColumnName("rejection_reason")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("State")
|
b.Property<int>("State")
|
||||||
.HasColumnName("state")
|
.HasColumnName("state")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@ -220,21 +220,21 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_internships");
|
.HasName("pk_internship");
|
||||||
|
|
||||||
b.HasIndex("EditionId")
|
b.HasIndex("EditionId")
|
||||||
.HasName("ix_internships_edition_id");
|
.HasName("ix_internship_edition_id");
|
||||||
|
|
||||||
b.HasIndex("InternshipRegistrationId")
|
b.HasIndex("InternshipRegistrationId")
|
||||||
.HasName("ix_internships_internship_registration_id");
|
.HasName("ix_internship_internship_registration_id");
|
||||||
|
|
||||||
b.HasIndex("ReportId")
|
b.HasIndex("ReportId")
|
||||||
.HasName("ix_internships_report_id");
|
.HasName("ix_internship_report_id");
|
||||||
|
|
||||||
b.HasIndex("StudentId")
|
b.HasIndex("StudentId")
|
||||||
.HasName("ix_internships_student_id");
|
.HasName("ix_internship_student_id");
|
||||||
|
|
||||||
b.ToTable("internships");
|
b.ToTable("internship");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
||||||
@ -249,10 +249,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("branch_address_id")
|
.HasColumnName("branch_address_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<string>("ChangeStateComment")
|
|
||||||
.HasColumnName("change_state_comment")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long?>("CompanyId")
|
b.Property<long?>("CompanyId")
|
||||||
.HasColumnName("company_id")
|
.HasColumnName("company_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -273,10 +269,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("state")
|
.HasColumnName("state")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<DateTime>("SubmissionDate")
|
|
||||||
.HasColumnName("submission_date")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<long?>("TypeId")
|
b.Property<long?>("TypeId")
|
||||||
.HasColumnName("type_id")
|
.HasColumnName("type_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -342,57 +334,12 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("label_eng")
|
.HasColumnName("label_eng")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<bool>("RequireDeansApproval")
|
|
||||||
.HasColumnName("require_deans_approval")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_internship_types");
|
.HasName("pk_internship_types");
|
||||||
|
|
||||||
b.ToTable("internship_types");
|
b.ToTable("internship_types");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.ReportField", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnName("description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("DescriptionEng")
|
|
||||||
.HasColumnName("description_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("FieldType")
|
|
||||||
.HasColumnName("field_type")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Label")
|
|
||||||
.HasColumnName("label")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("LabelEng")
|
|
||||||
.HasColumnName("label_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("field_discrimnator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnName("field_discrimnator")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_report_fields");
|
|
||||||
|
|
||||||
b.ToTable("report_fields");
|
|
||||||
|
|
||||||
b.HasDiscriminator<string>("field_discrimnator").HasValue("single");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
@ -401,14 +348,18 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnType("bigint")
|
.HasColumnType("bigint")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<int>("Range")
|
||||||
|
.HasColumnName("range")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("SiteAddress")
|
||||||
|
.HasColumnName("site_address")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("State")
|
b.Property<int>("State")
|
||||||
.HasColumnName("state")
|
.HasColumnName("state")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasColumnName("value")
|
|
||||||
.HasColumnType("jsonb");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_report");
|
.HasName("pk_report");
|
||||||
|
|
||||||
@ -544,36 +495,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
b.ToTable("program_subject");
|
b.ToTable("program_subject");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ReportFieldEdition", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("EditionId")
|
|
||||||
.HasColumnName("edition_id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<long>("ReportFieldId")
|
|
||||||
.HasColumnName("report_field_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("EditionId", "ReportFieldId")
|
|
||||||
.HasName("pk_report_field_edition");
|
|
||||||
|
|
||||||
b.HasIndex("ReportFieldId")
|
|
||||||
.HasName("ix_report_field_edition_report_field_id");
|
|
||||||
|
|
||||||
b.ToTable("report_field_edition");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.ReportChoiceField", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("InternshipSystem.Core.Entity.ReportField");
|
|
||||||
|
|
||||||
b.Property<string>("Choices")
|
|
||||||
.HasColumnName("choices")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("choice");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("InternshipSystem.Core.Company", null)
|
b.HasOne("InternshipSystem.Core.Company", null)
|
||||||
@ -625,7 +546,7 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
||||||
.WithMany("Documentation")
|
.WithMany("Documentation")
|
||||||
.HasForeignKey("InternshipId")
|
.HasForeignKey("InternshipId")
|
||||||
.HasConstraintName("fk_document_internships_internship_id");
|
.HasConstraintName("fk_document_internship_internship_id");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
||||||
@ -651,22 +572,22 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
.WithMany("Internships")
|
.WithMany("Internships")
|
||||||
.HasForeignKey("EditionId")
|
.HasForeignKey("EditionId")
|
||||||
.HasConstraintName("fk_internships_editions_edition_id");
|
.HasConstraintName("fk_internship_editions_edition_id");
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("InternshipRegistrationId")
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
.HasConstraintName("fk_internships_internship_registration_internship_registration");
|
.HasConstraintName("fk_internship_internship_registration_internship_registration_");
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Report", "Report")
|
b.HasOne("InternshipSystem.Core.Report", "Report")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("ReportId")
|
.HasForeignKey("ReportId")
|
||||||
.HasConstraintName("fk_internships_report_report_id");
|
.HasConstraintName("fk_internship_report_report_id");
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Student", "Student")
|
b.HasOne("InternshipSystem.Core.Student", "Student")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("StudentId")
|
.HasForeignKey("StudentId")
|
||||||
.HasConstraintName("fk_internships_students_student_id");
|
.HasConstraintName("fk_internship_students_student_id");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
||||||
@ -771,23 +692,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ReportFieldEdition", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
|
||||||
.WithMany("ReportSchema")
|
|
||||||
.HasForeignKey("EditionId")
|
|
||||||
.HasConstraintName("fk_report_field_edition_editions_edition_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.ReportField", "Field")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReportFieldId")
|
|
||||||
.HasConstraintName("fk_report_field_edition_report_fields_report_field_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -4,7 +4,7 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace InternshipSystem.Repository.Migrations
|
namespace InternshipSystem.Repository.Migrations
|
||||||
{
|
{
|
||||||
public partial class Init : Migration
|
public partial class init : Migration
|
||||||
{
|
{
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
{
|
{
|
||||||
@ -60,8 +60,7 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
label = table.Column<string>(nullable: true),
|
label = table.Column<string>(nullable: true),
|
||||||
label_eng = table.Column<string>(nullable: true),
|
label_eng = table.Column<string>(nullable: true),
|
||||||
description = table.Column<string>(nullable: true),
|
description = table.Column<string>(nullable: true),
|
||||||
description_eng = table.Column<string>(nullable: true),
|
description_eng = table.Column<string>(nullable: true)
|
||||||
require_deans_approval = table.Column<bool>(nullable: false)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -75,32 +74,14 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
id = table.Column<long>(nullable: false)
|
id = table.Column<long>(nullable: false)
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
state = table.Column<int>(nullable: false),
|
state = table.Column<int>(nullable: false),
|
||||||
value = table.Column<string>(type: "jsonb", nullable: true)
|
range = table.Column<int>(nullable: false),
|
||||||
|
site_address = table.Column<string>(nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_report", x => x.id);
|
table.PrimaryKey("pk_report", x => x.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "report_fields",
|
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
id = table.Column<long>(nullable: false)
|
|
||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
|
||||||
label = table.Column<string>(nullable: true),
|
|
||||||
label_eng = table.Column<string>(nullable: true),
|
|
||||||
description = table.Column<string>(nullable: true),
|
|
||||||
description_eng = table.Column<string>(nullable: true),
|
|
||||||
field_type = table.Column<int>(nullable: false),
|
|
||||||
field_discrimnator = table.Column<string>(nullable: false),
|
|
||||||
choices = table.Column<string>(nullable: true)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_report_fields", x => x.id);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "static_pages",
|
name: "static_pages",
|
||||||
columns: table => new
|
columns: table => new
|
||||||
@ -190,7 +171,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
company_id = table.Column<long>(nullable: true),
|
company_id = table.Column<long>(nullable: true),
|
||||||
branch_address_id = table.Column<long>(nullable: true),
|
branch_address_id = table.Column<long>(nullable: true),
|
||||||
submission_date = table.Column<DateTime>(nullable: false),
|
|
||||||
start = table.Column<DateTime>(nullable: false),
|
start = table.Column<DateTime>(nullable: false),
|
||||||
end = table.Column<DateTime>(nullable: false),
|
end = table.Column<DateTime>(nullable: false),
|
||||||
first_name = table.Column<string>(nullable: true),
|
first_name = table.Column<string>(nullable: true),
|
||||||
@ -199,8 +179,7 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
phone_number = table.Column<string>(nullable: true),
|
phone_number = table.Column<string>(nullable: true),
|
||||||
type_id = table.Column<long>(nullable: true),
|
type_id = table.Column<long>(nullable: true),
|
||||||
declared_hours = table.Column<int>(nullable: false),
|
declared_hours = table.Column<int>(nullable: false),
|
||||||
state = table.Column<int>(nullable: false),
|
state = table.Column<int>(nullable: false)
|
||||||
change_state_comment = table.Column<string>(nullable: true)
|
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
@ -274,31 +253,7 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
});
|
});
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
migrationBuilder.CreateTable(
|
||||||
name: "report_field_edition",
|
name: "internship",
|
||||||
columns: table => new
|
|
||||||
{
|
|
||||||
edition_id = table.Column<Guid>(nullable: false),
|
|
||||||
report_field_id = table.Column<long>(nullable: false)
|
|
||||||
},
|
|
||||||
constraints: table =>
|
|
||||||
{
|
|
||||||
table.PrimaryKey("pk_report_field_edition", x => new { x.edition_id, x.report_field_id });
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_report_field_edition_editions_edition_id",
|
|
||||||
column: x => x.edition_id,
|
|
||||||
principalTable: "editions",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
table.ForeignKey(
|
|
||||||
name: "fk_report_field_edition_report_fields_report_field_id",
|
|
||||||
column: x => x.report_field_id,
|
|
||||||
principalTable: "report_fields",
|
|
||||||
principalColumn: "id",
|
|
||||||
onDelete: ReferentialAction.Cascade);
|
|
||||||
});
|
|
||||||
|
|
||||||
migrationBuilder.CreateTable(
|
|
||||||
name: "internships",
|
|
||||||
columns: table => new
|
columns: table => new
|
||||||
{
|
{
|
||||||
id = table.Column<long>(nullable: false)
|
id = table.Column<long>(nullable: false)
|
||||||
@ -311,27 +266,27 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_internships", x => x.id);
|
table.PrimaryKey("pk_internship", x => x.id);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_internships_editions_edition_id",
|
name: "fk_internship_editions_edition_id",
|
||||||
column: x => x.edition_id,
|
column: x => x.edition_id,
|
||||||
principalTable: "editions",
|
principalTable: "editions",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_internships_internship_registration_internship_registration",
|
name: "fk_internship_internship_registration_internship_registration_",
|
||||||
column: x => x.internship_registration_id,
|
column: x => x.internship_registration_id,
|
||||||
principalTable: "internship_registration",
|
principalTable: "internship_registration",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_internships_report_report_id",
|
name: "fk_internship_report_report_id",
|
||||||
column: x => x.report_id,
|
column: x => x.report_id,
|
||||||
principalTable: "report",
|
principalTable: "report",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_internships_students_student_id",
|
name: "fk_internship_students_student_id",
|
||||||
column: x => x.student_id,
|
column: x => x.student_id,
|
||||||
principalTable: "students",
|
principalTable: "students",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
@ -371,16 +326,16 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
description = table.Column<string>(nullable: true),
|
description = table.Column<string>(nullable: true),
|
||||||
type = table.Column<int>(nullable: false),
|
type = table.Column<int>(nullable: false),
|
||||||
state = table.Column<int>(nullable: false),
|
state = table.Column<int>(nullable: false),
|
||||||
change_state_comment = table.Column<string>(nullable: true),
|
rejection_reason = table.Column<string>(nullable: true),
|
||||||
internship_id = table.Column<long>(nullable: true)
|
internship_id = table.Column<long>(nullable: true)
|
||||||
},
|
},
|
||||||
constraints: table =>
|
constraints: table =>
|
||||||
{
|
{
|
||||||
table.PrimaryKey("pk_document", x => x.id);
|
table.PrimaryKey("pk_document", x => x.id);
|
||||||
table.ForeignKey(
|
table.ForeignKey(
|
||||||
name: "fk_document_internships_internship_id",
|
name: "fk_document_internship_internship_id",
|
||||||
column: x => x.internship_id,
|
column: x => x.internship_id,
|
||||||
principalTable: "internships",
|
principalTable: "internship",
|
||||||
principalColumn: "id",
|
principalColumn: "id",
|
||||||
onDelete: ReferentialAction.Restrict);
|
onDelete: ReferentialAction.Restrict);
|
||||||
});
|
});
|
||||||
@ -431,6 +386,26 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
table: "editions",
|
table: "editions",
|
||||||
column: "course_id");
|
column: "course_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internship_edition_id",
|
||||||
|
table: "internship",
|
||||||
|
column: "edition_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internship_internship_registration_id",
|
||||||
|
table: "internship",
|
||||||
|
column: "internship_registration_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internship_report_id",
|
||||||
|
table: "internship",
|
||||||
|
column: "report_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internship_student_id",
|
||||||
|
table: "internship",
|
||||||
|
column: "student_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_internship_registration_branch_address_id",
|
name: "ix_internship_registration_branch_address_id",
|
||||||
table: "internship_registration",
|
table: "internship_registration",
|
||||||
@ -446,35 +421,10 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
table: "internship_registration",
|
table: "internship_registration",
|
||||||
column: "type_id");
|
column: "type_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_internships_edition_id",
|
|
||||||
table: "internships",
|
|
||||||
column: "edition_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_internships_internship_registration_id",
|
|
||||||
table: "internships",
|
|
||||||
column: "internship_registration_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_internships_report_id",
|
|
||||||
table: "internships",
|
|
||||||
column: "report_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_internships_student_id",
|
|
||||||
table: "internships",
|
|
||||||
column: "student_id");
|
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
migrationBuilder.CreateIndex(
|
||||||
name: "ix_program_subject_internship_subject_id",
|
name: "ix_program_subject_internship_subject_id",
|
||||||
table: "program_subject",
|
table: "program_subject",
|
||||||
column: "internship_subject_id");
|
column: "internship_subject_id");
|
||||||
|
|
||||||
migrationBuilder.CreateIndex(
|
|
||||||
name: "ix_report_field_edition_report_field_id",
|
|
||||||
table: "report_field_edition",
|
|
||||||
column: "report_field_id");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
@ -491,9 +441,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "program_subject");
|
name: "program_subject");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "report_field_edition");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "static_pages");
|
name: "static_pages");
|
||||||
|
|
||||||
@ -504,10 +451,7 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
name: "internship_subject");
|
name: "internship_subject");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "report_fields");
|
name: "internship");
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
|
||||||
name: "internships");
|
|
||||||
|
|
||||||
migrationBuilder.DropTable(
|
migrationBuilder.DropTable(
|
||||||
name: "editions");
|
name: "editions");
|
@ -1,798 +0,0 @@
|
|||||||
// <auto-generated />
|
|
||||||
using System;
|
|
||||||
using InternshipSystem.Repository;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
||||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Repository.Migrations
|
|
||||||
{
|
|
||||||
[DbContext(typeof(InternshipDbContext))]
|
|
||||||
[Migration("20210111195519_Insurance")]
|
|
||||||
partial class Insurance
|
|
||||||
{
|
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
#pragma warning disable 612, 618
|
|
||||||
modelBuilder
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
|
||||||
.HasAnnotation("ProductVersion", "3.1.4")
|
|
||||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<long?>("CompanyId")
|
|
||||||
.HasColumnName("company_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long>("Provider")
|
|
||||||
.HasColumnName("provider")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_branch_office");
|
|
||||||
|
|
||||||
b.HasIndex("CompanyId")
|
|
||||||
.HasName("ix_branch_office_company_id");
|
|
||||||
|
|
||||||
b.ToTable("branch_office");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Company", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnName("name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Nip")
|
|
||||||
.HasColumnName("nip")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long>("Provider")
|
|
||||||
.HasColumnName("provider")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_companies");
|
|
||||||
|
|
||||||
b.ToTable("companies");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Document", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("ChangeStateComment")
|
|
||||||
.HasColumnName("change_state_comment")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnName("description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long?>("InternshipId")
|
|
||||||
.HasColumnName("internship_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<int>("State")
|
|
||||||
.HasColumnName("state")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<int>("Type")
|
|
||||||
.HasColumnName("type")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_document");
|
|
||||||
|
|
||||||
b.HasIndex("InternshipId")
|
|
||||||
.HasName("ix_document_internship_id");
|
|
||||||
|
|
||||||
b.ToTable("document");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("DocumentId")
|
|
||||||
.HasColumnName("document_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<byte[]>("File")
|
|
||||||
.HasColumnName("file")
|
|
||||||
.HasColumnType("bytea");
|
|
||||||
|
|
||||||
b.Property<string>("Filename")
|
|
||||||
.HasColumnName("filename")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Mime")
|
|
||||||
.HasColumnName("mime")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long>("Size")
|
|
||||||
.HasColumnName("size")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("DocumentId")
|
|
||||||
.HasName("pk_document_scan");
|
|
||||||
|
|
||||||
b.ToTable("document_scan");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<long?>("CourseId")
|
|
||||||
.HasColumnName("course_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<DateTime>("EditionFinish")
|
|
||||||
.HasColumnName("edition_finish")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("EditionStart")
|
|
||||||
.HasColumnName("edition_start")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("ReportingStart")
|
|
||||||
.HasColumnName("reporting_start")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_editions");
|
|
||||||
|
|
||||||
b.HasIndex("CourseId")
|
|
||||||
.HasName("ix_editions_course_id");
|
|
||||||
|
|
||||||
b.ToTable("editions");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Course", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Name")
|
|
||||||
.HasColumnName("name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("NameEng")
|
|
||||||
.HasColumnName("name_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_courses");
|
|
||||||
|
|
||||||
b.ToTable("courses");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.Internship", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<Guid?>("EditionId")
|
|
||||||
.HasColumnName("edition_id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<float?>("Grade")
|
|
||||||
.HasColumnName("grade")
|
|
||||||
.HasColumnType("real");
|
|
||||||
|
|
||||||
b.Property<long?>("InternshipRegistrationId")
|
|
||||||
.HasColumnName("internship_registration_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long?>("ReportId")
|
|
||||||
.HasColumnName("report_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long?>("StudentId")
|
|
||||||
.HasColumnName("student_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_internships");
|
|
||||||
|
|
||||||
b.HasIndex("EditionId")
|
|
||||||
.HasName("ix_internships_edition_id");
|
|
||||||
|
|
||||||
b.HasIndex("InternshipRegistrationId")
|
|
||||||
.HasName("ix_internships_internship_registration_id");
|
|
||||||
|
|
||||||
b.HasIndex("ReportId")
|
|
||||||
.HasName("ix_internships_report_id");
|
|
||||||
|
|
||||||
b.HasIndex("StudentId")
|
|
||||||
.HasName("ix_internships_student_id");
|
|
||||||
|
|
||||||
b.ToTable("internships");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<long?>("BranchAddressId")
|
|
||||||
.HasColumnName("branch_address_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<string>("ChangeStateComment")
|
|
||||||
.HasColumnName("change_state_comment")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long?>("CompanyId")
|
|
||||||
.HasColumnName("company_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<int>("DeclaredHours")
|
|
||||||
.HasColumnName("declared_hours")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<DateTime>("End")
|
|
||||||
.HasColumnName("end")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<DateTime>("Start")
|
|
||||||
.HasColumnName("start")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<int>("State")
|
|
||||||
.HasColumnName("state")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<DateTime>("SubmissionDate")
|
|
||||||
.HasColumnName("submission_date")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<long?>("TypeId")
|
|
||||||
.HasColumnName("type_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_internship_registration");
|
|
||||||
|
|
||||||
b.HasIndex("BranchAddressId")
|
|
||||||
.HasName("ix_internship_registration_branch_address_id");
|
|
||||||
|
|
||||||
b.HasIndex("CompanyId")
|
|
||||||
.HasName("ix_internship_registration_company_id");
|
|
||||||
|
|
||||||
b.HasIndex("TypeId")
|
|
||||||
.HasName("ix_internship_registration_type_id");
|
|
||||||
|
|
||||||
b.ToTable("internship_registration");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipSubject", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnName("description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("DescriptionEng")
|
|
||||||
.HasColumnName("description_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_internship_subject");
|
|
||||||
|
|
||||||
b.ToTable("internship_subject");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipType", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnName("description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("DescriptionEng")
|
|
||||||
.HasColumnName("description_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Label")
|
|
||||||
.HasColumnName("label")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("LabelEng")
|
|
||||||
.HasColumnName("label_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<bool>("RequireDeansApproval")
|
|
||||||
.HasColumnName("require_deans_approval")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("RequireInsurance")
|
|
||||||
.HasColumnName("require_insurance")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_internship_types");
|
|
||||||
|
|
||||||
b.ToTable("internship_types");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.ReportField", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnName("description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("DescriptionEng")
|
|
||||||
.HasColumnName("description_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("FieldType")
|
|
||||||
.HasColumnName("field_type")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Label")
|
|
||||||
.HasColumnName("label")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("LabelEng")
|
|
||||||
.HasColumnName("label_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("field_discrimnator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnName("field_discrimnator")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_report_fields");
|
|
||||||
|
|
||||||
b.ToTable("report_fields");
|
|
||||||
|
|
||||||
b.HasDiscriminator<string>("field_discrimnator").HasValue("single");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<int>("State")
|
|
||||||
.HasColumnName("state")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasColumnName("value")
|
|
||||||
.HasColumnType("jsonb");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_report");
|
|
||||||
|
|
||||||
b.ToTable("report");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.StaticPage", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("AccessName")
|
|
||||||
.HasColumnName("access_name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Content")
|
|
||||||
.HasColumnName("content")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("ContentEng")
|
|
||||||
.HasColumnName("content_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Title")
|
|
||||||
.HasColumnName("title")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("TitleEng")
|
|
||||||
.HasColumnName("title_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_static_pages");
|
|
||||||
|
|
||||||
b.ToTable("static_pages");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Student", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<int>("AlbumNumber")
|
|
||||||
.HasColumnName("album_number")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Course")
|
|
||||||
.HasColumnName("course")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Email")
|
|
||||||
.HasColumnName("email")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("FirstName")
|
|
||||||
.HasColumnName("first_name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("LastName")
|
|
||||||
.HasColumnName("last_name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int?>("Semester")
|
|
||||||
.HasColumnName("semester")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_students");
|
|
||||||
|
|
||||||
b.ToTable("students");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionInternshipType", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("EditionId")
|
|
||||||
.HasColumnName("edition_id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<long>("InternshipTypeId")
|
|
||||||
.HasColumnName("internship_type_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("EditionId", "InternshipTypeId")
|
|
||||||
.HasName("pk_edition_internship_type");
|
|
||||||
|
|
||||||
b.HasIndex("InternshipTypeId")
|
|
||||||
.HasName("ix_edition_internship_type_internship_type_id");
|
|
||||||
|
|
||||||
b.ToTable("edition_internship_type");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("EditionId")
|
|
||||||
.HasColumnName("edition_id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<long>("InternshipSubjectId")
|
|
||||||
.HasColumnName("internship_subject_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("EditionId", "InternshipSubjectId")
|
|
||||||
.HasName("pk_edition_subject");
|
|
||||||
|
|
||||||
b.HasIndex("InternshipSubjectId")
|
|
||||||
.HasName("ix_edition_subject_internship_subject_id");
|
|
||||||
|
|
||||||
b.ToTable("edition_subject");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("InternshipRegistrationId")
|
|
||||||
.HasColumnName("internship_registration_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.Property<long>("InternshipSubjectId")
|
|
||||||
.HasColumnName("internship_subject_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("InternshipRegistrationId", "InternshipSubjectId")
|
|
||||||
.HasName("pk_program_subject");
|
|
||||||
|
|
||||||
b.HasIndex("InternshipSubjectId")
|
|
||||||
.HasName("ix_program_subject_internship_subject_id");
|
|
||||||
|
|
||||||
b.ToTable("program_subject");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ReportFieldEdition", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("EditionId")
|
|
||||||
.HasColumnName("edition_id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<long>("ReportFieldId")
|
|
||||||
.HasColumnName("report_field_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("EditionId", "ReportFieldId")
|
|
||||||
.HasName("pk_report_field_edition");
|
|
||||||
|
|
||||||
b.HasIndex("ReportFieldId")
|
|
||||||
.HasName("ix_report_field_edition_report_field_id");
|
|
||||||
|
|
||||||
b.ToTable("report_field_edition");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.ReportChoiceField", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("InternshipSystem.Core.Entity.ReportField");
|
|
||||||
|
|
||||||
b.Property<string>("Choices")
|
|
||||||
.HasColumnName("choices")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("choice");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Company", null)
|
|
||||||
.WithMany("Branches")
|
|
||||||
.HasForeignKey("CompanyId")
|
|
||||||
.HasConstraintName("fk_branch_office_companies_company_id");
|
|
||||||
|
|
||||||
b.OwnsOne("InternshipSystem.Core.BranchAddress", "Address", b1 =>
|
|
||||||
{
|
|
||||||
b1.Property<long>("BranchOfficeId")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b1.Property<string>("Building")
|
|
||||||
.HasColumnName("building")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("City")
|
|
||||||
.HasColumnName("city")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("Country")
|
|
||||||
.HasColumnName("country")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("PostalCode")
|
|
||||||
.HasColumnName("postal_code")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("Street")
|
|
||||||
.HasColumnName("street")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.HasKey("BranchOfficeId")
|
|
||||||
.HasName("pk_branch_office");
|
|
||||||
|
|
||||||
b1.ToTable("branch_office");
|
|
||||||
|
|
||||||
b1.WithOwner()
|
|
||||||
.HasForeignKey("BranchOfficeId")
|
|
||||||
.HasConstraintName("fk_branch_address_branch_office_branch_office_id");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Document", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
|
||||||
.WithMany("Documentation")
|
|
||||||
.HasForeignKey("InternshipId")
|
|
||||||
.HasConstraintName("fk_document_internships_internship_id");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Document", "Document")
|
|
||||||
.WithOne("Scan")
|
|
||||||
.HasForeignKey("InternshipSystem.Core.DocumentScan", "DocumentId")
|
|
||||||
.HasConstraintName("fk_document_scan_document_document_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Course", "Course")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CourseId")
|
|
||||||
.HasConstraintName("fk_editions_courses_course_id");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.Internship", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
|
||||||
.WithMany("Internships")
|
|
||||||
.HasForeignKey("EditionId")
|
|
||||||
.HasConstraintName("fk_internships_editions_edition_id");
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("InternshipRegistrationId")
|
|
||||||
.HasConstraintName("fk_internships_internship_registration_internship_registration");
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Report", "Report")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReportId")
|
|
||||||
.HasConstraintName("fk_internships_report_report_id");
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Student", "Student")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("StudentId")
|
|
||||||
.HasConstraintName("fk_internships_students_student_id");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.BranchOffice", "BranchAddress")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("BranchAddressId")
|
|
||||||
.HasConstraintName("fk_internship_registration_branch_office_branch_address_id");
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Company", "Company")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("CompanyId")
|
|
||||||
.HasConstraintName("fk_internship_registration_companies_company_id");
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipType", "Type")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("TypeId")
|
|
||||||
.HasConstraintName("fk_internship_registration_internship_types_type_id");
|
|
||||||
|
|
||||||
b.OwnsOne("InternshipSystem.Core.Mentor", "Mentor", b1 =>
|
|
||||||
{
|
|
||||||
b1.Property<long>("InternshipRegistrationId")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b1.Property<string>("Email")
|
|
||||||
.HasColumnName("email")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("FirstName")
|
|
||||||
.HasColumnName("first_name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("LastName")
|
|
||||||
.HasColumnName("last_name")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.Property<string>("PhoneNumber")
|
|
||||||
.HasColumnName("phone_number")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b1.HasKey("InternshipRegistrationId")
|
|
||||||
.HasName("pk_internship_registration");
|
|
||||||
|
|
||||||
b1.ToTable("internship_registration");
|
|
||||||
|
|
||||||
b1.WithOwner()
|
|
||||||
.HasForeignKey("InternshipRegistrationId")
|
|
||||||
.HasConstraintName("fk_mentor_internship_registration_internship_registration_id");
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionInternshipType", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
|
||||||
.WithMany("AvailableInternshipTypes")
|
|
||||||
.HasForeignKey("EditionId")
|
|
||||||
.HasConstraintName("fk_edition_internship_type_editions_edition_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipType", "InternshipType")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("InternshipTypeId")
|
|
||||||
.HasConstraintName("fk_edition_internship_type_internship_types_internship_type_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
|
||||||
.WithMany("AvailableSubjects")
|
|
||||||
.HasForeignKey("EditionId")
|
|
||||||
.HasConstraintName("fk_edition_subject_editions_edition_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("InternshipSubjectId")
|
|
||||||
.HasConstraintName("fk_edition_subject_internship_subject_internship_subject_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "Registration")
|
|
||||||
.WithMany("Subjects")
|
|
||||||
.HasForeignKey("InternshipRegistrationId")
|
|
||||||
.HasConstraintName("fk_program_subject_internship_registration_internship_registrat")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("InternshipSubjectId")
|
|
||||||
.HasConstraintName("fk_program_subject_internship_subject_internship_subject_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ReportFieldEdition", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
|
||||||
.WithMany("ReportSchema")
|
|
||||||
.HasForeignKey("EditionId")
|
|
||||||
.HasConstraintName("fk_report_field_edition_editions_edition_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.ReportField", "Field")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReportFieldId")
|
|
||||||
.HasConstraintName("fk_report_field_edition_report_fields_report_field_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,23 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore.Migrations;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Repository.Migrations
|
|
||||||
{
|
|
||||||
public partial class Insurance : Migration
|
|
||||||
{
|
|
||||||
protected override void Up(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.AddColumn<bool>(
|
|
||||||
name: "require_insurance",
|
|
||||||
table: "internship_types",
|
|
||||||
nullable: false,
|
|
||||||
defaultValue: false);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected override void Down(MigrationBuilder migrationBuilder)
|
|
||||||
{
|
|
||||||
migrationBuilder.DropColumn(
|
|
||||||
name: "require_insurance",
|
|
||||||
table: "internship_types");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -78,10 +78,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnType("bigint")
|
.HasColumnType("bigint")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
b.Property<string>("ChangeStateComment")
|
|
||||||
.HasColumnName("change_state_comment")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
b.Property<string>("Description")
|
||||||
.HasColumnName("description")
|
.HasColumnName("description")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
@ -90,6 +86,10 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("internship_id")
|
.HasColumnName("internship_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<string>("RejectionReason")
|
||||||
|
.HasColumnName("rejection_reason")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("State")
|
b.Property<int>("State")
|
||||||
.HasColumnName("state")
|
.HasColumnName("state")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
@ -218,21 +218,21 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_internships");
|
.HasName("pk_internship");
|
||||||
|
|
||||||
b.HasIndex("EditionId")
|
b.HasIndex("EditionId")
|
||||||
.HasName("ix_internships_edition_id");
|
.HasName("ix_internship_edition_id");
|
||||||
|
|
||||||
b.HasIndex("InternshipRegistrationId")
|
b.HasIndex("InternshipRegistrationId")
|
||||||
.HasName("ix_internships_internship_registration_id");
|
.HasName("ix_internship_internship_registration_id");
|
||||||
|
|
||||||
b.HasIndex("ReportId")
|
b.HasIndex("ReportId")
|
||||||
.HasName("ix_internships_report_id");
|
.HasName("ix_internship_report_id");
|
||||||
|
|
||||||
b.HasIndex("StudentId")
|
b.HasIndex("StudentId")
|
||||||
.HasName("ix_internships_student_id");
|
.HasName("ix_internship_student_id");
|
||||||
|
|
||||||
b.ToTable("internships");
|
b.ToTable("internship");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
||||||
@ -247,10 +247,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("branch_address_id")
|
.HasColumnName("branch_address_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
b.Property<string>("ChangeStateComment")
|
|
||||||
.HasColumnName("change_state_comment")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<long?>("CompanyId")
|
b.Property<long?>("CompanyId")
|
||||||
.HasColumnName("company_id")
|
.HasColumnName("company_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -271,10 +267,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("state")
|
.HasColumnName("state")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<DateTime>("SubmissionDate")
|
|
||||||
.HasColumnName("submission_date")
|
|
||||||
.HasColumnType("timestamp without time zone");
|
|
||||||
|
|
||||||
b.Property<long?>("TypeId")
|
b.Property<long?>("TypeId")
|
||||||
.HasColumnName("type_id")
|
.HasColumnName("type_id")
|
||||||
.HasColumnType("bigint");
|
.HasColumnType("bigint");
|
||||||
@ -340,61 +332,12 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnName("label_eng")
|
.HasColumnName("label_eng")
|
||||||
.HasColumnType("text");
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<bool>("RequireDeansApproval")
|
|
||||||
.HasColumnName("require_deans_approval")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.Property<bool>("RequireInsurance")
|
|
||||||
.HasColumnName("require_insurance")
|
|
||||||
.HasColumnType("boolean");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_internship_types");
|
.HasName("pk_internship_types");
|
||||||
|
|
||||||
b.ToTable("internship_types");
|
b.ToTable("internship_types");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.ReportField", b =>
|
|
||||||
{
|
|
||||||
b.Property<long>("Id")
|
|
||||||
.ValueGeneratedOnAdd()
|
|
||||||
.HasColumnName("id")
|
|
||||||
.HasColumnType("bigint")
|
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
|
||||||
|
|
||||||
b.Property<string>("Description")
|
|
||||||
.HasColumnName("description")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("DescriptionEng")
|
|
||||||
.HasColumnName("description_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<int>("FieldType")
|
|
||||||
.HasColumnName("field_type")
|
|
||||||
.HasColumnType("integer");
|
|
||||||
|
|
||||||
b.Property<string>("Label")
|
|
||||||
.HasColumnName("label")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("LabelEng")
|
|
||||||
.HasColumnName("label_eng")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.Property<string>("field_discrimnator")
|
|
||||||
.IsRequired()
|
|
||||||
.HasColumnName("field_discrimnator")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
|
||||||
.HasName("pk_report_fields");
|
|
||||||
|
|
||||||
b.ToTable("report_fields");
|
|
||||||
|
|
||||||
b.HasDiscriminator<string>("field_discrimnator").HasValue("single");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
||||||
{
|
{
|
||||||
b.Property<long>("Id")
|
b.Property<long>("Id")
|
||||||
@ -403,14 +346,18 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.HasColumnType("bigint")
|
.HasColumnType("bigint")
|
||||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<int>("Range")
|
||||||
|
.HasColumnName("range")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("SiteAddress")
|
||||||
|
.HasColumnName("site_address")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
b.Property<int>("State")
|
b.Property<int>("State")
|
||||||
.HasColumnName("state")
|
.HasColumnName("state")
|
||||||
.HasColumnType("integer");
|
.HasColumnType("integer");
|
||||||
|
|
||||||
b.Property<string>("Value")
|
|
||||||
.HasColumnName("value")
|
|
||||||
.HasColumnType("jsonb");
|
|
||||||
|
|
||||||
b.HasKey("Id")
|
b.HasKey("Id")
|
||||||
.HasName("pk_report");
|
.HasName("pk_report");
|
||||||
|
|
||||||
@ -546,36 +493,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
b.ToTable("program_subject");
|
b.ToTable("program_subject");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ReportFieldEdition", b =>
|
|
||||||
{
|
|
||||||
b.Property<Guid>("EditionId")
|
|
||||||
.HasColumnName("edition_id")
|
|
||||||
.HasColumnType("uuid");
|
|
||||||
|
|
||||||
b.Property<long>("ReportFieldId")
|
|
||||||
.HasColumnName("report_field_id")
|
|
||||||
.HasColumnType("bigint");
|
|
||||||
|
|
||||||
b.HasKey("EditionId", "ReportFieldId")
|
|
||||||
.HasName("pk_report_field_edition");
|
|
||||||
|
|
||||||
b.HasIndex("ReportFieldId")
|
|
||||||
.HasName("ix_report_field_edition_report_field_id");
|
|
||||||
|
|
||||||
b.ToTable("report_field_edition");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.ReportChoiceField", b =>
|
|
||||||
{
|
|
||||||
b.HasBaseType("InternshipSystem.Core.Entity.ReportField");
|
|
||||||
|
|
||||||
b.Property<string>("Choices")
|
|
||||||
.HasColumnName("choices")
|
|
||||||
.HasColumnType("text");
|
|
||||||
|
|
||||||
b.HasDiscriminator().HasValue("choice");
|
|
||||||
});
|
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
||||||
{
|
{
|
||||||
b.HasOne("InternshipSystem.Core.Company", null)
|
b.HasOne("InternshipSystem.Core.Company", null)
|
||||||
@ -627,7 +544,7 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
||||||
.WithMany("Documentation")
|
.WithMany("Documentation")
|
||||||
.HasForeignKey("InternshipId")
|
.HasForeignKey("InternshipId")
|
||||||
.HasConstraintName("fk_document_internships_internship_id");
|
.HasConstraintName("fk_document_internship_internship_id");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
||||||
@ -653,22 +570,22 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
.WithMany("Internships")
|
.WithMany("Internships")
|
||||||
.HasForeignKey("EditionId")
|
.HasForeignKey("EditionId")
|
||||||
.HasConstraintName("fk_internships_editions_edition_id");
|
.HasConstraintName("fk_internship_editions_edition_id");
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("InternshipRegistrationId")
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
.HasConstraintName("fk_internships_internship_registration_internship_registration");
|
.HasConstraintName("fk_internship_internship_registration_internship_registration_");
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Report", "Report")
|
b.HasOne("InternshipSystem.Core.Report", "Report")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("ReportId")
|
.HasForeignKey("ReportId")
|
||||||
.HasConstraintName("fk_internships_report_report_id");
|
.HasConstraintName("fk_internship_report_report_id");
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Student", "Student")
|
b.HasOne("InternshipSystem.Core.Student", "Student")
|
||||||
.WithMany()
|
.WithMany()
|
||||||
.HasForeignKey("StudentId")
|
.HasForeignKey("StudentId")
|
||||||
.HasConstraintName("fk_internships_students_student_id");
|
.HasConstraintName("fk_internship_students_student_id");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipRegistration", b =>
|
||||||
@ -773,23 +690,6 @@ namespace InternshipSystem.Repository.Migrations
|
|||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ReportFieldEdition", b =>
|
|
||||||
{
|
|
||||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
|
||||||
.WithMany("ReportSchema")
|
|
||||||
.HasForeignKey("EditionId")
|
|
||||||
.HasConstraintName("fk_report_field_edition_editions_edition_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
b.HasOne("InternshipSystem.Core.Entity.ReportField", "Field")
|
|
||||||
.WithMany()
|
|
||||||
.HasForeignKey("ReportFieldId")
|
|
||||||
.HasConstraintName("fk_report_field_edition_report_fields_report_field_id")
|
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
|
||||||
.IsRequired();
|
|
||||||
});
|
|
||||||
#pragma warning restore 612, 618
|
#pragma warning restore 612, 618
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -123,6 +123,7 @@ namespace InternshipSystem.Api.Test
|
|||||||
.Include(i => i.InternshipRegistration)
|
.Include(i => i.InternshipRegistration)
|
||||||
.ThenInclude(c => c.Subjects)
|
.ThenInclude(c => c.Subjects)
|
||||||
.Where(i => i.Student.Id == user.PersonNumber)
|
.Where(i => i.Student.Id == user.PersonNumber)
|
||||||
|
.Select(i => i.InternshipRegistration)
|
||||||
.First();
|
.First();
|
||||||
|
|
||||||
var useCase = new UpdateInternshipRegistrationUseCase(db, ir, ed, user);
|
var useCase = new UpdateInternshipRegistrationUseCase(db, ir, ed, user);
|
||||||
@ -160,6 +161,7 @@ namespace InternshipSystem.Api.Test
|
|||||||
.Include(i => i.InternshipRegistration)
|
.Include(i => i.InternshipRegistration)
|
||||||
.ThenInclude(c => c.Subjects)
|
.ThenInclude(c => c.Subjects)
|
||||||
.Where(i => i.Student.Id == user.PersonNumber)
|
.Where(i => i.Student.Id == user.PersonNumber)
|
||||||
|
.Select(i => i.InternshipRegistration)
|
||||||
.First();
|
.First();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user