mirror of https://github.com/EasyAbp/EShop.git
324 changed files with 9893 additions and 20798 deletions
@ -0,0 +1,64 @@ |
|||
# EShop.Plugins.Booking |
|||
|
|||
[](https://abp.io) |
|||
[](https://www.nuget.org/packages/EasyAbp.EShop.Plugins.Booking.Domain.Shared) |
|||
[](https://www.nuget.org/packages/EasyAbp.EShop.Plugins.Booking.Domain.Shared) |
|||
[](https://discord.gg/S6QaezrCRq) |
|||
[](https://www.github.com/EasyAbp/EShop) |
|||
|
|||
A booking-business plugin for EShop. It extends EShop to use the [EasyAbp.BookingService](https://github.com/EasyAbp/BookingService) module to help end-users to book some assets online. |
|||
|
|||
## Installation |
|||
|
|||
1. Install the [EasyAbp.BookingService](https://github.com/EasyAbp/BookingService) module locally or remotely. |
|||
|
|||
1. Install the following NuGet packages. ([see how](https://github.com/EasyAbp/EasyAbpGuide/blob/master/docs/How-To.md#add-nuget-packages)) |
|||
|
|||
* 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) |
|||
* EasyAbp.EShop.Plugins.Booking.Application |
|||
* 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. |
|||
|
|||
1. Add `DependsOn(typeof(EShopXxxModule))` attribute to configure the module dependencies. ([see how](https://github.com/EasyAbp/EasyAbpGuide/blob/master/docs/How-To.md#add-module-dependencies)) |
|||
|
|||
1. Add `builder.ConfigureEShopPluginsBooking();` to the `OnModelCreating()` method in **MyProjectMigrationsDbContext.cs**. |
|||
|
|||
1. Add EF Core migrations and update your database. See: [ABP document](https://docs.abp.io/en/abp/latest/Tutorials/Part-1?UI=MVC&DB=EF#add-database-migration). |
|||
|
|||
## Usage |
|||
|
|||
[](https://mermaid-js.github.io/mermaid-live-editor/edit#pako:eNrFlU1v2zAMhv-KoMtWIO3uxhCg6wLs1qzBbrkoEp0IlSWPkjZ4Rf_7qI84TpA2LTBgOVmU-JB8RTFPXDoFvOEefkawEr5qsUXRrS2jn4jB2dhtAMv6hwe8ns-_OPeo7XYF-EtLaNj3CDiwDVnFxgALugPWOmTCewi-uB77XBMlwRr2ACGi9awH1E75oziL1c71N_eoAH3D7hBEACZyIEIxlzbYbx12JRITVrEgcEufKYfCmkJG5tLErbb-pmbVsIX1ESn1HRTWp1yE9mNVnzc4_1iPZ1hORzt7G8POof6TF98oBQN4NQ19EuuMfheDn6lkFDCvmcziqDPyLcXQgQ0k4Iq0IZFYXyz5ilLMrONRxtXlH8lVcf9LsLGaUbJqeZNod67rDYQSrCr3Rnr1VK9Ku-_uvNortfdcBPeeJs77S6FP_S4Lei9l7If6YMvdRfNYrLfJSMSrsw_55WSSs7ByYAg-mjBSM2_cfcibB7wwYeLqo5RA56uGLxd0MiqmlzZpbzAeJvRWaPNuNHmCOYBTWWnuILQxjZ_TLgGrXplpZXJ2Q2F98MwHEaK__N574lJ6s0OXzYjBZM4OFJ_xDrCjVqDR_pRwa06p0UzkDX0qaAWpvuZr-0xHY6_oHSyUDg550wpSacbT7F8NVvImYIT9ofr3UE89_wU5QDGI) |
|||
|
|||
### Admins |
|||
|
|||
1. Define a "booking" product group. Customers can use only these configured product groups for booking. |
|||
```CSharp |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<EShopBookingOptions>(options => |
|||
{ |
|||
options.BookingProductGroups.Add(new BookingProductGroupDefinition("MyBookingProductGroup")); |
|||
}); |
|||
} |
|||
``` |
|||
2. Use the management pages to create [ProductAsset](https://github.com/EasyAbp/EShop/blob/dev/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssets/ProductAsset.cs) or [ProductAssetCategory](https://github.com/EasyAbp/EShop/blob/dev/plugins/Booking/src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp/EShop/Plugins/Booking/ProductAssetCategories/ProductAssetCategory.cs) 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. |
|||
@ -0,0 +1 @@ |
|||
**/wwwroot/libs/** linguist-vendored |
|||
@ -0,0 +1,259 @@ |
|||
## Ignore Visual Studio temporary files, build results, and |
|||
## files generated by popular Visual Studio add-ons. |
|||
|
|||
# User-specific files |
|||
*.suo |
|||
*.user |
|||
*.userosscache |
|||
*.sln.docstates |
|||
|
|||
# User-specific files (MonoDevelop/Xamarin Studio) |
|||
*.userprefs |
|||
|
|||
# Build results |
|||
[Dd]ebug/ |
|||
[Dd]ebugPublic/ |
|||
[Rr]elease/ |
|||
[Rr]eleases/ |
|||
x64/ |
|||
x86/ |
|||
bld/ |
|||
[Bb]in/ |
|||
[Oo]bj/ |
|||
[Ll]og/ |
|||
|
|||
# Visual Studio 2015 cache/options directory |
|||
.vs/ |
|||
# Uncomment if you have tasks that create the project's static files in wwwroot |
|||
#wwwroot/ |
|||
|
|||
# MSTest test Results |
|||
[Tt]est[Rr]esult*/ |
|||
[Bb]uild[Ll]og.* |
|||
|
|||
# NUNIT |
|||
*.VisualState.xml |
|||
TestResult.xml |
|||
|
|||
# Build Results of an ATL Project |
|||
[Dd]ebugPS/ |
|||
[Rr]eleasePS/ |
|||
dlldata.c |
|||
|
|||
# DNX |
|||
project.lock.json |
|||
artifacts/ |
|||
|
|||
*_i.c |
|||
*_p.c |
|||
*_i.h |
|||
*.ilk |
|||
*.meta |
|||
*.obj |
|||
*.pch |
|||
*.pdb |
|||
*.pgc |
|||
*.pgd |
|||
*.rsp |
|||
*.sbr |
|||
*.tlb |
|||
*.tli |
|||
*.tlh |
|||
*.tmp |
|||
*.tmp_proj |
|||
*.log |
|||
*.vspscc |
|||
*.vssscc |
|||
.builds |
|||
*.pidb |
|||
*.svclog |
|||
*.scc |
|||
|
|||
# Chutzpah Test files |
|||
_Chutzpah* |
|||
|
|||
# Visual C++ cache files |
|||
ipch/ |
|||
*.aps |
|||
*.ncb |
|||
*.opendb |
|||
*.opensdf |
|||
*.sdf |
|||
*.cachefile |
|||
*.VC.db |
|||
*.VC.VC.opendb |
|||
|
|||
# Visual Studio profiler |
|||
*.psess |
|||
*.vsp |
|||
*.vspx |
|||
*.sap |
|||
|
|||
# TFS 2012 Local Workspace |
|||
$tf/ |
|||
|
|||
# Guidance Automation Toolkit |
|||
*.gpState |
|||
|
|||
# ReSharper is a .NET coding add-in |
|||
_ReSharper*/ |
|||
*.[Rr]e[Ss]harper |
|||
*.DotSettings.user |
|||
|
|||
# JustCode is a .NET coding add-in |
|||
.JustCode |
|||
|
|||
# TeamCity is a build add-in |
|||
_TeamCity* |
|||
|
|||
# DotCover is a Code Coverage Tool |
|||
*.dotCover |
|||
|
|||
# NCrunch |
|||
_NCrunch_* |
|||
.*crunch*.local.xml |
|||
nCrunchTemp_* |
|||
|
|||
# MightyMoose |
|||
*.mm.* |
|||
AutoTest.Net/ |
|||
|
|||
# Web workbench (sass) |
|||
.sass-cache/ |
|||
|
|||
# Installshield output folder |
|||
[Ee]xpress/ |
|||
|
|||
# DocProject is a documentation generator add-in |
|||
DocProject/buildhelp/ |
|||
DocProject/Help/*.HxT |
|||
DocProject/Help/*.HxC |
|||
DocProject/Help/*.hhc |
|||
DocProject/Help/*.hhk |
|||
DocProject/Help/*.hhp |
|||
DocProject/Help/Html2 |
|||
DocProject/Help/html |
|||
|
|||
# Click-Once directory |
|||
publish/ |
|||
|
|||
# Publish Web Output |
|||
*.[Pp]ublish.xml |
|||
*.azurePubxml |
|||
# TODO: Comment the next line if you want to checkin your web deploy settings |
|||
# but database connection strings (with potential passwords) will be unencrypted |
|||
*.pubxml |
|||
*.publishproj |
|||
|
|||
# Microsoft Azure Web App publish settings. Comment the next line if you want to |
|||
# checkin your Azure Web App publish settings, but sensitive information contained |
|||
# in these scripts will be unencrypted |
|||
PublishScripts/ |
|||
|
|||
# NuGet Packages |
|||
*.nupkg |
|||
# The packages folder can be ignored because of Package Restore |
|||
**/packages/* |
|||
# except build/, which is used as an MSBuild target. |
|||
!**/packages/build/ |
|||
# Uncomment if necessary however generally it will be regenerated when needed |
|||
#!**/packages/repositories.config |
|||
# NuGet v3's project.json files produces more ignoreable files |
|||
*.nuget.props |
|||
*.nuget.targets |
|||
|
|||
# Microsoft Azure Build Output |
|||
csx/ |
|||
*.build.csdef |
|||
|
|||
# Microsoft Azure Emulator |
|||
ecf/ |
|||
rcf/ |
|||
|
|||
# Windows Store app package directories and files |
|||
AppPackages/ |
|||
BundleArtifacts/ |
|||
Package.StoreAssociation.xml |
|||
_pkginfo.txt |
|||
|
|||
# Visual Studio cache files |
|||
# files ending in .cache can be ignored |
|||
*.[Cc]ache |
|||
# but keep track of directories ending in .cache |
|||
!*.[Cc]ache/ |
|||
|
|||
# Others |
|||
ClientBin/ |
|||
~$* |
|||
*~ |
|||
*.dbmdl |
|||
*.dbproj.schemaview |
|||
*.pfx |
|||
*.publishsettings |
|||
node_modules/ |
|||
orleans.codegen.cs |
|||
|
|||
# Since there are multiple workflows, uncomment next line to ignore bower_components |
|||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) |
|||
#bower_components/ |
|||
|
|||
# RIA/Silverlight projects |
|||
Generated_Code/ |
|||
|
|||
# Backup & report files from converting an old project file |
|||
# to a newer Visual Studio version. Backup files are not needed, |
|||
# because we have git ;-) |
|||
_UpgradeReport_Files/ |
|||
Backup*/ |
|||
UpgradeLog*.XML |
|||
UpgradeLog*.htm |
|||
|
|||
# SQL Server files |
|||
*.mdf |
|||
*.ldf |
|||
|
|||
# Business Intelligence projects |
|||
*.rdl.data |
|||
*.bim.layout |
|||
*.bim_*.settings |
|||
|
|||
# Microsoft Fakes |
|||
FakesAssemblies/ |
|||
|
|||
# GhostDoc plugin setting file |
|||
*.GhostDoc.xml |
|||
|
|||
# Node.js Tools for Visual Studio |
|||
.ntvs_analysis.dat |
|||
|
|||
# Visual Studio 6 build log |
|||
*.plg |
|||
|
|||
# Visual Studio 6 workspace options file |
|||
*.opt |
|||
|
|||
# Visual Studio LightSwitch build output |
|||
**/*.HTMLClient/GeneratedArtifacts |
|||
**/*.DesktopClient/GeneratedArtifacts |
|||
**/*.DesktopClient/ModelManifest.xml |
|||
**/*.Server/GeneratedArtifacts |
|||
**/*.Server/ModelManifest.xml |
|||
_Pvt_Extensions |
|||
|
|||
# Paket dependency manager |
|||
.paket/paket.exe |
|||
paket-files/ |
|||
|
|||
# FAKE - F# Make |
|||
.fake/ |
|||
|
|||
# JetBrains Rider |
|||
.idea/ |
|||
*.sln.iml |
|||
|
|||
# Booking |
|||
host/EasyAbp.EShop.Plugins.Booking.IdentityServer/Logs/logs.txt |
|||
host/EasyAbp.EShop.Plugins.Booking.HttpApi.Host/Logs/logs.txt |
|||
host/EasyAbp.EShop.Plugins.Booking.Web.Host/Logs/logs.txt |
|||
host/EasyAbp.EShop.Plugins.Booking.Web.Unified/Logs/logs.txt |
|||
host/EasyAbp.EShop.Plugins.Booking.Blazor.Server.Host/Logs/logs.txt |
|||
@ -0,0 +1,5 @@ |
|||
{ |
|||
"singleQuote": true, |
|||
"useTabs": false, |
|||
"tabWidth": 4 |
|||
} |
|||
@ -0,0 +1,111 @@ |
|||
{ |
|||
"folders": { |
|||
"items": { |
|||
"src": {}, |
|||
"test": {}, |
|||
"host": {} |
|||
} |
|||
}, |
|||
"packages": { |
|||
"EasyAbp.EShop.Plugins.Booking.Domain.Shared": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Domain.Shared/EasyAbp.EShop.Plugins.Booking.Domain.Shared.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Domain": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Domain/EasyAbp.EShop.Plugins.Booking.Domain.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Application.Contracts": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Application.Contracts/EasyAbp.EShop.Plugins.Booking.Application.Contracts.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Application": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Application/EasyAbp.EShop.Plugins.Booking.Application.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.MongoDB": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.MongoDB/EasyAbp.EShop.Plugins.Booking.MongoDB.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.HttpApi": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.HttpApi/EasyAbp.EShop.Plugins.Booking.HttpApi.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.HttpApi.Client": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.HttpApi.Client/EasyAbp.EShop.Plugins.Booking.HttpApi.Client.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.TestBase": { |
|||
"path": "test/EasyAbp.EShop.Plugins.Booking.TestBase/EasyAbp.EShop.Plugins.Booking.TestBase.abppkg.json", |
|||
"folder": "test" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.Tests": { |
|||
"path": "test/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.Tests/EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.Tests.abppkg.json", |
|||
"folder": "test" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.MongoDB.Tests": { |
|||
"path": "test/EasyAbp.EShop.Plugins.Booking.MongoDB.Tests/EasyAbp.EShop.Plugins.Booking.MongoDB.Tests.abppkg.json", |
|||
"folder": "test" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Domain.Tests": { |
|||
"path": "test/EasyAbp.EShop.Plugins.Booking.Domain.Tests/EasyAbp.EShop.Plugins.Booking.Domain.Tests.abppkg.json", |
|||
"folder": "test" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Application.Tests": { |
|||
"path": "test/EasyAbp.EShop.Plugins.Booking.Application.Tests/EasyAbp.EShop.Plugins.Booking.Application.Tests.abppkg.json", |
|||
"folder": "test" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.HttpApi.Host": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.HttpApi.Host/EasyAbp.EShop.Plugins.Booking.HttpApi.Host.abppkg.json", |
|||
"folder": "host" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Web": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Web/EasyAbp.EShop.Plugins.Booking.Web.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.HttpApi.Client.ConsoleTestApp": { |
|||
"path": "test/EasyAbp.EShop.Plugins.Booking.HttpApi.Client.ConsoleTestApp/EasyAbp.EShop.Plugins.Booking.HttpApi.Client.ConsoleTestApp.abppkg.json", |
|||
"folder": "test" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Web.Host": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.Web.Host/EasyAbp.EShop.Plugins.Booking.Web.Host.abppkg.json", |
|||
"folder": "host" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.IdentityServer": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.IdentityServer/EasyAbp.EShop.Plugins.Booking.IdentityServer.abppkg.json", |
|||
"folder": "host" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Host.Shared": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.Host.Shared/EasyAbp.EShop.Plugins.Booking.Host.Shared.abppkg.json", |
|||
"folder": "host" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Web.Unified": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.Web.Unified/EasyAbp.EShop.Plugins.Booking.Web.Unified.abppkg.json", |
|||
"folder": "host" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Blazor": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Blazor/EasyAbp.EShop.Plugins.Booking.Blazor.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Blazor.Host": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.Blazor.Host/EasyAbp.EShop.Plugins.Booking.Blazor.Host.abppkg.json", |
|||
"folder": "host" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Blazor.Server": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Blazor.Server/EasyAbp.EShop.Plugins.Booking.Blazor.Server.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Blazor.WebAssembly": { |
|||
"path": "src/EasyAbp.EShop.Plugins.Booking.Blazor.WebAssembly/EasyAbp.EShop.Plugins.Booking.Blazor.WebAssembly.abppkg.json", |
|||
"folder": "src" |
|||
}, |
|||
"EasyAbp.EShop.Plugins.Booking.Blazor.Server.Host": { |
|||
"path": "host/EasyAbp.EShop.Plugins.Booking.Blazor.Server.Host/EasyAbp.EShop.Plugins.Booking.Blazor.Server.Host.abppkg.json", |
|||
"folder": "host" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
{ |
|||
"modules": { |
|||
"EasyAbp.EShop.Plugins.Booking": { |
|||
"path": "EasyAbp.EShop.Plugins.Booking.abpmdl.json" |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,146 @@ |
|||
|
|||
Microsoft Visual Studio Solution File, Format Version 12.00 |
|||
# Visual Studio Version 16 |
|||
VisualStudioVersion = 16.0.29001.49 |
|||
MinimumVisualStudioVersion = 10.0.40219.1 |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Domain.Shared", "src\EasyAbp.EShop.Plugins.Booking.Domain.Shared\EasyAbp.EShop.Plugins.Booking.Domain.Shared.csproj", "{D64C1577-4929-4B60-939E-96DE1534891A}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Domain", "src\EasyAbp.EShop.Plugins.Booking.Domain\EasyAbp.EShop.Plugins.Booking.Domain.csproj", "{F2840BC7-0188-4606-9126-DADD0F5ABF7A}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Application.Contracts", "src\EasyAbp.EShop.Plugins.Booking.Application.Contracts\EasyAbp.EShop.Plugins.Booking.Application.Contracts.csproj", "{BD65D04F-08D5-40C1-8C24-77CA0BACB877}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Application", "src\EasyAbp.EShop.Plugins.Booking.Application\EasyAbp.EShop.Plugins.Booking.Application.csproj", "{78040F9E-3501-4A40-82DF-00A597710F35}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{649A3FFA-182F-4E56-9717-E6A9A2BEC545}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D}" |
|||
EndProject |
|||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "host", "host", "{E400416D-2895-4512-9D17-90681EEC7E0A}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore", "src\EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore\EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.csproj", "{0CE86223-D31D-4315-A1F5-87BA3EE1B844}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.MongoDB", "src\EasyAbp.EShop.Plugins.Booking.MongoDB\EasyAbp.EShop.Plugins.Booking.MongoDB.csproj", "{F1C58097-4C08-4D88-8976-6B3389391481}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.HttpApi", "src\EasyAbp.EShop.Plugins.Booking.HttpApi\EasyAbp.EShop.Plugins.Booking.HttpApi.csproj", "{077AA5F8-8B61-420C-A6B5-0150A66FDB34}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.HttpApi.Client", "src\EasyAbp.EShop.Plugins.Booking.HttpApi.Client\EasyAbp.EShop.Plugins.Booking.HttpApi.Client.csproj", "{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.TestBase", "test\EasyAbp.EShop.Plugins.Booking.TestBase\EasyAbp.EShop.Plugins.Booking.TestBase.csproj", "{C5BB573D-3030-4BCB-88B7-F6A85C32766C}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.Tests", "test\EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.Tests\EasyAbp.EShop.Plugins.Booking.EntityFrameworkCore.Tests.csproj", "{527F645C-C1FC-406E-8479-81386C8ECF13}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.MongoDB.Tests", "test\EasyAbp.EShop.Plugins.Booking.MongoDB.Tests\EasyAbp.EShop.Plugins.Booking.MongoDB.Tests.csproj", "{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Domain.Tests", "test\EasyAbp.EShop.Plugins.Booking.Domain.Tests\EasyAbp.EShop.Plugins.Booking.Domain.Tests.csproj", "{E60895E5-79C4-447D-88B7-85CB5BA336A4}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Application.Tests", "test\EasyAbp.EShop.Plugins.Booking.Application.Tests\EasyAbp.EShop.Plugins.Booking.Application.Tests.csproj", "{90CB5DC4-C040-45C7-8900-9688B26405BC}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Web", "src\EasyAbp.EShop.Plugins.Booking.Web\EasyAbp.EShop.Plugins.Booking.Web.csproj", "{3B7B6317-1B85-4164-8E11-75574F80AE17}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.HttpApi.Client.ConsoleTestApp", "test\EasyAbp.EShop.Plugins.Booking.HttpApi.Client.ConsoleTestApp\EasyAbp.EShop.Plugins.Booking.HttpApi.Client.ConsoleTestApp.csproj", "{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}" |
|||
EndProject |
|||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EasyAbp.EShop.Plugins.Booking.Host.Shared", "host\EasyAbp.EShop.Plugins.Booking.Host.Shared\EasyAbp.EShop.Plugins.Booking.Host.Shared.csproj", "{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}" |
|||
EndProject |
|||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "EasyAbp.EShop.Plugins.Booking.Installer", "src\EasyAbp.EShop.Plugins.Booking.Installer\EasyAbp.EShop.Plugins.Booking.Installer.csproj", "{BE39FD00-745B-4049-8161-FC129817CBE4}" |
|||
EndProject |
|||
Global |
|||
GlobalSection(SolutionConfigurationPlatforms) = preSolution |
|||
Debug|Any CPU = Debug|Any CPU |
|||
Release|Any CPU = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(ProjectConfigurationPlatforms) = postSolution |
|||
{D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{D64C1577-4929-4B60-939E-96DE1534891A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{D64C1577-4929-4B60-939E-96DE1534891A}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{F2840BC7-0188-4606-9126-DADD0F5ABF7A}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{BD65D04F-08D5-40C1-8C24-77CA0BACB877}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{78040F9E-3501-4A40-82DF-00A597710F35}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{78040F9E-3501-4A40-82DF-00A597710F35}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{0CE86223-D31D-4315-A1F5-87BA3EE1B844}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{F1C58097-4C08-4D88-8976-6B3389391481}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{F1C58097-4C08-4D88-8976-6B3389391481}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{077AA5F8-8B61-420C-A6B5-0150A66FDB34}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{C5BB573D-3030-4BCB-88B7-F6A85C32766C}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{527F645C-C1FC-406E-8479-81386C8ECF13}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{527F645C-C1FC-406E-8479-81386C8ECF13}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{E60895E5-79C4-447D-88B7-85CB5BA336A4}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{90CB5DC4-C040-45C7-8900-9688B26405BC}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{3B7B6317-1B85-4164-8E11-75574F80AE17}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{3B7B6317-1B85-4164-8E11-75574F80AE17}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
{BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU |
|||
{BE39FD00-745B-4049-8161-FC129817CBE4}.Debug|Any CPU.Build.0 = Debug|Any CPU |
|||
{BE39FD00-745B-4049-8161-FC129817CBE4}.Release|Any CPU.ActiveCfg = Release|Any CPU |
|||
{BE39FD00-745B-4049-8161-FC129817CBE4}.Release|Any CPU.Build.0 = Release|Any CPU |
|||
EndGlobalSection |
|||
GlobalSection(SolutionProperties) = preSolution |
|||
HideSolutionNode = FALSE |
|||
EndGlobalSection |
|||
GlobalSection(NestedProjects) = preSolution |
|||
{D64C1577-4929-4B60-939E-96DE1534891A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{F2840BC7-0188-4606-9126-DADD0F5ABF7A} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{BD65D04F-08D5-40C1-8C24-77CA0BACB877} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{78040F9E-3501-4A40-82DF-00A597710F35} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{0CE86223-D31D-4315-A1F5-87BA3EE1B844} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{F1C58097-4C08-4D88-8976-6B3389391481} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{077AA5F8-8B61-420C-A6B5-0150A66FDB34} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{36E2735F-CEAB-44C8-A6D1-2CDAFF399751} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{C5BB573D-3030-4BCB-88B7-F6A85C32766C} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} |
|||
{527F645C-C1FC-406E-8479-81386C8ECF13} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} |
|||
{D0AD9179-125C-40B2-A8EE-CD4C1EE24BB6} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} |
|||
{E60895E5-79C4-447D-88B7-85CB5BA336A4} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} |
|||
{90CB5DC4-C040-45C7-8900-9688B26405BC} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} |
|||
{3B7B6317-1B85-4164-8E11-75574F80AE17} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
{1EDCD6D4-DF3A-4E3B-ABB6-C0D0B373EAB8} = {CCD2960C-23CC-4AB4-B84D-60C7AAA52F4D} |
|||
{F6AC8D4A-EDD7-4514-8E8A-5BCB019864DB} = {E400416D-2895-4512-9D17-90681EEC7E0A} |
|||
{BE39FD00-745B-4049-8161-FC129817CBE4} = {649A3FFA-182F-4E56-9717-E6A9A2BEC545} |
|||
EndGlobalSection |
|||
GlobalSection(ExtensibilityGlobals) = postSolution |
|||
SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD} |
|||
EndGlobalSection |
|||
EndGlobal |
|||
@ -0,0 +1,23 @@ |
|||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> |
|||
<s:Boolean x:Key="/Default/CodeEditing/Intellisense/CodeCompletion/IntelliSenseCompletingCharacters/CSharpCompletingCharacters/UpgradedFromVSSettings/@EntryValue">True</s:Boolean> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceDoWhileStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceFixedStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceForeachStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceForStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceIfStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceLockStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceUsingStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=EnforceWhileStatementBraces/@EntryIndexedValue">WARNING</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOR/@EntryValue">Required</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_FOREACH/@EntryValue">Required</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_IFELSE/@EntryValue">Required</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_FOR_WHILE/@EntryValue">Required</s:String> |
|||
<s:Boolean x:Key="/Default/CodeStyle/CodeFormatting/CSharpCodeStyle/BRACES_REDUNDANT/@EntryValue">False</s:Boolean> |
|||
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean> |
|||
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Async/@EntryIndexedValue">False</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Mutable/@EntryIndexedValue">False</s:String> |
|||
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Overrides/@KeyIndexDefined">True</s:Boolean> |
|||
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Async/@EntryIndexedValue">False</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Generate/=Overrides/Options/=Mutable/@EntryIndexedValue">False</s:String> |
|||
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=SQL/@EntryIndexedValue">SQL</s:String> |
|||
</wpf:ResourceDictionary> |
|||
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<configuration> |
|||
<packageSources> |
|||
<add key="BlazoriseMyGet" value="https://www.myget.org/F/blazorise/api/v3/index.json" /> |
|||
</packageSources> |
|||
</configuration> |
|||
@ -0,0 +1 @@ |
|||
../../docs/plugins/booking/README.md |
|||
@ -0,0 +1,13 @@ |
|||
version: '3.4' |
|||
|
|||
services: |
|||
migrations: |
|||
build: |
|||
context: ../../ |
|||
dockerfile: templates/service/database/Dockerfile |
|||
depends_on: |
|||
- sqlserver |
|||
environment: |
|||
- IdentityServer_DB=Booking_Identity |
|||
- Booking_DB=Booking_ModuleDb |
|||
- SA_PASSWORD=yourStrong(!)Password |
|||
@ -0,0 +1,29 @@ |
|||
version: '3.4' |
|||
|
|||
services: |
|||
sqlserver: |
|||
environment: |
|||
- SA_PASSWORD=yourStrong(!)Password |
|||
- ACCEPT_EULA=Y |
|||
ports: |
|||
- "51599:1433" |
|||
|
|||
identity-server: |
|||
environment: |
|||
- ASPNETCORE_URLS=http://0.0.0.0:80 |
|||
- ConnectionStrings__Default=Server=sqlserver;Database=Booking_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- ConnectionStrings__SqlServerCache=Server=sqlserver;Database=Booking_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
ports: |
|||
- "51600:80" |
|||
|
|||
booking: |
|||
environment: |
|||
- ASPNETCORE_URLS=http://0.0.0.0:80 |
|||
- ConnectionStrings__Default=Server=sqlserver;Database=Booking_ModuleDb;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- ConnectionStrings__AbpSettingManagement=Server=sqlserver;Database=Booking_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- ConnectionStrings__AbpPermissionManagement=Server=sqlserver;Database=Booking_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- ConnectionStrings__AbpAuditLogging=Server=sqlserver;Database=Booking_Identity;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- ConnectionStrings__SqlServerCache=Server=sqlserver;Database=Booking_Cache;Trusted_Connection=True;User=sa;Password=yourStrong(!)Password;Integrated Security=false |
|||
- AuthServer__Authority=http://identity-server |
|||
ports: |
|||
- "51601:80" |
|||
@ -0,0 +1,25 @@ |
|||
version: '3.4' |
|||
|
|||
services: |
|||
sqlserver: |
|||
image: mcr.microsoft.com/mssql/server |
|||
volumes: |
|||
- dbdata:/var/opt/mssql |
|||
|
|||
identity-server: |
|||
build: |
|||
context: ../../ |
|||
dockerfile: templates/service/host/IdentityServerHost/Dockerfile |
|||
depends_on: |
|||
- sqlserver |
|||
|
|||
booking: |
|||
build: |
|||
context: ../../ |
|||
dockerfile: templates/service/host/EasyAbp.EShop.Plugins.Booking.Host/Dockerfile |
|||
depends_on: |
|||
- sqlserver |
|||
- identity-server |
|||
|
|||
volumes: |
|||
dbdata: |
|||
@ -0,0 +1 @@ |
|||
{} |
|||
@ -0,0 +1,10 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace>EasyAbp.EShop.Plugins.Booking</RootNamespace> |
|||
</PropertyGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,9 @@ |
|||
namespace EasyAbp.EShop.Plugins.Booking.MultiTenancy; |
|||
|
|||
public static class MultiTenancyConsts |
|||
{ |
|||
/* Enable/disable multi-tenancy in a single point |
|||
* to test your module with multi-tenancy. |
|||
*/ |
|||
public const bool IsEnabled = false; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net6.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application\EasyAbp.EShop.Orders.Application.csproj" /> |
|||
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Booking.Application.Contracts\EasyAbp.EShop.Plugins.Booking.Application.Contracts.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="EasyAbp.BookingService.Application.Contracts" Version="$(EasyAbpBookingServiceModuleVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,231 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Security.Principal; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.AssetOccupancies; |
|||
using EasyAbp.BookingService.AssetOccupancies.Dtos; |
|||
using EasyAbp.BookingService.AssetOccupancyProviders; |
|||
using EasyAbp.BookingService.PeriodSchemes; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.GrantedStores; |
|||
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Orders.Booking.Authorization |
|||
{ |
|||
public class BookingOrderCreationAuthorizationHandler : OrderCreationAuthorizationHandler |
|||
{ |
|||
private readonly IPeriodSchemeAppService _periodSchemeAppService; |
|||
private readonly IProductAssetAppService _productAssetAppService; |
|||
private readonly IGrantedStoreAppService _grantedStoreAppService; |
|||
private readonly IProductAssetCategoryAppService _productAssetCategoryAppService; |
|||
private readonly IAssetOccupancyAppService _assetOccupancyAppService; |
|||
private readonly IBookingProductGroupDefinitionAppService _definitionAppService; |
|||
|
|||
public BookingOrderCreationAuthorizationHandler( |
|||
IPeriodSchemeAppService periodSchemeAppService, |
|||
IProductAssetAppService productAssetAppService, |
|||
IGrantedStoreAppService grantedStoreAppService, |
|||
IProductAssetCategoryAppService productAssetCategoryAppService, |
|||
IAssetOccupancyAppService assetOccupancyAppService, |
|||
IBookingProductGroupDefinitionAppService definitionAppService) |
|||
{ |
|||
_periodSchemeAppService = periodSchemeAppService; |
|||
_productAssetAppService = productAssetAppService; |
|||
_grantedStoreAppService = grantedStoreAppService; |
|||
_productAssetCategoryAppService = productAssetCategoryAppService; |
|||
_assetOccupancyAppService = assetOccupancyAppService; |
|||
_definitionAppService = definitionAppService; |
|||
} |
|||
|
|||
protected override async Task HandleOrderCreationAsync(AuthorizationHandlerContext context, |
|||
OrderOperationAuthorizationRequirement requirement, OrderCreationResource resource) |
|||
{ |
|||
var productGroupNames = (await _definitionAppService.GetListAsync()).Items.Select(x => x.ProductGroupName); |
|||
|
|||
var bookingOrderLines = resource.Input.OrderLines.Where(x => |
|||
productGroupNames.Contains(resource.ProductDictionary[x.ProductId].ProductGroupName)).ToList(); |
|||
|
|||
if (!bookingOrderLines.Any()) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var models = new List<OccupyAssetInfoModel>(); |
|||
var byCategoryModels = new List<OccupyAssetByCategoryInfoModel>(); |
|||
|
|||
foreach (var orderLine in bookingOrderLines) |
|||
{ |
|||
if (!await IsPeriodInfoValidAsync(orderLine)) |
|||
{ |
|||
context.Fail(); |
|||
return; |
|||
} |
|||
|
|||
var assetId = orderLine.FindBookingAssetId(); |
|||
var assetCategoryId = orderLine.FindBookingAssetCategoryId(); |
|||
|
|||
if (assetId is not null) |
|||
{ |
|||
if (!await IsAssetInfoValidAsync(orderLine, resource)) |
|||
{ |
|||
context.Fail(); |
|||
return; |
|||
} |
|||
|
|||
models.Add(CreateOccupyAssetInfoModel(assetId.Value, orderLine)); |
|||
} |
|||
else if (assetCategoryId is not null) |
|||
{ |
|||
if (!await IsAssetCategoryInfoValidAsync(orderLine, resource)) |
|||
{ |
|||
context.Fail(); |
|||
return; |
|||
} |
|||
|
|||
byCategoryModels.Add(CreateOccupyAssetByCategoryInfoModel(assetCategoryId.Value, orderLine)); |
|||
} |
|||
else |
|||
{ |
|||
context.Fail(); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
try |
|||
{ |
|||
await _assetOccupancyAppService.CheckBulkCreateAsync(new BulkCreateAssetOccupancyDto |
|||
{ |
|||
OccupierUserId = Check.NotNull(context.User.FindUserId(), "CurrentUserId"), |
|||
Models = models, |
|||
ByCategoryModels = byCategoryModels |
|||
}); |
|||
} |
|||
catch |
|||
{ |
|||
context.Fail(); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
protected virtual OccupyAssetInfoModel CreateOccupyAssetInfoModel(Guid assetId, CreateOrderLineDto orderLine) |
|||
{ |
|||
return new OccupyAssetInfoModel( |
|||
assetId, |
|||
orderLine.GetBookingVolume(), |
|||
orderLine.GetBookingDate(), |
|||
orderLine.GetBookingStartingTime(), |
|||
orderLine.GetBookingDuration() |
|||
); |
|||
} |
|||
|
|||
protected virtual OccupyAssetByCategoryInfoModel CreateOccupyAssetByCategoryInfoModel(Guid assetCategoryId, |
|||
CreateOrderLineDto orderLine) |
|||
{ |
|||
return new OccupyAssetByCategoryInfoModel( |
|||
assetCategoryId, |
|||
orderLine.GetBookingVolume(), |
|||
orderLine.GetBookingDate(), |
|||
orderLine.GetBookingStartingTime(), |
|||
orderLine.GetBookingDuration() |
|||
); |
|||
} |
|||
|
|||
protected virtual async Task<bool> IsAssetInfoValidAsync(CreateOrderLineDto orderLine, |
|||
OrderCreationResource resource) |
|||
{ |
|||
var mapping = (await _grantedStoreAppService.GetListAsync(new GetGrantedStoreListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
StoreId = resource.Input.StoreId, |
|||
AssetId = orderLine.GetBookingAssetId() |
|||
})).Items.FirstOrDefault(); |
|||
|
|||
if (mapping is null) |
|||
{ |
|||
mapping = (await _grantedStoreAppService.GetListAsync(new GetGrantedStoreListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
AllowAll = true |
|||
})).Items.FirstOrDefault(); |
|||
} |
|||
|
|||
if (mapping is null) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
var productAsset = (await _productAssetAppService.GetListAsync( |
|||
new GetProductAssetListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
StoreId = resource.Input.StoreId, |
|||
ProductId = orderLine.ProductId, |
|||
ProductSkuId = orderLine.ProductSkuId, |
|||
AssetId = orderLine.GetBookingAssetId(), |
|||
PeriodSchemeId = orderLine.GetBookingPeriodSchemeId() |
|||
} |
|||
)).Items.FirstOrDefault(); |
|||
|
|||
return productAsset is not null; |
|||
} |
|||
|
|||
protected virtual async Task<bool> IsAssetCategoryInfoValidAsync(CreateOrderLineDto orderLine, |
|||
OrderCreationResource resource) |
|||
{ |
|||
var mapping = (await _grantedStoreAppService.GetListAsync(new GetGrantedStoreListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
StoreId = resource.Input.StoreId, |
|||
AssetCategoryId = orderLine.GetBookingAssetCategoryId() |
|||
})).Items.FirstOrDefault(); |
|||
|
|||
if (mapping is null) |
|||
{ |
|||
mapping = (await _grantedStoreAppService.GetListAsync(new GetGrantedStoreListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
AllowAll = true |
|||
})).Items.FirstOrDefault(); |
|||
} |
|||
|
|||
if (mapping is null) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
var productAssetCategory = (await _productAssetCategoryAppService.GetListAsync( |
|||
new GetProductAssetCategoryListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
StoreId = resource.Input.StoreId, |
|||
ProductId = orderLine.ProductId, |
|||
ProductSkuId = orderLine.ProductSkuId, |
|||
AssetCategoryId = orderLine.GetBookingAssetCategoryId(), |
|||
PeriodSchemeId = orderLine.GetBookingPeriodSchemeId() |
|||
} |
|||
)).Items.FirstOrDefault(); |
|||
|
|||
return productAssetCategory is not null; |
|||
} |
|||
|
|||
protected virtual async Task<bool> IsPeriodInfoValidAsync(CreateOrderLineDto orderLine) |
|||
{ |
|||
var periodSchemeId = orderLine.GetBookingPeriodSchemeId(); |
|||
var periodId = orderLine.GetBookingPeriodId(); |
|||
|
|||
var periodScheme = await _periodSchemeAppService.GetAsync(periodSchemeId); |
|||
var period = periodScheme.Periods.Find(x => x.Id == periodId); |
|||
|
|||
return period is not null; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace EasyAbp.EShop.Orders.Booking; |
|||
|
|||
public class BookingOrderConsts |
|||
{ |
|||
public static string BookingOrderAutoCancellationResult = "Asset occupancy failed"; |
|||
} |
|||
@ -0,0 +1,123 @@ |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Products.Products.Dtos; |
|||
using NodaMoney; |
|||
using Volo.Abp.DependencyInjection; |
|||
|
|||
namespace EasyAbp.EShop.Orders.Booking; |
|||
|
|||
public class BookingOrderLinePriceOverrider : IOrderLinePriceOverrider, ITransientDependency |
|||
{ |
|||
private readonly IProductAssetAppService _productAssetAppService; |
|||
private readonly IProductAssetCategoryAppService _productAssetCategoryAppService; |
|||
|
|||
public BookingOrderLinePriceOverrider( |
|||
IProductAssetAppService productAssetAppService, |
|||
IProductAssetCategoryAppService productAssetCategoryAppService) |
|||
{ |
|||
_productAssetAppService = productAssetAppService; |
|||
_productAssetCategoryAppService = productAssetCategoryAppService; |
|||
} |
|||
|
|||
public virtual async Task<Money?> GetUnitPriceOrNullAsync(CreateOrderDto input, CreateOrderLineDto inputOrderLine, |
|||
ProductDto product, ProductSkuDto productSku, Currency effectiveCurrency) |
|||
{ |
|||
if (inputOrderLine.FindBookingAssetId() is not null) |
|||
{ |
|||
return await GetAssetBookingUnitPriceAsync(input, inputOrderLine, effectiveCurrency); |
|||
} |
|||
|
|||
if (inputOrderLine.FindBookingAssetCategoryId() is not null) |
|||
{ |
|||
return await GetAssetCategoryBookingUnitPriceAsync(input, inputOrderLine, effectiveCurrency); |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
public virtual async Task<Money?> GetAssetBookingUnitPriceAsync(CreateOrderDto input, |
|||
CreateOrderLineDto inputOrderLine, Currency effectiveCurrency) |
|||
{ |
|||
var productAsset = (await _productAssetAppService.GetListAsync( |
|||
new GetProductAssetListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
StoreId = input.StoreId, |
|||
ProductId = inputOrderLine.ProductId, |
|||
ProductSkuId = inputOrderLine.ProductSkuId, |
|||
AssetId = inputOrderLine.GetBookingAssetId(), |
|||
PeriodSchemeId = inputOrderLine.GetBookingPeriodSchemeId() |
|||
} |
|||
)).Items.First(); |
|||
|
|||
var productAssetPeriod = |
|||
productAsset.Periods.FirstOrDefault(x => x.PeriodId == inputOrderLine.GetBookingPeriodId()); |
|||
|
|||
if (productAssetPeriod is not null) |
|||
{ |
|||
await CheckCurrencyAsync(productAssetPeriod.Currency, effectiveCurrency); |
|||
|
|||
return new Money(productAssetPeriod.Price, effectiveCurrency); |
|||
} |
|||
|
|||
if (productAsset.Price.HasValue) |
|||
{ |
|||
await CheckCurrencyAsync(productAsset.Currency, effectiveCurrency); |
|||
|
|||
return new Money(productAsset.Price.Value, effectiveCurrency); |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
public virtual async Task<Money?> GetAssetCategoryBookingUnitPriceAsync(CreateOrderDto input, |
|||
CreateOrderLineDto inputOrderLine, Currency effectiveCurrency) |
|||
{ |
|||
var productAssetCategory = (await _productAssetCategoryAppService.GetListAsync( |
|||
new GetProductAssetCategoryListDto |
|||
{ |
|||
MaxResultCount = 1, |
|||
StoreId = input.StoreId, |
|||
ProductId = inputOrderLine.ProductId, |
|||
ProductSkuId = inputOrderLine.ProductSkuId, |
|||
AssetCategoryId = inputOrderLine.GetBookingAssetCategoryId(), |
|||
PeriodSchemeId = inputOrderLine.GetBookingPeriodSchemeId() |
|||
} |
|||
)).Items.First(); |
|||
|
|||
var productAssetCategoryPeriod = |
|||
productAssetCategory.Periods.FirstOrDefault(x => x.PeriodId == inputOrderLine.GetBookingPeriodId()); |
|||
|
|||
if (productAssetCategoryPeriod is not null) |
|||
{ |
|||
await CheckCurrencyAsync(productAssetCategoryPeriod.Currency, effectiveCurrency); |
|||
|
|||
return new Money(productAssetCategoryPeriod.Price, effectiveCurrency); |
|||
} |
|||
|
|||
if (productAssetCategory.Price.HasValue) |
|||
{ |
|||
await CheckCurrencyAsync(productAssetCategory.Currency, effectiveCurrency); |
|||
|
|||
return new Money(productAssetCategory.Price.Value, effectiveCurrency); |
|||
} |
|||
|
|||
return null; |
|||
} |
|||
|
|||
protected virtual Task CheckCurrencyAsync(string currency, Currency effectiveCurrency) |
|||
{ |
|||
if (currency != effectiveCurrency.Code) |
|||
{ |
|||
throw new UnexpectedCurrencyException(effectiveCurrency.Code); |
|||
} |
|||
|
|||
return Task.CompletedTask; |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using EasyAbp.BookingService; |
|||
using EasyAbp.EShop.Orders.Booking.Authorization; |
|||
using EasyAbp.EShop.Orders.Booking.ObjectExtending; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace EasyAbp.EShop.Orders.Booking |
|||
{ |
|||
[DependsOn( |
|||
typeof(EShopOrdersApplicationModule), |
|||
typeof(EShopOrdersApplicationContractsModule), |
|||
typeof(BookingServiceApplicationContractsModule) |
|||
)] |
|||
public class EShopOrdersBookingApplicationModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
EShopOrdersPluginsBookingObjectExtensions.Configure(); |
|||
context.Services.AddSingleton<IAuthorizationHandler, BookingOrderCreationAuthorizationHandler>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,80 @@ |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.AssetOccupancies; |
|||
using EasyAbp.BookingService.AssetOccupancyProviders; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Payments.Refunds; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
using Volo.Abp.Uow; |
|||
|
|||
namespace EasyAbp.EShop.Orders.Booking.EventHandlers; |
|||
|
|||
public class BulkAssetOccupancyResultEventHandler : IDistributedEventHandler<BulkAssetOccupancyResultEto>, ITransientDependency |
|||
{ |
|||
private readonly IOrderManager _orderManager; |
|||
private readonly IOrderRepository _orderRepository; |
|||
private readonly IDistributedEventBus _distributedEventBus; |
|||
|
|||
public BulkAssetOccupancyResultEventHandler( |
|||
IOrderManager orderManager, |
|||
IOrderRepository orderRepository, |
|||
IDistributedEventBus distributedEventBus) |
|||
{ |
|||
_orderManager = orderManager; |
|||
_orderRepository = orderRepository; |
|||
_distributedEventBus = distributedEventBus; |
|||
} |
|||
|
|||
[UnitOfWork(true)] |
|||
public virtual async Task HandleEventAsync(BulkAssetOccupancyResultEto eventData) |
|||
{ |
|||
var orderId = eventData.FindBookingOrderId(); |
|||
|
|||
if (orderId is null) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var order = await _orderRepository.GetAsync(orderId.Value); |
|||
|
|||
if (eventData.Success) |
|||
{ |
|||
if (order.CompletionTime.HasValue) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
await _orderManager.CompleteAsync(order); |
|||
} |
|||
else |
|||
{ |
|||
if (order.CanceledTime.HasValue) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
await _orderManager.CancelAsync(order, BookingOrderConsts.BookingOrderAutoCancellationResult); |
|||
|
|||
await TryRefundOrderAsync(order); |
|||
} |
|||
} |
|||
|
|||
protected virtual async Task TryRefundOrderAsync(Order order) |
|||
{ |
|||
if (order.PaymentId is null) |
|||
{ |
|||
return; |
|||
} |
|||
|
|||
var eto = new RefundOrderEto( |
|||
order.TenantId, |
|||
order.Id, |
|||
order.StoreId, |
|||
order.PaymentId.Value, |
|||
BookingOrderConsts.BookingOrderAutoCancellationResult, |
|||
BookingOrderConsts.BookingOrderAutoCancellationResult, |
|||
BookingOrderConsts.BookingOrderAutoCancellationResult); |
|||
|
|||
await _distributedEventBus.PublishAsync(eto); |
|||
} |
|||
} |
|||
@ -0,0 +1,66 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using Volo.Abp.ObjectExtending; |
|||
using Volo.Abp.Threading; |
|||
|
|||
namespace EasyAbp.EShop.Orders.Booking.ObjectExtending |
|||
{ |
|||
public static class EShopOrdersPluginsBookingObjectExtensions |
|||
{ |
|||
private static readonly OneTimeRunner OneTimeRunner = new OneTimeRunner(); |
|||
|
|||
public static void Configure() |
|||
{ |
|||
OneTimeRunner.Run(() => |
|||
{ |
|||
/* You can configure extension properties to entities or other object types |
|||
* defined in the depended modules. |
|||
* |
|||
* If you are using EF Core and want to map the entity extension properties to new |
|||
* table fields in the database, then configure them in the EShopSampleEfCoreEntityExtensionMappings |
|||
* |
|||
* Example: |
|||
* |
|||
* ObjectExtensionManager.Instance |
|||
* .AddOrUpdateProperty<IdentityRole, string>("Title"); |
|||
* |
|||
* See the documentation for more: |
|||
* https://docs.abp.io/en/abp/latest/Object-Extensions
|
|||
*/ |
|||
|
|||
ObjectExtensionManager.Instance |
|||
.AddOrUpdate( |
|||
new[] |
|||
{ |
|||
typeof(OrderLine), |
|||
typeof(OrderLineDto), |
|||
typeof(OrderLineEto), |
|||
typeof(CreateOrderLineDto) |
|||
}, |
|||
config => |
|||
{ |
|||
config.AddOrUpdateProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetId); |
|||
config.AddOrUpdateProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetCategoryId); |
|||
config.AddOrUpdateProperty<Guid?>(BookingOrderProperties.OrderLineBookingPeriodSchemeId); |
|||
config.AddOrUpdateProperty<Guid?>(BookingOrderProperties.OrderLineBookingPeriodId); |
|||
config.AddOrUpdateProperty<DateTime?>(BookingOrderProperties.OrderLineBookingDate); |
|||
config.AddOrUpdateProperty<TimeSpan?>(BookingOrderProperties.OrderLineBookingStartingTime); |
|||
config.AddOrUpdateProperty<TimeSpan?>(BookingOrderProperties.OrderLineBookingDuration); |
|||
} |
|||
) |
|||
.AddOrUpdate( |
|||
new[] |
|||
{ |
|||
typeof(OrderLine), |
|||
typeof(OrderLineDto), |
|||
typeof(OrderLineEto) |
|||
}, |
|||
config => |
|||
{ |
|||
config.AddOrUpdateProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetOccupancyId); |
|||
}); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,19 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net6.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Payments\src\EasyAbp.EShop.Payments.Application\EasyAbp.EShop.Payments.Application.csproj" /> |
|||
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Booking.Application.Contracts\EasyAbp.EShop.Plugins.Booking.Application.Contracts.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="EasyAbp.BookingService.Application.Contracts" Version="$(EasyAbpBookingServiceModuleVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,133 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Security.Principal; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.AssetOccupancies; |
|||
using EasyAbp.BookingService.AssetOccupancies.Dtos; |
|||
using EasyAbp.BookingService.AssetOccupancyProviders; |
|||
using EasyAbp.BookingService.PeriodSchemes; |
|||
using EasyAbp.EShop.Orders; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using EasyAbp.EShop.Payments.Payments; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Volo.Abp; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Booking.Authorization |
|||
{ |
|||
public class BookingPaymentCreationAuthorizationHandler : PaymentCreationAuthorizationHandler |
|||
{ |
|||
private readonly IPeriodSchemeAppService _periodSchemeAppService; |
|||
private readonly IAssetOccupancyAppService _assetOccupancyAppService; |
|||
|
|||
public BookingPaymentCreationAuthorizationHandler( |
|||
IPeriodSchemeAppService periodSchemeAppService, |
|||
IAssetOccupancyAppService assetOccupancyAppService) |
|||
{ |
|||
_periodSchemeAppService = periodSchemeAppService; |
|||
_assetOccupancyAppService = assetOccupancyAppService; |
|||
} |
|||
|
|||
protected override async Task HandlePaymentCreationAsync(AuthorizationHandlerContext context, |
|||
PaymentOperationAuthorizationRequirement requirement, PaymentCreationResource resource) |
|||
{ |
|||
foreach (var order in resource.Orders) |
|||
{ |
|||
if (await IsBookingOrderValidAsync(context, order)) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
context.Fail(); |
|||
return; |
|||
} |
|||
} |
|||
|
|||
protected virtual async Task<bool> IsBookingOrderValidAsync(AuthorizationHandlerContext context, OrderDto order) |
|||
{ |
|||
var bookingOrderLines = order.OrderLines.Where(x => x.FindBookingAssetId() is not null).ToList(); |
|||
|
|||
if (!bookingOrderLines.Any()) |
|||
{ |
|||
return true; |
|||
} |
|||
|
|||
var models = new List<OccupyAssetInfoModel>(); |
|||
var byCategoryModels = new List<OccupyAssetByCategoryInfoModel>(); |
|||
|
|||
foreach (var orderLine in bookingOrderLines) |
|||
{ |
|||
if (!await IsPeriodInfoValidAsync(orderLine)) |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
var assetId = orderLine.FindBookingAssetId(); |
|||
var assetCategoryId = orderLine.FindBookingAssetCategoryId(); |
|||
|
|||
if (assetId is not null) |
|||
{ |
|||
models.Add(CreateOccupyAssetInfoModel(assetId.Value, orderLine)); |
|||
} |
|||
else if (assetCategoryId is not null) |
|||
{ |
|||
byCategoryModels.Add(CreateOccupyAssetByCategoryInfoModel(assetCategoryId.Value, orderLine)); |
|||
} |
|||
else |
|||
{ |
|||
return false; |
|||
} |
|||
} |
|||
|
|||
try |
|||
{ |
|||
await _assetOccupancyAppService.CheckBulkCreateAsync(new BulkCreateAssetOccupancyDto |
|||
{ |
|||
OccupierUserId = Check.NotNull(context.User.FindUserId(), "CurrentUserId"), |
|||
Models = models, |
|||
ByCategoryModels = byCategoryModels |
|||
}); |
|||
} |
|||
catch |
|||
{ |
|||
return false; |
|||
} |
|||
|
|||
return true; |
|||
} |
|||
|
|||
protected virtual OccupyAssetInfoModel CreateOccupyAssetInfoModel(Guid assetId, OrderLineDto orderLine) |
|||
{ |
|||
return new OccupyAssetInfoModel( |
|||
assetId, |
|||
orderLine.GetBookingVolume(), |
|||
orderLine.GetBookingDate(), |
|||
orderLine.GetBookingStartingTime(), |
|||
orderLine.GetBookingDuration() |
|||
); |
|||
} |
|||
|
|||
protected virtual OccupyAssetByCategoryInfoModel CreateOccupyAssetByCategoryInfoModel(Guid assetCategoryId, |
|||
OrderLineDto orderLine) |
|||
{ |
|||
return new OccupyAssetByCategoryInfoModel( |
|||
assetCategoryId, |
|||
orderLine.GetBookingVolume(), |
|||
orderLine.GetBookingDate(), |
|||
orderLine.GetBookingStartingTime(), |
|||
orderLine.GetBookingDuration() |
|||
); |
|||
} |
|||
|
|||
protected virtual async Task<bool> IsPeriodInfoValidAsync(OrderLineDto orderLine) |
|||
{ |
|||
var periodSchemeId = orderLine.GetBookingPeriodSchemeId(); |
|||
var periodId = orderLine.GetBookingPeriodId(); |
|||
|
|||
var periodScheme = await _periodSchemeAppService.GetAsync(periodSchemeId); |
|||
var period = periodScheme.Periods.Find(x => x.Id == periodId); |
|||
|
|||
return period is not null; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using EasyAbp.BookingService; |
|||
using EasyAbp.EShop.Payments.Booking.Authorization; |
|||
using EasyAbp.EShop.Plugins.Booking; |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.Modularity; |
|||
|
|||
namespace EasyAbp.EShop.Payments.Booking |
|||
{ |
|||
[DependsOn( |
|||
typeof(EShopPaymentsApplicationModule), |
|||
typeof(EShopPluginsBookingApplicationContractsModule), |
|||
typeof(BookingServiceApplicationContractsModule) |
|||
)] |
|||
public class EShopPaymentsBookingApplicationModule : AbpModule |
|||
{ |
|||
public override void PreConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddSingleton<IAuthorizationHandler, BookingPaymentCreationAuthorizationHandler>(); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"role": "lib.application-contracts" |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Ddd.Application.Contracts" Version="$(AbpVersion)" /> |
|||
<PackageReference Include="Volo.Abp.Authorization" Version="$(AbpVersion)" /> |
|||
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Orders\src\EasyAbp.EShop.Orders.Application.Contracts\EasyAbp.EShop.Orders.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Booking.Domain.Shared\EasyAbp.EShop.Plugins.Booking.Domain.Shared.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="EasyAbp.BookingService.Domain.Shared" Version="$(EasyAbpBookingServiceModuleVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using System; |
|||
using EasyAbp.BookingService.AssetOccupancyProviders; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace EasyAbp.BookingService.AssetOccupancies; |
|||
|
|||
public static class BulkAssetOccupancyResultEtoExtensions |
|||
{ |
|||
public static Guid? FindBookingOrderId(this BulkAssetOccupancyResultEto eto) |
|||
{ |
|||
return eto.GetProperty<Guid?>(BulkAssetOccupancyResultEtoProperties.BookingOrderId); |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace EasyAbp.BookingService.AssetOccupancies; |
|||
|
|||
public class BulkAssetOccupancyResultEtoProperties |
|||
{ |
|||
public const string BookingOrderId = "BookingOrderId"; |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using EasyAbp.BookingService.AssetOccupancyProviders; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace EasyAbp.BookingService.AssetOccupancies; |
|||
|
|||
public static class BulkOccupyAssetEtoExtensions |
|||
{ |
|||
public static Guid? FindBookingOrderId(this BulkOccupyAssetEto eto) |
|||
{ |
|||
return eto.GetProperty<Guid?>(BulkOccupyAssetEtoProperties.BookingOrderId); |
|||
} |
|||
|
|||
public static void SetBookingOrderId(this BulkOccupyAssetEto eto, Guid? value) |
|||
{ |
|||
eto.SetProperty(BulkOccupyAssetEtoProperties.BookingOrderId, value); |
|||
} |
|||
} |
|||
@ -0,0 +1,6 @@ |
|||
namespace EasyAbp.BookingService.AssetOccupancies; |
|||
|
|||
public class BulkOccupyAssetEtoProperties |
|||
{ |
|||
public const string BookingOrderId = "BookingOrderId"; |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
namespace EasyAbp.EShop.Orders; |
|||
|
|||
public class BookingOrderProperties |
|||
{ |
|||
public const string OrderLineBookingAssetId = "BookingAssetId"; |
|||
|
|||
public const string OrderLineBookingAssetCategoryId = "BookingAssetCategoryId"; |
|||
|
|||
public const string OrderLineBookingPeriodSchemeId = "BookingPeriodSchemeId"; |
|||
|
|||
public const string OrderLineBookingPeriodId = "BookingPeriodId"; |
|||
|
|||
public const string OrderLineBookingVolume = "BookingVolume"; |
|||
|
|||
public const string OrderLineBookingDate = "BookingDate"; |
|||
|
|||
public const string OrderLineBookingStartingTime = "BookingStartingTime"; |
|||
|
|||
public const string OrderLineBookingDuration = "BookingDuration"; |
|||
|
|||
public const string OrderLineBookingAssetOccupancyId = "BookingAssetOccupancyId"; |
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Orders.Orders.Dtos; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace EasyAbp.EShop.Orders; |
|||
|
|||
public static class CreateOrderLineDtoExtensions |
|||
{ |
|||
public static Guid? FindBookingAssetId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetId); |
|||
} |
|||
|
|||
public static Guid GetBookingAssetId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingAssetId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingAssetId)!.Value; |
|||
} |
|||
|
|||
public static Guid? FindBookingAssetCategoryId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetCategoryId); |
|||
} |
|||
|
|||
public static Guid GetBookingAssetCategoryId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingAssetCategoryId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingAssetCategoryId)!.Value; |
|||
} |
|||
|
|||
public static Guid? FindBookingPeriodSchemeId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingPeriodSchemeId); |
|||
} |
|||
|
|||
public static Guid GetBookingPeriodSchemeId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingPeriodSchemeId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingPeriodSchemeId)!.Value; |
|||
} |
|||
|
|||
public static Guid? FindBookingPeriodId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingPeriodId); |
|||
} |
|||
|
|||
public static Guid GetBookingPeriodId(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingPeriodId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingPeriodId)!.Value; |
|||
} |
|||
|
|||
public static int? FindBookingVolume(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.Quantity; |
|||
} |
|||
|
|||
public static int GetBookingVolume(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingVolume(orderLine), |
|||
BookingOrderProperties.OrderLineBookingVolume)!.Value; |
|||
} |
|||
|
|||
public static DateTime? FindBookingDate(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.FindDateTimeProperty(BookingOrderProperties.OrderLineBookingDate); |
|||
} |
|||
|
|||
public static DateTime GetBookingDate(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingDate(orderLine), |
|||
BookingOrderProperties.OrderLineBookingDate)!.Value; |
|||
} |
|||
|
|||
public static TimeSpan? FindBookingStartingTime(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.FindTimeSpanProperty(BookingOrderProperties.OrderLineBookingStartingTime); |
|||
} |
|||
|
|||
public static TimeSpan GetBookingStartingTime(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingStartingTime(orderLine), |
|||
BookingOrderProperties.OrderLineBookingStartingTime)!.Value; |
|||
} |
|||
|
|||
public static TimeSpan? FindBookingDuration(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return orderLine.FindTimeSpanProperty(BookingOrderProperties.OrderLineBookingDuration); |
|||
} |
|||
|
|||
public static TimeSpan GetBookingDuration(this CreateOrderLineDto orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingDuration(orderLine), |
|||
BookingOrderProperties.OrderLineBookingDuration)!.Value; |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace EasyAbp.EShop.Orders; |
|||
|
|||
public static class HasExtraPropertiesExtensions |
|||
{ |
|||
public static DateTime? FindDateTimeProperty(this IHasExtraProperties extraProperties, string name) |
|||
{ |
|||
var objValue = extraProperties.GetProperty(name); |
|||
|
|||
return objValue switch |
|||
{ |
|||
null => null, |
|||
DateTime span => span, |
|||
_ => DateTime.Parse((string)objValue) |
|||
}; |
|||
} |
|||
|
|||
public static TimeSpan? FindTimeSpanProperty(this IHasExtraProperties extraProperties, string name) |
|||
{ |
|||
var objValue = extraProperties.GetProperty(name); |
|||
|
|||
return objValue switch |
|||
{ |
|||
null => null, |
|||
TimeSpan span => span, |
|||
_ => TimeSpan.Parse((string)objValue) |
|||
}; |
|||
} |
|||
} |
|||
@ -0,0 +1,97 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Data; |
|||
|
|||
namespace EasyAbp.EShop.Orders; |
|||
|
|||
public static class OrderLineExtensions |
|||
{ |
|||
public static Guid? FindBookingAssetId(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetId); |
|||
} |
|||
|
|||
public static Guid GetBookingAssetId(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingAssetId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingAssetId)!.Value; |
|||
} |
|||
|
|||
public static Guid? FindBookingAssetCategoryId(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingAssetCategoryId); |
|||
} |
|||
|
|||
public static Guid GetBookingAssetCategoryId(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingAssetCategoryId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingAssetCategoryId)!.Value; |
|||
} |
|||
|
|||
public static Guid? FindBookingPeriodSchemeId(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingPeriodSchemeId); |
|||
} |
|||
|
|||
public static Guid GetBookingPeriodSchemeId(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingPeriodSchemeId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingPeriodSchemeId)!.Value; |
|||
} |
|||
|
|||
public static Guid? FindBookingPeriodId(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.GetProperty<Guid?>(BookingOrderProperties.OrderLineBookingPeriodId); |
|||
} |
|||
|
|||
public static Guid GetBookingPeriodId(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingPeriodId(orderLine), |
|||
BookingOrderProperties.OrderLineBookingPeriodId)!.Value; |
|||
} |
|||
|
|||
public static int? FindBookingVolume(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.Quantity; |
|||
} |
|||
|
|||
public static int GetBookingVolume(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingVolume(orderLine), |
|||
BookingOrderProperties.OrderLineBookingVolume)!.Value; |
|||
} |
|||
|
|||
public static DateTime? FindBookingDate(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.FindDateTimeProperty(BookingOrderProperties.OrderLineBookingDate); |
|||
} |
|||
|
|||
public static DateTime GetBookingDate(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingDate(orderLine), |
|||
BookingOrderProperties.OrderLineBookingDate)!.Value; |
|||
} |
|||
|
|||
public static TimeSpan? FindBookingStartingTime(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.FindTimeSpanProperty(BookingOrderProperties.OrderLineBookingStartingTime); |
|||
} |
|||
|
|||
public static TimeSpan GetBookingStartingTime(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingStartingTime(orderLine), |
|||
BookingOrderProperties.OrderLineBookingStartingTime)!.Value; |
|||
} |
|||
|
|||
public static TimeSpan? FindBookingDuration(this IOrderLine orderLine) |
|||
{ |
|||
return orderLine.FindTimeSpanProperty(BookingOrderProperties.OrderLineBookingDuration); |
|||
} |
|||
|
|||
public static TimeSpan GetBookingDuration(this IOrderLine orderLine) |
|||
{ |
|||
return Check.NotNull(FindBookingDuration(orderLine), |
|||
BookingOrderProperties.OrderLineBookingDuration)!.Value; |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using System; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions.Dtos; |
|||
|
|||
[Serializable] |
|||
public class BookingProductGroupDefinitionDto |
|||
{ |
|||
public string ProductGroupName { get; set; } |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions; |
|||
|
|||
public interface IBookingProductGroupDefinitionAppService : IApplicationService |
|||
{ |
|||
Task<ListResultDto<BookingProductGroupDefinitionDto>> GetListAsync(); |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
using EasyAbp.BookingService; |
|||
using EasyAbp.EShop.Orders; |
|||
using Volo.Abp.Application; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Authorization; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
[DependsOn( |
|||
typeof(BookingServiceDomainSharedModule), |
|||
typeof(EShopPluginsBookingDomainSharedModule), |
|||
typeof(EShopOrdersApplicationContractsModule), |
|||
typeof(AbpDddApplicationContractsModule), |
|||
typeof(AbpAuthorizationModule) |
|||
)] |
|||
public class EShopPluginsBookingApplicationContractsModule : AbpModule |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,8 @@ |
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public class EShopPluginsBookingRemoteServiceConsts |
|||
{ |
|||
public const string RemoteServiceName = "EasyAbpEShopPluginsBooking"; |
|||
|
|||
public const string ModuleName = "easyAbpEShopPluginsBooking"; |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateUpdateGrantedStoreDto |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid? AssetId { get; set; } |
|||
|
|||
public Guid? AssetCategoryId { get; set; } |
|||
|
|||
public bool AllowAll { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
|||
|
|||
[Serializable] |
|||
public class GetGrantedStoreListDto : PagedAndSortedResultRequestDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
public Guid? AssetId { get; set; } |
|||
|
|||
public Guid? AssetCategoryId { get; set; } |
|||
|
|||
public bool? AllowAll { get; set; } |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class GrantedStoreDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid? AssetId { get; set; } |
|||
|
|||
public Guid? AssetCategoryId { get; set; } |
|||
|
|||
public bool AllowAll { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
|||
{ |
|||
public interface IGrantedStoreAppService : |
|||
ICrudAppService< |
|||
GrantedStoreDto, |
|||
Guid, |
|||
GetGrantedStoreListDto, |
|||
CreateUpdateGrantedStoreDto, |
|||
CreateUpdateGrantedStoreDto> |
|||
{ |
|||
|
|||
} |
|||
} |
|||
@ -0,0 +1,35 @@ |
|||
using EasyAbp.EShop.Plugins.Booking.Localization; |
|||
using Volo.Abp.Authorization.Permissions; |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
|
|||
public class BookingPermissionDefinitionProvider : PermissionDefinitionProvider |
|||
{ |
|||
public override void Define(IPermissionDefinitionContext context) |
|||
{ |
|||
var myGroup = context.AddGroup(BookingPermissions.GroupName, L("Permission:Booking")); |
|||
|
|||
var productAssetPermission = myGroup.AddPermission(BookingPermissions.ProductAsset.Default, L("Permission:ProductAsset")); |
|||
productAssetPermission.AddChild(BookingPermissions.ProductAsset.Manage, L("Permission:Manage")); |
|||
productAssetPermission.AddChild(BookingPermissions.ProductAsset.Create, L("Permission:Create")); |
|||
productAssetPermission.AddChild(BookingPermissions.ProductAsset.Update, L("Permission:Update")); |
|||
productAssetPermission.AddChild(BookingPermissions.ProductAsset.Delete, L("Permission:Delete")); |
|||
|
|||
var productAssetCategoryPermission = myGroup.AddPermission(BookingPermissions.ProductAssetCategory.Default, L("Permission:ProductAssetCategory")); |
|||
productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Manage, L("Permission:Manage")); |
|||
productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Create, L("Permission:Create")); |
|||
productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Update, L("Permission:Update")); |
|||
productAssetCategoryPermission.AddChild(BookingPermissions.ProductAssetCategory.Delete, L("Permission:Delete")); |
|||
|
|||
var grantedStorePermission = myGroup.AddPermission(BookingPermissions.GrantedStore.Default, L("Permission:GrantedStore")); |
|||
grantedStorePermission.AddChild(BookingPermissions.GrantedStore.Create, L("Permission:Create")); |
|||
grantedStorePermission.AddChild(BookingPermissions.GrantedStore.Update, L("Permission:Update")); |
|||
grantedStorePermission.AddChild(BookingPermissions.GrantedStore.Delete, L("Permission:Delete")); |
|||
} |
|||
|
|||
private static LocalizableString L(string name) |
|||
{ |
|||
return LocalizableString.Create<BookingResource>(name); |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using Volo.Abp.Reflection; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
|
|||
public class BookingPermissions |
|||
{ |
|||
public const string GroupName = "EasyAbp.EShop.Plugins.Booking"; |
|||
|
|||
public static string[] GetAll() |
|||
{ |
|||
return ReflectionHelper.GetPublicConstantsRecursively(typeof(BookingPermissions)); |
|||
} |
|||
|
|||
public class ProductAsset |
|||
{ |
|||
public const string Default = GroupName + ".ProductAsset"; |
|||
public const string Manage = Default + ".Manage"; |
|||
public const string Update = Default + ".Update"; |
|||
public const string Create = Default + ".Create"; |
|||
public const string Delete = Default + ".Delete"; |
|||
} |
|||
|
|||
public class ProductAssetCategory |
|||
{ |
|||
public const string Default = GroupName + ".ProductAssetCategory"; |
|||
public const string Manage = Default + ".Manage"; |
|||
public const string Update = Default + ".Update"; |
|||
public const string Create = Default + ".Create"; |
|||
public const string Delete = Default + ".Delete"; |
|||
} |
|||
|
|||
public class GrantedStore |
|||
{ |
|||
public const string Default = GroupName + ".GrantedStore"; |
|||
public const string Update = Default + ".Update"; |
|||
public const string Create = Default + ".Create"; |
|||
public const string Delete = Default + ".Delete"; |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetCategoryDto : IMultiStore, IValidatableObject |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetCategoryId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
|
|||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) |
|||
{ |
|||
if (Price is not null && Currency.IsNullOrWhiteSpace()) |
|||
{ |
|||
yield return new ValidationResult( |
|||
"Currency should not be empty when the Price has a value!", |
|||
new[] { nameof(Currency) } |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetCategoryPeriodDto |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[Required] |
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
|
|||
[Serializable] |
|||
public class GetProductAssetCategoryListDto : PagedAndSortedResultRequestDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
public Guid? ProductId { get; set; } |
|||
|
|||
public Guid? ProductSkuId { get; set; } |
|||
|
|||
public Guid? AssetCategoryId { get; set; } |
|||
|
|||
public Guid? PeriodSchemeId { get; set; } |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetCategoryDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetCategoryId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal? Price { get; set; } |
|||
|
|||
public List<ProductAssetCategoryPeriodDto> Periods { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetCategoryPeriodDto : EntityDto<Guid> |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,20 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetCategoryDto |
|||
{ |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Required] |
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,16 @@ |
|||
using System; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetCategoryPeriodDto |
|||
{ |
|||
[Required] |
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,22 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public interface IProductAssetCategoryAppService : |
|||
ICrudAppService< |
|||
ProductAssetCategoryDto, |
|||
Guid, |
|||
GetProductAssetCategoryListDto, |
|||
CreateProductAssetCategoryDto, |
|||
UpdateProductAssetCategoryDto> |
|||
{ |
|||
Task<ProductAssetCategoryDto> CreatePeriodAsync(Guid productAssetCategoryId, CreateProductAssetCategoryPeriodDto input); |
|||
|
|||
Task<ProductAssetCategoryDto> UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, UpdateProductAssetCategoryPeriodDto input); |
|||
|
|||
Task<ProductAssetCategoryDto> DeletePeriodAsync(Guid productAssetCategoryId, Guid periodId); |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetDto : IMultiStore, IValidatableObject |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
|
|||
public IEnumerable<ValidationResult> Validate(ValidationContext validationContext) |
|||
{ |
|||
if (Price is not null && Currency.IsNullOrWhiteSpace()) |
|||
{ |
|||
yield return new ValidationResult( |
|||
"Currency should not be empty when the Price has a value!", |
|||
new[] { nameof(Currency) } |
|||
); |
|||
} |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class CreateProductAssetPeriodDto |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
[Required] |
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,18 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
|
|||
[Serializable] |
|||
public class GetProductAssetListDto : PagedAndSortedResultRequestDto |
|||
{ |
|||
public Guid? StoreId { get; set; } |
|||
|
|||
public Guid? ProductId { get; set; } |
|||
|
|||
public Guid? ProductSkuId { get; set; } |
|||
|
|||
public Guid? AssetId { get; set; } |
|||
|
|||
public Guid? PeriodSchemeId { get; set; } |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetDto : AuditedEntityDto<Guid> |
|||
{ |
|||
public Guid StoreId { get; set; } |
|||
|
|||
public Guid ProductId { get; set; } |
|||
|
|||
public Guid ProductSkuId { get; set; } |
|||
|
|||
public Guid AssetId { get; set; } |
|||
|
|||
public Guid PeriodSchemeId { get; set; } |
|||
|
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal? Price { get; set; } |
|||
|
|||
public List<ProductAssetPeriodDto> Periods { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class ProductAssetPeriodDto : EntityDto<Guid> |
|||
{ |
|||
public Guid PeriodId { get; set; } |
|||
|
|||
public string Currency { get; set; } |
|||
|
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetDto |
|||
{ |
|||
public DateTime FromTime { get; set; } |
|||
|
|||
public DateTime? ToTime { get; set; } |
|||
|
|||
[Required] |
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal? Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,15 @@ |
|||
using System; |
|||
using System.ComponentModel.DataAnnotations; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos |
|||
{ |
|||
[Serializable] |
|||
public class UpdateProductAssetPeriodDto |
|||
{ |
|||
[Required] |
|||
public string Currency { get; set; } |
|||
|
|||
[Range(BookingConsts.MinimumPrice, BookingConsts.MaximumPrice)] |
|||
public decimal Price { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using Volo.Abp.Application.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public interface IProductAssetAppService : |
|||
ICrudAppService< |
|||
ProductAssetDto, |
|||
Guid, |
|||
GetProductAssetListDto, |
|||
CreateProductAssetDto, |
|||
UpdateProductAssetDto> |
|||
{ |
|||
Task<ProductAssetDto> CreatePeriodAsync(Guid productAssetId, CreateProductAssetPeriodDto input); |
|||
|
|||
Task<ProductAssetDto> UpdatePeriodAsync(Guid productAssetId, Guid periodId, UpdateProductAssetPeriodDto input); |
|||
|
|||
Task<ProductAssetDto> DeletePeriodAsync(Guid productAssetId, Guid periodId); |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"role": "lib.application" |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>net6.0</TargetFramework> |
|||
<RootNamespace /> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.AutoMapper" Version="$(AbpVersion)" /> |
|||
<PackageReference Include="Volo.Abp.Ddd.Application" Version="$(AbpVersion)" /> |
|||
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Products\src\EasyAbp.EShop.Products.Application.Contracts\EasyAbp.EShop.Products.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\..\..\..\modules\EasyAbp.EShop.Stores\src\EasyAbp.EShop.Stores.Application.Shared\EasyAbp.EShop.Stores.Application.Shared.csproj" /> |
|||
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Booking.Application.Contracts\EasyAbp.EShop.Plugins.Booking.Application.Contracts.csproj" /> |
|||
<ProjectReference Include="..\EasyAbp.EShop.Plugins.Booking.Domain\EasyAbp.EShop.Plugins.Booking.Domain.csproj" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="EasyAbp.BookingService.Application.Contracts" Version="$(EasyAbpBookingServiceModuleVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,13 @@ |
|||
using EasyAbp.EShop.Plugins.Booking.Localization; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public abstract class BookingAppService : ApplicationService |
|||
{ |
|||
protected BookingAppService() |
|||
{ |
|||
LocalizationResource = typeof(BookingResource); |
|||
ObjectMapperContext = typeof(EShopPluginsBookingApplicationModule); |
|||
} |
|||
} |
|||
@ -0,0 +1,33 @@ |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.GrantedStores; |
|||
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
|||
using AutoMapper; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public class BookingApplicationAutoMapperProfile : Profile |
|||
{ |
|||
public BookingApplicationAutoMapperProfile() |
|||
{ |
|||
/* You can configure your AutoMapper mapping configuration here. |
|||
* Alternatively, you can split your mapping configurations |
|||
* into multiple profile classes for a better organization. */ |
|||
CreateMap<ProductAsset, ProductAssetDto>(); |
|||
|
|||
CreateMap<ProductAssetPeriod, ProductAssetPeriodDto>(); |
|||
CreateMap<CreateProductAssetPeriodDto, ProductAssetPeriod>(MemberList.Source); |
|||
CreateMap<UpdateProductAssetPeriodDto, ProductAssetPeriod>(MemberList.Source); |
|||
|
|||
CreateMap<ProductAssetCategory, ProductAssetCategoryDto>(); |
|||
|
|||
CreateMap<ProductAssetCategoryPeriod, ProductAssetCategoryPeriodDto>(); |
|||
CreateMap<CreateProductAssetCategoryPeriodDto, ProductAssetCategoryPeriod>(MemberList.Source); |
|||
CreateMap<UpdateProductAssetCategoryPeriodDto, ProductAssetCategoryPeriod>(MemberList.Source); |
|||
|
|||
CreateMap<GrantedStore, GrantedStoreDto>(); |
|||
CreateMap<CreateUpdateGrantedStoreDto, GrantedStore>(MemberList.Source); |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions.Dtos; |
|||
using EasyAbp.EShop.Plugins.Booking.Options; |
|||
using Microsoft.Extensions.Options; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.BookingProductGroupDefinitions; |
|||
|
|||
public class BookingProductGroupDefinitionAppService : BookingAppService, IBookingProductGroupDefinitionAppService |
|||
{ |
|||
private readonly EShopBookingOptions _options; |
|||
|
|||
public BookingProductGroupDefinitionAppService(IOptions<EShopBookingOptions> options) |
|||
{ |
|||
_options = options.Value; |
|||
} |
|||
|
|||
public virtual Task<ListResultDto<BookingProductGroupDefinitionDto>> GetListAsync() |
|||
{ |
|||
return Task.FromResult( |
|||
new ListResultDto<BookingProductGroupDefinitionDto>( |
|||
_options.BookingProductGroups.Select(x => |
|||
new BookingProductGroupDefinitionDto |
|||
{ |
|||
ProductGroupName = x.ProductGroupName |
|||
}).ToList() |
|||
) |
|||
); |
|||
} |
|||
} |
|||
@ -0,0 +1,30 @@ |
|||
using EasyAbp.BookingService; |
|||
using EasyAbp.EShop.Products; |
|||
using EasyAbp.EShop.Stores; |
|||
using Microsoft.Extensions.DependencyInjection; |
|||
using Volo.Abp.AutoMapper; |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Application; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
[DependsOn( |
|||
typeof(EShopStoresApplicationSharedModule), |
|||
typeof(EShopProductsApplicationContractsModule), |
|||
typeof(EShopPluginsBookingDomainModule), |
|||
typeof(EShopPluginsBookingApplicationContractsModule), |
|||
typeof(BookingServiceApplicationContractsModule), |
|||
typeof(AbpDddApplicationModule), |
|||
typeof(AbpAutoMapperModule) |
|||
)] |
|||
public class EShopPluginsBookingApplicationModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
context.Services.AddAutoMapperObjectMapper<EShopPluginsBookingApplicationModule>(); |
|||
Configure<AbpAutoMapperOptions>(options => |
|||
{ |
|||
options.AddMaps<EShopPluginsBookingApplicationModule>(validate: true); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,69 @@ |
|||
using System.Collections.Generic; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.AssetOccupancies; |
|||
using EasyAbp.BookingService.AssetOccupancyProviders; |
|||
using EasyAbp.EShop.Orders; |
|||
using EasyAbp.EShop.Orders.Orders; |
|||
using Volo.Abp.DependencyInjection; |
|||
using Volo.Abp.EventBus.Distributed; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.EventHandlers; |
|||
|
|||
public class BookingOrderPaidEventHandler : IDistributedEventHandler<OrderPaidEto>, ITransientDependency |
|||
{ |
|||
private readonly IDistributedEventBus _distributedEventBus; |
|||
|
|||
public BookingOrderPaidEventHandler(IDistributedEventBus distributedEventBus) |
|||
{ |
|||
_distributedEventBus = distributedEventBus; |
|||
} |
|||
|
|||
public virtual async Task HandleEventAsync(OrderPaidEto eventData) |
|||
{ |
|||
var occupyModels = new List<OccupyAssetInfoModel>(); |
|||
var occupyByCategoryModels = new List<OccupyAssetByCategoryInfoModel>(); |
|||
|
|||
foreach (var orderLine in eventData.Order.OrderLines) |
|||
{ |
|||
var assetId = orderLine.FindBookingAssetId(); |
|||
var assetCategoryId = orderLine.FindBookingAssetCategoryId(); |
|||
var volume = orderLine.FindBookingVolume(); |
|||
var date = orderLine.FindBookingDate(); |
|||
var startingTime = orderLine.FindBookingStartingTime(); |
|||
var duration = orderLine.FindBookingDuration(); |
|||
|
|||
if (volume is null || date is null || startingTime is null || duration is null) |
|||
{ |
|||
continue; |
|||
} |
|||
|
|||
if (assetId.HasValue) |
|||
{ |
|||
occupyModels.Add(new OccupyAssetInfoModel( |
|||
assetId: assetId.Value, |
|||
volume: volume.Value, |
|||
date: date.Value, |
|||
startingTime: startingTime.Value, |
|||
duration: duration.Value |
|||
)); |
|||
} |
|||
else if (assetCategoryId.HasValue) |
|||
{ |
|||
occupyByCategoryModels.Add(new OccupyAssetByCategoryInfoModel( |
|||
assetCategoryId: assetCategoryId.Value, |
|||
volume: volume.Value, |
|||
date: date.Value, |
|||
startingTime: startingTime.Value, |
|||
duration: duration.Value |
|||
)); |
|||
} |
|||
} |
|||
|
|||
var eto = new BulkOccupyAssetEto(eventData.TenantId, eventData.Order.Id, eventData.Order.CustomerUserId, |
|||
occupyModels, occupyByCategoryModels); |
|||
|
|||
eto.SetBookingOrderId(eventData.Order.Id); |
|||
|
|||
await _distributedEventBus.PublishAsync(eto); |
|||
} |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
using EasyAbp.EShop.Plugins.Booking.GrantedStores.Dtos; |
|||
using Volo.Abp.Application.Services; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.GrantedStores |
|||
{ |
|||
public class GrantedStoreAppService : CrudAppService<GrantedStore, GrantedStoreDto, Guid, |
|||
GetGrantedStoreListDto, CreateUpdateGrantedStoreDto, CreateUpdateGrantedStoreDto>, |
|||
IGrantedStoreAppService |
|||
{ |
|||
protected override string GetPolicyName { get; set; } = null; |
|||
protected override string GetListPolicyName { get; set; } = null; |
|||
protected override string CreatePolicyName { get; set; } = BookingPermissions.GrantedStore.Create; |
|||
protected override string UpdatePolicyName { get; set; } = BookingPermissions.GrantedStore.Update; |
|||
protected override string DeletePolicyName { get; set; } = BookingPermissions.GrantedStore.Delete; |
|||
|
|||
private readonly IGrantedStoreRepository _repository; |
|||
|
|||
public GrantedStoreAppService(IGrantedStoreRepository repository) : base(repository) |
|||
{ |
|||
_repository = repository; |
|||
} |
|||
|
|||
protected override async Task<IQueryable<GrantedStore>> CreateFilteredQueryAsync(GetGrantedStoreListDto input) |
|||
{ |
|||
return (await base.CreateFilteredQueryAsync(input)) |
|||
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) |
|||
.WhereIf(input.AssetId.HasValue, x => x.AssetId == input.AssetId) |
|||
.WhereIf(input.AssetCategoryId.HasValue, x => x.AssetCategoryId == input.AssetCategoryId) |
|||
.WhereIf(input.AllowAll.HasValue, x => x.AllowAll == input.AllowAll); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,175 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.AssetCategories; |
|||
using EasyAbp.BookingService.PeriodSchemes; |
|||
using EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssetCategories.Dtos; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssetCategories |
|||
{ |
|||
public class ProductAssetCategoryAppService : MultiStoreCrudAppService<ProductAssetCategory, ProductAssetCategoryDto |
|||
, Guid, GetProductAssetCategoryListDto, CreateProductAssetCategoryDto, UpdateProductAssetCategoryDto>, |
|||
IProductAssetCategoryAppService |
|||
{ |
|||
protected override string CrossStorePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Manage; |
|||
protected override string GetPolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Default; |
|||
protected override string GetListPolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Default; |
|||
protected override string CreatePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Create; |
|||
protected override string UpdatePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Update; |
|||
protected override string DeletePolicyName { get; set; } = BookingPermissions.ProductAssetCategory.Delete; |
|||
|
|||
private readonly IProductAppService _productAppService; |
|||
private readonly IPeriodSchemeAppService _periodSchemeAppService; |
|||
private readonly IAssetCategoryAppService _assetCategoryAppService; |
|||
private readonly IProductAssetCategoryRepository _repository; |
|||
private readonly ProductAssetCategoryManager _productAssetCategoryManager; |
|||
|
|||
public ProductAssetCategoryAppService( |
|||
IProductAppService productAppService, |
|||
IPeriodSchemeAppService periodSchemeAppService, |
|||
IAssetCategoryAppService assetCategoryAppService, |
|||
IProductAssetCategoryRepository repository, |
|||
ProductAssetCategoryManager productAssetCategoryManager) : base(repository) |
|||
{ |
|||
_productAppService = productAppService; |
|||
_periodSchemeAppService = periodSchemeAppService; |
|||
_assetCategoryAppService = assetCategoryAppService; |
|||
_repository = repository; |
|||
_productAssetCategoryManager = productAssetCategoryManager; |
|||
} |
|||
|
|||
protected override async Task<IQueryable<ProductAssetCategory>> CreateFilteredQueryAsync( |
|||
GetProductAssetCategoryListDto input) |
|||
{ |
|||
return (await base.CreateFilteredQueryAsync(input)) |
|||
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) |
|||
.WhereIf(input.ProductId.HasValue, x => x.ProductId == input.ProductId) |
|||
.WhereIf(input.ProductSkuId.HasValue, x => x.ProductSkuId == input.ProductSkuId) |
|||
.WhereIf(input.AssetCategoryId.HasValue, x => x.AssetCategoryId == input.AssetCategoryId) |
|||
.WhereIf(input.PeriodSchemeId.HasValue, x => x.PeriodSchemeId == input.PeriodSchemeId); |
|||
} |
|||
|
|||
public override async Task<PagedResultDto<ProductAssetCategoryDto>> GetListAsync( |
|||
GetProductAssetCategoryListDto input) |
|||
{ |
|||
await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName); |
|||
|
|||
var query = await CreateFilteredQueryAsync(input); |
|||
|
|||
var totalCount = await AsyncExecuter.CountAsync(query); |
|||
|
|||
query = ApplySorting(query, input); |
|||
query = ApplyPaging(query, input); |
|||
|
|||
var entities = await AsyncExecuter.ToListAsync(query); |
|||
var entityDtos = await MapToGetListOutputDtosAsync(entities); |
|||
|
|||
return new PagedResultDto<ProductAssetCategoryDto>( |
|||
totalCount, |
|||
entityDtos |
|||
); |
|||
} |
|||
|
|||
public override async Task<ProductAssetCategoryDto> CreateAsync(CreateProductAssetCategoryDto input) |
|||
{ |
|||
await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); |
|||
|
|||
await EnsureProductSkuExistAsync(input.StoreId, input.ProductId, input.ProductSkuId); |
|||
await EnsureAssetCategoryExistAsync(input.AssetCategoryId); |
|||
await EnsurePeriodSchemeExistAsync(input.PeriodSchemeId); |
|||
|
|||
var entity = await MapToEntityAsync(input); |
|||
|
|||
TryToSetTenantId(entity); |
|||
|
|||
await Repository.InsertAsync(entity, autoSave: true); |
|||
|
|||
return await MapToGetOutputDtoAsync(entity); |
|||
} |
|||
|
|||
protected virtual async Task EnsureProductSkuExistAsync(Guid storeId, Guid productId, Guid productSkuId) |
|||
{ |
|||
var product = await _productAppService.GetAsync(productId); |
|||
|
|||
if (product.StoreId != storeId) |
|||
{ |
|||
throw (new BusinessException(BookingErrorCodes.WrongStoreIdForProduct)) |
|||
.WithData(nameof(storeId), storeId) |
|||
.WithData(nameof(productId), productId); |
|||
} |
|||
|
|||
product.GetSkuById(productSkuId); |
|||
} |
|||
|
|||
protected virtual async Task EnsureAssetCategoryExistAsync(Guid assetCategoryId) |
|||
{ |
|||
await _assetCategoryAppService.GetAsync(assetCategoryId); |
|||
} |
|||
|
|||
protected virtual async Task EnsurePeriodSchemeExistAsync(Guid periodSchemeId) |
|||
{ |
|||
await _periodSchemeAppService.GetAsync(periodSchemeId); |
|||
} |
|||
|
|||
protected override async Task<ProductAssetCategory> MapToEntityAsync(CreateProductAssetCategoryDto input) |
|||
{ |
|||
return await _productAssetCategoryManager.CreateAsync(input.StoreId, input.ProductId, input.ProductSkuId, |
|||
input.AssetCategoryId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Currency, input.Price); |
|||
} |
|||
|
|||
protected override async Task MapToEntityAsync(UpdateProductAssetCategoryDto input, ProductAssetCategory entity) |
|||
{ |
|||
await _productAssetCategoryManager.UpdateAsync( |
|||
entity, input.FromTime, input.ToTime, input.Currency, input.Price); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetCategoryDto> CreatePeriodAsync(Guid productAssetCategoryId, |
|||
CreateProductAssetCategoryPeriodDto input) |
|||
{ |
|||
var productAssetCategory = await GetEntityByIdAsync(productAssetCategoryId); |
|||
|
|||
await CheckMultiStorePolicyAsync(productAssetCategory.StoreId, UpdatePolicyName); |
|||
|
|||
productAssetCategory.AddPeriod( |
|||
ObjectMapper.Map<CreateProductAssetCategoryPeriodDto, ProductAssetCategoryPeriod>(input)); |
|||
|
|||
await _repository.UpdateAsync(productAssetCategory, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAssetCategory); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetCategoryDto> UpdatePeriodAsync(Guid productAssetCategoryId, Guid periodId, |
|||
UpdateProductAssetCategoryPeriodDto input) |
|||
{ |
|||
var productAssetCategory = await GetEntityByIdAsync(productAssetCategoryId); |
|||
|
|||
await CheckMultiStorePolicyAsync(productAssetCategory.StoreId, UpdatePolicyName); |
|||
|
|||
var productAssetCategoryPeriod = productAssetCategory.GetPeriod(periodId); |
|||
|
|||
ObjectMapper.Map(input, productAssetCategoryPeriod); |
|||
|
|||
await _repository.UpdateAsync(productAssetCategory, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAssetCategory); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetCategoryDto> DeletePeriodAsync(Guid productAssetCategoryId, Guid periodId) |
|||
{ |
|||
var productAssetCategory = await GetEntityByIdAsync(productAssetCategoryId); |
|||
|
|||
await CheckMultiStorePolicyAsync(productAssetCategory.StoreId, UpdatePolicyName); |
|||
|
|||
productAssetCategory.RemovePeriod(periodId); |
|||
|
|||
await _repository.UpdateAsync(productAssetCategory, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAssetCategory); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,173 @@ |
|||
using System; |
|||
using System.Linq; |
|||
using System.Threading.Tasks; |
|||
using EasyAbp.BookingService.Assets; |
|||
using EasyAbp.BookingService.PeriodSchemes; |
|||
using EasyAbp.EShop.Plugins.Booking.Permissions; |
|||
using EasyAbp.EShop.Plugins.Booking.ProductAssets.Dtos; |
|||
using EasyAbp.EShop.Products.Products; |
|||
using EasyAbp.EShop.Stores.Stores; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Dtos; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.ProductAssets |
|||
{ |
|||
public class ProductAssetAppService : MultiStoreCrudAppService<ProductAsset, ProductAssetDto |
|||
, Guid, GetProductAssetListDto, CreateProductAssetDto, UpdateProductAssetDto>, |
|||
IProductAssetAppService |
|||
{ |
|||
protected override string CrossStorePolicyName { get; set; } = BookingPermissions.ProductAsset.Manage; |
|||
protected override string GetPolicyName { get; set; } = BookingPermissions.ProductAsset.Default; |
|||
protected override string GetListPolicyName { get; set; } = BookingPermissions.ProductAsset.Default; |
|||
protected override string CreatePolicyName { get; set; } = BookingPermissions.ProductAsset.Create; |
|||
protected override string UpdatePolicyName { get; set; } = BookingPermissions.ProductAsset.Update; |
|||
protected override string DeletePolicyName { get; set; } = BookingPermissions.ProductAsset.Delete; |
|||
|
|||
private readonly IProductAppService _productAppService; |
|||
private readonly IPeriodSchemeAppService _periodSchemeAppService; |
|||
private readonly IAssetAppService _assetAppService; |
|||
private readonly IProductAssetRepository _repository; |
|||
private readonly ProductAssetManager _productAssetManager; |
|||
|
|||
public ProductAssetAppService( |
|||
IProductAppService productAppService, |
|||
IPeriodSchemeAppService periodSchemeAppService, |
|||
IAssetAppService assetAppService, |
|||
IProductAssetRepository repository, |
|||
ProductAssetManager productAssetManager) : base(repository) |
|||
{ |
|||
_productAppService = productAppService; |
|||
_periodSchemeAppService = periodSchemeAppService; |
|||
_assetAppService = assetAppService; |
|||
_repository = repository; |
|||
_productAssetManager = productAssetManager; |
|||
} |
|||
|
|||
protected override async Task<IQueryable<ProductAsset>> CreateFilteredQueryAsync(GetProductAssetListDto input) |
|||
{ |
|||
return (await base.CreateFilteredQueryAsync(input)) |
|||
.WhereIf(input.StoreId.HasValue, x => x.StoreId == input.StoreId) |
|||
.WhereIf(input.ProductId.HasValue, x => x.ProductId == input.ProductId) |
|||
.WhereIf(input.ProductSkuId.HasValue, x => x.ProductSkuId == input.ProductSkuId) |
|||
.WhereIf(input.AssetId.HasValue, x => x.AssetId == input.AssetId) |
|||
.WhereIf(input.PeriodSchemeId.HasValue, x => x.PeriodSchemeId == input.PeriodSchemeId); |
|||
} |
|||
|
|||
public override async Task<PagedResultDto<ProductAssetDto>> GetListAsync( |
|||
GetProductAssetListDto input) |
|||
{ |
|||
await CheckMultiStorePolicyAsync(input.StoreId, GetListPolicyName); |
|||
|
|||
var query = await CreateFilteredQueryAsync(input); |
|||
|
|||
var totalCount = await AsyncExecuter.CountAsync(query); |
|||
|
|||
query = ApplySorting(query, input); |
|||
query = ApplyPaging(query, input); |
|||
|
|||
var entities = await AsyncExecuter.ToListAsync(query); |
|||
var entityDtos = await MapToGetListOutputDtosAsync(entities); |
|||
|
|||
return new PagedResultDto<ProductAssetDto>( |
|||
totalCount, |
|||
entityDtos |
|||
); |
|||
} |
|||
|
|||
public override async Task<ProductAssetDto> CreateAsync(CreateProductAssetDto input) |
|||
{ |
|||
await CheckMultiStorePolicyAsync(input.StoreId, CreatePolicyName); |
|||
|
|||
await EnsureProductSkuExistAsync(input.StoreId, input.ProductId, input.ProductSkuId); |
|||
await EnsureAssetExistAsync(input.AssetId); |
|||
await EnsurePeriodSchemeExistAsync(input.PeriodSchemeId); |
|||
|
|||
var entity = await MapToEntityAsync(input); |
|||
|
|||
TryToSetTenantId(entity); |
|||
|
|||
await Repository.InsertAsync(entity, autoSave: true); |
|||
|
|||
return await MapToGetOutputDtoAsync(entity); |
|||
} |
|||
|
|||
protected virtual async Task EnsureProductSkuExistAsync(Guid storeId, Guid productId, Guid productSkuId) |
|||
{ |
|||
var product = await _productAppService.GetAsync(productId); |
|||
|
|||
if (product.StoreId != storeId) |
|||
{ |
|||
throw (new BusinessException(BookingErrorCodes.WrongStoreIdForProduct)) |
|||
.WithData(nameof(storeId), storeId) |
|||
.WithData(nameof(productId), productId); |
|||
} |
|||
|
|||
product.GetSkuById(productSkuId); |
|||
} |
|||
|
|||
protected virtual async Task EnsureAssetExistAsync(Guid assetId) |
|||
{ |
|||
await _assetAppService.GetAsync(assetId); |
|||
} |
|||
|
|||
protected virtual async Task EnsurePeriodSchemeExistAsync(Guid periodSchemeId) |
|||
{ |
|||
await _periodSchemeAppService.GetAsync(periodSchemeId); |
|||
} |
|||
|
|||
protected override async Task<ProductAsset> MapToEntityAsync(CreateProductAssetDto input) |
|||
{ |
|||
return await _productAssetManager.CreateAsync(input.StoreId, input.ProductId, input.ProductSkuId, |
|||
input.AssetId, input.PeriodSchemeId, input.FromTime, input.ToTime, input.Currency, input.Price); |
|||
} |
|||
|
|||
protected override async Task MapToEntityAsync(UpdateProductAssetDto input, ProductAsset entity) |
|||
{ |
|||
await _productAssetManager.UpdateAsync(entity, input.FromTime, input.ToTime, input.Currency, input.Price); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetDto> CreatePeriodAsync(Guid productAssetId, |
|||
CreateProductAssetPeriodDto input) |
|||
{ |
|||
var productAsset = await GetEntityByIdAsync(productAssetId); |
|||
|
|||
await CheckMultiStorePolicyAsync(productAsset.StoreId, UpdatePolicyName); |
|||
|
|||
productAsset.AddPeriod( |
|||
ObjectMapper.Map<CreateProductAssetPeriodDto, ProductAssetPeriod>(input)); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetDto> UpdatePeriodAsync(Guid productAssetId, Guid periodId, |
|||
UpdateProductAssetPeriodDto input) |
|||
{ |
|||
var productAsset = await GetEntityByIdAsync(productAssetId); |
|||
|
|||
await CheckMultiStorePolicyAsync(productAsset.StoreId, UpdatePolicyName); |
|||
|
|||
var productAssetPeriod = productAsset.GetPeriod(periodId); |
|||
|
|||
ObjectMapper.Map(input, productAssetPeriod); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
|
|||
public virtual async Task<ProductAssetDto> DeletePeriodAsync(Guid productAssetId, Guid periodId) |
|||
{ |
|||
var productAsset = await GetEntityByIdAsync(productAssetId); |
|||
|
|||
await CheckMultiStorePolicyAsync(productAsset.StoreId, UpdatePolicyName); |
|||
|
|||
productAsset.RemovePeriod(periodId); |
|||
|
|||
await _repository.UpdateAsync(productAsset, true); |
|||
|
|||
return await MapToGetOutputDtoAsync(productAsset); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
@ -0,0 +1,30 @@ |
|||
<?xml version="1.0" encoding="utf-8"?> |
|||
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> |
|||
<!-- This file was generated by Fody. Manual changes to this file will be lost when your project is rebuilt. --> |
|||
<xs:element name="Weavers"> |
|||
<xs:complexType> |
|||
<xs:all> |
|||
<xs:element name="ConfigureAwait" minOccurs="0" maxOccurs="1"> |
|||
<xs:complexType> |
|||
<xs:attribute name="ContinueOnCapturedContext" type="xs:boolean" /> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:all> |
|||
<xs:attribute name="VerifyAssembly" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'true' to run assembly verification (PEVerify) on the target assembly after all weavers have been executed.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="VerifyIgnoreCodes" type="xs:string"> |
|||
<xs:annotation> |
|||
<xs:documentation>A comma-separated list of error codes that can be safely ignored in assembly verification.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
<xs:attribute name="GenerateXsd" type="xs:boolean"> |
|||
<xs:annotation> |
|||
<xs:documentation>'false' to turn off automatic generation of the XML Schema file.</xs:documentation> |
|||
</xs:annotation> |
|||
</xs:attribute> |
|||
</xs:complexType> |
|||
</xs:element> |
|||
</xs:schema> |
|||
@ -0,0 +1,3 @@ |
|||
{ |
|||
"role": "lib.domain-shared" |
|||
} |
|||
@ -0,0 +1,24 @@ |
|||
<Project Sdk="Microsoft.NET.Sdk"> |
|||
|
|||
<Import Project="..\..\..\..\common.props" /> |
|||
|
|||
<PropertyGroup> |
|||
<TargetFramework>netstandard2.0</TargetFramework> |
|||
<RootNamespace /> |
|||
<GenerateEmbeddedFilesManifest>true</GenerateEmbeddedFilesManifest> |
|||
</PropertyGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Volo.Abp.Validation" Version="$(AbpVersion)" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<PackageReference Include="Microsoft.Extensions.FileProviders.Embedded" Version="6.0.*" /> |
|||
</ItemGroup> |
|||
|
|||
<ItemGroup> |
|||
<EmbeddedResource Include="EasyAbp\EShop\Plugins\Booking\Localization\*.json" /> |
|||
<Content Remove="EasyAbp\EShop\Plugins\Booking\Localization\*.json" /> |
|||
</ItemGroup> |
|||
|
|||
</Project> |
|||
@ -0,0 +1,7 @@ |
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public class BookingConsts |
|||
{ |
|||
public const double MinimumPrice = 0f; |
|||
public const double MaximumPrice = 999999999999.99999999f; |
|||
} |
|||
@ -0,0 +1,10 @@ |
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
public static class BookingErrorCodes |
|||
{ |
|||
public const string PeriodNotFound = "EasyAbp.EShop.Plugins.Booking:PeriodNotFound"; |
|||
public const string DuplicatePeriod = "EasyAbp.EShop.Plugins.Booking:DuplicatePeriod"; |
|||
public const string ConflictingProductAsset = "EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset"; |
|||
public const string ConflictingProductAssetCategory = "EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory"; |
|||
public const string WrongStoreIdForProduct = "EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct"; |
|||
} |
|||
@ -0,0 +1,36 @@ |
|||
using Volo.Abp.Modularity; |
|||
using Volo.Abp.Localization; |
|||
using EasyAbp.EShop.Plugins.Booking.Localization; |
|||
using Volo.Abp.Localization.ExceptionHandling; |
|||
using Volo.Abp.Validation; |
|||
using Volo.Abp.Validation.Localization; |
|||
using Volo.Abp.VirtualFileSystem; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking; |
|||
|
|||
[DependsOn( |
|||
typeof(AbpValidationModule) |
|||
)] |
|||
public class EShopPluginsBookingDomainSharedModule : AbpModule |
|||
{ |
|||
public override void ConfigureServices(ServiceConfigurationContext context) |
|||
{ |
|||
Configure<AbpVirtualFileSystemOptions>(options => |
|||
{ |
|||
options.FileSets.AddEmbedded<EShopPluginsBookingDomainSharedModule>(); |
|||
}); |
|||
|
|||
Configure<AbpLocalizationOptions>(options => |
|||
{ |
|||
options.Resources |
|||
.Add<BookingResource>("en") |
|||
.AddBaseTypes(typeof(AbpValidationResource)) |
|||
.AddVirtualJson("EasyAbp/EShop/Plugins/Booking/Localization"); |
|||
}); |
|||
|
|||
Configure<AbpExceptionLocalizationOptions>(options => |
|||
{ |
|||
options.MapCodeNamespace("EasyAbp.EShop.Plugins.Booking", typeof(BookingResource)); |
|||
}); |
|||
} |
|||
} |
|||
@ -0,0 +1,9 @@ |
|||
using Volo.Abp.Localization; |
|||
|
|||
namespace EasyAbp.EShop.Plugins.Booking.Localization; |
|||
|
|||
[LocalizationResourceName("EasyAbpEShopPluginsBooking")] |
|||
public class BookingResource |
|||
{ |
|||
|
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
{ |
|||
"culture": "en", |
|||
"texts": { |
|||
"Menu:Booking": "Booking business", |
|||
"Permission:ProductAsset": "Asset prices", |
|||
"Permission:Create": "Create", |
|||
"Permission:Update": "Update", |
|||
"Permission:Delete": "Delete", |
|||
"Menu:ProductAsset": "Asset prices", |
|||
"ProductAsset": "Asset prices", |
|||
"ProductAssetStoreId": "Store ID", |
|||
"ProductAssetProductId": "Product ID", |
|||
"ProductAssetProductSkuId": "Product SKU ID", |
|||
"ProductAssetAssetId": "Asset ID", |
|||
"ProductAssetPeriodSchemeId": "Period Scheme ID", |
|||
"ProductAssetFromTime": "From time", |
|||
"ProductAssetToTime": "To time", |
|||
"ProductAssetCurrency": "Currency", |
|||
"ProductAssetPrice": "Price", |
|||
"ProductAssetPeriods": "Period prices", |
|||
"CreateProductAsset": "New", |
|||
"EditProductAsset": "Edit", |
|||
"ProductAssetDeletionConfirmationMessage": "Are you sure to delete the product asset {0}?", |
|||
"SuccessfullyDeleted": "Successfully deleted", |
|||
"Menu:ProductAssetPeriod": "Asset period prices", |
|||
"ProductAssetPeriod": "Asset period prices", |
|||
"ProductAssetPeriodPeriodId": "Period ID", |
|||
"ProductAssetPeriodCurrency": "Currency", |
|||
"ProductAssetPeriodPrice": "Price", |
|||
"CreateProductAssetPeriod": "New", |
|||
"EditProductAssetPeriod": "Edit", |
|||
"ProductAssetPeriodDeletionConfirmationMessage": "Are you sure to delete the product asset period {0}?", |
|||
"Permission:ProductAssetCategory": "Asset category prices", |
|||
"Menu:ProductAssetCategory": "Asset category prices", |
|||
"ProductAssetCategory": "Asset category prices", |
|||
"ProductAssetCategoryStoreId": "Store ID", |
|||
"ProductAssetCategoryProductId": "Product ID", |
|||
"ProductAssetCategoryProductSkuId": "Product SKU ID", |
|||
"ProductAssetCategoryAssetCategoryId": "Asset Category ID", |
|||
"ProductAssetCategoryPeriodSchemeId": "Period Scheme ID", |
|||
"ProductAssetCategoryFromTime": "From time", |
|||
"ProductAssetCategoryToTime": "To time", |
|||
"ProductAssetCategoryCurrency": "Currency", |
|||
"ProductAssetCategoryPrice": "Price", |
|||
"ProductAssetCategoryPeriods": "Period prices", |
|||
"CreateProductAssetCategory": "New", |
|||
"EditProductAssetCategory": "Edit", |
|||
"ProductAssetCategoryDeletionConfirmationMessage": "Are you sure to delete the product asset category {0}?", |
|||
"Menu:ProductAssetCategoryPeriod": "Asset category period prices", |
|||
"ProductAssetCategoryPeriod": "Asset category period prices", |
|||
"ProductAssetCategoryPeriodPeriodId": "Period ID", |
|||
"ProductAssetCategoryPeriodCurrency": "Currency", |
|||
"ProductAssetCategoryPeriodPrice": "Price", |
|||
"CreateProductAssetCategoryPeriod": "New", |
|||
"EditProductAssetCategoryPeriod": "Edit", |
|||
"ProductAssetCategoryPeriodDeletionConfirmationMessage": "Are you sure to delete the product asset category period {0}?", |
|||
"EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "Period {id} not found.", |
|||
"EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "Period {id} exists.", |
|||
"EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset": "Exist conflicting product asset mapping.", |
|||
"EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory": "Exist conflicting product asset category mapping.", |
|||
"EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct": "Wrong StoreId {storeId} for product {productId}.", |
|||
"Permission:GrantedStore": "Store assets", |
|||
"Menu:GrantedStore": "Store assets", |
|||
"GrantedStore": "Store assets", |
|||
"GrantedStoreStoreId": "Store ID", |
|||
"GrantedStoreAssetId": "Asset ID", |
|||
"GrantedStoreAssetCategoryId": "Asset category ID", |
|||
"GrantedStoreAllowAll": "Allow all", |
|||
"CreateGrantedStore": "New", |
|||
"EditGrantedStore": "Edit", |
|||
"GrantedStoreDeletionConfirmationMessage": "Are you sure to delete the store asset category {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
{ |
|||
"culture": "zh-Hans", |
|||
"texts": { |
|||
"Menu:Booking": "预约业务", |
|||
"Permission:ProductAsset": "资产价格", |
|||
"Permission:Create": "新建", |
|||
"Permission:Update": "更新", |
|||
"Permission:Delete": "删除", |
|||
"Menu:ProductAsset": "资产价格", |
|||
"ProductAsset": "资产价格", |
|||
"ProductAssetStoreId": "店铺 ID", |
|||
"ProductAssetProductId": "产品 ID", |
|||
"ProductAssetProductSkuId": "产品 SKU ID", |
|||
"ProductAssetAssetId": "资产 ID", |
|||
"ProductAssetPeriodSchemeId": "时段方案 ID", |
|||
"ProductAssetFromTime": "生效时间", |
|||
"ProductAssetToTime": "结束时间", |
|||
"ProductAssetCurrency": "币种", |
|||
"ProductAssetPrice": "价格", |
|||
"ProductAssetPeriods": "时段价格", |
|||
"CreateProductAsset": "新建", |
|||
"EditProductAsset": "编辑", |
|||
"ProductAssetDeletionConfirmationMessage": "确认删除资产价格 {0}?", |
|||
"SuccessfullyDeleted": "删除成功", |
|||
"Menu:ProductAssetPeriod": "资产时段价格", |
|||
"ProductAssetPeriod": "资产时段价格", |
|||
"ProductAssetPeriodPeriodId": "时段 ID", |
|||
"ProductAssetPeriodCurrency": "币种", |
|||
"ProductAssetPeriodPrice": "价格", |
|||
"CreateProductAssetPeriod": "新建", |
|||
"EditProductAssetPeriod": "编辑", |
|||
"ProductAssetPeriodDeletionConfirmationMessage": "确认删除资产时段价格 {0}?", |
|||
"Permission:ProductAssetCategory": "资产类目价格", |
|||
"Menu:ProductAssetCategory": "资产类目价格", |
|||
"ProductAssetCategory": "资产类目价格", |
|||
"ProductAssetCategoryStoreId": "店铺 ID", |
|||
"ProductAssetCategoryProductId": "产品 ID", |
|||
"ProductAssetCategoryProductSkuId": "产品 SKU ID", |
|||
"ProductAssetCategoryAssetCategoryId": "资产目录 ID", |
|||
"ProductAssetCategoryPeriodSchemeId": "时段方案 ID", |
|||
"ProductAssetCategoryFromTime": "生效时间", |
|||
"ProductAssetCategoryToTime": "结束时间", |
|||
"ProductAssetCategoryCurrency": "币种", |
|||
"ProductAssetCategoryPrice": "价格", |
|||
"ProductAssetCategoryPeriods": "时段价格", |
|||
"CreateProductAssetCategory": "新建", |
|||
"EditProductAssetCategory": "编辑", |
|||
"ProductAssetCategoryDeletionConfirmationMessage": "确认删除资产类目价格 {0}?", |
|||
"Menu:ProductAssetCategoryPeriod": "资产类目时段价格", |
|||
"ProductAssetCategoryPeriod": "资产类目时段价格", |
|||
"ProductAssetCategoryPeriodPeriodId": "时段 ID", |
|||
"ProductAssetCategoryPeriodCurrency": "币种", |
|||
"ProductAssetCategoryPeriodPrice": "价格", |
|||
"CreateProductAssetCategoryPeriod": "新建", |
|||
"EditProductAssetCategoryPeriod": "编辑", |
|||
"ProductAssetCategoryPeriodDeletionConfirmationMessage": "确认删除资产类目时段价格 {0}?", |
|||
"EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "时段 {id} 不存在。", |
|||
"EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "时段 {id} 已存在。", |
|||
"EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset": "存在冲突的产品资产映射。", |
|||
"EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory": "存在冲突的产品资产映射。", |
|||
"EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct": "错误的店铺 ID {storeId} 之于产品 {productId}。", |
|||
"Permission:GrantedStore": "店铺资产", |
|||
"Menu:GrantedStore": "店铺资产", |
|||
"GrantedStore": "店铺资产", |
|||
"GrantedStoreStoreId": "店铺 ID", |
|||
"GrantedStoreAssetId": "资产 ID", |
|||
"GrantedStoreAssetCategoryId": "资产目录 ID", |
|||
"GrantedStoreAllowAll": "允许所有", |
|||
"CreateGrantedStore": "新建", |
|||
"EditGrantedStore": "编辑", |
|||
"GrantedStoreDeletionConfirmationMessage": "确认删除店铺资产 {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,73 @@ |
|||
{ |
|||
"culture": "zh-Hant", |
|||
"texts": { |
|||
"Menu:Booking": "預約業務", |
|||
"Permission:ProductAsset": "資產價格", |
|||
"Permission:Create": "新建", |
|||
"Permission:Update": "更新", |
|||
"Permission:Delete": "刪除", |
|||
"Menu:ProductAsset": "資產價格", |
|||
"ProductAsset": "資產價格", |
|||
"ProductAssetStoreId": "店鋪 ID", |
|||
"ProductAssetProductId": "產品 ID", |
|||
"ProductAssetProductSkuId": "產品 SKU ID", |
|||
"ProductAssetAssetId": "資產 ID", |
|||
"ProductAssetPeriodSchemeId": "時段方案 ID", |
|||
"ProductAssetFromTime": "生效時間", |
|||
"ProductAssetToTime": "結束時間", |
|||
"ProductAssetCurrency": "幣種", |
|||
"ProductAssetPrice": "價格", |
|||
"ProductAssetPeriods": "時段價格", |
|||
"CreateProductAsset": "新建", |
|||
"EditProductAsset": "編輯", |
|||
"ProductAssetDeletionConfirmationMessage": "確認刪除資產價格 {0}?", |
|||
"SuccessfullyDeleted": "刪除成功", |
|||
"Menu:ProductAssetPeriod": "資產時段價格", |
|||
"ProductAssetPeriod": "資產時段價格", |
|||
"ProductAssetPeriodPeriodId": "時段 ID", |
|||
"ProductAssetPeriodCurrency": "幣種", |
|||
"ProductAssetPeriodPrice": "價格", |
|||
"CreateProductAssetPeriod": "新建", |
|||
"EditProductAssetPeriod": "編輯", |
|||
"ProductAssetPeriodDeletionConfirmationMessage": "確認刪除資產時段價格 {0}?", |
|||
"Permission:ProductAssetCategory": "資產類目價格", |
|||
"Menu:ProductAssetCategory": "資產類目價格", |
|||
"ProductAssetCategory": "資產類目價格", |
|||
"ProductAssetCategoryStoreId": "店鋪 ID", |
|||
"ProductAssetCategoryProductId": "產品 ID", |
|||
"ProductAssetCategoryProductSkuId": "產品 SKU ID", |
|||
"ProductAssetCategoryAssetCategoryId": "資產目錄 ID", |
|||
"ProductAssetCategoryPeriodSchemeId": "時段方案 ID", |
|||
"ProductAssetCategoryFromTime": "生效時間", |
|||
"ProductAssetCategoryToTime": "結束時間", |
|||
"ProductAssetCategoryCurrency": "幣種", |
|||
"ProductAssetCategoryPrice": "價格", |
|||
"ProductAssetCategoryPeriods": "時段價格", |
|||
"CreateProductAssetCategory": "新建", |
|||
"EditProductAssetCategory": "編輯", |
|||
"ProductAssetCategoryDeletionConfirmationMessage": "確認刪除資產類目價格 {0}?", |
|||
"Menu:ProductAssetCategoryPeriod": "資產類目時段價格", |
|||
"ProductAssetCategoryPeriod": "資產類目時段價格", |
|||
"ProductAssetCategoryPeriodPeriodId": "時段 ID", |
|||
"ProductAssetCategoryPeriodCurrency": "幣種", |
|||
"ProductAssetCategoryPeriodPrice": "價格", |
|||
"CreateProductAssetCategoryPeriod": "新建", |
|||
"EditProductAssetCategoryPeriod": "編輯", |
|||
"ProductAssetCategoryPeriodDeletionConfirmationMessage": "確認刪除資產類目時段價格 {0}?", |
|||
"EasyAbp.EShop.Plugins.Booking:PeriodNotFound": "時段 {id} 不存在。", |
|||
"EasyAbp.EShop.Plugins.Booking:DuplicatePeriod": "時段 {id} 已存在。", |
|||
"EasyAbp.EShop.Plugins.Booking:ConflictingProductAsset": "存在衝突的產品資產映射。", |
|||
"EasyAbp.EShop.Plugins.Booking:ConflictingProductAssetCategory": "存在衝突的產品資產映射。", |
|||
"EasyAbp.EShop.Plugins.Booking:WrongStoreIdForProduct": "錯誤的店鋪 ID {storeId} 之於產品 {productId}。", |
|||
"Permission:GrantedStore": "店鋪資產", |
|||
"Menu:GrantedStore": "店鋪資產", |
|||
"GrantedStore": "店鋪資產", |
|||
"GrantedStoreStoreId": "店鋪 ID", |
|||
"GrantedStoreAssetId": "資產 ID", |
|||
"GrantedStoreAssetCategoryId": "資產目錄 ID", |
|||
"GrantedStoreAllowAll": "允許所有", |
|||
"CreateGrantedStore": "新建", |
|||
"EditGrantedStore": "編輯", |
|||
"GrantedStoreDeletionConfirmationMessage": "確認刪除店鋪資產 {0}?" |
|||
} |
|||
} |
|||
@ -0,0 +1,3 @@ |
|||
<Weavers xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="FodyWeavers.xsd"> |
|||
<ConfigureAwait ContinueOnCapturedContext="false" /> |
|||
</Weavers> |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue