Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate OrchardCore.Commerce into more projects (OCC-81) #175

Open
sarahelsaig opened this issue Sep 8, 2022 · 6 comments
Open

Separate OrchardCore.Commerce into more projects (OCC-81) #175

sarahelsaig opened this issue Sep 8, 2022 · 6 comments
Labels
technical debt Necessary but not urgent code cleanup or reorganization

Comments

@sarahelsaig
Copy link
Contributor

sarahelsaig commented Sep 8, 2022

Is your feature request related to a problem? Please describe

At least create a OrchardCore.Commerce.Core, probably also a OrchardCore.Commerce.Prices. Organize the projects, so we can create modules without having to throw everything into OrchardCore.Commerce as an everything-bucket.

Describe the solution you'd like

OrchardCore.Commerce module should only contain the cross-cutting concerns, everything else should be moved to new lower level modules. Note that #149 is related, but it has other enhancements. The two can be done in any order.

Describe alternatives you've considered

Currently we have almost everything in that one module. We have already started moving away from that with OrchardCore.Commerce.ContentFields, but so far anything that involves existing content parts or services has to go into OrchardCore.Commerce which is not ideal.

Jira issue

@sarahelsaig sarahelsaig added the technical debt Necessary but not urgent code cleanup or reorganization label Sep 8, 2022
@github-actions github-actions bot changed the title Separate OrchardCore.Commerce into more projects Separate OrchardCore.Commerce into more projects (OCC-81) Sep 18, 2022
@bleroy
Copy link
Member

bleroy commented Nov 10, 2022

This seems like an internal project organization problem. Segregating the code into area folders and Orchard features seems like a better solution, unless there is user benefit in having separate modules. The question for me is whether users would choose not to install the prices module and if so, why? What are the scenarios this helps with?

