Giter Club home page Giter Club logo

eshop's Introduction

EShop

ABP version NuGet NuGet Download Discord online GitHub stars

An abp application module group that provides basic e-shop service.

image

You can also clone this repo and run the demo project locally.

Installation

  1. Follow the document to install the dependent PaymentService module.

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

    • EasyAbp.EShop.Application
    • EasyAbp.EShop.Application.Contracts
    • EasyAbp.EShop.Domain
    • EasyAbp.EShop.Domain.Shared
    • EasyAbp.EShop.EntityFrameworkCore
    • EasyAbp.EShop.HttpApi
    • EasyAbp.EShop.HttpApi.Client
    • (Optional) EasyAbp.EShop.MongoDB
    • (Optional) EasyAbp.EShop.Web

    The above packages are integration packages containing the necessary sub-modules. Please install packages of each sub-module separately if you are using microservices. For example: install only the EasyAbp.EShop.Products.Application package.

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

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

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

Basic Usage

  • Create a Store (optional)

    • EShop supports multi-store, it provides a default store, it will be created when you seed the initial data. (learn more about ABP Data Seeding)
    • Use the store management page to create a new store.
  • Define a Product Group (optional)

    • Product group is used to classify different types of products, so we can customize different behavior for them, for example, products of the "GiftCard" product group could automatically send the card number and password to the customer's mailbox.
    • EShop provides a default product group.
    • Refer to the configuration of the default product group and define a new product group.
  • Create a Product

    • Use the product management page to create new a product.
    • Click the "SKU" item in the actions button of the product you created and then create an SKU.
  • Place an Order (We have not yet provided UI for this step.)

    • Use the API /api/e-shop/orders/order (POST) to create a new order.
  • Pay for the Order (We have not yet provided UI for this step.)

    • Wait for the inventory reduction to be completed, get the order and ensure the Order.ReducedInventoryAfterPlacingTime is not null.
    • Use the API /api/e-shop/payments/payment (POST) to create a pending new payment for your order.
      • You can pay for multiple orders at once.
      • You need to decide one of the payment methods provided by the EasyAbp.PaymentService module.
    • Use the API /api/e-shop/orders/order/{id} (GET) get the order, then you can get the "paymentId" in the result.
    • Use the API /api/payment-service/payment/{id}/pay (POST) to complete the payment.
      • "id" is the "paymentId" we got above.
      • Different payment methods require different "extraProperties" for this API. Read the document of the EasyAbp.PaymentService module to learn more.
  • Complete the Order

    • We have not yet provided relevant UI for this action.
    • Use the API /api/e-shop/orders/order/{id}/complete (POST) to complete the order.
      • The customer should have permission to complete the order himself.
      • You need to override the "CompleteAsync" method of the "OrderAppService" if you want to prohibit users from completing orders themselves for some specific product groups but complete them through automated processes.

Advanced Usages

We can customize the EShop for complex application scenarios.

Gift Card Shop

  • When a gift card order is paid, automatically send the card number and password to the customer's mailbox.
  • Automatically set the order status to completed after the mail is sent.
  • Read the article to learn how to implement it. (todo)

Paid Knowledge Market

  • Install the EasyAbp.SharedResources module.
  • The carrier of knowledge can be articles, pictures, audio, videos, files, streams, etc.
  • When a knowledge order is paid, automatically authorize the customer to access the resources he purchased.
  • Read the article to learn how to implement it. (todo)

Submodules

Roadmap

Todo.

eshop's People

Contributors

ericeric284 avatar gdlcf88 avatar hueifeng avatar jadynwong avatar raymmond avatar yinchang0626 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

eshop's Issues

Make storeId required

Simplify to reduce problems. If an app does not need stores, it can create only one store an set it as default.

Change ProductDetail to an aggregate root and make it also related to ProductSku.

  • Change ProductDetail to an aggregate root.
  • A Product must have one ProductDetail.
  • A ProductSku may have one ProductDetail.
  • A ProductDetail can be updated when the user has permission to manage the related Product.
  • Usually, ProductDetail belongs to only one Product or ProductSku.
  • Product and ProductDto will not contain the product's details, the only way to get them is using ProductDetail's API.

Rename EasyMall to EShopSample.

In the future, we create a new git repository named EasyMall to provide an ABP application solution with installer or an ABP startup template.

Get/GetList permission requirement adjustment

  • Remove the requirement of Get/GetList permissions from Product and Category.
  • Remove the requirement of Get permissions from ProductDetail.
  • GetList with ShowHidden == true requires .Default permission.

Introduce currency setting

  • A new setting named "CurrencyCode" in the Orders module.
  • It specifies a valid currency code for stores, tenants, and the host.
  • It will finally fall back to "USD" if the value doesn't set.
  • Check whether the currency code of OrderLines is equal to the value from the setting.
  • The store-side setting value implementation depends on #174.

Multi-store: check if the current user an owner of the specified store

Related to #68

Use IStoreOwnerStore to check whether the user is one of the store owners, if so, he has the authority.

For example:

// Todo: Check if current user is an admin of the store.
var isCurrentUserStoreAdmin = true && await AuthorizationService.IsGrantedAsync(ProductsPermissions.Products.Default);

should be:

var isStoreOwner = await _storeOwnerStore.IsOwnerAsync(CurrentUser.GetId(), input.StoreId)
    && await AuthorizationService.IsGrantedAsync(ProductsPermissions.Products.Default);

Create Payment entity and Refund entity in Payments module

  • Sharing tables with PaymentService module. Should make sure they are in the same app.
  • Payment and Refund in Payments module have extra StoreId property.
  • Add management pages for the new entities.
  • Set StoreId property for Payment entity in EShopOrderPaymentAuthorizer.

Add OrderNumber property to Order entity

  • Add OrderNumber property to Order entity.
    • It must be set before the entity inserted.
    • It has a unique index.
  • Create IOrderNumberGenerator interface to create new order numbers.
  • Add GetByOrderNumberAsync() method to IOrderAppService.

Implement IProductDiscountManager

  • Create IProductDiscountManager and IProductDiscountProvider.
  • Add MinimumPrice, MaximumPrice, DiscountedPrice and RealInventory properties to ProductDto and set their values in IProductAppService.GetAsync and IProductAppService.GetListAsync methods.

Change RemoteServiceNames

Should add "EShop" prefix, for example:

public const string RemoteServiceName = "Orders";

should be

public const string RemoteServiceName = "EShopOrders";

Static products

Add IsStatic property to Product entity, if it set to true, no one can modify them except those with the ManageStaticProduct permissions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.