InMemorySkuRepository class
An in-memory ISkuRepository.
Records are kept as their JSON rows, so this reference persists exactly the wire form the model round-trips. Nothing here is durable, indexed or thread-safe: it is the smallest backend that satisfies the contract.
- Implemented types
- Mixed-in types
Constructors
- InMemorySkuRepository()
- Creates an empty InMemorySkuRepository.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
rows
→ Map<
String, Map< String, dynamic> > -
The rows, keyed by record id.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
table
→ InMemoryTable<
Sku> -
The rows behind this repository — what a transaction snapshots.
final
Methods
-
create(
{required Sku sku}) → TaskEither< DomainFailure, Sku> -
Create a new SKU.
override
-
delete(
{required String id}) → TaskEither< DomainFailure, void> -
Delete a SKU by id.
override
-
fetchAll(
) → TaskEither< DomainFailure, List< Sku> > -
Fetch all SKUs.
override
-
fetchById(
{required String id}) → TaskEither< DomainFailure, Sku> -
Fetch a single SKU by id.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
replaceAll(
Map< String, Map< rows) → voidString, dynamic> > -
Replaces every row — how a rollback restores a snapshot.
inherited
-
snapshot(
) → Map< String, Map< String, dynamic> > -
A copy of every row — what a transaction keeps to undo itself.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
{required Sku sku}) → TaskEither< DomainFailure, Sku> -
Update an existing SKU.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited