pub struct SqliteCostAccountingRepository { /* private fields */ }Available on crate feature
sqlite only.Implementations§
Source§impl SqliteCostAccountingRepository
impl SqliteCostAccountingRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl CostAccountingRepository for SqliteCostAccountingRepository
impl CostAccountingRepository for SqliteCostAccountingRepository
Source§fn set_item_cost(&self, input: SetItemCost) -> Result<ItemCost>
fn set_item_cost(&self, input: SetItemCost) -> Result<ItemCost>
Set/update item cost
Source§fn list_item_costs(&self, filter: ItemCostFilter) -> Result<Vec<ItemCost>>
fn list_item_costs(&self, filter: ItemCostFilter) -> Result<Vec<ItemCost>>
List item costs
Source§fn update_average_cost(
&self,
sku: &str,
quantity: Decimal,
unit_cost: Decimal,
) -> Result<ItemCost>
fn update_average_cost( &self, sku: &str, quantity: Decimal, unit_cost: Decimal, ) -> Result<ItemCost>
Update average cost (called when receiving inventory)
Source§fn update_last_cost(&self, sku: &str, unit_cost: Decimal) -> Result<ItemCost>
fn update_last_cost(&self, sku: &str, unit_cost: Decimal) -> Result<ItemCost>
Update last cost
Source§fn create_cost_layer(&self, input: CreateCostLayer) -> Result<CostLayer>
fn create_cost_layer(&self, input: CreateCostLayer) -> Result<CostLayer>
Create a cost layer
Source§fn list_cost_layers(&self, filter: CostLayerFilter) -> Result<Vec<CostLayer>>
fn list_cost_layers(&self, filter: CostLayerFilter) -> Result<Vec<CostLayer>>
List cost layers
Source§fn issue_fifo(&self, input: IssueCostLayers) -> Result<Vec<CostTransaction>>
fn issue_fifo(&self, input: IssueCostLayers) -> Result<Vec<CostTransaction>>
Issue from cost layers (FIFO)
Source§fn issue_lifo(&self, input: IssueCostLayers) -> Result<Vec<CostTransaction>>
fn issue_lifo(&self, input: IssueCostLayers) -> Result<Vec<CostTransaction>>
Issue from cost layers (LIFO)
Source§fn get_layers_remaining(&self, sku: &str) -> Result<Decimal>
fn get_layers_remaining(&self, sku: &str) -> Result<Decimal>
Get remaining quantity in layers for SKU
Source§fn record_cost_transaction(
&self,
sku: &str,
transaction_type: CostTransactionType,
quantity: Decimal,
unit_cost: Decimal,
layer_id: Option<Uuid>,
reference_type: Option<&str>,
reference_id: Option<Uuid>,
notes: Option<&str>,
) -> Result<CostTransaction>
fn record_cost_transaction( &self, sku: &str, transaction_type: CostTransactionType, quantity: Decimal, unit_cost: Decimal, layer_id: Option<Uuid>, reference_type: Option<&str>, reference_id: Option<Uuid>, notes: Option<&str>, ) -> Result<CostTransaction>
Record a cost transaction
Source§fn list_cost_transactions(
&self,
filter: CostTransactionFilter,
) -> Result<Vec<CostTransaction>>
fn list_cost_transactions( &self, filter: CostTransactionFilter, ) -> Result<Vec<CostTransaction>>
List cost transactions
Source§fn record_variance(&self, input: RecordCostVariance) -> Result<CostVariance>
fn record_variance(&self, input: RecordCostVariance) -> Result<CostVariance>
Record a cost variance
Source§fn list_variances(
&self,
filter: CostVarianceFilter,
) -> Result<Vec<CostVariance>>
fn list_variances( &self, filter: CostVarianceFilter, ) -> Result<Vec<CostVariance>>
List cost variances
Source§fn get_variance_summary(
&self,
from: DateTime<Utc>,
to: DateTime<Utc>,
) -> Result<Decimal>
fn get_variance_summary( &self, from: DateTime<Utc>, to: DateTime<Utc>, ) -> Result<Decimal>
Get variance summary for period
Source§fn create_adjustment(
&self,
input: CreateCostAdjustment,
) -> Result<CostAdjustment>
fn create_adjustment( &self, input: CreateCostAdjustment, ) -> Result<CostAdjustment>
Create a cost adjustment
Source§fn get_adjustment(&self, id: Uuid) -> Result<Option<CostAdjustment>>
fn get_adjustment(&self, id: Uuid) -> Result<Option<CostAdjustment>>
Get adjustment by ID
Source§fn list_adjustments(
&self,
filter: CostAdjustmentFilter,
) -> Result<Vec<CostAdjustment>>
fn list_adjustments( &self, filter: CostAdjustmentFilter, ) -> Result<Vec<CostAdjustment>>
List adjustments
Source§fn approve_adjustment(
&self,
id: Uuid,
approved_by: &str,
) -> Result<CostAdjustment>
fn approve_adjustment( &self, id: Uuid, approved_by: &str, ) -> Result<CostAdjustment>
Approve adjustment
Source§fn apply_adjustment(&self, id: Uuid) -> Result<CostAdjustment>
fn apply_adjustment(&self, id: Uuid) -> Result<CostAdjustment>
Apply adjustment (update item cost)
Source§fn reject_adjustment(&self, id: Uuid) -> Result<CostAdjustment>
fn reject_adjustment(&self, id: Uuid) -> Result<CostAdjustment>
Reject adjustment
Source§fn calculate_rollup(
&self,
sku: &str,
bom_id: Option<Uuid>,
) -> Result<CostRollup>
fn calculate_rollup( &self, sku: &str, bom_id: Option<Uuid>, ) -> Result<CostRollup>
Calculate cost rollup for manufactured item
Source§fn get_rollup(&self, sku: &str) -> Result<Option<CostRollup>>
fn get_rollup(&self, sku: &str) -> Result<Option<CostRollup>>
Get latest rollup for SKU
Source§fn get_inventory_valuation(
&self,
cost_method: CostMethod,
) -> Result<InventoryValuation>
fn get_inventory_valuation( &self, cost_method: CostMethod, ) -> Result<InventoryValuation>
Get inventory valuation
Source§fn get_sku_cost_summary(&self, sku: &str) -> Result<Option<SkuCostSummary>>
fn get_sku_cost_summary(&self, sku: &str) -> Result<Option<SkuCostSummary>>
Get SKU cost summary
Source§fn get_total_inventory_value(&self) -> Result<Decimal>
fn get_total_inventory_value(&self) -> Result<Decimal>
Get total inventory value
Auto Trait Implementations§
impl !RefUnwindSafe for SqliteCostAccountingRepository
impl !UnwindSafe for SqliteCostAccountingRepository
impl Freeze for SqliteCostAccountingRepository
impl Send for SqliteCostAccountingRepository
impl Sync for SqliteCostAccountingRepository
impl Unpin for SqliteCostAccountingRepository
impl UnsafeUnpin for SqliteCostAccountingRepository
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