using Nop.Core; using Nop.Core.Domain.Customers; using Nop.Core.Domain.Orders; namespace Nop.Services.Orders; /// /// Gift card service interface /// public partial interface IGiftCardService { /// /// Deletes a gift card /// /// Gift card /// A task that represents the asynchronous operation Task DeleteGiftCardAsync(GiftCard giftCard); /// /// Gets a gift card /// /// Gift card identifier /// /// A task that represents the asynchronous operation /// The task result contains the gift card entry /// Task GetGiftCardByIdAsync(int giftCardId); /// /// Gets all gift cards /// /// Associated order ID; null to load all records /// The order ID in which the gift card was used; null to load all records /// Created date from (UTC); null to load all records /// Created date to (UTC); null to load all records /// Value indicating whether gift card is activated; null to load all records /// Gift card coupon code; null to load all records /// Recipient name; null to load all records /// Page index /// Page size /// /// A task that represents the asynchronous operation /// The task result contains the gift cards /// Task> GetAllGiftCardsAsync(int? purchasedWithOrderId = null, int? usedWithOrderId = null, DateTime? createdFromUtc = null, DateTime? createdToUtc = null, bool? isGiftCardActivated = null, string giftCardCouponCode = null, string recipientName = null, int pageIndex = 0, int pageSize = int.MaxValue); /// /// Inserts a gift card /// /// Gift card /// A task that represents the asynchronous operation Task InsertGiftCardAsync(GiftCard giftCard); /// /// Updates the gift card /// /// Gift card /// A task that represents the asynchronous operation Task UpdateGiftCardAsync(GiftCard giftCard); /// /// Gets gift cards by 'PurchasedWithOrderItemId' /// /// Purchased with order item identifier /// /// A task that represents the asynchronous operation /// The task result contains the gift card entries /// Task> GetGiftCardsByPurchasedWithOrderItemIdAsync(int purchasedWithOrderItemId); /// /// Get active gift cards that are applied by a customer /// /// Customer /// /// A task that represents the asynchronous operation /// The task result contains the active gift cards /// Task> GetActiveGiftCardsAppliedByCustomerAsync(Customer customer); /// /// Generate new gift card code /// /// Result string GenerateGiftCardCode(); /// /// Delete gift card usage history /// /// Order /// A task that represents the asynchronous operation Task DeleteGiftCardUsageHistoryAsync(Order order); /// /// Gets a gift card remaining amount /// /// Gift card /// /// A task that represents the asynchronous operation /// The task result contains the gift card remaining amount /// Task GetGiftCardRemainingAmountAsync(GiftCard giftCard); /// /// Gets a gift card usage history entries /// /// Gift card /// /// A task that represents the asynchronous operation /// The task result contains the result /// Task> GetGiftCardUsageHistoryAsync(GiftCard giftCard); /// /// Gets a gift card usage history entries /// /// Order /// /// A task that represents the asynchronous operation /// The task result contains the result /// Task> GetGiftCardUsageHistoryAsync(Order order); /// /// Inserts a gift card usage history entry /// /// Gift card usage history entry /// A task that represents the asynchronous operation Task InsertGiftCardUsageHistoryAsync(GiftCardUsageHistory giftCardUsageHistory); /// /// Is gift card valid /// /// Gift card /// /// A task that represents the asynchronous operation /// The task result contains the result /// Task IsGiftCardValidAsync(GiftCard giftCard); }