Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

2.2 KB
Raw Blame
using Grand.Business.Core.Interfaces.Catalog.Discounts;
using Grand.Domain.Catalog;
using Grand.Domain.Discounts;
using Grand.Domain.Vendors;
using Grand.Web.AdminShared.Models.Catalog;
using Grand.Web.AdminShared.Models.Discounts;

namespace Grand.Web.AdminShared.Interfaces;

public interface IDiscountViewModelService
{
    DiscountListModel PrepareDiscountListModel();

    Task<(IEnumerable<DiscountModel> discountModel, int totalCount)> PrepareDiscountModel(DiscountListModel model,
        int pageIndex, int pageSize);

    Task PrepareDiscountModel(DiscountModel model, Discount discount);
    Task<Discount> InsertDiscountModel(DiscountModel model);
    Task<Discount> UpdateDiscountModel(Discount discount, DiscountModel model);
    Task DeleteDiscount(Discount discount);
    Task InsertCouponCode(string discountId, string couponCode);

    string GetRequirementUrlInternal(IDiscountRule discountRequirementRule, Discount discount,
        string discountRequirementId);

    Task DeleteDiscountRequirement(DiscountRule discountRequirement, Discount discount);
    Task<DiscountModel.AddProductToDiscountModel> PrepareProductToDiscountModel();

    Task<(IList<ProductModel> products, int totalCount)> PrepareProductModel(
        DiscountModel.AddProductToDiscountModel model, int pageIndex, int pageSize);

    Task InsertProductToDiscountModel(DiscountModel.AddProductToDiscountModel model);
    Task DeleteProduct(Discount discount, Product product);
    Task DeleteCategory(Discount discount, Category category);
    Task DeleteBrand(Discount discount, Brand brand);
    Task DeleteVendor(Discount discount, Vendor vendor);
    Task DeleteCollection(Discount discount, Collection collection);
    Task InsertCategoryToDiscountModel(DiscountModel.AddCategoryToDiscountModel model);
    Task InsertBrandToDiscountModel(DiscountModel.AddBrandToDiscountModel model);
    Task InsertCollectionToDiscountModel(DiscountModel.AddCollectionToDiscountModel model);
    Task InsertVendorToDiscountModel(DiscountModel.AddVendorToDiscountModel model);

    Task<(IEnumerable<DiscountModel.DiscountUsageHistoryModel> usageHistoryModels, int totalCount)>
        PrepareDiscountUsageHistoryModel(Discount discount, int pageIndex, int pageSize);
}