Fixing coord bug
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 57s
Deploy Promiscuity Locations API / deploy (push) Successful in 44s
k8s smoke test / test (push) Successful in 7s

This commit is contained in:
Zeeshaun 2026-03-13 13:14:30 -05:00
parent d615527dcc
commit c296ebc9cb
4 changed files with 14 additions and 6 deletions

View File

@ -1,12 +1,8 @@
using MongoDB.Bson.Serialization.Attributes;
namespace CharacterApi.Models; namespace CharacterApi.Models;
public class Coord public class Coord
{ {
[BsonElement("x")]
public int X { get; set; } public int X { get; set; }
[BsonElement("y")]
public int Y { get; set; } public int Y { get; set; }
} }

View File

@ -0,0 +1,12 @@
using MongoDB.Bson.Serialization.Attributes;
namespace CharacterApi.Models;
public class LocationCoord
{
[BsonElement("x")]
public int X { get; set; }
[BsonElement("y")]
public int Y { get; set; }
}

View File

@ -13,5 +13,5 @@ public class VisibleLocation
public string Name { get; set; } = string.Empty; public string Name { get; set; } = string.Empty;
[BsonElement("coord")] [BsonElement("coord")]
public Coord Coord { get; set; } = new(); public LocationCoord Coord { get; set; } = new();
} }

View File

@ -85,7 +85,7 @@ public class CharacterStore
var update = Builders<VisibleLocation>.Update var update = Builders<VisibleLocation>.Update
.SetOnInsert(l => l.Name, DefaultLocationName(x, y)) .SetOnInsert(l => l.Name, DefaultLocationName(x, y))
.SetOnInsert(l => l.Coord, new Coord { X = x, Y = y }) .SetOnInsert(l => l.Coord, new LocationCoord { X = x, Y = y })
.SetOnInsert(l => l.Id, ObjectId.GenerateNewId().ToString()) .SetOnInsert(l => l.Id, ObjectId.GenerateNewId().ToString())
.SetOnInsert("createdUtc", DateTime.UtcNow); .SetOnInsert("createdUtc", DateTime.UtcNow);