An abp application module group that provides basic e-shop service.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

5.7 KiB

EShop.Plugins.Booking

ABP version NuGet NuGet Download Discord online GitHub stars

A booking-business plugin for EShop. It extends EShop to use the EasyAbp.BookingService module to help end-users to book some assets online.

Installation

  1. Install the EasyAbp.BookingService module locally or remotely.

  2. Install the following NuGet packages. (see how)

    • EasyAbp.EShop.Orders.Booking.Application (install at EasyAbp.EShop.Orders.Application location)
    • (Optional) EasyAbp.EShop.Payments.Booking.Application (install at EasyAbp.EShop.Payments.Application location)
    • (Optional) EasyAbp.EShop.Plugins.Baskets.Booking.Application (install at EasyAbp.EShop.Plugins.Baskets.Application location)
    • EasyAbp.EShop.Plugins.Booking.Application
    • EasyAbp.EShop.Plugins.Booking.Application.Contracts
    • EasyAbp.EShop.Plugins.Booking.Domain
    • EasyAbp.EShop.Plugins.Booking.Domain.Shared
    • EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore
    • EasyAbp.EShop.Plugins.Booking.HttpApi
    • EasyAbp.EShop.Plugins.Booking.HttpApi.Client
    • (Optional) EasyAbp.EShop.Plugins.Booking.MongoDB
    • (Optional) EasyAbp.EShop.Plugins.Booking.Web

    Skip installing the EasyAbp.EShop.Payments.Plugins.Booking module if you don't want to check assets are bookable during payment.

  3. Add DependsOn(typeof(EShopXxxModule)) attribute to configure the module dependencies. (see how)

  4. Add builder.ConfigureEShopPluginsBooking(); to the OnModelCreating() method in MyProjectMigrationsDbContext.cs.

  5. Add EF Core migrations and update your database. See: ABP document.

Usage

Admins

  1. Define a "booking" product group. Customers can use only these configured product groups for booking.
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        Configure<EShopBookingOptions>(options =>
        {
            options.BookingProductGroups.Add(new BookingProductGroupDefinition("MyBookingProductGroup"));
        });
    }
    
  2. Use the management pages to create ProductAsset or ProductAssetCategory entities to set prices and more information.

Customers

  1. Use BookingService module's /api/booking-service/asset-occupancy/search-booking-periods (GET) or /api/booking-service/asset-occupancy/search-category-booking-periods (GET) to get available periods for an asset or an asset category.
  2. Create an EShop order with these ExtraProperties:
    • BookingAssetId or BookingAssetCategoryId.
    • BookingPeriodSchemeId, BookingPeriodId, BookingVolume, BookingDate, BookingStartingTime, BookingDuration.
  3. Pay for the order, and then it will automatically call the BookingService module to occupy the asset.
    • If the occupancy succeeds, it will set the order to complete.
    • If the occupancy fails, it will cancel the order and refund the payment.