Skip to content

Commit

Permalink
Group DTOs by their model in single files (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
romandykyi authored Jan 5, 2024
1 parent 7fc591f commit 356b697
Show file tree
Hide file tree
Showing 32 changed files with 95 additions and 121 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ namespace EUniversity.Core.Dtos.University;

[ValidateNever] // Remove data annotations validation
public record ActivityTypeCreateDto(string Name);

public record ActivityTypeViewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate);

public record ActivityTypeMinimalDto(int Id, string Name);
3 changes: 0 additions & 3 deletions Core/Dtos/University/ActivityTypeMinimalDto.cs

This file was deleted.

4 changes: 0 additions & 4 deletions Core/Dtos/University/ActivityTypeViewDto.cs

This file was deleted.

9 changes: 0 additions & 9 deletions Core/Dtos/University/ClassCreateDto.cs

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,19 @@
using EUniversity.Core.Dtos.Users;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;

namespace EUniversity.Core.Dtos.University;

[ValidateNever] // Remove data annotations validation
public record ClassCreateDto(int ClassTypeId,
int ClassroomId, int GroupId, string? SubstituteTeacherId,
DateTimeOffset StartDate, TimeSpan Duration,
int? Repeats, int? RepeatsDelayDays) : IClassWriteDto;

[ValidateNever] // Remove data annotations validation
public record ClassUpdateDto(int ClassTypeId,
int ClassroomId, int GroupId, string? SubstituteTeacherId,
DateTimeOffset StartDate, TimeSpan Duration) : IClassWriteDto;

public record ClassViewDto(int Id,
DateTimeOffset StartDate, TimeSpan Duration,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
Expand All @@ -16,4 +28,4 @@ public record ClassClassTypeViewDto(int Id, string Name);
public record ClassGroupViewDto(int Id, string Name,
TeacherPreviewDto? Teacher, ClassCourseViewDto Course);

public record ClassCourseViewDto(int Id, string Name, SemesterMinimalViewDto? Semester);
public record ClassCourseViewDto(int Id, string Name, SemesterMinimalViewDto? Semester);
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@

namespace EUniversity.Core.Dtos.University;

public record ClassTypeViewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate);

[ValidateNever] // Remove data annotations validation
public record ClassTypeCreateDto(string Name);
4 changes: 0 additions & 4 deletions Core/Dtos/University/ClassTypeViewDto.cs

This file was deleted.

8 changes: 0 additions & 8 deletions Core/Dtos/University/ClassUpdateDto.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ namespace EUniversity.Core.Dtos.University;

[ValidateNever] // Remove data annotations validation
public record ClassroomCreateDto(string Name);

public record ClassroomViewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate);

4 changes: 0 additions & 4 deletions Core/Dtos/University/ClassroomViewDto.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Core/Dtos/University/CourseCreateDto.cs

This file was deleted.

16 changes: 16 additions & 0 deletions Core/Dtos/University/CourseDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;

namespace EUniversity.Core.Dtos.University;

[ValidateNever] // Remove data annotations validation
public record CourseCreateDto(string Name, string? Description, int? SemesterId);

public record CourseMinimalViewDto(int Id, string Name, SemesterMinimalViewDto? Semester);

public record CoursePreviewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
SemesterMinimalViewDto? Semester);

public record CourseViewDto(int Id, string Name, string? Description,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
SemesterPreviewDto? Semester);
3 changes: 0 additions & 3 deletions Core/Dtos/University/CourseMinimalViewDto.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Core/Dtos/University/CoursePreviewDto.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Core/Dtos/University/CourseViewDto.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Core/Dtos/University/Grades/AssignedGradeCreateDto.cs

This file was deleted.

18 changes: 18 additions & 0 deletions Core/Dtos/University/Grades/AssignedGradeDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
using EUniversity.Core.Dtos.Users;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;

namespace EUniversity.Core.Dtos.University.Grades;

[ValidateNever] // Remove data annotations validation
public record AssignedGradeCreateDto(int GradeId, int GroupId, string StudentId, string? Notes, int? ActivityTypeId);


[ValidateNever] // Remove data annotations validation
public record class AssignedGradeUpdateDto(int GradeId, string? Notes, int? ActivityTypeId);

public record AssignedGradeViewDto(int Id, string? Notes,
GradeMinimalViewDto Grade, GroupMinimalViewDto? Group,
UserViewDto? Assigner, UserViewDto? Reassigner,
StudentPreviewDto? Student,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
ActivityTypeMinimalDto? ActivityType);
6 changes: 0 additions & 6 deletions Core/Dtos/University/Grades/AssignedGradeUpdateDto.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Core/Dtos/University/Grades/AssignedGradeViewDto.cs

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@ namespace EUniversity.Core.Dtos.University.Grades;

[ValidateNever] // Remove data annotations validation
public record GradeCreateDto(string Name, int Score);

public record GradeMinimalViewDto(int Id, string Name);

public record GradeViewDto(int Id, string Name, int Score,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate);
3 changes: 0 additions & 3 deletions Core/Dtos/University/Grades/GradeMinimalViewDto.cs

This file was deleted.

4 changes: 0 additions & 4 deletions Core/Dtos/University/Grades/GradeViewDto.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Core/Dtos/University/GroupCreateDto.cs

This file was deleted.

15 changes: 15 additions & 0 deletions Core/Dtos/University/GroupDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using EUniversity.Core.Dtos.Users;
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;

namespace EUniversity.Core.Dtos.University;

[ValidateNever] // Remove data annotations validation
public record GroupCreateDto(string Name, int CourseId, string? TeacherId);

public record GroupMinimalViewDto(int Id, string Name, CourseMinimalViewDto Course);

public record GroupPreviewDto(int Id, string Name, DateTimeOffset CreationDate, DateTimeOffset UpdateDate, TeacherPreviewDto? Teacher, CoursePreviewDto Course);

public record GroupViewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
TeacherPreviewDto? Teacher, CoursePreviewDto Course);
3 changes: 0 additions & 3 deletions Core/Dtos/University/GroupMinimalViewDto.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Core/Dtos/University/GroupPreviewDto.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Core/Dtos/University/GroupViewDto.cs

This file was deleted.

6 changes: 0 additions & 6 deletions Core/Dtos/University/SemesterCreateDto.cs

This file was deleted.

16 changes: 16 additions & 0 deletions Core/Dtos/University/SemesterDtos.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Microsoft.AspNetCore.Mvc.ModelBinding.Validation;

namespace EUniversity.Core.Dtos.University;

[ValidateNever] // Remove data annotations validation
public record SemesterCreateDto(string Name, DateTimeOffset DateFrom, DateTimeOffset DateTo);

public record SemesterMinimalViewDto(int Id, string Name);

public record SemesterPreviewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
DateTimeOffset DateFrom, DateTimeOffset DateTo);

public record SemesterViewDto(int Id, string Name,
DateTimeOffset CreationDate, DateTimeOffset UpdateDate,
DateTimeOffset DateFrom, DateTimeOffset DateTo);
3 changes: 0 additions & 3 deletions Core/Dtos/University/SemesterMinimalViewDto.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Core/Dtos/University/SemesterPreviewDto.cs

This file was deleted.

5 changes: 0 additions & 5 deletions Core/Dtos/University/SemesterViewDto.cs

This file was deleted.

0 comments on commit 356b697

Please sign in to comment.