Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:42:29 -06:00
parent 9c1958d351
commit 83fc1878c4
67 changed files with 4586 additions and 0 deletions

View File

@@ -0,0 +1,48 @@
// ***********************************************************************
// <copyright file="Claims.cs">
// Heath
// </copyright>
// ***********************************************************************
namespace Core.Blueprint.Logging
{
/// <summary>
/// Constants for claims used in JWT tokens.
/// </summary>
public class Claims
{
/// <summary>
/// Claim name for user's name.
/// </summary>
public const string Name = "name";
/// <summary>
/// Claim name for user's name.
/// </summary>
public const string Email = "email";
/// <summary>
/// Claim name for user's ID.
/// </summary>
public const string Id = "id";
/// <summary>
/// Claim name for user's role ID.
/// </summary>
public const string Rol = "rol";
/// <summary>
/// Claim name for user's companies.
/// </summary>
public const string Companies = "companies";
/// <summary>
/// Claim name for user's projects.
/// </summary>
public const string Projects = "projects";
/// <summary>
/// Claim name for user's surveys.
/// </summary>
public const string Surveys = "surveys";
}
}

View File

@@ -0,0 +1,397 @@
// ***********************************************************************
// <copyright file="DisplayNames.cs">
// Heath
// </copyright>
// ***********************************************************************
namespace Core.Blueprint.Logging
{
/// <summary>
/// Constants of the display names for this service.
/// </summary>
public static class DisplayNames
{
/// <summary>
/// The active patameter.
/// </summary>
public const string Active = "active";
/// <summary>
/// The keyVaultProvider identifier parameter.
/// </summary>
public const string ClientId = "keyVaultProviderId";
/// <summary>
/// The keyVaultProvider request parameter.
/// </summary>
public const string ClientRequest = "keyVaultProviderRequest";
/// <summary>
/// The keyVaultProvider response parameter.
/// </summary>
public const string ClientResponse = "keyVaultProviderResponse";
/// <summary>
/// The creation date.
/// </summary>
public const string CreationDate = "creationDate";
/// <summary>
/// The content parameter.
/// </summary>
public const string Content = "content";
/// <summary>
/// The delete parameter.
/// </summary>
public const string Delete = "delete";
/// <summary>
/// The description parameter.
/// </summary>
public const string Description = "description";
/// <summary>
/// The detail parameter.
/// </summary>
public const string Detail = "detail";
/// <summary>
/// The environment parameter.
/// </summary>
public const string Environment = "environment";
/// <summary>
/// The error log severity level parameter.
/// </summary>
public const string Error = "error";
/// <summary>
/// The error code parameter.
/// </summary>
public const string ErrorCode = "errorCode";
/// <summary>
/// The external request parameter.
/// </summary>
public const string ExternalRequest = "externalRequest";
/// <summary>
/// The external response parameter.
/// </summary>
public const string ExternalResponse = "externalResponse";
/// <summary>
/// The fatal log severity level parameter.
/// </summary>
public const string Fatal = "fatal";
/// <summary>
/// The host parameter.
/// </summary>
public const string Host = "host";
/// <summary>
/// The identifier parameter.
/// </summary>
public const string Id = "id";
/// <summary>
/// The inactive parameter.
/// </summary>
public const string Inactive = "inactive";
/// <summary>
/// The info log severity level parameter.
/// </summary>
public const string Info = "info";
/// <summary>
/// The information log severity level parameter.
/// </summary>
public const string Information = "information";
/// <summary>
/// The media parameter.
/// </summary>
public const string Media = "media";
/// <summary>
/// The media type parameter.
/// </summary>
public const string MediaType = "mediaType";
/// <summary>
/// The media use type parameter.
/// </summary>
public const string MediaUseType = "mediaUseType";
/// <summary>
/// Th message parameter.
/// </summary>
public const string Message = "message";
/// <summary>
/// The method parameter.
/// </summary>
public const string Method = "method";
/// <summary>
/// The monday parameter.
/// </summary>
public const string Monday = "monday";
/// <summary>
/// The MXN parameter.
/// </summary>
public const string MXN = "MXN";
/// <summary>
/// The name parameter.
/// </summary>
public const string Name = "name";
/// <summary>
/// The next page parameter.
/// </summary>
public const string NextPage = "nextPage";
/// <summary>
/// The nick name parameter.
/// </summary>
public const string NickName = "nickName";
/// <summary>
/// The note parameter.
/// </summary>
public const string Note = "note";
/// <summary>
/// The not so affordable parameter.
/// </summary>
public const string NotSoAffordable = "notSoAffordable";
/// <summary>
/// The object status parameter.
/// </summary>
public const string ObjectStatus = "objectStatus";
/// <summary>
/// The opening time parameter.
/// </summary>
public const string OpeningTime = "openingTime";
/// <summary>
/// The operation days parameter.
/// </summary>
public const string OperationDays = "operationDays";
/// <summary>
/// The page parameter.
/// </summary>
public const string Page = "page";
/// <summary>
/// The page count parameter.
/// </summary>
public const string PageCount = "pageCount";
/// <summary>
/// The page metadata parameter.
/// </summary>
public const string PageMetadata = "pageMetadata";
/// <summary>
/// The page size parameter.
/// </summary>
public const string PageSize = "pageSize";
/// <summary>
/// The parent identifier parameter.
/// </summary>
public const string ParentId = "ParentId";
/// <summary>
/// The pet ticket price parameter.
/// </summary>
public const string PetTicketPrice = "petTicketPrice";
/// <summary>
/// The place parameter.
/// </summary>
public const string Place = "place";
/// <summary>
/// The place type parameter.
/// </summary>
public const string PlaceType = "placeType";
/// <summary>
/// The previous page parameter.
/// </summary>
public const string PreviousPage = "previousPage";
/// <summary>
/// The provider identifier parameter.
/// </summary>
public const string ProviderId = "providerId";
/// <summary>
/// The provider type identifier parameter.
/// </summary>
public const string ProviderTypeId = "providerTypeId";
/// <summary>
/// The request identifier parameter.
/// </summary>
public const string RequestId = "requestId";
/// <summary>
/// The RNT identifier parameter.
/// </summary>
public const string RntId = "rntId";
/// <summary>
/// The route parameter.
/// </summary>
public const string Route = "route";
/// <summary>
/// The operation parameter.
/// </summary>
public const string Operation = "operation";
/// <summary>
/// The other ticket price parameter.
/// </summary>
public const string OtherTicketPrice = "otherTicketPrice";
/// <summary>
/// The path parameter.
/// </summary>
public const string Path = "path";
/// <summary>
/// The saturday parameter.
/// </summary>
public const string Saturday = "saturday";
/// <summary>
/// The secondary parameter.
/// </summary>
public const string Secondary = "secondary";
/// <summary>
/// The service health parameter.
/// </summary>
public const string ServiceHealth = "serviceHealth";
/// <summary>
/// The service identifier parameter.
/// </summary>
public const string ServiceId = "serviceId";
/// <summary>
/// The severity parameter.
/// </summary>
public const string Severity = "severity";
/// <summary>
/// The state identifier parameter.
/// </summary>
public const string StateId = "stateId";
/// <summary>
/// The region identifier parameter.
/// </summary>
public const string StateProvinceRegionId = "regionId";
/// <summary>
/// The sunday parameter.
/// </summary>
public const string Sunday = "sunday";
/// <summary>
/// The tax identifier parameter.
/// </summary>
public const string TaxId = "taxId";
/// <summary>
/// The target parameter.
/// </summary>
public const string Target = "target";
/// <summary>
/// The thursday parameter.
/// </summary>
public const string Thursday = "thursday";
/// <summary>
/// The timestamp parameter.
/// </summary>
public const string Timestamp = "timestamp";
/// <summary>
/// The total items parameter.
/// </summary>
public const string TotalItems = "totalItems";
/// <summary>
/// Gets or sets the transaction identifier parameter.
/// </summary>
public const string TransactionId = "transactionId";
/// <summary>
/// The tuesday parameter.
/// </summary>
public const string Tuesday = "tuesday";
/// <summary>
/// The URI parameter.
/// </summary>
public const string Uri = "uri";
/// <summary>
/// The update parameter.
/// </summary>
public const string Update = "update";
/// <summary>
/// The x-forwarded-for header parameter.
/// </summary>
public const string XForwardedFor = "xForwardedFor";
/// <summary>
/// The x-forwarded-for header parameter.
/// </summary>
public const string XForwardedForHeader = "X-Forwarded-For";
/// <summary>
/// The final currency identifier parameter.
/// </summary>
public const string CurrencyId = "currencyId";
/// <summary>
/// The user identifier parameter.
/// </summary>
public const string UserId = "userId";
/// <summary>
/// The user parameter.
/// </summary>
public const string User = "user";
/// <summary>
/// The warning log severity level.
/// </summary>
public const string Warning = "warning";
/// <summary>
/// The email parameter.
/// </summary>
public const string Email = "email";
}
}

