Skip to content

Commit

Permalink
feat: loan manager api endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
Shavkatjon-O committed Sep 12, 2024
1 parent cc15a5b commit 0adbe9d
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 0 deletions.
1 change: 1 addition & 0 deletions apps/applications/api/ApplicationsList/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .views import *
1 change: 1 addition & 0 deletions apps/borrowers/api/BorrowersList/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .views import *
11 changes: 11 additions & 0 deletions apps/borrowers/api/BorrowersList/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from rest_framework import serializers
from apps.borrowers.models import Borrower


class BorrowersListSerializer(serializers.ModelSerializer):
class Meta:
model = Borrower
fields = "__all__"


__all__ = ("BorrowersListSerializer",)
14 changes: 14 additions & 0 deletions apps/borrowers/api/BorrowersList/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from rest_framework.generics import ListAPIView
from rest_framework.permissions import IsAuthenticated

from apps.borrowers.api.BorrowersList.serializers import BorrowersListSerializer
from apps.borrowers.models import Borrower


class BorrowersListAPIView(ListAPIView):
permission_classes = (IsAuthenticated,)
serializer_class = BorrowersListSerializer
queryset = Borrower.objects.all()


__all__ = ("BorrowersListAPIView",)
Empty file added apps/borrowers/api/__init__.py
Empty file.
1 change: 1 addition & 0 deletions apps/loans/api/LoansList/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .views import *
11 changes: 11 additions & 0 deletions apps/loans/api/LoansList/serializers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from rest_framework import serializers
from apps.loans.models import Loan


class LoansListSerializer(serializers.ModelSerializer):
class Meta:
model = Loan
fields = "__all__"


__all__ = ("LoansListSerializer",)
14 changes: 14 additions & 0 deletions apps/loans/api/LoansList/views.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
from rest_framework.generics import ListAPIView
from rest_framework.permissions import IsAuthenticated

from apps.loans.api.LoansList.serializers import LoansListSerializer
from apps.loans.models import Loan


class LoansListAPIView(ListAPIView):
permission_classes = (IsAuthenticated,)
serializer_class = LoansListSerializer
queryset = Loan.objects.all()


__all__ = ("LoansListAPIView",)
Empty file added apps/loans/api/__init__.py
Empty file.
Empty file added apps/loans/urls.py
Empty file.

0 comments on commit 0adbe9d

Please sign in to comment.