66using Bugget . Entities . DbModels . Bug ;
77using Bugget . Entities . DbModels . Report ;
88using Bugget . Entities . DTO . Report ;
9+ using Bugget . Entities . SocketViews ;
910using Bugget . Entities . Views ;
1011
1112namespace Bugget . BO . Mappers ;
1213
1314public static class ReportMapper
1415{
15- public static ReportView ToView ( this ReportDbModel report , IReadOnlyDictionary < string , Employee > employeesDict )
16+ public static ReportView ToView ( this ReportObsoleteDbModel report , IReadOnlyDictionary < string , EmployeeObsolete > employeesDict )
1617 {
1718 return new ReportView
1819 {
@@ -35,7 +36,7 @@ public static ReportView ToView(this ReportDbModel report, IReadOnlyDictionary<s
3536 } ;
3637 }
3738
38- public static SearchReportsView ToView ( this SearchReportsDbModel search , IReadOnlyDictionary < string , Employee > employeesDict )
39+ public static SearchReportsView ToView ( this SearchReportsDbModel search , IReadOnlyDictionary < string , EmployeeObsolete > employeesDict )
3940 {
4041 return new SearchReportsView
4142 {
@@ -52,17 +53,17 @@ public static Report ToReport(this ReportCreateDto report, string userId)
5253 ResponsibleUserId = report . ResponsibleId ,
5354 CreatorUserId = userId ,
5455 Bugs = report . Bugs . Select ( b => new Bug
55- {
56- Receive = b . Receive ,
57- Expect = b . Expect ,
58- CreatorUserId = userId ,
59- } )
56+ {
57+ Receive = b . Receive ,
58+ Expect = b . Expect ,
59+ CreatorUserId = userId ,
60+ } )
6061 . ToArray ( ) ,
6162 ParticipantsUserIds = new string [ ] { userId , report . ResponsibleId } . Distinct ( ) . ToArray ( )
6263 } ;
6364 }
6465
65- public static ReportUpdate ToReportUpdate ( this ReportUpdateDto report , int reportId , string userId )
66+ public static ReportUpdate ToReportUpdate ( this ReportPatchDto report , int reportId , string userId )
6667 {
6768 return new ReportUpdate
6869 {
@@ -113,7 +114,7 @@ public static SearchReports ToSearchReports(
113114 string ? sort ,
114115 uint skip ,
115116 uint take ,
116- IReadOnlyDictionary < string , IReadOnlyCollection < Employee > > employeesByTeam )
117+ IReadOnlyDictionary < string , IReadOnlyCollection < EmployeeObsolete > > employeesByTeam )
117118 {
118119 List < string > resultUserIds = [ ] ;
119120 if ( ! string . IsNullOrEmpty ( teamId ) )
@@ -139,4 +140,15 @@ public static SearchReports ToSearchReports(
139140 Sort = SortOption . Parse ( sort )
140141 } ;
141142 }
143+
144+ public static PatchReportSocketView ToSocketView ( this ReportPatchDto patchDto , ReportPatchResultDbModel ? result )
145+ {
146+ return new PatchReportSocketView
147+ {
148+ Title = patchDto . Title ,
149+ Status = patchDto . Status ,
150+ ResponsibleUserId = patchDto . ResponsibleUserId ,
151+ PastResponsibleUserId = patchDto . ResponsibleUserId == null ? null : result ? . PastResponsibleUserId
152+ } ;
153+ }
142154}
0 commit comments