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

Add Services for Default Stock manipulation #121

Merged
merged 7 commits into from
Oct 6, 2017

Conversation

bartekszymanski
Copy link
Contributor

@bartekszymanski bartekszymanski commented Oct 5, 2017

Description

Fixed Issues (if relevant)

  1. Add Services for Default Stock manipulation  #97: Add Services for Default Stock manipulation

Contribution checklist

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with unit/integration tests (if applicable)
  • All automated tests passed successfully (all builds on Travis CI are green)

@bartekszymanski bartekszymanski changed the title Add Services for Default Stock manipulatio Add Services for Default Stock manipulation Oct 5, 2017
*/
interface DefaultSourceRepositoryInterface
{
const DEFAULT_SOURCE= 1;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, we have a requirement to provide a description to all the constants declared,
because constant introduces public contract the same as the public method.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But in this case, I propose to remove this constant and leave an interface method

DefaultSourceResolverInterface::getId(): int

in this case, somebody could customize it. For example, change ID of the default source/stock

Having constant - there is no such possibility

*
* @api
*/
interface DefaultSourceRepositoryInterface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's better not to call this service as Repository. We have a strict pattern for Repositories and which methods should be placed there.
Here you can read more about this rules - https://github.com/magento-engcom/msi/wiki/Service-Contracts#magento-repositories-basics

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case, I propose to rename service to

DefaultSourceResolverInterface::getId(): int

which will return Id of the default Source (in our case 1 )

*
* @api
*/
interface DefaultStockRepositoryInterface
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above

@maghamed maghamed merged commit 9db9b41 into develop Oct 6, 2017
maghamed added a commit that referenced this pull request Oct 6, 2017
@maghamed maghamed deleted the default-stock-source-manipulation branch December 11, 2018 18:15
magento-cicd2 pushed a commit that referenced this pull request May 18, 2021
[LYNX] Jquery upgrade compatibility changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants