doroboty #53
@ -21,6 +21,8 @@ namespace InternshipSystem.Api
|
|||||||
|
|
||||||
CreateMap<Edition, EditionConfigurationResult>();
|
CreateMap<Edition, EditionConfigurationResult>();
|
||||||
|
|
||||||
|
CreateMap<InternshipSubject, InternshipSubject>();
|
||||||
|
|
||||||
CreateMap<EditionSubject, InternshipSubject>().IncludeMembers(es => es.Subject);
|
CreateMap<EditionSubject, InternshipSubject>().IncludeMembers(es => es.Subject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
|
|
||||||
[HttpGet("loginEdition")]
|
[HttpGet("loginEdition")]
|
||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> LoginIntoEdition(Guid editionId, [FromServices] User user, CancellationToken token)
|
public async Task<ActionResult> LoginIntoEdition([FromBody] Guid editionId, [FromServices] User user, CancellationToken token)
|
||||||
{
|
{
|
||||||
var edition = await _context.Editions.FindAsync(editionId);
|
var edition = await _context.Editions.FindAsync(editionId);
|
||||||
|
|
||||||
|
@ -18,14 +18,12 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
[Route("companies")]
|
[Route("companies")]
|
||||||
public class CompaniesController : ControllerBase
|
public class CompaniesController : ControllerBase
|
||||||
{
|
{
|
||||||
public CompaniesController(InternshipDbContext context, InternshipPractiseSupervisorDbContext practiseSupervisorDbContext)
|
public CompaniesController(InternshipDbContext context)
|
||||||
{
|
{
|
||||||
Context = context;
|
Context = context;
|
||||||
PractiseSupervisorDbContext = practiseSupervisorDbContext;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private InternshipDbContext Context { get; }
|
private InternshipDbContext Context { get; }
|
||||||
private InternshipPractiseSupervisorDbContext PractiseSupervisorDbContext { get; }
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Get companies matching provided paginated query
|
/// Get companies matching provided paginated query
|
||||||
@ -94,7 +92,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
|
|
||||||
if (companyForm.Id.HasValue)
|
if (companyForm.Id.HasValue)
|
||||||
{
|
{
|
||||||
var companyToUpdate = await PractiseSupervisorDbContext.Companies.FindAsync(companyForm.Id);
|
var companyToUpdate = await Context.Companies.FindAsync(companyForm.Id);
|
||||||
|
|
||||||
if (companyToUpdate != null)
|
if (companyToUpdate != null)
|
||||||
{
|
{
|
||||||
@ -113,10 +111,10 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
Name = companyForm.Name,
|
Name = companyForm.Name,
|
||||||
Nip = companyForm.Nip,
|
Nip = companyForm.Nip,
|
||||||
};
|
};
|
||||||
await PractiseSupervisorDbContext.Companies.AddAsync(newCompany, cancellationToken);
|
await Context.Companies.AddAsync(newCompany, cancellationToken);
|
||||||
}
|
}
|
||||||
|
|
||||||
await PractiseSupervisorDbContext.SaveChangesAsync(cancellationToken);
|
await Context.SaveChangesAsync(cancellationToken);
|
||||||
return Ok($"Company updated successfully");
|
return Ok($"Company updated successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -135,7 +133,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<ActionResult> DeleteCompany(long companyId, CancellationToken cancellationToken)
|
public async Task<ActionResult> DeleteCompany(long companyId, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var companyToDelete = await PractiseSupervisorDbContext.Companies
|
var companyToDelete = await Context.Companies
|
||||||
.Include(c => c.Branches)
|
.Include(c => c.Branches)
|
||||||
.FirstOrDefaultAsync(c => c.Id.Equals(companyId), cancellationToken: cancellationToken);
|
.FirstOrDefaultAsync(c => c.Id.Equals(companyId), cancellationToken: cancellationToken);
|
||||||
|
|
||||||
@ -144,9 +142,9 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
return NotFound($"Company with id: {companyId} does not exist");
|
return NotFound($"Company with id: {companyId} does not exist");
|
||||||
}
|
}
|
||||||
|
|
||||||
PractiseSupervisorDbContext.Companies.Attach(companyToDelete);
|
Context.Companies.Attach(companyToDelete);
|
||||||
PractiseSupervisorDbContext.Companies.Remove(companyToDelete);
|
Context.Companies.Remove(companyToDelete);
|
||||||
await PractiseSupervisorDbContext.SaveChangesAsync(cancellationToken);
|
await Context.SaveChangesAsync(cancellationToken);
|
||||||
return Ok($"Company with id: {companyId} deleted successfully");
|
return Ok($"Company with id: {companyId} deleted successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +172,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
return BadRequest(validationResult.ToString());
|
return BadRequest(validationResult.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
var company = await PractiseSupervisorDbContext.Companies
|
var company = await Context.Companies
|
||||||
.Include(c => c.Branches)
|
.Include(c => c.Branches)
|
||||||
.FirstOrDefaultAsync(c => c.Id.Equals(companyId), cancellationToken: cancellationToken);
|
.FirstOrDefaultAsync(c => c.Id.Equals(companyId), cancellationToken: cancellationToken);
|
||||||
|
|
||||||
@ -214,7 +212,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
company.Branches.Add(newBranchOffice);
|
company.Branches.Add(newBranchOffice);
|
||||||
}
|
}
|
||||||
|
|
||||||
await PractiseSupervisorDbContext.SaveChangesAsync(cancellationToken);
|
await Context.SaveChangesAsync(cancellationToken);
|
||||||
return Ok($"Branch office updated successfully");
|
return Ok($"Branch office updated successfully");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,7 +232,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
public async Task<ActionResult> DeleteBranch(long branchOfficeId, CancellationToken cancellationToken)
|
public async Task<ActionResult> DeleteBranch(long branchOfficeId, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var company =
|
var company =
|
||||||
await PractiseSupervisorDbContext.Companies
|
await Context.Companies
|
||||||
.Include(c => c.Branches)
|
.Include(c => c.Branches)
|
||||||
.Where(c => c.Branches.Any(b => b.Id.Equals(branchOfficeId)))
|
.Where(c => c.Branches.Any(b => b.Id.Equals(branchOfficeId)))
|
||||||
.FirstOrDefaultAsync(cancellationToken: cancellationToken);
|
.FirstOrDefaultAsync(cancellationToken: cancellationToken);
|
||||||
@ -247,7 +245,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
var branchOffice = company.Branches.Find(b => b.Id.Equals(branchOfficeId));
|
var branchOffice = company.Branches.Find(b => b.Id.Equals(branchOfficeId));
|
||||||
company.Branches.Remove(branchOffice);
|
company.Branches.Remove(branchOffice);
|
||||||
|
|
||||||
await PractiseSupervisorDbContext.SaveChangesAsync(cancellationToken);
|
await Context.SaveChangesAsync(cancellationToken);
|
||||||
return Ok($"Branch office with id: {branchOfficeId} deleted successfully");
|
return Ok($"Branch office with id: {branchOfficeId} deleted successfully");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -46,7 +46,7 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
return BadRequest(validationResult.ToString());
|
return BadRequest(validationResult.ToString());
|
||||||
}
|
}
|
||||||
|
|
||||||
return await _internshipService.AddDocumentToInternship(documentRequest, user.PersonNumber, cancellationToken);
|
return await _internshipService.AddDocumentToInternship(documentRequest, user, cancellationToken);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -66,12 +66,13 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
[HttpGet("{id}")]
|
[HttpGet("{id}")]
|
||||||
[ProducesResponseType(StatusCodes.Status200OK)]
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
[Authorize(Policy = Policies.RegisteredOnly)]
|
[Authorize]
|
||||||
public async Task<ActionResult<EditionConfigurationResult>> GetEditionsConfiguration(Guid id, CancellationToken token)
|
public async Task<ActionResult<EditionConfigurationResult>> GetEditionsConfiguration(Guid id, CancellationToken token)
|
||||||
{
|
{
|
||||||
var edition =
|
var edition =
|
||||||
await Context.Editions
|
await Context.Editions
|
||||||
.Include(e => e.AvailableSubjects)
|
.Include(e => e.AvailableSubjects)
|
||||||
|
.Include(e => e.Course)
|
||||||
.Where(e => e.Id.Equals(id))
|
.Where(e => e.Id.Equals(id))
|
||||||
.ProjectTo<EditionConfigurationResult>(Mapper.ConfigurationProvider)
|
.ProjectTo<EditionConfigurationResult>(Mapper.ConfigurationProvider)
|
||||||
.FirstOrDefaultAsync(token);
|
.FirstOrDefaultAsync(token);
|
||||||
|
@ -6,6 +6,9 @@ using InternshipSystem.Api.Security;
|
|||||||
using InternshipSystem.Api.UseCases;
|
using InternshipSystem.Api.UseCases;
|
||||||
using InternshipSystem.Repository;
|
using InternshipSystem.Repository;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using InternshipSystem.Api.Services;
|
||||||
|
using InternshipSystem.Core;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
@ -15,11 +18,11 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
[Route("internshipRegistration")]
|
[Route("internshipRegistration")]
|
||||||
public class InternshipRegistrationController : ControllerBase
|
public class InternshipRegistrationController : ControllerBase
|
||||||
{
|
{
|
||||||
private readonly InternshipDbContext _dbContext;
|
private readonly InternshipDbContext _context;
|
||||||
|
|
||||||
public InternshipRegistrationController(InternshipDbContext dbContext)
|
public InternshipRegistrationController(InternshipDbContext dbContext)
|
||||||
{
|
{
|
||||||
_dbContext = dbContext;
|
_context = dbContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -38,10 +41,10 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
[FromServices] User user,
|
[FromServices] User user,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var edition = await _dbContext.Editions.FirstAsync(e => e.Id == user.EditionId, cancellationToken);
|
var edition = await _context.Editions.FirstAsync(e => e.Id == user.EditionId, cancellationToken);
|
||||||
|
|
||||||
var internshipRegistration =
|
var internshipRegistration =
|
||||||
await _dbContext
|
await _context
|
||||||
.Entry(edition)
|
.Entry(edition)
|
||||||
.Collection(e => e.Internships)
|
.Collection(e => e.Internships)
|
||||||
.Query()
|
.Query()
|
||||||
@ -52,13 +55,41 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
.ThenInclude(c => c.Branches)
|
.ThenInclude(c => c.Branches)
|
||||||
.FirstAsync(cancellationToken);
|
.FirstAsync(cancellationToken);
|
||||||
|
|
||||||
var useCase = new UpdateInternshipRegistrationUseCase(_dbContext, internshipRegistration, edition, user);
|
var useCase = new UpdateInternshipRegistrationUseCase(_context, internshipRegistration, edition, user);
|
||||||
|
|
||||||
var result = await useCase.UpdateInternshipRegistration(registrationCommand, cancellationToken);
|
var result = await useCase.UpdateInternshipRegistration(registrationCommand, cancellationToken);
|
||||||
|
|
||||||
await _dbContext.SaveChangesAsync(cancellationToken);
|
await _context.SaveChangesAsync(cancellationToken);
|
||||||
|
|
||||||
return Ok(result);
|
return Ok(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status400BadRequest)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[Authorize(Policy = Policies.RegisteredOnly)]
|
||||||
|
public async Task<ActionResult<Internship>> GetCurrentEditionInternship([FromServices] User user, CancellationToken cancellationToken)
|
||||||
|
{
|
||||||
|
var edition = await _context.Editions
|
||||||
|
.FindAsync(user.EditionId);
|
||||||
|
|
||||||
|
var internship = await _context.Entry(edition)
|
||||||
|
.Collection(e => e.Internships)
|
||||||
|
.Query()
|
||||||
|
.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.InternshipProgram)
|
||||||
|
.Include(i => i.Report)
|
||||||
|
.Include(i => i.Approvals)
|
||||||
|
.Include(i => i.Documentation)
|
||||||
|
.SingleAsync(i => i.Student.Id == user.PersonNumber, cancellationToken);
|
||||||
|
|
||||||
|
internship.Edition = null;
|
||||||
|
return Ok(internship);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -6,6 +6,7 @@ using InternshipSystem.Repository;
|
|||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Http;
|
using Microsoft.AspNetCore.Http;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Controllers
|
namespace InternshipSystem.Api.Controllers
|
||||||
{
|
{
|
||||||
@ -35,20 +36,21 @@ namespace InternshipSystem.Api.Controllers
|
|||||||
[Authorize]
|
[Authorize]
|
||||||
public async Task<IActionResult> RegisterStudentForEdition([FromBody] Guid registrationCode, [FromServices] User user, CancellationToken token)
|
public async Task<IActionResult> RegisterStudentForEdition([FromBody] Guid registrationCode, [FromServices] User user, CancellationToken token)
|
||||||
{
|
{
|
||||||
var edition = await _context.Editions.FindAsync(registrationCode, token);
|
var edition = await _context.Editions
|
||||||
|
.Include(e => e.Internships)
|
||||||
|
.FirstOrDefaultAsync(e => e.Id.Equals(registrationCode), cancellationToken: token);
|
||||||
|
|
||||||
if (edition == null)
|
if (edition == null)
|
||||||
{
|
{
|
||||||
return NotFound();
|
return NotFound();
|
||||||
}
|
}
|
||||||
|
|
||||||
var student = await _context.Students.FindAsync(user.PersonNumber, token);
|
var student = await _context.Students.FindAsync(user.PersonNumber);
|
||||||
|
|
||||||
edition.RegisterInternship(student);
|
edition.RegisterInternship(student);
|
||||||
await _context.SaveChangesAsync(token);
|
await _context.SaveChangesAsync(token);
|
||||||
|
|
||||||
return Ok();
|
return Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -17,7 +17,7 @@ namespace InternshipSystem.Api.Extensions
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
using var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
|
using var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
|
||||||
using var context = serviceScope.ServiceProvider.GetService<InternshipPractiseSupervisorDbContext>();
|
using var context = serviceScope.ServiceProvider.GetService<InternshipDbContext>();
|
||||||
|
|
||||||
context.Database.Migrate();
|
context.Database.Migrate();
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ namespace InternshipSystem.Api.Extensions
|
|||||||
public static IApplicationBuilder UseDefaultData(this IApplicationBuilder app, bool useDefaultData)
|
public static IApplicationBuilder UseDefaultData(this IApplicationBuilder app, bool useDefaultData)
|
||||||
{
|
{
|
||||||
using var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
|
using var serviceScope = app.ApplicationServices.GetRequiredService<IServiceScopeFactory>().CreateScope();
|
||||||
using var context = serviceScope.ServiceProvider.GetService<InternshipPractiseSupervisorDbContext>();
|
using var context = serviceScope.ServiceProvider.GetService<InternshipDbContext>();
|
||||||
var filler = serviceScope.ServiceProvider.GetService<DatabaseFiller>();
|
var filler = serviceScope.ServiceProvider.GetService<DatabaseFiller>();
|
||||||
|
|
||||||
context.Database.Migrate();
|
context.Database.Migrate();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using InternshipSystem.Core;
|
||||||
using InternshipSystem.Core.Entity.Internship;
|
using InternshipSystem.Core.Entity.Internship;
|
||||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||||
|
|
||||||
@ -8,6 +9,7 @@ namespace InternshipSystem.Api.Result
|
|||||||
public class EditionConfigurationResult
|
public class EditionConfigurationResult
|
||||||
{
|
{
|
||||||
public List<InternshipSubject> AvailableSubjects { get; set; }
|
public List<InternshipSubject> AvailableSubjects { 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; }
|
||||||
public DateTime ReportingStart { get; set; }
|
public DateTime ReportingStart { get; set; }
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System.Threading;
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using InternshipSystem.Api.Queries;
|
using InternshipSystem.Api.Queries;
|
||||||
|
using InternshipSystem.Api.Security;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
|
||||||
namespace InternshipSystem.Api.Services
|
namespace InternshipSystem.Api.Services
|
||||||
|
@ -3,6 +3,7 @@ using System.Threading;
|
|||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using AutoMapper;
|
using AutoMapper;
|
||||||
using InternshipSystem.Api.Queries;
|
using InternshipSystem.Api.Queries;
|
||||||
|
using InternshipSystem.Api.Security;
|
||||||
using InternshipSystem.Core;
|
using InternshipSystem.Core;
|
||||||
using InternshipSystem.Repository;
|
using InternshipSystem.Repository;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
@ -22,15 +23,16 @@ namespace InternshipSystem.Api.Services
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public async Task<ActionResult> AddDocumentToInternship(DocumentPublishRequest documentRequest, long personNumber,
|
public async Task<ActionResult> AddDocumentToInternship(DocumentPublishRequest documentRequest, User user,
|
||||||
CancellationToken cancellationToken)
|
CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
var edition = await _context.Editions.FindAsync(personNumber);
|
var edition = await _context.Editions.FindAsync(user.EditionId);
|
||||||
|
|
||||||
var internship = await _context.Entry(edition)
|
var internship = await _context.Entry(edition)
|
||||||
.Collection(e => e.Internships)
|
.Collection(e => e.Internships)
|
||||||
.Query()
|
.Query()
|
||||||
.SingleAsync(i => i.Student.Id == personNumber, cancellationToken);
|
.Include(i => i.Documentation)
|
||||||
|
.SingleAsync(i => i.Student.Id == user.PersonNumber, cancellationToken);
|
||||||
|
|
||||||
var document = Mapper.Map<Document>(documentRequest);
|
var document = Mapper.Map<Document>(documentRequest);
|
||||||
|
|
||||||
|
@ -42,8 +42,6 @@ namespace InternshipSystem.Api
|
|||||||
services
|
services
|
||||||
.AddDbContext<InternshipDbContext>(o =>
|
.AddDbContext<InternshipDbContext>(o =>
|
||||||
o.UseNpgsql(Configuration.GetConnectionString("InternshipDatabase")))
|
o.UseNpgsql(Configuration.GetConnectionString("InternshipDatabase")))
|
||||||
.AddDbContext<InternshipPractiseSupervisorDbContext>(o =>
|
|
||||||
o.UseNpgsql(Configuration.GetConnectionString("InternshipDatabase")))
|
|
||||||
.AddScoped<DatabaseFiller>()
|
.AddScoped<DatabaseFiller>()
|
||||||
.AddScoped<IInternshipService, InternshipService>()
|
.AddScoped<IInternshipService, InternshipService>()
|
||||||
.AddScoped<JwtTokenService>()
|
.AddScoped<JwtTokenService>()
|
||||||
|
@ -2,9 +2,15 @@
|
|||||||
{
|
{
|
||||||
public enum DocumentState
|
public enum DocumentState
|
||||||
{
|
{
|
||||||
|
// Oczekujaca
|
||||||
Draft,
|
Draft,
|
||||||
|
// Oczekuje na akceptacje
|
||||||
Submitted,
|
Submitted,
|
||||||
|
// Zaakceptowana
|
||||||
Accepted,
|
Accepted,
|
||||||
Rejected
|
// Odrzucona
|
||||||
|
Rejected,
|
||||||
|
// Archiwalna
|
||||||
|
Archival
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -2,6 +2,8 @@
|
|||||||
{
|
{
|
||||||
public enum DocumentType
|
public enum DocumentType
|
||||||
{
|
{
|
||||||
IPPScan
|
IppScan,
|
||||||
|
DeanConsent,
|
||||||
|
NnwIsurance
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -174,9 +174,9 @@ namespace InternshipSystem.Repository
|
|||||||
new Edition
|
new Edition
|
||||||
{
|
{
|
||||||
Id = Guid.Parse("138da8a3-855c-4b17-9bd2-5f357679efa9"),
|
Id = Guid.Parse("138da8a3-855c-4b17-9bd2-5f357679efa9"),
|
||||||
EditionStart = new DateTime(2000, 5, 10),
|
EditionStart = new DateTime(2020, 5, 10),
|
||||||
EditionFinish = new DateTime(2000, 11, 10),
|
EditionFinish = new DateTime(2020, 12, 10),
|
||||||
ReportingStart = new DateTime(2000, 9, 30),
|
ReportingStart = new DateTime(2020, 9, 30),
|
||||||
AvailableSubjects = new List<EditionSubject>
|
AvailableSubjects = new List<EditionSubject>
|
||||||
{
|
{
|
||||||
new EditionSubject
|
new EditionSubject
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
using InternshipSystem.Core;
|
|
||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Repository
|
|
||||||
{
|
|
||||||
public class InternshipPractiseSupervisorDbContext : InternshipDbContext
|
|
||||||
{
|
|
||||||
public InternshipPractiseSupervisorDbContext(DbContextOptions<InternshipDbContext> options) : base(options)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
|
||||||
using Microsoft.EntityFrameworkCore.Design;
|
|
||||||
|
|
||||||
namespace InternshipSystem.Repository
|
|
||||||
{
|
|
||||||
public class InternshipPractiseSupervisorDbContextFactory : IDesignTimeDbContextFactory<InternshipPractiseSupervisorDbContext>
|
|
||||||
{
|
|
||||||
public InternshipPractiseSupervisorDbContext CreateDbContext(string[] args)
|
|
||||||
{
|
|
||||||
var optionsBuilder = new DbContextOptionsBuilder<InternshipDbContext>();
|
|
||||||
optionsBuilder.UseNpgsql("Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=szwoniu");
|
|
||||||
|
|
||||||
return new InternshipPractiseSupervisorDbContext(optionsBuilder.Options);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -9,8 +9,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace InternshipSystem.Repository.Migrations
|
namespace InternshipSystem.Repository.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(InternshipPractiseSupervisorDbContext))]
|
[DbContext(typeof(InternshipDbContext))]
|
||||||
[Migration("20200923103350_init")]
|
[Migration("20200927114840_init")]
|
||||||
partial class init
|
partial class init
|
||||||
{
|
{
|
||||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
@ -8,8 +8,8 @@ using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|||||||
|
|
||||||
namespace InternshipSystem.Repository.Migrations
|
namespace InternshipSystem.Repository.Migrations
|
||||||
{
|
{
|
||||||
[DbContext(typeof(InternshipPractiseSupervisorDbContext))]
|
[DbContext(typeof(InternshipDbContext))]
|
||||||
partial class InternshipPractiseSupervisorDbContextModelSnapshot : ModelSnapshot
|
partial class InternshipDbContextModelSnapshot : ModelSnapshot
|
||||||
{
|
{
|
||||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||||
{
|
{
|
Loading…
Reference in New Issue
Block a user