pub struct PriceLevels { /* private fields */ }Expand description
Price level operations.
Implementations§
Source§impl PriceLevels
impl PriceLevels
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Whether price levels are supported by the active backend.
Sourcepub fn create(&self, input: CreatePriceLevel) -> Result<PriceLevel>
pub fn create(&self, input: CreatePriceLevel) -> Result<PriceLevel>
Create a new price level.
Sourcepub fn get(&self, id: PriceLevelId) -> Result<Option<PriceLevel>>
pub fn get(&self, id: PriceLevelId) -> Result<Option<PriceLevel>>
Get a price level by ID.
Sourcepub fn update(
&self,
id: PriceLevelId,
input: UpdatePriceLevel,
) -> Result<PriceLevel>
pub fn update( &self, id: PriceLevelId, input: UpdatePriceLevel, ) -> Result<PriceLevel>
Update a price level.
Sourcepub fn list(&self, filter: PriceLevelFilter) -> Result<Vec<PriceLevel>>
pub fn list(&self, filter: PriceLevelFilter) -> Result<Vec<PriceLevel>>
List price levels with optional filtering.
Sourcepub fn delete(&self, id: PriceLevelId) -> Result<()>
pub fn delete(&self, id: PriceLevelId) -> Result<()>
Delete a price level and its entries.
Sourcepub fn set_entry(
&self,
id: PriceLevelId,
product_id: ProductId,
price: Decimal,
) -> Result<PriceLevelEntry>
pub fn set_entry( &self, id: PriceLevelId, product_id: ProductId, price: Decimal, ) -> Result<PriceLevelEntry>
Upsert a per-product fixed price entry.
Sourcepub fn delete_entry(
&self,
id: PriceLevelId,
product_id: ProductId,
) -> Result<()>
pub fn delete_entry( &self, id: PriceLevelId, product_id: ProductId, ) -> Result<()>
Remove a per-product entry.
Sourcepub fn list_entries(&self, id: PriceLevelId) -> Result<Vec<PriceLevelEntry>>
pub fn list_entries(&self, id: PriceLevelId) -> Result<Vec<PriceLevelEntry>>
List per-product entries for a level.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for PriceLevels
impl !UnwindSafe for PriceLevels
impl Freeze for PriceLevels
impl Send for PriceLevels
impl Sync for PriceLevels
impl Unpin for PriceLevels
impl UnsafeUnpin for PriceLevels
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more