Add project files.

This commit is contained in:
Sergio Matias Urquin
2025-04-29 18:37:40 -06:00
parent ef5b7ed2ca
commit dacb004ae9
43 changed files with 1432 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
using Core.Blueprint.External.Clients.Blueprint.Requests;
namespace Core.Blueprint.External.Clients.Blueprint.Adapters
{
public class BlueprintAdapter
{
public string Name { get; set; } = null!;
public string? Description { get; set; }
public string _Id { get; set; } = null!;
public string Id { get; init; } = null!;
public DateTime CreatedAt { get; set; }
public string? CreatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public string? UpdatedBy { get; set; }
public StatusEnum Status { get; set; }
}
}

View File

@@ -0,0 +1,10 @@
using Core.Blueprint.KeyVault;
namespace Core.Blueprint.External.Clients.Blueprint.Adapters
{
public class KeyVaultAdapter
{
public KeyVaultResponse Item1 { get; set; }
public string Item2 { get; set; }
}
}

View File

@@ -0,0 +1,18 @@
using Core.Blueprint.External.Clients.Blueprint.Requests;
namespace Core.Blueprint.External.Clients.Blueprint.Adapters
{
public class UserProjectAdapter
{
public string ProjectCode { get; set; } = null!;
public string ProjectDescription { get; set; } = null!;
public string UserId { get; set; } = null!;
public int Id { get; set; }
public string Guid { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public string? CreatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public string? UpdatedBy { get; set; }
public StatusEnum Status { get; set; }
}
}

View File

@@ -0,0 +1,70 @@
using Core.Blueprint.External.Clients.Blueprint.Adapters;
using Core.Blueprint.External.Clients.Blueprint.Requests.BlobStorage;
using Core.Blueprint.External.Clients.Blueprint.Requests.KeyVault;
using Core.Blueprint.External.Clients.Blueprint.Requests.Mongo;
using Core.Blueprint.External.Clients.Blueprint.Requests.SQL;
using Core.Blueprint.KeyVault;
using Core.Blueprint.Storage;
using Core.Blueprint.Storage.Adapters;
using Microsoft.AspNetCore.Mvc;
using Refit;
namespace Core.Blueprint.External.Clients.Blueprint
{
public interface IBlueprintServiceClient
{
[Post("/v1/MongoBlueprint/Create")]
Task<ApiResponse<BlueprintAdapter>> CreateBlueprintService([Body] CreateBlueprintRequest newBlueprint, CancellationToken cancellationToken = default);
[Get("/v1/MongoBlueprint/GetAll")]
Task<ApiResponse<IEnumerable<BlueprintAdapter>>> GetAllBlueprintsService(CancellationToken cancellationToken = default);
[Post("/v1/MongoBlueprint/GetById")]
Task<ApiResponse<BlueprintAdapter>> GetBlueprintByIdService([Body] GetBlueprintRequest request, CancellationToken cancellationToken = default);
[Put("/v1/MongoBlueprint/Update")]
Task<ApiResponse<BlueprintAdapter>> UpdateBlueprintService([Body] UpdateBlueprintRequest entity, CancellationToken cancellationToken = default);
[Delete("/v1/MongoBlueprint/Delete")]
Task<ApiResponse<BlueprintAdapter>> DeleteBlueprintService([Body] DeleteBlueprintRequest request, CancellationToken cancellationToken = default);
[Post("/v1/SQLUserProject/Create")]
Task<ApiResponse<UserProjectAdapter>> CreateUserProjectService([Body] CreateUserProjectRequest newUserProject, CancellationToken cancellationToken = default);
[Get("/v1/SQLUserProject/GetAll")]
Task<ApiResponse<IEnumerable<UserProjectAdapter>>> GetAllUserProjectsService(CancellationToken cancellationToken = default);
[Post("/v1/SQLUserProject/GetById")]
Task<ApiResponse<UserProjectAdapter>> GetUserProjectByIdService([Body] GetUserProjectRequest request, CancellationToken cancellationToken = default);
[Put("/v1/SQLUserProject/Update")]
Task<ApiResponse<UserProjectAdapter>> UpdateUserProjectService([Body] UpdateUserProjectRequest entity, CancellationToken cancellationToken = default);
[Delete("/v1/SQLUserProject/Delete")]
Task<ApiResponse<UserProjectAdapter>> DeleteUserProjectService([Body] DeleteUserProjectRequest request, CancellationToken cancellationToken = default);
[Post("/v1/KeyVault/CreateSecret")]
Task<ApiResponse<KeyVaultResponse>> CreateSecretService([Body] CreateSecretRequest newKeyVault, CancellationToken cancellationToken = default);
[Post("/v1/KeyVault/GetSecretByName")]
Task<ApiResponse<KeyVaultAdapter>> GetSecretByNameService([Body] GetSecretRequest request, CancellationToken cancellationToken = default);
[Put("/v1/KeyVault/UpdateSecret")]
Task<ApiResponse<KeyVaultAdapter>> UpdateSecretService([Body] UpdateSecretRequest entity, CancellationToken cancellationToken = default);
[Delete("/v1/KeyVault/DeleteSecret")]
Task<ApiResponse<KeyVaultAdapter>> DeleteSecretService([Body] DeleteSecretRequest request, CancellationToken cancellationToken = default);
[Post("/v1/BlobStorage/UploadBlob")]
Task<ApiResponse<BlobFileAdapter>> UploadBlobService([Body] UploadBlobRequest request, CancellationToken cancellationToken = default);
[Get("/v1/BlobStorage/GetBlobList")]
Task<ApiResponse<List<BlobFileAdapter>>> GetBlobListAsync([FromQuery] string? prefix, CancellationToken cancellationToken = default);
[Post("/v1/BlobStorage/DownloadBlob")]
Task<ApiResponse<BlobDownloadUriAdapter>> DownloadBlobAsync([Body] DownloadBlobRequest request, CancellationToken cancellationToken = default);
[Delete("/v1/BlobStorage/DeleteBlob")]
Task<ApiResponse<BlobFileAdapter>> DeleteBlobService([Body] DeleteBlobRequest request, CancellationToken cancellationToken = default);
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.BlobStorage
{
public class DeleteBlobRequest
{
public string BlobName { get; set; } = null!;
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.BlobStorage
{
public class DownloadBlobRequest
{
public string BlobName { get; set; } = null!;
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.BlobStorage
{
public class GetBlobListRequest
{
public string? Prefix { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.BlobStorage
{
public class UploadBlobRequest
{
public string BlobName { get; set; } = null!;
public byte[] BlobContent { get; set; } = null!;
}
}

View File

@@ -0,0 +1,9 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.KeyVault
{
public class CreateSecretRequest
{
public string Name { get; set; } = null!;
public string Value { get; set; } = null!;
}
}

View File

@@ -0,0 +1,6 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.KeyVault;
public class DeleteSecretRequest
{
public string Name { get; set; }
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.KeyVault
{
public class GetSecretRequest
{
public string Name { get; set; }
}
}

View File

@@ -0,0 +1,8 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.KeyVault
{
public class UpdateSecretRequest
{
public string Name { get; set; } = null!;
public string Value { get; set; } = null!;
}
}

View File

@@ -0,0 +1,9 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.Mongo
{
public class CreateBlueprintRequest
{
public string Name { get; set; } = null!;
public string? Description { get; set; }
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.Mongo
{
public class DeleteBlueprintRequest
{
public string _Id { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.Mongo
{
public class GetAllBlueprintsRequest
{
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.Mongo
{
public class GetBlueprintRequest
{
public string _Id { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.Mongo
{
public class UpdateBlueprintRequest
{
public string Name { get; set; } = null!;
public string? Description { get; set; }
public string _Id { get; set; } = null!;
public string Id { get; init; } = null!;
public DateTime CreatedAt { get; set; }
public string? CreatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public string? UpdatedBy { get; set; }
public StatusEnum Status { get; set; }
}
}

View File

@@ -0,0 +1,9 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.SQL
{
public class CreateUserProjectRequest
{
public string ProjectCode { get; set; } = null!;
public string ProjectDescription { get; set; } = null!;
public string UserId { get; set; } = null!;
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.SQL
{
public class DeleteUserProjectRequest
{
public int Id { get; set; }
}
}

View File

@@ -0,0 +1,6 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.SQL
{
public class GetAllUserProjectsRequest
{
}
}

View File

@@ -0,0 +1,7 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.SQL
{
public class GetUserProjectRequest
{
public int Id { get; set; }
}
}

View File

@@ -0,0 +1,16 @@
namespace Core.Blueprint.External.Clients.Blueprint.Requests.SQL
{
public class UpdateUserProjectRequest
{
public string ProjectCode { get; set; } = null!;
public string ProjectDescription { get; set; } = null!;
public string UserId { get; set; } = null!;
public int Id { get; set; }
public string Guid { get; set; } = null!;
public DateTime CreatedAt { get; set; }
public string? CreatedBy { get; set; }
public DateTime? UpdatedAt { get; set; }
public string? UpdatedBy { get; set; }
public StatusEnum Status { get; set; }
}
}

View File

@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;
namespace Core.Blueprint.External.Clients.Blueprint.Requests
{
[JsonConverter(typeof(JsonStringEnumConverter))]
public enum StatusEnum
{
Active = 0,
Inactive = 1,
Deleted = 2
}
}