The `ShopItem` type takes the `InventoryItem` type and removes the
unnecessary params and adds its own. That way we maintain the parity
between the two but enforce a much simpler mental model of the
inheritance hierarchy.
export type EquipmentSlot = ArmourEquipmentSlot | WeaponEquipmentSlot;
-export type ShopItem = {
- id: number;
+export type InventoryItem = {
+ item_id: string;
+ player_id: string;
name: string;
type: InventoryType;
profession: Profession;
currentAp: number;
maxAp: number;
affectedSkills: SkillID[];
- location_id: number;
}
-export type InventoryItem = Omit<ShopItem, 'id' | 'location_id'> & {
- item_id: string;
- player_id: string;
+// shop items have a numeric id since they're tracked in a separate spreadsheet
+// and they are also tied to a specific location
+export type ShopItem = Omit<InventoryItem, 'id' | 'player_id'> & {
+ id: number;
+ location_id: number;
};