-
Notifications
You must be signed in to change notification settings - Fork 0
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
#52 #55
base: main
Are you sure you want to change the base?
#52 #55
Conversation
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.
- Fix naming as it is a bit off the topic of the feature
- Don't use
batteries
if they don't solve your problem. It seems like neither filter forms nor Dango filters help us to make querying sufficient - We need more test cases.
Tests I'd like to see:
- One point has multiple stocks and usages
- Two points have multiple stocks and usages in the same period
- Two points have multiple stocks and usages in the non-intersecting periods
- One point has stocks and usages and the other is the empty one.
tests/apps/companies/services/test_materials_statistic_validator.py
Outdated
Show resolved
Hide resolved
src/companies/api/viewsets/point.py
Outdated
@@ -33,3 +40,17 @@ def add_employees(self, *args: Any, **kwargs: Any) -> Response: | |||
serializer = EmployeeSerializer(data=self.request.data, context=self.get_serializer_context(*args, **kwargs)) | |||
employee = EmployeeCreator(serializer)() | |||
return Response(EmployeeSerializer(employee).data) | |||
|
|||
|
|||
class MaterialsStatisticViewSet(ModelViewSet): |
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.
We only need listing here.
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.
Are you saying that we won't have a retrieve
logic at the front? Do I need to remove the retrieve
method?
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.
I can use mixins.ListModelMixin
and GenericViewSet
.
), | ||
data=material_date_query_params, | ||
) | ||
for movement in [response["stocks"], response["usage"]]: |
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.
What is movement?
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.
This is the movement of materials. That is, delivery to the point and use.
No description provided.