| | 1 | | namespace Syki.Shared; |
| | 2 | |
|
| | 3 | | public class CreateUserIn |
| | 4 | | { |
| 3084 | 5 | | public Guid InstitutionId { get; set; } |
| 2056 | 6 | | public string Name { get; set; } |
| 4112 | 7 | | public string Email { get; set; } |
| 2056 | 8 | | public string Password { get; set; } |
| 2040 | 9 | | public UserRole Role { get; set; } |
| 1200 | 10 | | public string? PhoneNumber { get; set; } |
| | 11 | |
|
| | 12 | | public static CreateUserIn NewAcademic(Guid institutionId, string email, string password) |
| | 13 | | { |
| 588 | 14 | | return new() |
| 588 | 15 | | { |
| 588 | 16 | | Name = email, |
| 588 | 17 | | Email = email, |
| 588 | 18 | | Password = password, |
| 588 | 19 | | Role = UserRole.Academic, |
| 588 | 20 | | InstitutionId = institutionId, |
| 588 | 21 | | }; |
| | 22 | | } |
| | 23 | |
|
| | 24 | | public static CreateUserIn NewTeacher(Guid institutionId, string name, string email) |
| | 25 | | { |
| 264 | 26 | | return new() |
| 264 | 27 | | { |
| 264 | 28 | | Name = name, |
| 264 | 29 | | Email = email, |
| 264 | 30 | | Role = UserRole.Teacher, |
| 264 | 31 | | InstitutionId = institutionId, |
| 264 | 32 | | Password = $"Teacher@{Guid.CreateVersion7()}", |
| 264 | 33 | | }; |
| | 34 | | } |
| | 35 | |
|
| | 36 | | public static CreateUserIn NewStudent(Guid institutionId, string name, string email, string? phoneNumber) |
| | 37 | | { |
| 178 | 38 | | return new() |
| 178 | 39 | | { |
| 178 | 40 | | Name = name, |
| 178 | 41 | | Email = email, |
| 178 | 42 | | Role = UserRole.Student, |
| 178 | 43 | | PhoneNumber = phoneNumber, |
| 178 | 44 | | InstitutionId = institutionId, |
| 178 | 45 | | Password = $"Student@{Guid.CreateVersion7()}", |
| 178 | 46 | | }; |
| | 47 | | } |
| | 48 | | } |