-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
72 changed files
with
7,024 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.ComponentModel; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text.Json.Serialization; | ||
using App.Modules.Common; | ||
using NJsonSchema.Annotations; | ||
|
||
namespace App.Error.V1; | ||
|
||
[ | ||
Description( | ||
"Like conflict error occurs when a user tries to like a template, plugin or processor that they have already liked, or unlike a template, plugin or processor that they have not liked.") | ||
] | ||
internal class LikeConflictError : IDomainProblem | ||
{ | ||
public LikeConflictError() { } | ||
|
||
public LikeConflictError(string detail, string resourceId, string resourceType, string conflictType) | ||
{ | ||
this.Detail = detail; | ||
this.ResourceId = resourceId; | ||
this.ResourceType = resourceType; | ||
this.ConflictType = conflictType; | ||
} | ||
|
||
[JsonIgnore, JsonSchemaIgnore] public string Id { get; } = "like_conflict"; | ||
[JsonIgnore, JsonSchemaIgnore] public string Title { get; } = "Like Conflict"; | ||
[JsonIgnore, JsonSchemaIgnore] public string Version { get; } = "v1"; | ||
[JsonIgnore, JsonSchemaIgnore] public string Detail { get; } = string.Empty; | ||
|
||
[Description("Type of Resource that like conflicted. Can be either 'template', 'plugin' or 'processor'")] | ||
public string ResourceType { get; } = string.Empty; | ||
|
||
[Description("ID of the resource that like conflicted")] | ||
public string ResourceId { get; } = string.Empty; | ||
|
||
[Description("Conflict type of the like. Can be either 'like' or 'unlike'")] | ||
public string ConflictType { get; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using System.ComponentModel; | ||
using System.ComponentModel.DataAnnotations; | ||
using System.Text.Json.Serialization; | ||
using App.Modules.Common; | ||
using NJsonSchema.Annotations; | ||
|
||
namespace App.Error.V1; | ||
|
||
[ | ||
Description( | ||
"Like race condition error occurs when a user tries to like a template, plugin or processor, when the start of the like query, the like exist and at the end of the like query, the like disappeared.") | ||
] | ||
internal class LikeRaceConditionError : IDomainProblem | ||
{ | ||
public LikeRaceConditionError() { } | ||
|
||
public LikeRaceConditionError(string detail, string resourceId, string resourceType, string conflictType) | ||
{ | ||
this.Detail = detail; | ||
this.ResourceId = resourceId; | ||
this.ResourceType = resourceType; | ||
this.ConflictType = conflictType; | ||
} | ||
|
||
[JsonIgnore, JsonSchemaIgnore] public string Id { get; } = "like_race_condition"; | ||
[JsonIgnore, JsonSchemaIgnore] public string Title { get; } = "Like Race Condition"; | ||
[JsonIgnore, JsonSchemaIgnore] public string Version { get; } = "v1"; | ||
[JsonIgnore, JsonSchemaIgnore] public string Detail { get; } = string.Empty; | ||
|
||
[Description("Type of Resource that like have race condition. Can be either 'template', 'plugin' or 'processor'")] | ||
public string ResourceType { get; } = string.Empty; | ||
|
||
[Description("ID of the resource that like have race condition")] | ||
public string ResourceId { get; } = string.Empty; | ||
|
||
[Description("Type of the like of the race condition. Can be either 'like' or 'unlike'")] | ||
public string ConflictType { get; } = string.Empty; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System.ComponentModel; | ||
using Newtonsoft.Json; | ||
using NJsonSchema.Annotations; | ||
|
||
namespace App.Error.V1; | ||
|
||
[Description("This error represents an error that multiple entities could not be found during a batch request")] | ||
public class MultipleEntityNotFound : IDomainProblem | ||
{ | ||
public MultipleEntityNotFound() { } | ||
|
||
public MultipleEntityNotFound(string detail, Type type, string[] notfound, string[] found) | ||
{ | ||
this.Detail = detail; | ||
this.AssemblyQualifiedName = type.AssemblyQualifiedName ?? "Unknown"; | ||
this.TypeName = type.FullName ?? "Unknown"; | ||
this.RequestIdentifiers = notfound; | ||
this.FoundRequestIdentifiers = found; | ||
} | ||
|
||
[JsonIgnore, JsonSchemaIgnore] public string Id { get; } = "multiple_entity_not_found"; | ||
|
||
[JsonIgnore, JsonSchemaIgnore] public string Title { get; } = "Multiple Entity Not Found"; | ||
|
||
[JsonIgnore, JsonSchemaIgnore] public string Version { get; } = "v1"; | ||
|
||
[JsonIgnore, JsonSchemaIgnore] public string Detail { get; } = string.Empty; | ||
|
||
|
||
[Description("All identifiers of the requested entity, that could not be found")] | ||
public string[] RequestIdentifiers { get; } = Array.Empty<string>(); | ||
|
||
[Description("All identifiers of the requested entity, that could be found")] | ||
public string[] FoundRequestIdentifiers { get; } = Array.Empty<string>(); | ||
|
||
[Description("The Full Name of the type of entities that could not be found")] | ||
public string TypeName { get; } = string.Empty; | ||
|
||
[Description("The AssemblyQualifiedName of the entities that could not be found")] | ||
public string AssemblyQualifiedName { get; } = string.Empty; | ||
} |
Oops, something went wrong.