pub struct Loyalty { /* private fields */ }Expand description
Loyalty program operations for points, accounts, and rewards.
Implementations§
Source§impl Loyalty
impl Loyalty
Sourcepub fn is_supported(&self) -> bool
pub fn is_supported(&self) -> bool
Whether loyalty programs and rewards are supported by the active backend.
Sourcepub fn create_program(
&self,
input: CreateLoyaltyProgram,
) -> Result<LoyaltyProgram>
pub fn create_program( &self, input: CreateLoyaltyProgram, ) -> Result<LoyaltyProgram>
Sourcepub fn get_program(
&self,
id: LoyaltyProgramId,
) -> Result<Option<LoyaltyProgram>>
pub fn get_program( &self, id: LoyaltyProgramId, ) -> Result<Option<LoyaltyProgram>>
Get a loyalty program by ID.
Sourcepub fn list_programs(&self) -> Result<Vec<LoyaltyProgram>>
pub fn list_programs(&self) -> Result<Vec<LoyaltyProgram>>
List all loyalty programs.
Sourcepub fn enroll(&self, input: EnrollCustomer) -> Result<LoyaltyAccount>
pub fn enroll(&self, input: EnrollCustomer) -> Result<LoyaltyAccount>
Enroll a customer in a loyalty program.
Sourcepub fn get_account(
&self,
id: LoyaltyAccountId,
) -> Result<Option<LoyaltyAccount>>
pub fn get_account( &self, id: LoyaltyAccountId, ) -> Result<Option<LoyaltyAccount>>
Get a loyalty account by ID.
Sourcepub fn get_account_by_customer(
&self,
customer_id: CustomerId,
program_id: LoyaltyProgramId,
) -> Result<Option<LoyaltyAccount>>
pub fn get_account_by_customer( &self, customer_id: CustomerId, program_id: LoyaltyProgramId, ) -> Result<Option<LoyaltyAccount>>
Get a loyalty account by customer and program.
Sourcepub fn list_accounts(
&self,
filter: LoyaltyAccountFilter,
) -> Result<Vec<LoyaltyAccount>>
pub fn list_accounts( &self, filter: LoyaltyAccountFilter, ) -> Result<Vec<LoyaltyAccount>>
List loyalty accounts with optional filtering.
Sourcepub fn adjust_points(&self, input: AdjustPoints) -> Result<LoyaltyTransaction>
pub fn adjust_points(&self, input: AdjustPoints) -> Result<LoyaltyTransaction>
Adjust points on an account (earn, redeem, expire, etc.).
Sourcepub fn get_transactions(
&self,
account_id: LoyaltyAccountId,
limit: Option<u32>,
) -> Result<Vec<LoyaltyTransaction>>
pub fn get_transactions( &self, account_id: LoyaltyAccountId, limit: Option<u32>, ) -> Result<Vec<LoyaltyTransaction>>
Get transaction history for an account.
Sourcepub fn create_reward(&self, input: CreateReward) -> Result<Reward>
pub fn create_reward(&self, input: CreateReward) -> Result<Reward>
Create a new reward in the catalog.
Sourcepub fn list_rewards(&self, filter: RewardFilter) -> Result<Vec<Reward>>
pub fn list_rewards(&self, filter: RewardFilter) -> Result<Vec<Reward>>
List rewards with optional filtering.
Sourcepub fn delete_reward(&self, id: RewardId) -> Result<()>
pub fn delete_reward(&self, id: RewardId) -> Result<()>
Delete a reward from the catalog.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Loyalty
impl !UnwindSafe for Loyalty
impl Freeze for Loyalty
impl Send for Loyalty
impl Sync for Loyalty
impl Unpin for Loyalty
impl UnsafeUnpin for Loyalty
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