Skip to content

Commit

Permalink
add review_notes to application
Browse files Browse the repository at this point in the history
  • Loading branch information
Prometheo committed Dec 27, 2024
1 parent 0c2ba9f commit ab226ba
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion indexer_app/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ async def handle_list_update(

logger.info(f"updating list..... {data}")

listObject = await List.objects.filter(on_chain_id=data["id"]).aupdate(
listObject = await List.objects.filter(on_chain_id=data["list_id"]).aupdate(
owner_id=data["owner"],
default_registration_status=data["default_registration_status"],
name=data["name"],
Expand Down
27 changes: 26 additions & 1 deletion pots/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from base.serializers import TwoDecimalPlacesField
from tokens.serializers import SIMPLE_TOKEN_EXAMPLE, TokenSerializer

from .models import Pot, PotApplication, PotFactory, PotPayout
from .models import Pot, PotApplication, PotFactory, PotPayout, PotApplicationReview


class PotSerializer(ModelSerializer):
Expand Down Expand Up @@ -80,7 +80,22 @@ class Meta:
whitelisted_deployers = AccountSerializer(many=True)


class ApplicationReviewSerializer(serializers.ModelSerializer):
reviewer = AccountSerializer()

class Meta:
model = PotApplicationReview
fields = [
"reviewer",
"notes",
"status",
"reviewed_at",
"tx_hash"
]


class PotApplicationSerializer(ModelSerializer):
reviews = ApplicationReviewSerializer(many=True)

class Meta:
model = PotApplication
Expand All @@ -93,6 +108,7 @@ class Meta:
"submitted_at",
"updated_at",
"tx_hash",
"reviews",
]

pot = PotSerializer()
Expand Down Expand Up @@ -211,6 +227,14 @@ class PaginatedPotFactoriesResponseSerializer(serializers.Serializer):
"results": [SIMPLE_POT_FACTORY_EXAMPLE],
}

POT_APPLICATION_REVIEW_EXAMPLE = {
"reviewer": SIMPLE_ACCOUNT_EXAMPLE,
"notes": "Looks good!",
"status": "Approved",
"reviewed_at": "2024-06-05T18:12:39.014Z",
"tx_hash": "EVMQsXorrrxPLHfK9UnbzFUy1SVYWvc8hwSGQZs4RbTk",
}


SIMPLE_POT_APPLICATION_EXAMPLE = {
"id": 2,
Expand All @@ -221,6 +245,7 @@ class PaginatedPotFactoriesResponseSerializer(serializers.Serializer):
"tx_hash": "EVMQsXorrrxPLHfK9UnbzFUy1SVYWvc8hwSGQZs4RbTk",
"pot": SIMPLE_POT_EXAMPLE,
"applicant": SIMPLE_ACCOUNT_EXAMPLE,
"reviews": [POT_APPLICATION_REVIEW_EXAMPLE],
}

PAGINATED_POT_APPLICATION_EXAMPLE = {
Expand Down

0 comments on commit ab226ba

Please sign in to comment.