/// <summary> /// Initializes a new instance of the <see cref="HootsuiteClient"/> class. /// </summary> /// <param name="options">The options.</param> public HootsuiteClient(dynamic options) { _connection = new Connection(options); _connectionOwly = new ConnectionOwly(options); // Me = new Me(this, _connection); Media = new Media(this, _connection); Members = new Members(this, _connection); Messages = new Messages(this, _connection); Organizations = new Organizations(this, _connection); Scim = new Scim(this, _connection); SocialProfiles = new SocialProfiles(this, _connection); Teams = new Teams(this, _connection); Owly = new Owly(this, _connectionOwly); InteractionHistory = new InteractionHistory(this, _connection); }
public async Task <bool> StatusUpdate(Guid userId, Guid reportId, Guid newStatusId, string updateDescription) { var reportToUpdate = await _reportRepository.GetById(reportId); Guid oldStatus = reportToUpdate.ReportStatusId; reportToUpdate.ReportStatusId = newStatusId; await _reportRepository.Update(reportToUpdate); InteractionHistory interaction = new InteractionHistory() { UserId = userId, ReportId = reportId, oldReportStatusId = oldStatus, NewReportStatusId = newStatusId, Description = updateDescription, CreationDate = DateTime.Now }; await _interactionRepository.Add(interaction); var currentStatus = await _statusRepository.GetById(newStatusId); if (currentStatus.InProgress) { var records = await _progressRepo.Find(x => x.ReportId == reportToUpdate.Id); if (!records.Any()) { ReportInProgress inProgress = new ReportInProgress() { InteractionHistoryId = interaction.Id, ReportId = reportToUpdate.Id, UserId = interaction.UserId, CreationDate = DateTime.Now }; //TO-DO: Disparar notificacao para os usuários await _progressRepo.Add(inProgress); } } await SendNotifications(reportToUpdate, interaction.Id); return(true); }
private async Task SendNotifications(Report report, Guid interactionId) { InteractionHistory interaction = await _interactionRepository.GetById(interactionId); string description = "A denúncia {0} sofreu uma atualização de status.\n Data de alteração: {1}"; CreateUserNotification notification = new CreateUserNotification() { Description = string.Format(description, report.Title, interaction.CreationDate.ToShortDateString()), ReportId = report.Id, Title = $"Alteração de status na denúncia {report.Title}", InteractionHistoryId = interactionId, UserId = report.UserId }; await _notificationHandler.SendUserNotification(notification); }
public Task Add(InteractionHistory interaction) { throw new System.NotImplementedException(); }