View File

@@ -0,0 +1,21 @@
// ***********************************************************************
// <copyright file="EnvironmentVariables.cs">
// Heath
// </copyright>
// ***********************************************************************
namespace Core.Blueprint.Logging
{
/// <summary>
/// Constants of the environment variables for this service.
/// </summary>
public static class EnvironmentVariables
{
/// <summary>
/// The stage environment vriable.
/// </summary>
public const string Stage = "ASPNETCORE_ENVIRONMENT";
}
}

View File

@@ -0,0 +1,79 @@
// ***********************************************************************
// <copyright file="ErrorCodes.cs">
// Heath
// </copyright>
// ***********************************************************************
namespace Core.Blueprint.Logging
{
/// <summary>
/// Constants for the error codes.
/// </summary>
public static class ErrorCodes
{
/// <summary>
/// The generic entities not found error code.
/// </summary>
public const string EntitiesNotFound = "{0}EntitiesNotFound";
/// <summary>
/// The entity already exsits error message.
/// </summary>
public const string EntityAlreadyExists = "{0}EntityAlreadyExists";
/// <summary>
/// The generic entity not found error code.
/// </summary>
public const string EntityNotFound = "{0}EntityNotFound";
/// <summary>
/// The generic not supported error code.
/// </summary>
public const string EntityNotSupported = "{0}NotSupported";
/// <summary>
/// The internal server error code.
/// </summary>
public const string InternalServerError = "InternalServerError";
/// <summary>
/// The invalid parameters in mapper error code.
/// </summary>
public const string InvalidParametersMapper = "InvalidParametersMapper";
/// <summary>
/// The page size invalid value error code.
/// </summary>
public const string PageSizeInvalidValue = "PageSizeInvalidValue";
/// <summary>
/// The page ot of range error code.
/// </summary>
public const string PageOutOfRange = "PageOutOfRange";
/// <summary>
/// The property does not match the regular expresion error code.
/// </summary>
public const string PropertyDoesNotMatchRegex = "{0}PropertyDoesNotMatchRegex";
/// <summary>
/// The property is required error code.
/// </summary>
public const string PropertyIsRequired = "{0}PropertyIsRequired";
/// <summary>
/// The property length invalid error code.
/// </summary>
public const string PropertyLengthInvalid = "{0}PropertyLengthInvalid";
/// <summary>
/// The property must be in range error code.
/// </summary>
public const string PropertyMustBeInRange = "{0}PropertyMustBeInRange";
/// <summary>
/// The route not found error code.
/// </summary>
public const string RouteNotFound = "RouteNotFound";
}
}

