Skip to content

Add payout run UI#773

Merged
Karthikeyantestpress merged 6 commits intomainfrom
payout-list
Feb 26, 2026
Merged

Add payout run UI#773
Karthikeyantestpress merged 6 commits intomainfrom
payout-list

Conversation

@Karthikeyantestpress
Copy link
Contributor

No description provided.

@gemini-code-assist
Copy link

Summary of Changes

Hello @Karthikeyantestpress, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request overhauls the payout mechanism by introducing a robust, automated, and ledger-driven system. The primary goal is to establish a single source of truth for financial liabilities, streamline the payout process with explicit approval workflows, and enable reliable, auditable money movement through integrated payment gateways. This change significantly enhances the platform's financial operations by moving away from manual interventions and providing a clear, traceable history of all transactions.

Highlights

  • New Ledger-Based Payout System: Introduced a comprehensive ledger-first system for managing institute payouts, replacing the previous manual and order-selection driven process with an immutable, auditable record of financial events.
  • Explicit Payout Models and Lifecycle: Defined new PayoutRun and InstitutePayout models with clear, deterministic lifecycles, including states for evaluation, approval, and execution, ensuring better control and traceability.
  • Payment Gateway Integration: Implemented integration with payment gateways for asynchronous, idempotent, and auditable payout execution, supporting multiple providers and preventing duplicate transfers.
  • Staff UI for Payout Management: Added new staff views and UI components for triggering, monitoring, approving, and reviewing payout runs and individual institute payouts, enhancing operational control.
  • Detailed Specifications and Tasks: Provided extensive design documents, proposals, and detailed specifications for ledger, payout run, institute payout, and payout execution, along with a structured task list for implementation.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • openspec/changes/ledger-based-payouts/.openspec.yaml
    • Added a new OpenSpec YAML configuration file for the ledger-based payouts feature.
  • openspec/changes/ledger-based-payouts/design.md
    • Added a detailed design document outlining the new ledger-based payout system, including its context, goals, decisions, risks, and migration plan.
  • openspec/changes/ledger-based-payouts/proposal.md
    • Added a proposal document explaining the rationale and high-level changes for the ledger-based automated payouts.
  • openspec/changes/ledger-based-payouts/specs/institute-payout/spec.md
    • Added specifications for the InstitutePayout model, covering its lifecycle, amount derivation from the ledger, and handling of institute-level holds.
  • openspec/changes/ledger-based-payouts/specs/ledger/spec.md
    • Added specifications for the new ledger system, detailing its append-only nature, cleared balance definition, and traceability for payouts.
  • openspec/changes/ledger-based-payouts/specs/payout-execution/spec.md
    • Added specifications for payout execution, focusing on payment gateway integration, idempotency, and asynchronous status handling.
  • openspec/changes/ledger-based-payouts/specs/payout-run/spec.md
    • Added specifications for the PayoutRun model, including its creation, evaluation, lifecycle, approval process, and creation constraints.
  • openspec/changes/ledger-based-payouts/tasks.md
    • Added a detailed list of implementation tasks for the new ledger-based payout system.
  • openspec/config.yaml
    • Updated the OpenSpec configuration to include new rules for proposals, designs, tasks, and specifications.
  • src/_data/approved_payout_runs.json
    • Added sample JSON data for approved payout runs to be used in the UI.
  • src/_data/completed_payout_runs.json
    • Added sample JSON data for completed payout runs to be used in the UI.
  • src/_data/evaluated_payout_runs.json
    • Added sample JSON data for evaluated payout runs to be used in the UI.
  • src/_data/evaluation_payout_runs.json
    • Added sample JSON data for payout runs currently under evaluation to be used in the UI.
  • src/_data/processing_payment_payout_runs.json
    • Added sample JSON data for payout runs with payments currently processing to be used in the UI.
  • src/_data/rejected_failed_payout_runs.json
    • Added sample JSON data for rejected or failed payout runs to be used in the UI.
  • src/_includes/layouts/staff_base.html
    • Modified the Tailwind CSS configuration to ensure it's applied correctly within the staff base layout.
  • src/_includes/partials/staff_navbar.html
    • Updated the staff navigation bar to include a shadow for improved visual separation.
  • src/payout_runs/approved_tab.html
    • Added an HTML template for displaying approved payout runs within the new UI.
  • src/payout_runs/awaiting_approval_tab.html
    • Added an HTML template for displaying payout runs awaiting approval within the new UI.
  • src/payout_runs/completed_tab.html
    • Added an HTML template for displaying completed payout runs within the new UI.
  • src/payout_runs/create_payout_run_modal.html
    • Added an HTML template for a modal to create new payout runs, including a date/time picker for cutoff times.
  • src/payout_runs/evaluating_tab.html
    • Added an HTML template for displaying payout runs currently evaluating within the new UI.
  • src/payout_runs/header.html
    • Added an HTML template for the header section of the payout runs page, including a 'Create New Run' button.
  • src/payout_runs/index.html
    • Added the main HTML page for payout runs, integrating various tab templates and the create payout run modal.
  • src/payout_runs/navigation_tab.html
    • Added an HTML template for the navigation tabs on the payout runs page, allowing users to switch between different payout run statuses.
  • src/payout_runs/payout_script.html
    • Added a JavaScript file containing Alpine.js logic for the payout run cutoff time picker, including calendar and time selection functionality.
  • src/payout_runs/processing_payment_tab.html
    • Added an HTML template for displaying payout runs with payments in process within the new UI.
  • src/payout_runs/rejected_failed_tab.html
    • Added an HTML template for displaying rejected or failed payout runs within the new UI.
