Skip to content

Conversation

akzmoudud
Copy link
Contributor

@akzmoudud akzmoudud commented Sep 29, 2025

All Submissions:

  • My code follow the WordPress' coding standards
  • My code satisfies feature requirements
  • My code is tested
  • My code passes the PHPCS tests
  • My code has proper inline documentation
  • I've included related pull request(s) (optional)
  • I've included developer documentation (optional)
  • I've added proper labels to this pull request

Changes proposed in this Pull Request:

Related Pull Request(s)

  • Full PR Link

Closes

How to test the changes in this Pull Request:

  • Steps or issue link

Changelog entry

Title

Detailed Description of the pull request. What was previous behaviour
and what will be changed in this PR.

Before Changes

Describe the issue before changes with screenshots(s).

After Changes

Describe the issue after changes with screenshot(s).

Feature Video (optional)

Link of detailed video if this PR is for a feature.

PR Self Review Checklist:

  • Code is not following code style guidelines
  • Bad naming: make sure you would understand your code if you read it a few months from now.
  • KISS: Keep it simple, Sweetie (not stupid!).
  • DRY: Don't Repeat Yourself.
  • Code that is not readable: too many nested 'if's are a bad sign.
  • Performance issues
  • Complicated constructions that need refactoring or comments: code should almost always be self-explanatory.
  • Grammar errors.

FOR PR REVIEWER ONLY:

As a reviewer, your feedback should be focused on the idea, not the person. Seek to understand, be respectful, and focus on constructive dialog.

As a contributor, your responsibility is to learn from suggestions and iterate your pull request should it be needed based on feedback. Seek to collaborate and produce the best possible contribution to the greater whole.

  • Correct — Does the change do what it’s supposed to? ie: code 100% fulfilling the requirements?
  • Secure — Would a nefarious party find some way to exploit this change? ie: everything is sanitized/escaped appropriately for any SQL or XSS injection possibilities?
  • Readable — Will your future self be able to understand this change months down the road?
  • Elegant — Does the change fit aesthetically within the overall style and architecture?

Summary by CodeRabbit

  • New Features

    • Added admin dashboard pages for Withdraw and Reverse Withdrawal with filtering, pagination, and management actions.
    • Enabled export of withdraw reports with filtering and download, integrated into the existing export flow.
  • Documentation

    • Introduced a comprehensive guide for creating custom export controllers and advanced export capabilities.
  • Style

    • Refined dashboard table visuals and interaction states for a cleaner, more consistent UI.
  • Bug Fixes

    • Improved currency formatting by falling back to admin dashboard settings when storefront settings are unavailable.

shohag121 and others added 21 commits August 27, 2025 18:29
…package-using-webpack' into feat/dokan-widthraw-admin-list
…package-using-webpack' into feat/dokan-widthraw-admin-list
…ing, and eligibility conditions

- Improved handling for `dokanAdminDashboard.currency` fallback in `Accounting.ts`.
- Implemented `processDetails` for detailed render of withdrawal methods.
- Replaced custom buttons with `DokanButton` for better consistency.
- Added eligibility conditions for bulk actions (approve, cancel, delete).
- Introduced `formatPrice` utility for consistent price formatting.
- Updated table styling with new borders and rounded corners in SCSS.
- Corrected TSPath alias in `tsconfig.json`.
# Conflicts:
#	includes/Admin/Dashboard/Dashboard.php
- Added `VendorAsyncSelect` and `DateRangePicker` components for improved filtering.
- Updated SCSS to fix z-index and add relative positioning.
- Refactored filter handling logic for better clarity and usability.
- Introduced `AsyncSelect` with payment method filter support.
- Enhanced UI components for filtering, including updated placeholders and button styles.
- Added `loadPaymentMethods` function to dynamically fetch payment methods.
- Improved filter reset functionality with additional cleanup actions.
…ollers

- Added `ExportController` and `WithdrawExportController` to manage export functionality.
- Registered `WithdrawExportController` with WooCommerce under `withdraws` type.
- Created comprehensive usage documentation for the export controller.
- Enhanced `REST/Manager` to support export controllers seamlessly.
…integration

- Added support for withdraw data export via WooCommerce export system.
- Introduced `register_data_endpoint` method to map withdraw export endpoint.
- Updated `ExportController` and `WithdrawExportController` for endpoint structure alignment.
- Enhanced admin withdraw page with bulk export options and improved pagination.
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Sep 29, 2025

Caution

Review failed

Failed to post review comments

Walkthrough

Adds admin dashboard pages for Withdraw and Reverse Withdrawal, integrates WooCommerce-style exports via new REST export controllers and manager wiring, updates dashboard routing and styles, introduces TypeScript config and typings, adjusts currency utilities to support admin context, and tweaks admin CSS script dependencies.

Changes

