Fixing gather bug
All checks were successful
Deploy Promiscuity Auth API / deploy (push) Successful in 46s
Deploy Promiscuity Character API / deploy (push) Successful in 45s
Deploy Promiscuity Inventory API / deploy (push) Successful in 46s
Deploy Promiscuity Locations API / deploy (push) Successful in 58s
k8s smoke test / test (push) Successful in 8s

This commit is contained in:
Zeeshaun 2026-03-19 17:01:47 -05:00
parent 52a76625a3
commit 0fc023b75c
2 changed files with 6 additions and 6 deletions

View File

@ -5,7 +5,7 @@ namespace LocationsApi.Models;
public class LocationObject
{
[BsonElement("id")]
public string Id { get; set; } = Guid.NewGuid().ToString("N");
public string ObjectId { get; set; } = Guid.NewGuid().ToString("N");
[BsonElement("objectType")]
public string ObjectType { get; set; } = "gatherable";

View File

@ -185,7 +185,7 @@ public class LocationStore
var locationObject = location.LocationObject;
if (locationObject is null)
return new InteractResult(InteractStatus.ObjectNotFound);
if (!string.Equals(locationObject.Id, objectId, StringComparison.Ordinal))
if (!string.Equals(locationObject.ObjectId, objectId, StringComparison.Ordinal))
return new InteractResult(InteractStatus.ObjectNotFound);
if (!string.Equals(locationObject.ObjectType, "gatherable", StringComparison.OrdinalIgnoreCase))
return new InteractResult(InteractStatus.UnsupportedObjectType);
@ -196,7 +196,7 @@ public class LocationStore
var remainingQuantity = locationObject.State.RemainingQuantity - quantityGranted;
var objectFilter = Builders<Location>.Filter.And(
Builders<Location>.Filter.Eq(l => l.Id, locationId),
Builders<Location>.Filter.Eq("locationObject.id", locationObject.Id),
Builders<Location>.Filter.Eq("locationObject.id", locationObject.ObjectId),
Builders<Location>.Filter.Eq("locationObject.state.remainingQuantity", locationObject.State.RemainingQuantity)
);
@ -216,7 +216,7 @@ public class LocationStore
return new InteractResult(
InteractStatus.Ok,
locationObject.Id,
locationObject.ObjectId,
locationObject.ObjectType,
locationObject.State.ItemKey,
quantityGranted,
@ -400,7 +400,7 @@ public class LocationStore
var normalizedItemKey = NormalizeItemKey(itemKey);
return new LocationObject
{
Id = Guid.NewGuid().ToString("N"),
ObjectId = Guid.NewGuid().ToString("N"),
ObjectType = "gatherable",
ObjectKey = $"{normalizedItemKey}_node",
Name = HumanizeItemKey(normalizedItemKey),
@ -432,7 +432,7 @@ public class LocationStore
{
return new LocationObject
{
Id = source.Id,
ObjectId = source.ObjectId,
ObjectType = source.ObjectType,
ObjectKey = source.ObjectKey,
Name = source.Name,