source: src/FinkiChattery/FinkiChattery.Persistence/Repositories/Contracts/Question/QuestionStateDto.cs@ 7f1a891

dev
Last change on this file since 7f1a891 was b25b9ea, checked in by Стојков Марко <mst@…>, 3 years ago

Get question state endpoint

  • Property mode set to 100644
File size: 4.7 KB
Line 
1#nullable enable
2
3using System;
4using System.Collections.Generic;
5
6namespace FinkiChattery.Persistence.Repositories.Contracts
7{
8 public class QuestionStateDto
9 {
10 public QuestionStateDto(long id, Guid uid, string title, string text, DateTime createdOn, long views, DateTime lastActiveOn, StudentQuestionStateDto studentDto, IEnumerable<AnswerQuestionStateDto> answersDto, IEnumerable<QuestionCategoryQuestionStateDto> categoriesDto, TeamQuestionStateDto? teamDto)
11 {
12 Id = id;
13 Uid = uid;
14 Title = title;
15 Text = text;
16 CreatedOn = createdOn;
17 Views = views;
18 LastActiveOn = lastActiveOn;
19 StudentDto = studentDto;
20 AnswersDto = answersDto;
21 CategoriesDto = categoriesDto;
22 TeamDto = teamDto;
23 }
24
25 public long Id { get; }
26 public Guid Uid { get; }
27 public string Title { get; }
28 public string Text { get; }
29 public DateTime CreatedOn { get; }
30 public long Views { get; }
31 public DateTime LastActiveOn { get; }
32 public StudentQuestionStateDto StudentDto { get; }
33 public IEnumerable<AnswerQuestionStateDto> AnswersDto { get; }
34 public IEnumerable<QuestionCategoryQuestionStateDto> CategoriesDto { get; }
35 public TeamQuestionStateDto? TeamDto { get; }
36 }
37
38 public class StudentQuestionStateDto
39 {
40 public StudentQuestionStateDto(long id, Guid uid, string index, string imageUrl)
41 {
42 Id = id;
43 Uid = uid;
44 Index = index;
45 ImageUrl = imageUrl;
46 }
47
48 public long Id { get; }
49 public Guid Uid { get; }
50 public string Index { get; }
51 public string ImageUrl { get; }
52 }
53
54 public class TeamQuestionStateDto
55 {
56 public TeamQuestionStateDto(long id, Guid uid, string name)
57 {
58 Id = id;
59 Uid = uid;
60 Name = name;
61 }
62
63 public long Id { get; }
64 public Guid Uid { get; }
65 public string Name { get; }
66 }
67
68 public class QuestionCategoryQuestionStateDto
69 {
70 public QuestionCategoryQuestionStateDto(long id, Guid uid, string name)
71 {
72 Id = id;
73 Uid = uid;
74 Name = name;
75 }
76
77 public long Id { get; }
78 public Guid Uid { get; }
79 public string Name { get; }
80 }
81
82 public class AnswerQuestionStateDto
83 {
84 public AnswerQuestionStateDto(long id, Guid uid, string text, bool correctAnswer, DateTime createdOn, long upvotesCount, AnswerStudentQuestionStateDto studentDto, IEnumerable<AnswerResponseQuestionStateDto> answerResponsesDto)
85 {
86 Id = id;
87 Uid = uid;
88 Text = text;
89 CorrectAnswer = correctAnswer;
90 CreatedOn = createdOn;
91 UpvotesCount = upvotesCount;
92 StudentDto = studentDto;
93 AnswerResponsesDto = answerResponsesDto;
94 }
95
96 public long Id { get; }
97 public Guid Uid { get; }
98 public string Text { get; }
99 public bool CorrectAnswer { get; }
100 public DateTime CreatedOn { get; }
101 public long UpvotesCount { get; }
102 public AnswerStudentQuestionStateDto StudentDto { get; }
103 public IEnumerable<AnswerResponseQuestionStateDto> AnswerResponsesDto { get; }
104 }
105
106 public class AnswerStudentQuestionStateDto
107 {
108 public AnswerStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl)
109 {
110 Id = id;
111 Uid = uid;
112 Index = index;
113 ImageUrl = imageUrl;
114 }
115 public long Id { get; }
116 public Guid Uid { get; }
117 public string Index { get; }
118 public string ImageUrl { get; }
119 }
120
121 public class AnswerResponseQuestionStateDto
122 {
123 public AnswerResponseQuestionStateDto(long id, Guid uid, string text, DateTime createdOn, AnswerResponseStudentQuestionStateDto studentDto)
124 {
125 Id = id;
126 Uid = uid;
127 Text = text;
128 CreatedOn = createdOn;
129 StudentDto = studentDto;
130 }
131
132 public long Id { get; }
133 public Guid Uid { get; }
134 public string Text { get; }
135 public DateTime CreatedOn { get; }
136 public AnswerResponseStudentQuestionStateDto StudentDto { get; }
137 }
138
139 public class AnswerResponseStudentQuestionStateDto
140 {
141 public AnswerResponseStudentQuestionStateDto(long id, Guid uid, string index, string imageUrl)
142 {
143 Id = id;
144 Uid = uid;
145 Index = index;
146 ImageUrl = imageUrl;
147 }
148
149 public long Id { get; }
150 public Guid Uid { get; }
151 public string Index { get; }
152 public string ImageUrl { get; }
153 }
154}
Note: See TracBrowser for help on using the repository browser.