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

Services Concept #527

Open
pozylon opened this issue Dec 6, 2022 · 2 comments
Open

Services Concept #527

pozylon opened this issue Dec 6, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@pozylon
Copy link
Member

pozylon commented Dec 6, 2022

Unchained Architecture v3.0:
(it's not nice to explicitly pass the context 3 layers down)

  • Core Modules should not know the Unchained API
  • Core Modules expose the underlying raw database collections through a standard way to make it easier for user-land code when you need to get a certain product by certain special attributes or do some aggregation.
  • All cross-module functions are defined on the "core" umbrella package as "services", an example: instead of doing:
const checkedOut = await modules.orders.checkout(
  order._id,
  {
    paymentContext: {
      receiptData: responseBody?.unified_receipt?.latest_receipt,
    },
  },
  resolvedContext,
);

it should be:

const checkedOut = await services.checkoutCart(
  order._id,
  {
    paymentContext: {
      receiptData: responseBody?.unified_receipt?.latest_receipt,
    },
  }
);
@pozylon pozylon added the enhancement New feature or request label Dec 6, 2022
@macrozone
Copy link
Contributor

best base it on nestjs, which already has a good service-layer with DI

@pozylon
Copy link
Member Author

pozylon commented Dec 6, 2022

nestjs has some good approaches and also strapi with v3 (v4 not so much in my opinion)

@pozylon pozylon added this to the v3.0 milestone Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: v3.0 (Q3 / 2024)
Development

No branches or pull requests

2 participants