EndpointProduct class Endpoint

Product catalog management.

Inheritance

Constructors

EndpointProduct(EndpointCaller caller)

Properties

caller → EndpointCaller
Holds a reference to the caller class.
finalinherited
client ↔ ServerpodClientShared
Reference to the client.
latefinalinherited
hashCode → int
The hash code for this object.
no setterinherited
name → String
The name of the endpoint this reference is connected to.
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

archive(UuidValue productId) → Future<Product>
Archives a product. Batches and identities are preserved.
create({UuidValue? workspaceId, required String name, String? sku, String? category, String? description, List<String>? imageUrls, String? packaging, String? shelfLife, List<String>? countryRestrictions, String? safetyInstructions}) → Future<Product>
Creates a product.
delete({UuidValue? workspaceId, required UuidValue productId, String? reason}) → Future<Product>
Moves a product to the recycle bin. Batches and identities stay attached and the product can be restored with restore until it is purged.
deleteImpact({UuidValue? workspaceId, required UuidValue productId}) → Future<ProductDeleteImpact>
Counts everything a delete or purge would affect, so the confirmation dialogs can spell out exactly what is at stake.
get(UuidValue productId) → Future<Product>
Loads one product.
list({UuidValue? workspaceId, String? search, required bool includeArchived}) → Future<List<Product>>
Lists products, optionally filtered by a search term.
listDeleted({UuidValue? workspaceId}) → Future<List<Product>>
Lists the products sitting in the recycle bin.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
purge({UuidValue? workspaceId, required UuidValue productId}) → Future<void>
Permanently deletes a recycled product and everything attached to it: batches, serialized units, verification sessions, reports, and fraud evidence. Audit events and fraud alerts are kept as history. This cannot be undone.
restore({UuidValue? workspaceId, required UuidValue productId}) → Future<Product>
Restores a recycled product to the live catalog.
toString() → String
A string representation of this object.
inherited
update({required UuidValue productId, String? name, String? sku, String? category, String? description, List<String>? imageUrls, String? packaging, String? shelfLife, List<String>? countryRestrictions, String? safetyInstructions}) → Future<Product>
Updates product details. Only supplied fields change.
uploadImage({UuidValue? workspaceId, required String fileName, required String data, UuidValue? productId}) → Future<String>
Uploads a product image and returns its public URL.

Operators

operator ==(Object other) → bool
The equality operator.
inherited