Activity
  • The pull request introduces a significant new feature with extensive design, specification, and UI components. No specific comments or reviews are available in the provided context.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

github-actions bot commented Feb 26, 2026

PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-02-26 12:17 UTC

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive UI for the new ledger-based payout system, including detailed design documents, specifications, and mock data. The changes are well-structured, with clear separation of concerns in the HTML templates and good use of Alpine.js for interactivity. My review has identified a few areas for improvement, primarily related to UI/UX consistency and correctness in the HTML and mock data. I've pointed out a potential usability issue with a modal, incorrect use of Tailwind CSS classes for focus states, a class override bug in the tab navigation, and some inconsistencies in the design document and mock data. Addressing these points will enhance the robustness and user experience of the new UI.

Approve
</button>

<button aria-haspopup="dialog" aria-expanded="false" aria-controls="delete_class_1" data-hs-overlay="#delete_class_1" type="button" class="w-full flex items-center gap-x-3 py-2 px-3 rounded-lg text-sm text-gray-800 hover:bg-gray-100 disabled:opacity-50 disabled:pointer-events-none focus:outline-none focus:bg-gray-100 dark:text-neutral-300 dark:hover:bg-neutral-800 dark:focus:bg-neutral-800">

Choose a reason for hiding this comment

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

high

The data-hs-overlay attribute is targeting #delete_class_1, but there is no corresponding modal element with this ID defined in the provided files. This will result in the 'Reject' button being non-functional. Please ensure the data-hs-overlay selector points to a valid modal ID.

@@ -0,0 +1,278 @@
<form
id="hs-create-payout-run-modal"
class="hs-overlay hidden size-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto [--close-when-click-inside:true] pointer-events-none"

Choose a reason for hiding this comment

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

high

The attribute [--close-when-click-inside:true] is likely to cause a poor user experience. Modals should typically close when clicking outside the modal content, not inside. This attribute appears to enable closing on an inside click, which would prevent users from interacting with the form fields within the modal. This should be removed to ensure standard and expected modal behavior.

Suggested change
class="hs-overlay hidden size-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto [--close-when-click-inside:true] pointer-events-none"
class="hs-overlay hidden size-full fixed top-0 start-0 z-[80] overflow-x-hidden overflow-y-auto pointer-events-none"

