Merge branch 'main' of https://git.ranaze.com/null/promiscuity into main
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 58s
Deploy Promiscuity Inventory API / deploy (push) Successful in 45s
Deploy Promiscuity Locations API / deploy (push) Successful in 59s
k8s smoke test / test (push) Successful in 7s

This commit is contained in:
2026-03-19 16:44:12 -05:00
8 changed files with 942 additions and 740 deletions
+1
View File
@@ -39,6 +39,7 @@ Stored documents (MongoDB)
"x": 0,
"y": 0
},
"biomeKey": "plains",
"resources": [
{
"itemKey": "wood",
+22 -22
View File
@@ -1,32 +1,32 @@
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace LocationsApi.Models;
using MongoDB.Bson;
using MongoDB.Bson.Serialization.Attributes;
namespace LocationsApi.Models;
public class Location
{
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string? Id { get; set; }
[BsonElement("name")]
public string Name { get; set; } = string.Empty;
[BsonId]
[BsonRepresentation(BsonType.ObjectId)]
public string? Id { get; set; }
[BsonElement("name")]
public string Name { get; set; } = string.Empty;
[BsonElement("coord")]
public required Coord Coord { get; set; }
[BsonElement("biomeKey")]
public string BiomeKey { get; set; } = "plains";
[BsonElement("resources")]
public List<LocationResource> Resources { get; set; } = [];
[BsonElement("biomeKey")]
public string BiomeKey { get; set; } = string.Empty;
[BsonElement("locationObject")]
public LocationObject? LocationObject { get; set; }
[BsonElement("locationObjectResolved")]
public bool LocationObjectResolved { get; set; }
[BsonElement("createdUtc")]
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
}
[BsonElement("locationObjectResolved")]
public bool LocationObjectResolved { get; set; }
[BsonElement("createdUtc")]
public DateTime CreatedUtc { get; set; } = DateTime.UtcNow;
}
@@ -36,7 +36,7 @@ public class LocationStore
"$jsonSchema", new BsonDocument
{
{ "bsonType", "object" },
{ "required", new BsonArray { "name", "coord", "createdUtc" } },
{ "required", new BsonArray { "name", "coord", "biomeKey", "createdUtc" } },
{
"properties", new BsonDocument
{
@@ -55,6 +55,7 @@ public class LocationStore
}
}
},
{ "biomeKey", new BsonDocument { { "bsonType", "string" } } },
{
"resources", new BsonDocument
{
@@ -76,7 +77,6 @@ public class LocationStore
}
}
},
{ "biomeKey", new BsonDocument { { "bsonType", new BsonArray { "string", "null" } } } },
{
"locationObject", new BsonDocument
{
@@ -273,9 +273,9 @@ public class LocationStore
{
var filter = Builders<Location>.Filter.And(
Builders<Location>.Filter.Eq(l => l.Coord.X, 0),
Builders<Location>.Filter.Eq(l => l.Coord.Y, 0)
);
var existing = _col.Find(filter).FirstOrDefault();
Builders<Location>.Filter.Eq(l => l.Coord.Y, 0)
);
var existing = _col.Find(filter).FirstOrDefault();
if (existing is not null)
return;