-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Accounting exports summary APIs (#17)
* Accounting exports summary APIs * Errors APIs (#18) * Errors APIs * Expense filter api (#19) * Expense Filter APIs * Expense Filter APIs * Expense Filter APIs * Resolved
- Loading branch information
Showing
15 changed files
with
446 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
""" | ||
Fyle Serializers | ||
""" | ||
import logging | ||
from rest_framework import serializers | ||
|
||
from apps.fyle.models import ExpenseFilter | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.level = logging.INFO | ||
|
||
|
||
class ExpenseFilterSerializer(serializers.ModelSerializer): | ||
""" | ||
Expense Filter Serializer | ||
""" | ||
|
||
class Meta: | ||
model = ExpenseFilter | ||
fields = '__all__' | ||
read_only_fields = ('id', 'workspace', 'created_at', 'updated_at') |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""fyle_ms_business_central URL Configuration | ||
The `urlpatterns` list routes URLs to views. For more information please see: | ||
https://docs.djangoproject.com/en/3.0/topics/http/urls/ | ||
Examples: | ||
Function views | ||
1. Add an import: from my_app import views | ||
2. Add a URL to urlpatterns: path('', views.home, name='home') | ||
Class-based views | ||
1. Add an import: from other_app.views import Home | ||
2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') | ||
Including another URLconf | ||
1. Import the include() function: from django.urls import include, path | ||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) | ||
""" | ||
|
||
from django.urls import path | ||
from apps.fyle.views import ExpenseFilterView, ExpenseFilterDeleteView | ||
|
||
|
||
urlpatterns = [ | ||
path('expense_filters/<int:pk>/', ExpenseFilterDeleteView.as_view(), name='expense-filters'), | ||
path('expense_filters/', ExpenseFilterView.as_view(), name='expense-filters'), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import logging | ||
from rest_framework import generics | ||
from ms_business_central_api.utils import LookupFieldMixin | ||
from apps.fyle.serializers import ExpenseFilterSerializer | ||
from apps.fyle.models import ExpenseFilter | ||
|
||
logger = logging.getLogger(__name__) | ||
logger.level = logging.INFO | ||
|
||
|
||
class ExpenseFilterView(LookupFieldMixin, generics.ListCreateAPIView): | ||
""" | ||
Expense Filter view | ||
""" | ||
|
||
queryset = ExpenseFilter.objects.all() | ||
serializer_class = ExpenseFilterSerializer | ||
|
||
|
||
class ExpenseFilterDeleteView(generics.DestroyAPIView): | ||
""" | ||
Expense Filter Delete view | ||
""" | ||
|
||
queryset = ExpenseFilter.objects.all() | ||
serializer_class = ExpenseFilterSerializer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.