Example #1
0
        public async Task <ActionResult <IEnumerable <BusinessEvent> > > getEnrolleeBusinessEvents(int enrolleeId)
        {
            var enrollee = await _enrolleeService.GetEnrolleeAsync(enrolleeId);

            if (enrollee == null)
            {
                return(NotFound(ApiResponse.Message($"Enrollee not found with id {enrolleeId}")));
            }

            var events = await _enrolleeService.GetEnrolleeBusinessEvents(enrolleeId);

            return(Ok(ApiResponse.Result(events)));
        }
        public async Task <ActionResult <IEnumerable <BusinessEvent> > > GetEnrolleeBusinessEvents(int enrolleeId, [FromQuery] string businessEventTypeCodes)
        {
            var enrollee = await _enrolleeService.GetEnrolleeAsync(enrolleeId);

            if (enrollee == null)
            {
                return(NotFound(ApiResponse.Message($"Enrollee not found with id {enrolleeId}")));
            }

            var codes  = businessEventTypeCodes?.Split(',').Select(int.Parse).ToArray() ?? new int[0];
            var events = await _enrolleeService.GetEnrolleeBusinessEvents(enrolleeId, codes);

            return(Ok(ApiResponse.Result(events)));
        }