Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 9 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,37 +1,17 @@
# Ignore Visual Studio folder
/.vs/
# Ignore build folders
/bin/
/obj/
.vs/

# Ignore build folders (all projects)
**/bin/
**/obj/

# Ignore config files
*.config
!NuGet.config
/AnointedAutomation.APIMiddlewares/bin
/AnointedAutomation.APIMiddlewares/obj
/AnointedAutomation.Logging/bin
/AnointedAutomation.Logging/obj
/AnointedAutomation.Repository.Mongo/obj
/AnointedAutomation.Repository.Mongo/bin
/AnointedAutomation.Objects.API/obj
/AnointedAutomation.Objects.API/bin
/AnointedAutomation.Memory/bin
/AnointedAutomation.Memory/obj

# Other
deploy_nugets.py
/AnointedAutomation.Objects/obj
/AnointedAutomation.Objects/bin
/AnointedAutomation.Logging.Tests/obj
/AnointedAutomation.APIMiddlewares.Tests/obj
/AnointedAutomation.Memory.Tests/obj
/AnointedAutomation.Repository.Mongo.Tests/obj
/AnointedAutomation.Memory.Tests/bin
/AnointedAutomation.Logging.Tests/bin
/AnointedAutomation.APIMiddlewares.Tests/bin
/AnointedAutomation.Repository.Mongo.Tests/bin
/AnointedAutomation.Repository.MySql/bin
/AnointedAutomation.Repository.MySql/obj
/AnointedAutomation.Repository.MySql.Tests/bin
/AnointedAutomation.Repository.MySql.Tests/obj
/AnointedAutomation.APIMiddlewares/Properties
**/Properties/

**/.claude/settings.local.json

Expand Down
73 changes: 40 additions & 33 deletions AnointedAutomation.Objects.API/API/ResponseData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
// Edited by Alexander Fields https://www.alexanderfields.me 2025-07-02 11:48:25
//Created by Alexander Fields

// =============================================================================
// NAMING CONVENTION:
// This codebase follows a specific property naming pattern:
// - Value types (structs): lowercase (e.g., bool success, int statusCode)
// - Reference types (objects): PascalCase (e.g., string Message, object Data)
// =============================================================================

namespace AnointedAutomation.Objects.API
{
/// <summary>
Expand All @@ -15,7 +22,7 @@ public class ResponseData
public ResponseData()
{
Timestamp = System.DateTime.UtcNow.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'");
Success = Error == null;
success = Error == null;
}

/// <summary>
Expand All @@ -30,7 +37,7 @@ public ResponseData(string message, object data, object error)
Data = data;
Error = error;
Timestamp = System.DateTime.UtcNow.ToString("yyyy-MM-dd'T'HH:mm:ss.fff'Z'");
Success = error == null;
success = error == null;
}

/// <summary>
Expand All @@ -48,7 +55,7 @@ public ResponseData(string message, object data, object error)
/// <summary>
/// Gets or sets whether the response represents a successful operation.
/// </summary>
public bool Success { get; set; }
public bool success { get; set; }
/// <summary>
/// Gets or sets the timestamp when the response was created in ISO 8601 format.
/// </summary>
Expand Down Expand Up @@ -80,7 +87,7 @@ public class ResponseData<T>
/// <summary>
/// Gets or sets whether the response represents a successful operation.
/// </summary>
public bool Success { get; set; }
public bool success { get; set; }
/// <summary>
/// Gets or sets the response data payload.
/// </summary>
Expand All @@ -92,7 +99,7 @@ public class ResponseData<T>
/// <summary>
/// Gets or sets the HTTP status code.
/// </summary>
public int StatusCode { get; set; }
public int statusCode { get; set; }
/// <summary>
/// Gets or sets the timestamp when the response was created in ISO 8601 format.
/// </summary>
Expand Down Expand Up @@ -121,10 +128,10 @@ public static ResponseData<T> Ok(T data, string message = null)
{
return new ResponseData<T>
{
Success = true,
success = true,
Data = data,
Message = message,
StatusCode = 200
statusCode = 200
};
}

Expand All @@ -135,10 +142,10 @@ public static ResponseData<T> Created(T data, string message = null)
{
return new ResponseData<T>
{
Success = true,
success = true,
Data = data,
Message = message,
StatusCode = 201
statusCode = 201
};
}

Expand All @@ -149,10 +156,10 @@ public static ResponseData<T> Error(string message, int statusCode = 400)
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = statusCode
statusCode = statusCode
};
}

Expand All @@ -163,10 +170,10 @@ public static ResponseData<T> NotFound(string message = "Resource not found")
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 404
statusCode = 404
};
}

Expand All @@ -177,10 +184,10 @@ public static ResponseData<T> Unauthorized(string message = "Unauthorized")
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 401
statusCode = 401
};
}

Expand All @@ -191,10 +198,10 @@ public static ResponseData<T> Forbidden(string message = "Forbidden")
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 403
statusCode = 403
};
}

Expand All @@ -205,10 +212,10 @@ public static ResponseData<T> BadRequest(string message = "Bad request")
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 400
statusCode = 400
};
}

Expand All @@ -219,10 +226,10 @@ public static ResponseData<T> Conflict(string message = "Conflict")
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 409
statusCode = 409
};
}

Expand All @@ -233,10 +240,10 @@ public static ResponseData<T> UnprocessableEntity(string message = "Unprocessabl
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 422
statusCode = 422
};
}

Expand All @@ -247,10 +254,10 @@ public static ResponseData<T> TooManyRequests(string message = "Too many request
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 429
statusCode = 429
};
}

Expand All @@ -261,10 +268,10 @@ public static ResponseData<T> InternalServerError(string message = "Internal ser
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 500
statusCode = 500
};
}

Expand All @@ -275,10 +282,10 @@ public static ResponseData<T> ServiceUnavailable(string message = "Service unava
{
return new ResponseData<T>
{
Success = false,
success = false,
Data = default,
Message = message,
StatusCode = 503
statusCode = 503
};
}

Expand All @@ -289,10 +296,10 @@ public static ResponseData<T> NoContent()
{
return new ResponseData<T>
{
Success = true,
success = true,
Data = default,
Message = null,
StatusCode = 204
statusCode = 204
};
}

Expand All @@ -303,10 +310,10 @@ public static ResponseData<T> Accepted(T data = default, string message = "Accep
{
return new ResponseData<T>
{
Success = true,
success = true,
Data = data,
Message = message,
StatusCode = 202
statusCode = 202
};
}
}
Expand Down
Loading
Loading