Add project
This commit is contained in:
9
Common/Dtos/Common/BaseResponse.cs
Normal file
9
Common/Dtos/Common/BaseResponse.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using System.Net;
|
||||
|
||||
namespace Common.Dtos.Common;
|
||||
|
||||
public abstract class BaseResponse
|
||||
{
|
||||
public bool Ok { get; set; }
|
||||
public string? Error { get; set; }
|
||||
}
|
||||
22
Common/Dtos/Common/PagedList.cs
Normal file
22
Common/Dtos/Common/PagedList.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace Common.Dtos.Common;
|
||||
|
||||
public class PagedList<T>
|
||||
{
|
||||
public PagedList(T[] items, int pageNumber, int pageSize, int totalItemsCount, int numberOfPages)
|
||||
{
|
||||
Items = items;
|
||||
PageNumber = pageNumber;
|
||||
PageSize = pageSize;
|
||||
TotalItemsCount = totalItemsCount;
|
||||
NumberOfPages = numberOfPages;
|
||||
}
|
||||
|
||||
public static PagedList<T> Empty(int pagedNumber, int pageSize)
|
||||
=> new([], pagedNumber, pageSize, 0, 0);
|
||||
|
||||
public T[] Items { get; }
|
||||
public int PageNumber { get; }
|
||||
public int PageSize { get; }
|
||||
public int TotalItemsCount { get; }
|
||||
public int NumberOfPages { get; }
|
||||
}
|
||||
7
Common/Dtos/Common/PagedRequest.cs
Normal file
7
Common/Dtos/Common/PagedRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Common.Dtos.Common;
|
||||
|
||||
public abstract class PagedRequest
|
||||
{
|
||||
public int PageNumber { get; set; }
|
||||
public int PageSize { get; set; }
|
||||
}
|
||||
11
Common/Dtos/Common/ValidationProblems.cs
Normal file
11
Common/Dtos/Common/ValidationProblems.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
namespace Common.Dtos.Common;
|
||||
|
||||
public class ValidationProblems
|
||||
{
|
||||
public ValidationProblems()
|
||||
{
|
||||
Errors = [];
|
||||
}
|
||||
|
||||
public List<string> Errors { get; set; }
|
||||
}
|
||||
8
Common/Dtos/Season/CreateSeasonRequest.cs
Normal file
8
Common/Dtos/Season/CreateSeasonRequest.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Common.Dtos.Season;
|
||||
|
||||
public class CreateSeasonRequest
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public DateOnly StartDate { get; set; }
|
||||
public DateOnly EndDate { get; set; }
|
||||
}
|
||||
8
Common/Dtos/Season/CreateSeasonResponse.cs
Normal file
8
Common/Dtos/Season/CreateSeasonResponse.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Common.Dtos.Common;
|
||||
|
||||
namespace Common.Dtos.Season;
|
||||
|
||||
public class CreateSeasonResponse : BaseResponse
|
||||
{
|
||||
public string? CreateSeasonResult { get; set; }
|
||||
}
|
||||
9
Common/Dtos/Season/GetSeasonsRequest.cs
Normal file
9
Common/Dtos/Season/GetSeasonsRequest.cs
Normal file
@@ -0,0 +1,9 @@
|
||||
using Common.Dtos.Common;
|
||||
|
||||
namespace Common.Dtos.Season;
|
||||
|
||||
public class GetSeasonsRequest : PagedRequest
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public bool? HideObsolete { get; set; }
|
||||
}
|
||||
10
Common/Dtos/Season/SeasonDto.cs
Normal file
10
Common/Dtos/Season/SeasonDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Common.Dtos.Season;
|
||||
|
||||
public class SeasonDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public DateOnly StartDate { get; set; }
|
||||
public DateOnly EndDate { get; set; }
|
||||
public bool IsCurrent => StartDate <= DateOnly.FromDateTime(DateTime.Now) && EndDate >= DateOnly.FromDateTime(DateTime.Now);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
namespace Common.Dtos.Specialization;
|
||||
|
||||
public class CreateSpecializationRequest
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
}
|
||||
12
Common/Dtos/Specialization/CreateSpecializationResponse.cs
Normal file
12
Common/Dtos/Specialization/CreateSpecializationResponse.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Common.Dtos.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Common.Dtos.Specialization
|
||||
{
|
||||
public class CreateSpecializationResponse : BaseResponse
|
||||
{
|
||||
public string? CreateSpecializationResult { get; set; }
|
||||
}
|
||||
}
|
||||
8
Common/Dtos/Specialization/GetSpecializationsRequest.cs
Normal file
8
Common/Dtos/Specialization/GetSpecializationsRequest.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Common.Dtos.Common;
|
||||
|
||||
namespace Common.Dtos.Specialization;
|
||||
|
||||
public class GetSpecializationsRequest : PagedRequest
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
15
Common/Dtos/Specialization/SpecializationDto.cs
Normal file
15
Common/Dtos/Specialization/SpecializationDto.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Text;
|
||||
|
||||
namespace Common.Dtos.Specialization;
|
||||
|
||||
public class SpecializationDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
}
|
||||
8
Common/Dtos/Student/CreateStudentRequest.cs
Normal file
8
Common/Dtos/Student/CreateStudentRequest.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
namespace Common.Dtos.Student;
|
||||
|
||||
public class CreateStudentRequest
|
||||
{
|
||||
public required string FirstName { get; set; }
|
||||
public required string LastName { get; set; }
|
||||
public required string AlbumNumber { get; set; }
|
||||
}
|
||||
8
Common/Dtos/Student/CreateStudentResponse.cs
Normal file
8
Common/Dtos/Student/CreateStudentResponse.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Common.Dtos.Common;
|
||||
|
||||
namespace Common.Dtos.Student;
|
||||
|
||||
public class CreateStudentResponse : BaseResponse
|
||||
{
|
||||
public string? CreateStudentResult { get; set; }
|
||||
}
|
||||
10
Common/Dtos/Student/StudentBasicDto.cs
Normal file
10
Common/Dtos/Student/StudentBasicDto.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
namespace Common.Dtos.Student;
|
||||
|
||||
public class StudentBasicDto
|
||||
{
|
||||
public Guid Id { get; set; }
|
||||
public string? FirstName { get; set; }
|
||||
public string? LastName { get; set; }
|
||||
public string? AlbumNumber { get; set; }
|
||||
public string FullNameReverese => $"{LastName} {FirstName} ({AlbumNumber})";
|
||||
}
|
||||
7
Common/Dtos/Subject/CreateSubjectRequest.cs
Normal file
7
Common/Dtos/Subject/CreateSubjectRequest.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Common.Dtos.Subject;
|
||||
|
||||
public class CreateSubjectRequest
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
}
|
||||
12
Common/Dtos/Subject/CreateSubjectResponse.cs
Normal file
12
Common/Dtos/Subject/CreateSubjectResponse.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using Common.Dtos.Common;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Common.Dtos.Subject
|
||||
{
|
||||
public class CreateSubjectResponse : BaseResponse
|
||||
{
|
||||
public string? CreateSubjectResult { get; set; }
|
||||
}
|
||||
}
|
||||
8
Common/Dtos/Subject/GetSubjectsRequest.cs
Normal file
8
Common/Dtos/Subject/GetSubjectsRequest.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Common.Dtos.Common;
|
||||
|
||||
namespace Common.Dtos.Subject;
|
||||
|
||||
public class GetSubjectsRequest : PagedRequest
|
||||
{
|
||||
public string? Name { get; set; }
|
||||
}
|
||||
12
Common/Dtos/Subject/SubjectDto.cs
Normal file
12
Common/Dtos/Subject/SubjectDto.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace Common.Dtos.Subject;
|
||||
|
||||
public class SubjectDto
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string? Name { get; set; }
|
||||
public string? ShortName { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user