public async Task <IActionResult> CheckChildSuspension([FromQuery] IdModel model)
        {
            var user = await userManager.GetUserAsync(User);

            if (user == null ||
                !(await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.VolunteerCaptain.ToString()) ||
                  await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.BusDriver.ToString()) ||
                  await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.Staff.ToString())))
            {
                return(Utilities.ErrorJson("Not authorized."));
            }

            if (model.Id == 0)
            {
                return(Utilities.GenerateMissingInputMessage("child id"));
            }

            try
            {
                ChildRepository repo = new ChildRepository(configModel.ConnectionString);

                return(new JsonResult(new
                {
                    IsSuspended = repo.IsSuspended(model.Id)
                }));
            }
            catch (Exception exc)
            {
                return(new JsonResult(new
                {
                    Error = exc.Message,
                }));
            }
        }
        public async Task <IActionResult> Child([FromQuery] IdModel model)
        {
            var user = await userManager.GetUserAsync(User);

            if (user == null ||
                !(await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.VolunteerCaptain.ToString()) ||
                  await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.BusDriver.ToString()) ||
                  await userManager.IsInRoleAsync(user, UserHelpers.UserRoles.Staff.ToString())))
            {
                return(Utilities.ErrorJson("Not authorized."));
            }

            if (model == null || model.Id == 0)
            {
                return(Utilities.GenerateMissingInputMessage("child id"));
            }

            try
            {
                ChildRepository    repo  = new ChildRepository(configModel.ConnectionString);
                PostChildEditModel child = repo.GetChild(model.Id);

                if (child.Id == 0)
                {
                    return(Utilities.ErrorJson("Invalid id"));
                }

                return(new JsonResult(new PostChildEditModel
                {
                    Id = child.Id,
                    FirstName = child.FirstName,
                    LastName = child.LastName,
                    PreferredName = child.LastName,
                    ContactNumber = child.ContactNumber,
                    ContactEmail = child.ContactEmail,
                    ParentName = child.ParentName,
                    BusId = child.BusId,
                    Birthday = child.Birthday,
                    Gender = child.Gender,
                    Grade = child.Grade,
                    ParentalWaiver = child.ParentalWaiver,
                    ClassId = child.ClassId,
                    Picture = child.Picture,
                    BusWaiver = child.BusWaiver,
                    HaircutWaiver = child.HaircutWaiver,
                    ParentalEmailOptIn = child.ParentalEmailOptIn,
                    OrangeShirtStatus = child.OrangeShirtStatus,
                    StartDate = child.StartDate,
                    IsSuspended = repo.IsSuspended(model.Id),
                    IsCheckedIn = repo.IsCheckedIn(model.Id)
                }));
            }
            catch (Exception exc)
            {
                return(new JsonResult(new
                {
                    Error = exc.Message,
                }));
            }
        }