Exemple #1
0
 public void SetExpectedProcessingTime(VisaExpectedProcessingTime expectedProcessingTime)
 {
     Apply(new VisaEvents.ExceptedProcessingTimeChanged
     {
         ExceptedProcessingTime = expectedProcessingTime.Days
     });
 }
Exemple #2
0
        protected override void When(object @event)
        {
            Requirement requirement;

            switch (@event)
            {
            case VisaEvents.Created e:
                Id   = new VisaId(e.Id);
                Type = e.Type;
                Goal = VisaGoal.NoGoal;
                ExpectedProcessingTime = VisaExpectedProcessingTime.NoExpectedProcessingTime;
                break;

            case VisaEvents.GoalChanged e:
                Goal = new VisaGoal(e.Goal);
                break;

            case VisaEvents.TypeUpdated e:
                Type = e.Type;
                break;

            case VisaEvents.ExceptedProcessingTimeChanged e:
                ExpectedProcessingTime = new VisaExpectedProcessingTime(e.ExceptedProcessingTime);
                break;

            case RequirementEvents.AddedToVisa e:
                requirement = new Requirement(Apply);
                ApplyToEntity(requirement, e);
                Requirements.Add(requirement);
                break;

            case RequirementEvents.NameChanged e:
                requirement = FindRequirement(new RequirementId(e.Id));
                ApplyToEntity(requirement, e);
                break;

            case RequirementEvents.ExampleChanged e:
                requirement = FindRequirement(new RequirementId(e.Id));
                ApplyToEntity(requirement, e);
                break;

            case RequirementEvents.DescriptionChanged e:
                requirement = FindRequirement(new RequirementId(e.Id));
                ApplyToEntity(requirement, e);
                break;
            }
        }