Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release: Enrollment Check-in SMS Opt-in, RecIM Player Hall #1070

Merged
merged 11 commits into from
Sep 26, 2024
Merged
16 changes: 6 additions & 10 deletions Gordon360/Controllers/AcademicCheckInController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,19 @@ public async Task<ActionResult<EmergencyContactViewModel>> PutEmergencyContactAs

}



/// <summary> Sets the students cell phone number</summary>
/// <param name="data"> The phone number object to be added to the database </param>
/// <returns> The data stored </returns>
[HttpPut]
[Route("cellphone")]
public async Task<ActionResult<AcademicCheckInViewModel>> PutCellPhoneAsync([FromBody] AcademicCheckInViewModel data)
public async Task<ActionResult> PutCellPhoneAsync([FromBody] MobilePhoneUpdateViewModel data)
{
var username = AuthUtils.GetUsername(User);
var id = accountService.GetAccountByUsername(username).GordonID;

try
{
var result = await academicCheckInService.PutCellPhoneAsync(id, data);
return Ok(result);
await academicCheckInService.PutCellPhoneAsync(id, data);
return Ok();
}
catch (System.Exception e)
{
Expand Down Expand Up @@ -91,22 +88,21 @@ public async Task<ActionResult<AcademicCheckInViewModel>> PutDemographicAsync([F
/// <returns> The user's stored holds </returns>
[HttpGet]
[Route("holds")]
public async Task<ActionResult<AcademicCheckInViewModel>> GetHoldsAsync()
public async Task<ActionResult<EnrollmentCheckinHolds>> GetHoldsAsync()
{
var username = AuthUtils.GetUsername(User);
var id = accountService.GetAccountByUsername(username).GordonID;

try
{
var result = (await academicCheckInService.GetHoldsAsync(id)).First();
return Ok(result);
EnrollmentCheckinHolds holds = await academicCheckInService.GetHoldsAsync(id);
return Ok(holds);
}
catch (System.Exception e)
{
System.Diagnostics.Debug.WriteLine(e.Message);
return NotFound();
}

}

/// <summary> Sets the user as having completed Academic Checkin </summary>
Expand Down
7 changes: 6 additions & 1 deletion Gordon360/Controllers/RecIM/TeamsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ public ActionResult<TeamExtendedViewModel> GetTeams([FromQuery] bool active)
[Route("{teamID}")]
public ActionResult<TeamExtendedViewModel> GetTeamByID(int teamID)
{
var team = teamService.GetTeamByID(teamID);

var viewerUsername = AuthUtils.GetUsername(User);
var viewerParticipation = participantService.GetParticipantByUsername(viewerUsername);
var isAdmin = viewerParticipation?.IsAdmin == true || AuthUtils.UserIsInGroup(User, Enums.AuthGroup.RecIMSuperAdmin);

var team = teamService.GetTeamByID(teamID, isAdmin);

if (team == null)
{
Expand Down
61 changes: 57 additions & 4 deletions Gordon360/Documentation/Gordon360.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Gordon360/Models/CCT/Context/CCTContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
entity.Property(e => e.JOB_NAME).IsFixedLength();
entity.Property(e => e.PART_CDE).IsFixedLength();
entity.Property(e => e.SESS_CDE).IsFixedLength();
entity.Property(e => e.USER_NAME).IsFixedLength();
});

modelBuilder.Entity<Mailboxes>(entity =>
Expand Down Expand Up @@ -468,6 +469,7 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
{
entity.ToView("ParticipantView", "RecIM");

entity.Property(e => e.Hall).IsFixedLength();
entity.Property(e => e.SpecifiedGender).IsFixedLength();
});

Expand Down Expand Up @@ -611,7 +613,6 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
});
modelBuilder.HasSequence("Information_Change_Request_Seq");

OnModelCreatingGeneratedProcedures(modelBuilder);
OnModelCreatingPartial(modelBuilder);
}

Expand Down
Loading
Loading