pub struct Credit { /* private fields */ }Implementations§
Source§impl Credit
impl Credit
pub fn into_reference(val: Credit, env: Env) -> Result<Reference<Credit>>
pub fn into_instance(self, env: Env) -> Result<ClassInstance<Credit>>
Source§impl Credit
impl Credit
Sourcepub async fn create_credit_account(
&self,
input: CreateCreditAccountInput,
) -> Result<CreditAccountOutput>
pub async fn create_credit_account( &self, input: CreateCreditAccountInput, ) -> Result<CreditAccountOutput>
Create a credit account
Sourcepub async fn get_credit_account(
&self,
id: String,
) -> Result<Option<CreditAccountOutput>>
pub async fn get_credit_account( &self, id: String, ) -> Result<Option<CreditAccountOutput>>
Get a credit account by ID
Sourcepub async fn get_credit_account_by_customer(
&self,
customer_id: String,
) -> Result<Option<CreditAccountOutput>>
pub async fn get_credit_account_by_customer( &self, customer_id: String, ) -> Result<Option<CreditAccountOutput>>
Get credit account by customer
Sourcepub async fn list_credit_accounts(&self) -> Result<Vec<CreditAccountOutput>>
pub async fn list_credit_accounts(&self) -> Result<Vec<CreditAccountOutput>>
List credit accounts
Sourcepub async fn check_credit(
&self,
customer_id: String,
order_amount: f64,
) -> Result<CreditCheckOutput>
pub async fn check_credit( &self, customer_id: String, order_amount: f64, ) -> Result<CreditCheckOutput>
Check credit
Sourcepub async fn adjust_credit_limit(
&self,
customer_id: String,
new_limit: f64,
reason: String,
) -> Result<CreditAccountOutput>
pub async fn adjust_credit_limit( &self, customer_id: String, new_limit: f64, reason: String, ) -> Result<CreditAccountOutput>
Adjust credit limit
Sourcepub async fn suspend_credit_account(
&self,
customer_id: String,
reason: String,
) -> Result<CreditAccountOutput>
pub async fn suspend_credit_account( &self, customer_id: String, reason: String, ) -> Result<CreditAccountOutput>
Suspend credit account
Sourcepub async fn reactivate_credit_account(
&self,
customer_id: String,
) -> Result<CreditAccountOutput>
pub async fn reactivate_credit_account( &self, customer_id: String, ) -> Result<CreditAccountOutput>
Reactivate credit account
Sourcepub async fn get_over_limit_customers(&self) -> Result<Vec<CreditAccountOutput>>
pub async fn get_over_limit_customers(&self) -> Result<Vec<CreditAccountOutput>>
Get over-limit customers
Trait Implementations§
Source§impl FromNapiMutRef for Credit
impl FromNapiMutRef for Credit
Source§unsafe fn from_napi_mut_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static mut Self>
unsafe fn from_napi_mut_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static mut Self>
Safety Read more
Source§impl FromNapiRef for Credit
impl FromNapiRef for Credit
Source§unsafe fn from_napi_ref(
env: napi_env,
napi_val: napi_value,
) -> Result<&'static Self>
unsafe fn from_napi_ref( env: napi_env, napi_val: napi_value, ) -> Result<&'static Self>
Safety Read more
Source§impl FromNapiValue for &Credit
impl FromNapiValue for &Credit
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl FromNapiValue for &mut Credit
impl FromNapiValue for &mut Credit
Source§unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
unsafe fn from_napi_value(env: napi_env, napi_val: napi_value) -> Result<Self>
Safety Read more
fn from_unknown(value: JsUnknown) -> Result<Self, Error>
Source§impl ToNapiValue for Credit
impl ToNapiValue for Credit
Source§unsafe fn to_napi_value(env: napi_env, val: Credit) -> Result<napi_value>
unsafe fn to_napi_value(env: napi_env, val: Credit) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &Credit
impl ValidateNapiValue for &Credit
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Source§impl ValidateNapiValue for &mut Credit
impl ValidateNapiValue for &mut Credit
Source§unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
unsafe fn validate(env: napi_env, napi_val: napi_value) -> Result<napi_value>
Safety Read more
Auto Trait Implementations§
impl Freeze for Credit
impl !RefUnwindSafe for Credit
impl Send for Credit
impl Sync for Credit
impl Unpin for Credit
impl UnsafeUnpin for Credit
impl !UnwindSafe for Credit
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