View File

@@ -0,0 +1,10 @@
namespace Core.Blueprint.Logging
{
public static class Headers
{
/// <summary>
/// The authorization header.
/// </summary>
public const string Authorization = "Authorization";
}
}

View File

@@ -0,0 +1,148 @@
// ***********************************************************************
// <copyright file="MimeTypes.cs">
// Heath
// </copyright>
// ***********************************************************************
using System.Globalization;
namespace Core.Blueprint.Logging
{
/// <summary>
/// Constants for the mime types.
/// </summary>
public static class MimeTypes
{
/// <summary>
/// The service application/json mime type.
/// </summary>
public const string ApplicationJson = "application/json";
/// <summary>
/// The application/pdf mime type.
/// </summary>
public const string ApplicationPdf = "application/pdf";
/// <summary>
/// The end index.
/// </summary>
public const int EndIndex = 5;
/// <summary>
/// The JPEG extension.
/// </summary>
public const string ExtensionGif = "gif";
/// <summary>
/// The JPEG extension.
/// </summary>
public const string ExtensionJpeg = "jpeg";
/// <summary>
/// The PNG extension.
/// </summary>
public const string ExtensionPng = "png";
/// <summary>
/// The SVG extension.
/// </summary>
public const string ExtensionSvg = "svg";
/// <summary>
/// The image/gif mime type.
/// </summary>
public const string ImageGif = "image/gif";
/// <summary>
/// The image/jpeg mime type.
/// </summary>
public const string ImageJpeg = "image/jpeg";
/// <summary>
/// The image/png mime type.
/// </summary>
public const string ImagePng = "image/png";
/// <summary>
/// The image/svg+xml mime type.
/// </summary>
public const string ImageSvg = "image/svg+xml";
/// <summary>
/// The identifier GIF.
/// </summary>
public const string IdentifierGif = "R0LGO";
/// <summary>
/// The identifier PNG.
/// </summary>
public const string IdentifierJpeg = "/9J/4";
/// <summary>
/// The identifier PDF.
/// </summary>
public const string IdentifierPdf = "JVBER";
/// <summary>
/// The identifier PNG.
/// </summary>
public const string IdentifierPng = "IVBOR";
/// <summary>
/// The identifier SVG.
/// </summary>
public const string IdentifierSvg = "PHN2Z";
/// <summary>
/// The parameter name.
/// </summary>
public const string ParameterName = "MimeType";
/// <summary>
/// The start index.
/// </summary>
public const int StartIndex = 0;
/// <summary>
/// The mime type dictionary.
/// </summary>
public static readonly Dictionary<string, string> Dictionary = new Dictionary<string, string>
{
{ IdentifierJpeg, ImageJpeg },
{ IdentifierPng, ImagePng },
{ IdentifierGif, ImageGif },
{ IdentifierSvg, ImageSvg },
};
/// <summary>
/// The mime type dictionary.
/// </summary>
public static readonly Dictionary<string, string> DictionaryExtension = new Dictionary<string, string>
{
{ IdentifierJpeg, ExtensionJpeg },
{ IdentifierPng, ExtensionPng },
{ IdentifierGif, ExtensionGif },
{ IdentifierSvg, ExtensionSvg },
};
/// <summary>
/// Gets the mime type.
/// </summary>
/// <param name="content">The cpntent with mime type identifier, substring 0, 5 from content.</param>
/// <returns>A <see cref="string"/> representing the value.</returns>
public static string GetMimeType(this string content)
{
return Dictionary.FirstOrDefault(_ => _.Key == content[..EndIndex].ToUpper(CultureInfo.InvariantCulture)).Value;
}
/// <summary>
/// Gets the extension.
/// </summary>
/// <param name="content">The mime type identifier, substring 0, 5 from content.</param>
/// <returns>A <see cref="string"/> representing the value.</returns>
public static string GetExtension(this string content)
{
return DictionaryExtension.FirstOrDefault(_ => _.Key == content[..EndIndex].ToUpper(CultureInfo.InvariantCulture)).Value;
}
}
}

View File

@@ -0,0 +1,29 @@
// ***********************************************************************
// <copyright file="Responses.cs">
// Heath
// </copyright>
// ***********************************************************************
namespace Core.Blueprint.Logging
{
/// <summary>
/// Constants of the responses for this service.
/// </summary>
public static class Responses
{
/// <summary>
/// The health response.
/// </summary>
public const string HealthyService = "healthy";
/// <summary>
/// The route does not exist response.
/// </summary>
public const string RouteDoesNotExist = "The specified route '{0}' does not exist for method '{1}' in this service.";
/// <summary>
/// The target response.
/// </summary>
public const string Target = "{0}|{1}://{2}{3}";
}
}