- `LedgerEntry` shape (high level):
- `id`
- `institute` (FK to `institutes.Institute`, nullable for platform-only events)
- `entry_type` (enum, e.g. GROSS_PAYMENT (credit), PLATFORM_FEE (debit), TAX (debit), ADJUSTMENT ("Adjustment (+/-), PAYOUT_SETTLEMENT (debit), etc.)

Choose a reason for hiding this comment

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

medium

There appears to be a typo or formatting error in the example for the entry_type enum. The ADJUSTMENT type has a stray double quote which could cause confusion during implementation.

Suggested change
- `entry_type` (enum, e.g. GROSS_PAYMENT (credit), PLATFORM_FEE (debit), TAX (debit), ADJUSTMENT ("Adjustment (+/-), PAYOUT_SETTLEMENT (debit), etc.)
- `entry_type` (enum, e.g. GROSS_PAYMENT (credit), PLATFORM_FEE (debit), TAX (debit), ADJUSTMENT (credit/debit), PAYOUT_SETTLEMENT (debit), etc.)

[
{
"run_id": "PR-20022026-001",
"cutoff_time": "2026-02-20T22:00:00",

Choose a reason for hiding this comment

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

medium

The cutoff_time values in this mock data file are missing timezone information (e.g., "2026-02-20T22:00:00"). This is inconsistent with other mock data files (like evaluated_payout_runs.json) and the implementation in payout_script.html, which correctly handle timezone offsets. To prevent ambiguity and potential bugs, all timestamps should consistently follow the ISO 8601 format with timezone information.

theme: {
extend: {
fontFamily: {
sans: ['Inter var',],

Choose a reason for hiding this comment

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

medium

There is a trailing comma in the sans font family array. While this doesn't break JavaScript, it's unnecessary and can be removed for cleaner code.

            sans: ['Inter var'],

<tr>
<td class="size-px whitespace-nowrap px-4 py-3">
<a href="#"
class="text-sm text-emerald-600 decoration-2 hover:underline font-medium focus:outline-hidden focus:underline">

Choose a reason for hiding this comment

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

medium

The class focus:outline-hidden is not a standard Tailwind CSS utility. The correct class to remove the outline on focus is focus:outline-none. Using a non-existent class can lead to inconsistent focus styling and potential accessibility issues. This incorrect class is used in multiple files across the new UI components.

                class="text-sm text-emerald-600 decoration-2 hover:underline font-medium focus:outline-none focus:underline">

Comment on lines +9 to +11
:class="activeTab === 'evaluating' ? 'inline-flex items-center justify-center font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full min-w-[1.25rem]' : 'rounded-full bg-gray-100 text-gray-600 px-2.5 py-0.5 text-xs font-medium'"
class="ml-2">
5

Choose a reason for hiding this comment

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

medium

The class="ml-2" on the <span> element will be overridden by the :class binding from Alpine.js, causing the margin to be lost and breaking the layout. The ml-2 class should be included within the conditional logic of the :class attribute to ensure it is always applied. This issue is repeated for all tab buttons in this file.

Suggested change
:class="activeTab === 'evaluating' ? 'inline-flex items-center justify-center font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full min-w-[1.25rem]' : 'rounded-full bg-gray-100 text-gray-600 px-2.5 py-0.5 text-xs font-medium'"
class="ml-2">
5
:class="activeTab === 'evaluating' ? 'ml-2 inline-flex items-center justify-center font-medium text-[10px] py-0.5 px-[5px] bg-gray-800 text-white leading-3 rounded-full min-w-[1.25rem]' : 'ml-2 rounded-full bg-gray-100 text-gray-600 px-2.5 py-0.5 text-xs font-medium'">
5

@Karthikeyantestpress Karthikeyantestpress merged commit 59093e6 into main Feb 26, 2026
6 checks passed
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.

1 participant