pub struct SqliteFixedAssetRepository { /* private fields */ }Available on crate feature
sqlite only.Implementations§
Source§impl SqliteFixedAssetRepository
impl SqliteFixedAssetRepository
pub const fn new(pool: Pool<SqliteConnectionManager>) -> Self
Trait Implementations§
Source§impl Debug for SqliteFixedAssetRepository
impl Debug for SqliteFixedAssetRepository
Source§impl FixedAssetRepository for SqliteFixedAssetRepository
impl FixedAssetRepository for SqliteFixedAssetRepository
Source§fn create(&self, input: CreateFixedAsset) -> Result<FixedAsset>
fn create(&self, input: CreateFixedAsset) -> Result<FixedAsset>
Create a new fixed asset (draft, or in-service when an in-service date is supplied).
Source§fn list(&self, filter: FixedAssetFilter) -> Result<Vec<FixedAsset>>
fn list(&self, filter: FixedAssetFilter) -> Result<Vec<FixedAsset>>
List fixed assets with filter.
Source§fn update(&self, id: Uuid, input: UpdateFixedAsset) -> Result<FixedAsset>
fn update(&self, id: Uuid, input: UpdateFixedAsset) -> Result<FixedAsset>
Update a fixed asset (partial). Terminal assets cannot be updated.
Source§fn place_in_service(&self, id: Uuid, date: NaiveDate) -> Result<FixedAsset>
fn place_in_service(&self, id: Uuid, date: NaiveDate) -> Result<FixedAsset>
Place a draft asset in service on the given date.
Source§fn dispose(
&self,
id: Uuid,
date: NaiveDate,
proceeds: Decimal,
notes: Option<String>,
) -> Result<FixedAsset>
fn dispose( &self, id: Uuid, date: NaiveDate, proceeds: Decimal, notes: Option<String>, ) -> Result<FixedAsset>
Dispose of an asset for the given proceeds, recording gain/loss.
Source§fn write_off(
&self,
id: Uuid,
date: NaiveDate,
notes: Option<String>,
) -> Result<FixedAsset>
fn write_off( &self, id: Uuid, date: NaiveDate, notes: Option<String>, ) -> Result<FixedAsset>
Write off an asset (disposal with zero proceeds).
Source§fn generate_schedule(&self, id: Uuid) -> Result<DepreciationSchedule>
fn generate_schedule(&self, id: Uuid) -> Result<DepreciationSchedule>
Generate and persist the depreciation schedule for an asset,
replacing any previously scheduled (unposted) entries.
Source§fn get_schedule(&self, id: Uuid) -> Result<Option<DepreciationSchedule>>
fn get_schedule(&self, id: Uuid) -> Result<Option<DepreciationSchedule>>
Get the persisted depreciation schedule for an asset, if generated.
Source§fn post_depreciation(&self, id: Uuid, periods: u32) -> Result<FixedAsset>
fn post_depreciation(&self, id: Uuid, periods: u32) -> Result<FixedAsset>
Post the next
periods scheduled depreciation entries, advancing
accumulated depreciation (and status when fully depreciated).Auto Trait Implementations§
impl !RefUnwindSafe for SqliteFixedAssetRepository
impl !UnwindSafe for SqliteFixedAssetRepository
impl Freeze for SqliteFixedAssetRepository
impl Send for SqliteFixedAssetRepository
impl Sync for SqliteFixedAssetRepository
impl Unpin for SqliteFixedAssetRepository
impl UnsafeUnpin for SqliteFixedAssetRepository
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