public async Task<int> CreateEvent(BirthdayPresentEventCreationDataTransferModel model)
        {
            if (this.CanCreateEvent(model))
            {
                var creator = await this.users.All().SingleOrDefaultAsync(x => x.UserName.Equals(model.CreatorUsername));
                var birthdayGuy = await this.users.All().SingleOrDefaultAsync(x => x.UserName.Equals(model.BirthdayGuyUsername));
                var birthdayDate = DateTime.Parse(model.BirthdayDate);

                if (creator == null || birthdayGuy == null || birthdayDate == null)
                {
                    return ServicesConstants.DbModelCreationFailed;
                }

                var birthdayPresentEvent = new BirthdayPresentEvent()
                {
                    Creator = creator,
                    BirthdayGuy = birthdayGuy,
                    BirthdayDate = birthdayDate,
                    IsActive = true
                };

                this.birthdayPresentEvents.Add(birthdayPresentEvent);
                await this.birthdayPresentEvents.SaveChangesAsync();

                int id = birthdayPresentEvent.Id;
                return id != 0 ? id : ServicesConstants.DbModelInsertionFailed;
            }
            else
            {
                return ServicesConstants.DbModelCreationFailed;
            }

        }
        private bool CanCreateEvent(BirthdayPresentEventCreationDataTransferModel model)
        {
            // User cannot create event for his own benefits
            if (model.CreatorUsername.Equals(model.BirthdayGuyUsername))
            {
                return false;
            }

            // Check if there is an event that is already active for the targeted person
            var isActive = this.birthdayPresentEvents.All().Any(x => x.BirthdayGuy.UserName.Equals(model.BirthdayGuyUsername) && x.IsActive);

            if (isActive)
            {
                return false;
            }

            // Check if there was an event from the same type created this year
            var isDoneThisYear = this.birthdayPresentEvents.All()
                .Any(
                    x =>
                        x.BirthdayGuy.UserName.Equals(model.BirthdayGuyUsername) &&
                        x.BirthdayDate.Year.Equals(DateTime.Now.Year));

            if (isDoneThisYear)
            {
                return false;
            }

            // If none of the above is true, then an event may be created.
            return true;
        }