예제 #1
0
        public void CriarExtrato(Guid extratoId, Guid participanteId)
        {
            if (extratoRepository.ExisteExtratoParticipante(participanteId))
            {
                throw new DomainException("O participante já possui extrato.");
            }

            var extrato = new Extrato(extratoId, participanteId);


            eventStoreService.SaveAggregate(extrato);
        }
        public async Task <DomainResult> AdicionarParticipante(Guid id, string nome, string email)
        {
            var participante = new Participante(id, nome, email);

            if (!participante.IsValid())
            {
                return(participante.Notifications().ToDomainResult());
            }

            await eventStoreService.SaveAggregate(participante);

            return(new DomainResult());
        }
        public async Task <DomainResult> CriarExtrato(Guid extratoId, Guid participanteId)
        {
            if (await extratoRepository.ExisteExtratoParticipante(participanteId))
            {
                return(new DomainResult("O participante já possui extrato."));
            }

            var extrato = new Extrato(extratoId, participanteId);


            await eventStoreService.SaveAggregate(extrato);

            return(new DomainResult());
        }
예제 #4
0
        public void AdicionarParticipante(Guid id, string nome, string email)
        {
            var participante = new Participante(id, nome, email);

            eventStoreService.SaveAggregate(participante);
        }