Implement Model Refactoring
<UserStory> 1957: Model Refactoring </UserStory> UserStory #1957 <Changes> 1. Added SerializedRecords.h dependency and forward declaration for SerializedInventoryItem to support fixed-size record storage. 2. Replaced CSV-based serialization in InventoryItem with serialize() method returning SerializedInventoryItem structure. 3. Replaced CSV-based deserialization logic with deserialize() method that reconstructs InventoryItem directly from SerializedInventoryItem record. 4. Removed legacy CSV parsing, header generation, and exception handling tied to string-based serialization. 5. Updated InventoryItem class interface in InventoryItem.h to use SerializedInventoryItem types instead of std::string serialization APIs. </Changes> <Test> N/A </Test> <Review> Sreeja Reghukumar </Review>
This commit is contained in:
@@ -6,11 +6,12 @@ Author: Trenser
|
||||
Date: 19-May-2026
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <string>
|
||||
#include "Enums.h"
|
||||
|
||||
struct SerializedInventoryItem;
|
||||
|
||||
class InventoryItem
|
||||
{
|
||||
private:
|
||||
@@ -34,7 +35,6 @@ public:
|
||||
void setQuantity(int quantity);
|
||||
void setPrice(double price);
|
||||
void setState(util::State status);
|
||||
std::string serialize() const;
|
||||
static InventoryItem* deserialize(const std::string&);
|
||||
static std::string getHeaders();
|
||||
SerializedInventoryItem serialize() const;
|
||||
static InventoryItem* deserialize(const SerializedInventoryItem&);
|
||||
};
|
||||
Reference in New Issue
Block a user