Skip to content

Commit

Permalink
Updated json properties
Browse files Browse the repository at this point in the history
  • Loading branch information
mathijs-bb committed May 14, 2024
1 parent be714ca commit ceee0a2
Show file tree
Hide file tree
Showing 9 changed files with 147 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Apps.BWX/Apps.BWX.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Product>Bureau Works</Product>
<Version>1.0.6</Version>
<Version>1.0.7</Version>
<Description>Bureau Works is cutting edge translation software that helps its users translate at greater speeds and with an increased sense of authorship.</Description>
<AssemblyName>Apps.BWX</AssemblyName>
</PropertyGroup>
Expand Down
8 changes: 8 additions & 0 deletions Apps.BWX/Webhooks/Payload/NewOrgEvent.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,26 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class NewOrgEvent
{
[Display("Organization ID")]
[JsonProperty("uuid")]
public string Uuid { get; set; }

[JsonProperty("country")]
public string Country { get; set; }

[Display("Event type")]
[JsonProperty("event_type")]
public string EventType { get; set; }

//[JsonProperty("id")]
//public int Id { get; set; }
public string Name { get; set; }

[Display("Custom fields")]
[JsonProperty("custom_fields")]
public List<string> CustomFields { get; set; }
}
25 changes: 25 additions & 0 deletions Apps.BWX/Webhooks/Payload/NewProjectEvent.cs
Original file line number Diff line number Diff line change
@@ -1,38 +1,63 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class NewProjectEvent
{
[Display("Project ID")]
[JsonProperty("uuid")]
public string Uuid { get; set; }

//[Display("Creation timestamp")]
//[JsonProperty("creation_timestamp")]
//public long CreationTimestamp { get; set; }

[JsonProperty("creator")]
public string Creator { get; set; }

[Display("Creator email")]
[JsonProperty("creator_email")]
public string CreatorEmail { get; set; }

[Display("Event type")]
[JsonProperty("event_type")]
public string EventType { get; set; }

//[Display("ID")]
//[JsonProperty("id")]
//public int Id { get; set; }

[JsonProperty("instructions")]
public string Instructions { get; set; }

[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("notes")]
public string Notes { get; set; }

[JsonProperty("reference")]
public string Reference { get; set; }

[Display("Source locale")]
[JsonProperty("source_locale")]
public string SourceLocale { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("tags")]
public List<string> Tags { get; set; }

[Display("Target locales")]
[JsonProperty("target_locales")]
public List<string> TargetLocales { get; set; }

[JsonProperty("workflows")]
public List<string> Workflows { get; set; }

[Display("Custom fields")]
[JsonProperty("custom_fields")]
public List<string> CustomFields { get; set; }
}
15 changes: 15 additions & 0 deletions Apps.BWX/Webhooks/Payload/NewUserEvent.cs
Original file line number Diff line number Diff line change
@@ -1,24 +1,39 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class NewUserEvent
{
[Display("User ID")]
[JsonProperty("uuid")]
public string Uuid { get; set; }

[JsonProperty("country")]
public string Country { get; set; }

[Display("Event type")]
[JsonProperty("event_type")]
public string EventType { get; set; }

//[Display("ID")]
//[JsonProperty("id")]
//public int Id { get; set; }

[JsonProperty("name")]
public string Name { get; set; }

[JsonProperty("email")]
public string Email { get; set; }

[Display("Roles")]
[JsonProperty("role")]
public List<string> Role { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[Display("Custom fields")]
[JsonProperty("custom_fields")]
public List<string> CustomFields { get; set; }
}
29 changes: 27 additions & 2 deletions Apps.BWX/Webhooks/Payload/ProjectStatusChangedPayload.cs
Original file line number Diff line number Diff line change
@@ -1,44 +1,69 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class ProjectStatusChangedPayload
{
[Display("Project ID")]
[JsonProperty("uuid")]
public string Uuid { get; set; }

[Display("Creation timestamp")]
public long CreationTimestamp { get; set; }
//[Display("Creation timestamp")]
//[JsonProperty("creation_timestamp")]
//public long CreationTimestamp { get; set; }
public string Creator { get; set; }

[Display("Creator email")]
[JsonProperty("creator_email")]
public string CreatorEmail { get; set; }

[Display("Event type")]
[JsonProperty("event_type")]
public string EventType { get; set; }

//[Display("ID")]
//[JsonProperty("id")]
//public int Id { get; set; }

[JsonProperty("instructions")]
public string Instructions { get; set; }

[JsonProperty("name")]
public string Name { get; set; }

[Display("New status")]
[JsonProperty("new_status")]
public string NewStatus { get; set; }

[JsonProperty("notes")]
public string Notes { get; set; }

[Display("Previous status")]
[JsonProperty("previous_status")]
public string PreviousStatus { get; set; }

[JsonProperty("reference")]
public string Reference { get; set; }

[Display("Source locale")]
[JsonProperty("source_locale")]
public string SourceLocale { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("tags")]
public List<string> Tags { get; set; }

[Display("Target locales")]
[JsonProperty("target_locales")]
public List<string> TargetLocales { get; set; }

[JsonProperty("workflows")]
public List<string> Workflows { get; set; }

[Display("Custom fields")]
[JsonProperty("custom_fields")]
public List<string> CustomFields { get; set; }
}
8 changes: 8 additions & 0 deletions Apps.BWX/Webhooks/Payload/ProjectTranslationFinishedEvent.cs
Original file line number Diff line number Diff line change
@@ -1,28 +1,36 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class ProjectTranslationFinishedEvent
{

//[Display("Project ID")]
//[JsonProperty("project_id")]
//public int ProjectId { get; set; }

[Display("Project ID")]
[JsonProperty("project_uuid")]
public string ProjectUuid { get; set; }

[Display("Project name")]
[JsonProperty("project_name")]
public string ProjectName { get; set; }

[Display("Total work units completed")]
[JsonProperty("total_work_units_completed")]
public int TotalWorkUnitsCompleted { get; set; }

[Display("Total work units failed")]
[JsonProperty("total_work_units_failed")]
public int TotalWorkUnitsFailed { get; set; }

[Display("Total work units")]
[JsonProperty("total_work_units")]
public int TotalWorkUnits { get; set; }

[Display("Event type")]
[JsonProperty("event_type")]
public string EventType { get; set; }
}
35 changes: 35 additions & 0 deletions Apps.BWX/Webhooks/Payload/TaskAssignedEvent.cs
Original file line number Diff line number Diff line change
@@ -1,73 +1,108 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class TaskAssignedEvent
{
[Display("Task ID")]
[JsonProperty("uuid")]
public string Uuid { get; set; }

//[Display("Acceptance date")]
//[JsonProperty("acceptance_date")]
//public long AcceptanceDate { get; set; }

//[Display("Assign date")]
//[JsonProperty("assign_date")]
//public long AssignDate { get; set; }

[Display("Assigned by email")]
[JsonProperty("assigned_by_email")]
public string AssignedByEmail { get; set; }

[Display("Assigned by name")]
[JsonProperty("assigned_by_name")]
public string AssignedByName { get; set; }

[JsonProperty("assignee")]
public string Assignee { get; set; }

[Display("Assignee email")]
[JsonProperty("assignee_email")]
public string AssigneeEmail { get; set; }

[Display("Assignee word rate")]
[JsonProperty("assignee_word_rate")]
public double AssigneeWordRate { get; set; }

[Display("Begin index")]
[JsonProperty("begin_index")]
public long BeginIndex { get; set; }

//[Display("Creation timestamp")]
//[JsonProperty("creation_timestamp")]
//public long CreationTimestamp { get; set; }

[JsonProperty("creator")]
public string Creator { get; set; }

[Display("Creator email")]
[JsonProperty("creator_email")]
public string CreatorEmail { get; set; }

//[Display("Delivery date")]
//[JsonProperty("delivery_date")]
//public long DeliveryDate { get; set; }

//[Display("Due date")]
//[JsonProperty("due_date")]
//public long DueDate { get; set; }

//[Display("End index")]
//[JsonProperty("end_index")]
//public long EndIndex { get; set; }

[Display("Event type")]
[JsonProperty("event_type")]
public string EventType { get; set; }

[JsonProperty("files")]
public List<string> Files { get; set; }

//[Display("ID")]
//[JsonProperty("id")]
//public int Id { get; set; }

[JsonProperty("instructions")]
public string Instructions { get; set; }

[Display("Minimum score required")]
[JsonProperty("minimum_score_required")]
public double MinimumScoreRequired { get; set; }

[JsonProperty("name")]
public string Name { get; set; }

[Display("Reference files")]
[JsonProperty("reference_files")]
public List<string> ReferenceFiles { get; set; }

//[Display("Scheduled date")]
//[JsonProperty("scheduled_date")]
//public long ScheduledDate { get; set; }

//[Display("Skip date")]
//[JsonProperty("skip_date")]
//public long SkipDate { get; set; }

[JsonProperty("status")]
public string Status { get; set; }

[JsonProperty("workflow")]
public string Workflow { get; set; }

[Display("Custom fields")]
[JsonProperty("custom_fields")]
public List<string> CustomFields { get; set; }
}
3 changes: 3 additions & 0 deletions Apps.BWX/Webhooks/Payload/TaskStatusChangedPayload.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
using Blackbird.Applications.Sdk.Common;
using Newtonsoft.Json;

namespace Apps.BWX.Webhooks.Payload;

public class TaskStatusChangedPayload : TaskAssignedEvent
{
[Display("New status")]
[JsonProperty("new_status")]
public string NewStatus { get; set; }

[Display("Previous status")]
[JsonProperty("previous_status")]
public string PreviousStatus { get; set; }

}
Loading

0 comments on commit ceee0a2

Please sign in to comment.