Fill out model partialy
This commit is contained in:
parent
f9da73ea76
commit
a9ba22a518
@ -1,7 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
@ -1,43 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Serilog;
|
||||
|
||||
namespace Internship.Api.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("[controller]")]
|
||||
public class WeatherForecastController : ControllerBase
|
||||
{
|
||||
private static readonly string[] Summaries = new[]
|
||||
{
|
||||
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
|
||||
};
|
||||
|
||||
private readonly ILogger<WeatherForecastController> _logger;
|
||||
|
||||
public WeatherForecastController(ILogger<WeatherForecastController> logger)
|
||||
{
|
||||
_logger = logger;
|
||||
}
|
||||
|
||||
[HttpGet]
|
||||
public IEnumerable<WeatherForecast> Get()
|
||||
{
|
||||
var rng = new Random();
|
||||
|
||||
Log.Warning("Randomly generated number was: {Rng}", rng);
|
||||
|
||||
return Enumerable.Range(1, 5).Select(index => new WeatherForecast
|
||||
{
|
||||
Date = DateTime.Now.AddDays(index),
|
||||
TemperatureC = rng.Next(-20, 55),
|
||||
Summary = Summaries[rng.Next(Summaries.Length)]
|
||||
})
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
@ -12,4 +12,8 @@
|
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="5.3.2" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Folder Include="Controllers" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
@ -1,15 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Internship.Api
|
||||
{
|
||||
public class WeatherForecast
|
||||
{
|
||||
public DateTime Date { get; set; }
|
||||
|
||||
public int TemperatureC { get; set; }
|
||||
|
||||
public int TemperatureF => 32 + (int)(TemperatureC / 0.5556);
|
||||
|
||||
public string Summary { get; set; }
|
||||
}
|
||||
}
|
11
src/Internship.Core/Address.cs
Normal file
11
src/Internship.Core/Address.cs
Normal file
@ -0,0 +1,11 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public struct Address
|
||||
{
|
||||
public string Street { get; set; }
|
||||
public string Building { get; set; }
|
||||
public string City { get; set; }
|
||||
public string PostalCode { get; set; }
|
||||
public string Country { get; set; }
|
||||
}
|
||||
}
|
@ -2,5 +2,7 @@
|
||||
{
|
||||
public class BranchOffice
|
||||
{
|
||||
public Company Company { get; set; }
|
||||
public Address Address { get; set; }
|
||||
}
|
||||
}
|
12
src/Internship.Core/Company.cs
Normal file
12
src/Internship.Core/Company.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class Company
|
||||
{
|
||||
public string Name { get; set; }
|
||||
public RangeOfActivities Range { get; set; }
|
||||
public Uri SiteAddress { get; set; }
|
||||
public string Nip { get; set; }
|
||||
}
|
||||
}
|
6
src/Internship.Core/Course.cs
Normal file
6
src/Internship.Core/Course.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class Course
|
||||
{
|
||||
}
|
||||
}
|
18
src/Internship.Core/DeanAcceptance.cs
Normal file
18
src/Internship.Core/DeanAcceptance.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public struct DeanAcceptance
|
||||
{
|
||||
public DateTime AcceptanceDate { get; set; }
|
||||
public bool IsDeansAcceptanceRequired { get; set; }
|
||||
public DeanAcceptanceReason Reason { get; set; }
|
||||
}
|
||||
|
||||
public enum DeanAcceptanceReason
|
||||
{
|
||||
Semester,
|
||||
Delay,
|
||||
Whatever
|
||||
}
|
||||
}
|
@ -6,6 +6,7 @@ namespace Internship.Core
|
||||
{
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public DateTime IPPDeadlineDate { get; set; }
|
||||
|
||||
}
|
||||
}
|
10
src/Internship.Core/Insurance.cs
Normal file
10
src/Internship.Core/Insurance.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public struct Insurance
|
||||
{
|
||||
public DateTime InsuranceDeliveryDate { get; set; }
|
||||
public bool IsInsuranceRequired { get; set; }
|
||||
}
|
||||
}
|
@ -7,5 +7,8 @@ namespace Internship.Core
|
||||
public string AlbumNumber { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string Surname { get; set; }
|
||||
public string Email { get; set; }
|
||||
public Course Course { get; set; }
|
||||
public int Semester { get; set; }
|
||||
}
|
||||
}
|
@ -1,4 +1,6 @@
|
||||
namespace Internship.Core
|
||||
using System;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class Internship
|
||||
{
|
||||
@ -7,5 +9,13 @@
|
||||
public Report Report { get; set; }
|
||||
public BranchOffice BranchOffice { get; set; }
|
||||
public InternshipProgram Program { get; set; }
|
||||
public InternshipType Type { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public bool IsAccepted { get; set; }
|
||||
public DeanAcceptance DeanAcceptance { get; set; }
|
||||
public Insurance Insurance { get; set; }
|
||||
|
||||
public int InternshipLengthInWeeks { get; set; }
|
||||
}
|
||||
}
|
8
src/Internship.Core/InternshipType.cs
Normal file
8
src/Internship.Core/InternshipType.cs
Normal file
@ -0,0 +1,8 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public enum InternshipType
|
||||
{
|
||||
B2B,
|
||||
Free
|
||||
}
|
||||
}
|
6
src/Internship.Core/RangeOfActivities.cs
Normal file
6
src/Internship.Core/RangeOfActivities.cs
Normal file
@ -0,0 +1,6 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public enum RangeOfActivities
|
||||
{
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user