First version of Service
This commit is contained in:
		
							
								
								
									
										49
									
								
								Core.Inventory.External/Clients/IInventoryServiceClient.cs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								Core.Inventory.External/Clients/IInventoryServiceClient.cs
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,49 @@ | ||||
| using Core.Adapters.Lib; | ||||
| using Core.Blueprint.Mongo; | ||||
| using Core.Inventory.External.Clients.Requests; | ||||
| using Microsoft.AspNetCore.Mvc; | ||||
| using Refit; | ||||
|  | ||||
| namespace Core.Inventory.External.Clients | ||||
| { | ||||
|     public interface IInventoryServiceClient | ||||
|     { | ||||
|         #region FurnitureBase | ||||
|  | ||||
|         [Get("/api/v1/FurnitureBase")] | ||||
|         Task<IEnumerable<FurnitureBase>> GetAllFurnitureBaseAsync(CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Get("/api/v1/FurnitureBase/{id}")] | ||||
|         Task<FurnitureBase> GetFurnitureBaseByIdAsync([FromRoute] string id, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Post("/api/v1/FurnitureBase")] | ||||
|         Task<FurnitureBase> CreateFurnitureBaseAsync([FromBody] FurnitureBaseRequest request, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Put("/api/v1/FurnitureBase/{id}")] | ||||
|         Task<FurnitureBase> UpdateFurnitureBaseAsync([FromBody] FurnitureBaseRequest request, [FromRoute] string id, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Patch("/api/v1/FurnitureBase/{id}/{newStatus}/ChangeStatus")] | ||||
|         Task<FurnitureBase> ChangeFurnitureBaseStatusAsync([FromRoute] string id, [FromRoute] StatusEnum newStatus, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         #endregion | ||||
|  | ||||
|         #region FurnitureVariant | ||||
|  | ||||
|         [Get("/api/v1/FurnitureVariant/{modelId}")] | ||||
|         Task<IEnumerable<FurnitureVariant>> GetAllVariantsByModelIdAsync([FromRoute] string modelId, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Get("/api/v1/FurnitureVariant/{id}/byId")] | ||||
|         Task<FurnitureVariant> GetFurnitureVariantByIdAsync([FromRoute] string id, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Post("/api/v1/FurnitureVariant")] | ||||
|         Task<FurnitureVariant> CreateFurnitureVariantAsync([FromBody] FurnitureVariantRequest request, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Put("/api/v1/FurnitureVariant/{id}")] | ||||
|         Task<FurnitureVariant> UpdateFurnitureVariantAsync([FromBody] FurnitureVariantRequest request, [FromRoute] string id, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         [Patch("/api/v1/FurnitureVariant/{id}/{newStatus}/ChangeStatus")] | ||||
|         Task<FurnitureVariant> ChangeFurnitureVariantStatusAsync([FromRoute] string id, [FromRoute] StatusEnum newStatus, CancellationToken cancellationToken = default); | ||||
|  | ||||
|         #endregion | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,17 @@ | ||||
| using Core.Adapters.Lib; | ||||
|  | ||||
| namespace Core.Inventory.External.Clients.Requests | ||||
| { | ||||
|     public class FurnitureBaseRequest | ||||
|     { | ||||
|         public string ModelName { get; set; } = null!; | ||||
|         public string Material { get; set; } = null!; | ||||
|         public string Condition { get; set; } = null!; | ||||
|         public string? BaseDescription { get; set; } | ||||
|         public string? Representation { get; set; } | ||||
|         public string? MaintenanceNotes { get; set; } | ||||
|  | ||||
|         public Dimensions Dimensions { get; set; } = new(); | ||||
|         public List<string>? VariantIds { get; set; } | ||||
|     } | ||||
| } | ||||
| @@ -0,0 +1,19 @@ | ||||
| namespace Core.Inventory.External.Clients.Requests | ||||
| { | ||||
|     public class FurnitureVariantRequest | ||||
|     { | ||||
|         public string ModelId { get; set; } = null!; | ||||
|         public string Name { get; set; } = null!; | ||||
|         public string Color { get; set; } = null!; | ||||
|         public string? Line { get; set; } | ||||
|  | ||||
|         public decimal Price { get; set; } | ||||
|         public string Currency { get; set; } = "USD"; | ||||
|         public int Stock { get; set; } | ||||
|  | ||||
|         public Guid CategoryId { get; set; } | ||||
|         public Guid ProviderId { get; set; } | ||||
|  | ||||
|         public Dictionary<string, object> Attributes { get; set; } = []; | ||||
|     } | ||||
| } | ||||
		Reference in New Issue
	
	Block a user