sarahelsaig added a commit that referenced this issue Oct 26, 2023
…rfaces the modules should be able to access. This will be relevant to #175 (OCC-81) as well.
DemeSzabolcs pushed a commit that referenced this issue Nov 9, 2023
…if other payment provider is desired. (#373)

* Adding Product List base architecture

* Improving boolean attribute display in cart

* Handling attributes on checkout in ProductAttributeProvider

* Handling attributes during Order creation

* Fixing Order view

* Renaming SelectedAttributes property to SelectedTextAttributes

* Adding boolean attribute editing capabilities to Order editor

* Fixing bug with boolean attributes display

* Constructing actual boolean attributes as well

* Fistfighting analyzer

* Adjusting Order editor styling

* Adding handling of numeric attributes

* Improving numeric inputs in Order editor

* Fixing warning

* Potentially fixing test

* Extending UI test

* Adding minor improvements

* Improving JSON parsing

* Adding minor fixes

* Creating navigation extension method

* Fixing string in view

* Replacing SelectedTextAttributes with SelectedAttributes

* Create OrchardCore.Commerce.Payment module.

* Add separate module to OrchardCore.Commerce.Payment.Stripe.

* Move most Stripe files into its own module.

* Move PaymentIntent too.

* Fix some easier errors.

* Using SelectedAttributes everywhere

* Moving business logic to service

* Warnin't

* Fixing test

* Use _productService.GetProductsAsync in CreateOrderLineItemsAsync.

* Create RequestOptionsService.

* Create OrchardCore.Commerce.Abstraction to store some models and interfaces the modules should be able to access. This will be relevant to #175 (OCC-81) as well.

* Some project organization.

* Move two view-models and add SKU holder interfaces.

* Move more stuff over to abstractions.

* More code reorganization.

* Move serialization to abstraction.

* Resolve non-Payment related errors except ProductAttributeValueConverter.

* Modular deserializers.

* Move CreateOrderLineItemsAsync to ShoppingCartHelpers.

* Working on adding providers

* Fixing Order editor; removing unnecessary code

* Moving method to service

* Make GetPaymentAmount private.

* Extending providers with new meth

* Move WebhookController.

* Create StripeController.

* Move order updating from StripePaymentService to regular PaymentService.

* Abstract CheckoutViewModel.

* Replace InitializePaymentIntentAsync with CreateClientSecretAsync.

* Move assets to the stripe project.

* Fix NodeJS Extensions references in csproj.

* Move payment-form.scss into Add separate module to OrchardCore.Commerce.Payment.

* Move FieldsOnlyDisplayManager to ContentFields module.

* Move PaymentController and PaymentService to the module.

* Move AddressField into ContentFields module.

* Extract the UserAddress stuff into an event handler.

* Adding ordering options

* Move commerce-regions.js to ContentFields.

* Externalize OrderContentTypeDefinitionDisplayDriver._excludedShapes.

* Remove stripe-specific properties from ICheckoutViewModel.

* Adding title filter

* Abstract stripe data in CheckoutViewModel.

* Replace StripeCheckout shape usages with a list of provider shapes.

* Go back to directly importing PaymentForm after all.

* Wire OrchardCore.Commerce.Payment into OrchardCore.Commerce.

* Update excludes.

* Add "deserializers" to the allow list.

* unusing

* Fix non-Stripe problems with PaymentController.

* Add ProductAttributeProvider name constants.

* Minor code cleanup.

* Post merge fix-up.

* PaymentViewModel

* Create shape data in the provider, move Stripe stuff to StripePaymentProvider.

* Make `~/checkout/validate` provider-based.

* Namespace fix.

* Don't assume default shopping cart ID.

* More shopping cart fixes.

* Set charges in the outer service.

* Turn Payment into a record.

* Resolving applied filters from query string

* Adding UI tests

* Renaming interface and fixing analyzer violations

* Fixing analyzer violation

* Ignoring pager HTML validation error

* Removing unnecessary ContainedPart from products

* Some more fixes.

* Add missing dependency.

* Add IPaymentProvider.FinalModificationOfOrderAsync().

* Move OrderCreatedEvent workflow event into abstraction.

* Update inventories using the OrderedAsync event.

* Save user addresses in the FinalizeAsync event.

* All promotion services should be in the PromotionStartup.

* Add PromotionOrderEvents.

* Add UserSettingsCheckoutEvents.

* Make Promotion a dependency of Payment.Stripe.

* Add missing Node Extensions files.

* Remove broken project reference.

* Ensure payment view model's data is never null.

* Fix CreatedFreeAsync.

* Add missing Node Extensions files.

* Fix warnings.

* Feature setup.

* Don't break with free orders.

* shoppingCartId nullable

* Minor refactorings

* Accepting only one order by value

* Fixing failing UI test

* Update src/Modules/OrchardCore.Commerce/Services/ProductListService.cs

* Move Checkout-Stripe to CheckoutStripe.

* Fix wrong data property names.

* Fail early in PaymentConfirmationMiddleware if the payment intent or order are missing.

* Throw notification if there is a total in the free order.

* Use UpdateOrderToOrderedAsync in OrderController.

* Move IPaymentService to OrchardCore.Commerce.Payment.

* Return the same way in stripe too.

* No need for IOrchardHelper.

* Turn StripePaymentService.CheckTotals into an extension method.

* Extract reusable parts of CreateOrUpdateOrderFromShoppingCartAsync logic.

* Handle FrontendException.

* Merge unnecessary single-use private method.

* Simplify StripePaymentService constructor.

* Add PaymentIntentPersistence.Remove() method.

* Add dummy provider.

* Extract payment button into a separate shape.

* Fix PayButton.

* Add "Stripe" to the middleware action's name for consistency.

* Fix spinner on the wrong button.

* Update payment intent persistence during submit.

* Add CreateShoppingCartViewModelAsync extension method.

* grammar

* Add WhereName extension method to payment provider collection.

* Now working dummy provider.

* Update recipes.

* Code cleanup.

* Don't break if the Stripe API key is not configured.

* Update Stripe docs.

* Add general payment provider documentation.

* Add unit test.

* Fix spacing.

* Update excludes.txt.

* Fix CartEventsShouldUpdateTableAndAddLineItem.

* fallbacks

* fix paymentRequestUrl

* cshtml unusing

* Move ContentTypes to Abstractions.

* Pluralize OrchardCore.Commerce.Abstraction.

* Fix namespace.

* Fix missing constant from unit test.

* Fix and DRY ShoppingCartControllerTests.

* Update namespaces.

* Early payment intent error handling.

* Skip charges if there is no PaymentMethod.

* Fix Stripe checkout for real now.

* Add error message to PaymentConfirmationMiddleware failure.

* Add const for repeated string.

* DRY AddNewItemToCart and AddExistingItemToCart tests.

* Add warning when no providers are applicable.

* Validate that the Stripe order is not empty.

* This didn't work as expected.

* Fix bug where orderPart.LineItems.SetItems() cleared itself.

* Fix nuget references.

* Remove broken usings.

---------

Co-authored-by: Márk Bartha <barthamark@gmail.com>
Co-authored-by: Gábor Pór <gabor.por@lombiq.com>
Co-authored-by: Dávid El-Saig <david.el-saig@lombiq.com>
@Piedone
Copy link
Member

Piedone commented Nov 25, 2023

Doesn't #149 cover this?

@sarahelsaig
Copy link
Contributor Author

Only partially. It was just the minimum amount needed to separate payments into a separate module. We should still further refactor common code and move stuff from OrchardCore.Commerce in the tax/promotion/inventory modules if they only concern that module with no overlap.

@hishamco
Copy link
Member

Can I work on this?

One more thing I notice a strange namespace *.Abstractions.Abstractions" which is weird IMHO

@sarahelsaig
Copy link
Contributor Author

This should be done before the next major version (because it will involve breaking changes) but it's not a priority. Also I'd rather do it myself since I already have a reasonable vision about what needs to be done. I recall you've shown interest in contributing to #300 in the past, wouldn't you rather do that?

I totally agree, OrchardCode.Commerce.Abstractions.Abstractions doesn't look good. I anticipate it will be renamed OrchardCode.Commerce.Abstractions.Services, but it's not yet set in stone. Also I consider abolishing the Abstractions directories in every module and moving the service interfaces into Services. Like it is in every other Lombiq and OrchardCore project I've seen.

@hishamco
Copy link
Member

I recall you've shown interest in contributing to #300 in the past, wouldn't you rather do that?

Sure, I need to revise the related issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
technical debt Necessary but not urgent code cleanup or reorganization
Projects
None yet
Development

No branches or pull requests

4 participants