-
Notifications
You must be signed in to change notification settings - Fork 4
Added validators #3
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
base: master
Are you sure you want to change the base?
Conversation
Service/ModuleManager.php
Outdated
| public function checkAccess(): bool | ||
| { | ||
| throw new \LogicException('Method should be implemented'); | ||
| } | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Его можно сделать абстрактным. Таким образом я кидал исключения для методов которые можно реализовать или не реализовать (например save, его в некоторых модулях нет), а этот метод вполне можно сделаьт обязательным
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Сделал обязательным для реализации
| private const REQUIRED_METHODS = [ | ||
| '/api/integration-modules/{code}', | ||
| '/api/integration-modules/{code}/edit', | ||
| '/api/delivery/generic/setting/{code}', | ||
| '/api/delivery/generic/setting/{code}/edit', | ||
| '/api/delivery/generic/{code}/tracking', | ||
| '/api/delivery/shipments', | ||
| '/api/delivery/shipments/{id}', | ||
| '/api/delivery/shipments/create', | ||
| '/api/delivery/shipments/{id}/edit', | ||
| '/api/reference/sites', | ||
| '/api/reference/stores', | ||
| '/api/reference/payment-types', | ||
| '/api/reference/statuses', | ||
| ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
С этим проблема - не всем модулям нужны все эти методы, некоторые модули работают только на трекинг например, в некоторых не реализована передача сеттингов и не нужен доступ к спаровчникам и т.д.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Перенес список обязательных методов в аннотацию RetailCrmAccess
11e84eb to
9d43331
Compare
Update gitignore file
* Update composer.json * Added LICENSE file
Refactoring dependencies
9d43331 to
b9bbce7
Compare
No description provided.