Пример #1
0
        public async Task <IActionResult> ForceAssignment([FromBody] ReprocessForceAssignment command)
        {
            await rules
            .MustNotHaveExistingPendingOutcome()
            .EnsureValidProfileId()
            .Apply(command, ModelState);

            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await elrService.Execute(command);

            return(Ok());
        }
Пример #2
0
        public async Task Execute(ReprocessForceAssignment command)
        {
            foreach (var observation in command.ObservationKeys)
            {
                await writeContext.ElrOutcome.AddAsync(new Data.ElrOutcome
                {
                    CdAction           = "Send to Task List",
                    CdAssignmentType   = command.AssignmentType,
                    DsAssignmentReason = command.AssignmentReason,
                    IdElrObservation   = observation,
                    IdProfile          = command.ProfileId,
                    IdStateno          = command.StateNo,
                    CdCounty           = command.County
                });
            }

            await writeContext.SaveChangesAsync();

            await Execute(new RefilterObservations
            {
                ObservationKeys = command.ObservationKeys
            });
        }