Cohort / File(s) Summary
Documentation
docs/export-controller-usage.md
New guide on creating/registering export controllers, covering controllers, endpoints, permissions, pagination, and examples (withdraw exporter).
Admin Dashboard PHP pages
includes/Admin/Dashboard/Pages/Withdraw.php, includes/Admin/Dashboard/Pages/ReverseWithdrawal.php
Adds Withdraw and Reverse Withdrawal dashboard pages extending AbstractPage with menu metadata; no assets registered.
Admin Dashboard provider
includes/DependencyManagement/Providers/AdminDashboardServiceProvider.php
Registers new page classes (Withdraw, ReverseWithdrawal) in services array; adds use statements.
Dashboard assets dependency
includes/Admin/Dashboard/Dashboard.php
Extends CSS deps for dokan-admin-dashboard.css to include dokan-react-components.
REST: Export integration
includes/REST/ExportController.php, includes/REST/WithdrawExportController.php, includes/REST/Manager.php
Adds Dokan export controller and withdraw export controller; registers routes, permissions, controller map, and data endpoint; updates REST class map.
REST: Withdraw V2
includes/REST/WithdrawControllerV2.php
Ensures parent routes are registered by calling parent::register_routes() first.
Admin Dashboard routing (React)
src/admin/dashboard/components/Dashboard.tsx
Adds routes for /withdraw and /reverse-withdrawal, importing corresponding pages.
Withdraw page (React)
src/admin/dashboard/pages/withdraw/index.tsx
New page with tabs, filters, table, actions, modals, export flow (initiate, poll status, download).
Reverse Withdrawal page (React)
src/admin/dashboard/pages/reverse-withdrawal/index.tsx, src/admin/dashboard/pages/reverse-withdrawal/AddReverseWithdrawModal.tsx
New page with stats, filters, list; modal to add reverse withdrawal via API; handles validation and submission.
Styles
src/admin/dashboard/style.scss
Adds scoped styles for DataViews tables, buttons, headers, and empty states under #dokan-admin-dashboard.
Utilities: Accounting
src/utilities/Accounting.ts
Currency helpers now fallback to window.dokanAdminDashboard.currency when dokanFrontend.currency missing; warn if none.
TypeScript config
tsconfig.json
Adds project TS config with strict settings, path aliases, module options, includes/excludes.
TypeScript typings
types/externals.d.ts, types/globals.d.ts
Adds externals and globals declarations for WP/WC/Dokan modules, jQuery, Chart, moment, and global objects.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor Admin
  participant UI as Admin UI (Withdraw Page)
  participant DOK as Dokan ExportController
  participant WEXP as WithdrawExportController
  participant WC as WC Export Engine

  Admin->>UI: Click "Export"
  UI->>DOK: POST /dokan/v1/reports/withdraws/export (init)
  DOK->>WC: Delegate export job (type=withdraws)
  WC-->>DOK: Job queued (export_id)
  DOK-->>UI: { export_id }

  loop Poll status
    UI->>DOK: GET /dokan/v1/reports/withdraws/export/status?export_id
    DOK->>WC: Fetch job status
    WC-->>DOK: { status, file_url? }
    DOK-->>UI: { status, file_url? }
  end

  alt Completed
    UI->>WC: Download file_url
    WC-->>UI: CSV file
  else Error
    DOK-->>UI: Error response
  end
Loading
sequenceDiagram
  autonumber
  actor Admin
  participant UI as Admin UI (Reverse Withdrawal)
  participant API as REST API
  note over UI,API: Add Reverse Withdrawal Transaction
  Admin->>UI: Open "Add New" modal
  Admin->>UI: Select vendor/product/order, type, amount, note
  UI->>API: POST /dokan/v1/reverse-withdrawal/transactions {payload}
  alt Success
    API-->>UI: 201 Created
    UI->>UI: Close modal, refresh list
  else Validation/Error
    API-->>UI: 4xx/5xx
    UI->>Admin: Show inline errors
  end
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~75 minutes

Possibly related PRs

Suggested labels

Needs: Dev Review, Upcoming Release

Suggested reviewers

  • mrabbani
  • Aunshon

Poem

A rabbit taps keys with a whisker’s flair,
Exports hop out, fresh bytes in the air.
Withdraws align, reverse trails set,
Routes burrow neat—no errors yet.
Tables dressed sharp, totals in sight,
CSV moons glow—downloaded delight.
Thump-thump: shipped tonight! 🐇📦✨

Pre-merge checks and finishing touches and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description consists solely of the unfilled template sections and checkboxes without any actual content summarizing the changes, test steps, linked issues, or changelog entry. As a result, reviewers have no clear guidance on what was implemented, how to verify it, or what issues the PR addresses. Populate each section of the template with specific details: describe the changes proposed, reference related PRs or issues, outline testing instructions, provide a changelog entry, and include before-and-after descriptions or screenshots to give reviewers the necessary context.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The title “Reverse withdrawal page” accurately names one of the new features but does not reflect the inclusion of the Withdraw management page, REST export controllers, documentation updates, and related wiring that are also introduced in this PR. It is therefore only partially related to the full scope of changes.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/rev-withdrawal-page
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/rev-withdrawal-page

Tip

👮 Agentic pre-merge checks are now available in preview!

Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.

  • Built-in checks – Quickly apply ready-made checks to enforce title conventions, require pull request descriptions that follow templates, validate linked issues for compliance, and more.
  • Custom agentic checks – Define your own rules using CodeRabbit’s advanced agentic capabilities to enforce organization-specific policies and workflows. For example, you can instruct CodeRabbit’s agent to verify that API documentation is updated whenever API schema files are modified in a PR. Note: Upto 5 custom checks are currently allowed during the preview period. Pricing for this feature will be announced in a few weeks.

Please see the documentation for more information.

Example:

reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).

Please share your feedback with us on this Discord post.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@akzmoudud akzmoudud changed the base branch from develop to feat/dokan-widthraw-admin-list September 29, 2025 12:16
@akzmoudud akzmoudud self-assigned this Sep 29, 2025
@akzmoudud akzmoudud added the In Progress The issues is being worked on label Oct 17, 2025
Base automatically changed from feat/dokan-widthraw-admin-list to develop October 22, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

In Progress The issues is being worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants