Guard source gear namespaces and retain recoverable legacy records (#9)

This commit is contained in:
warren committed 2026-10-10 11:36:10 -04:00
1 parent ab37006932
commit e567910c04
23 files changed
+1203 -66

No files matched your search

+24
View File
@@ -22,6 +22,28 @@ export interface PlayerSession {
accessToken?: string;
}
export type GearRecoveryReason = "missing-category" | "foreign-category" | "invalid-native-payload";
/** Original rejected gear data kept with its character so migrations never erase it. */
export interface GearRecoveryItem {
readonly item: unknown;
readonly reason: GearRecoveryReason;
}
/** A former loadout reference for an item that is quarantined from active gear. */
export interface GearRecoveryEquipmentReference {
readonly ownerId: string;
readonly slot: string;
readonly instanceId: string;
readonly reason: GearRecoveryReason;
}
/** Character-scoped recovery for legacy or foreign-namespace gear. */
export interface CharacterGearRecovery {
readonly items: readonly GearRecoveryItem[];
readonly equipment: readonly GearRecoveryEquipmentReference[];
}
export interface CharacterProfile {
id: string;
ownerId: string;
@@ -50,6 +72,8 @@ export interface CharacterProfile {
actionLoadouts?: Record<string, Record<string, string | null>>;
inventory: InventoryItem[];
equipment: EquipmentAssignments;
/** Rejected gear remains recoverable here and is excluded from active inventory/loadouts. */
gearRecovery?: CharacterGearRecovery;
/** Legacy character log, read only during migration to the account collection. */
bossCards?: BossCardCollection;
/** Present on normalized and newly created profiles; optional for legacy callers. */