Skip to content

feat: Make decline-all endpoint support decline reason#178

Open
zwidekalanga wants to merge 1 commit into
mainfrom
feat/decline-accept-reason
Open

feat: Make decline-all endpoint support decline reason#178
zwidekalanga wants to merge 1 commit into
mainfrom
feat/decline-accept-reason

Conversation

@zwidekalanga

Copy link
Copy Markdown
Contributor

Description:
Make decline-all endpoint support decline reason

Jira:
ENT-11787

Merge checklist:

  • ./manage.py makemigrations has been run
    • Note: This must be run if you modified any models.
      • It may or may not make a migration depending on exactly what you modified, but it should still be run.

Post merge:

  • Ensure that your changes went out to the stage instance
  • Deploy to prod instance

@zwidekalanga zwidekalanga requested review from a team as code owners May 25, 2026 07:20
@codecov

codecov Bot commented May 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.08%. Comparing base (4a4f726) to head (0f62309).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #178   +/-   ##
=======================================
  Coverage   86.08%   86.08%           
=======================================
  Files         149      149           
  Lines       12500    12501    +1     
  Branches     1194     1194           
=======================================
+ Hits        10761    10762    +1     
  Misses       1424     1424           
  Partials      315      315           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@pwnage101 pwnage101 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nit and a simple fix, otherwise LGTM!

)


class LearnerCreditRequestDeclineAllSerializer(serializers.Serializer): # pylint: disable=abstract-method

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: While you're already in here, can you do a favor and rename this to LearnerCreditRequestDeclineAllRequestSerializer? It's a request serializer so it should end with "...RequestSerializer" despite the class name already having "Request" earlier.

Comment on lines +407 to +412
decline_reason = serializers.CharField(
required=False,
allow_blank=True,
allow_null=True,
help_text="Reason for declining all matching requests.",
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ We should impose max_length=255. Better to fail validation and throw HTTP 400 than to bump against the database limit and raise HTTP 500.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants