Mailbox support + crafting api
Deploy Promiscuity Auth API / deploy (push) Successful in 48s
Deploy Promiscuity Character API / deploy (push) Successful in 46s
Deploy Promiscuity Crafting API / deploy (push) Successful in 1m9s
Deploy Promiscuity Inventory API / deploy (push) Successful in 46s
Deploy Promiscuity Locations API / deploy (push) Successful in 48s
Deploy Promiscuity Mail API / deploy (push) Successful in 46s
k8s smoke test / test (push) Successful in 8s

This commit is contained in:
2026-03-26 09:36:42 -05:00
parent a8db66b93e
commit a283969e4c
22 changed files with 1026 additions and 17 deletions
@@ -0,0 +1,10 @@
namespace CraftingApi.Models;
public class AvailableCraftingRecipeResponse
{
public CraftingRecipeResponse Recipe { get; set; } = new();
public bool CanCraft { get; set; }
public List<string> MissingRequirements { get; set; } = [];
}
@@ -0,0 +1,12 @@
namespace CraftingApi.Models;
public class CraftRecipeRequest
{
public string RecipeKey { get; set; } = string.Empty;
public int Quantity { get; set; } = 1;
public string? LocationId { get; set; }
public string? StationObjectId { get; set; }
}
@@ -0,0 +1,14 @@
namespace CraftingApi.Models;
public class CraftRecipeResponse
{
public string CharacterId { get; set; } = string.Empty;
public string RecipeKey { get; set; } = string.Empty;
public int CraftedQuantity { get; set; }
public List<CraftingIngredient> Consumed { get; set; } = [];
public List<CraftingIngredient> Produced { get; set; } = [];
}
@@ -0,0 +1,8 @@
namespace CraftingApi.Models;
public class CraftingIngredient
{
public string ItemKey { get; set; } = string.Empty;
public int Quantity { get; set; } = 1;
}
@@ -0,0 +1,38 @@
using MongoDB.Bson.Serialization.Attributes;
namespace CraftingApi.Models;
[BsonIgnoreExtraElements]
public class CraftingRecipe
{
[BsonId]
[BsonElement("recipeKey")]
public string RecipeKey { get; set; } = string.Empty;
[BsonElement("name")]
public string Name { get; set; } = string.Empty;
[BsonElement("category")]
public string Category { get; set; } = "misc";
[BsonElement("stationType")]
public string StationType { get; set; } = "hand";
[BsonElement("inputs")]
public List<CraftingIngredient> Inputs { get; set; } = [];
[BsonElement("outputs")]
public List<CraftingIngredient> Outputs { get; set; } = [];
[BsonElement("craftTimeSeconds")]
public int CraftTimeSeconds { get; set; }
[BsonElement("enabled")]
public bool Enabled { get; set; } = true;
[BsonElement("createdUtc")]
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
[BsonElement("updatedUtc")]
public DateTime UpdatedUtc { get; set; } = DateTime.UtcNow;
}
@@ -0,0 +1,32 @@
namespace CraftingApi.Models;
public class CraftingRecipeResponse
{
public string RecipeKey { get; set; } = string.Empty;
public string Name { get; set; } = string.Empty;
public string Category { get; set; } = string.Empty;
public string StationType { get; set; } = string.Empty;
public List<CraftingIngredient> Inputs { get; set; } = [];
public List<CraftingIngredient> Outputs { get; set; } = [];
public int CraftTimeSeconds { get; set; }
public bool Enabled { get; set; }
public static CraftingRecipeResponse FromModel(CraftingRecipe recipe) => new()
{
RecipeKey = recipe.RecipeKey,
Name = recipe.Name,
Category = recipe.Category,
StationType = recipe.StationType,
Inputs = recipe.Inputs.Select(i => new CraftingIngredient { ItemKey = i.ItemKey, Quantity = i.Quantity }).ToList(),
Outputs = recipe.Outputs.Select(i => new CraftingIngredient { ItemKey = i.ItemKey, Quantity = i.Quantity }).ToList(),
CraftTimeSeconds = recipe.CraftTimeSeconds,
Enabled = recipe.Enabled
};
}
@@ -0,0 +1,18 @@
namespace CraftingApi.Models;
public class UpsertCraftingRecipeRequest
{
public string Name { get; set; } = string.Empty;
public string Category { get; set; } = "misc";
public string StationType { get; set; } = "hand";
public List<CraftingIngredient> Inputs { get; set; } = [];
public List<CraftingIngredient> Outputs { get; set; } = [];
public int CraftTimeSeconds { get; set; }
public bool Enabled { get; set; } = true;
}