🔧 Complete Worker & SQL Structure Test

Test semua endpoint Worker Bridge, SQL Functions, Views, dan koneksi database

Initializing...
Worker URL: https://worker-sales-dasboard.sfllh.my.id

Configuration

Quick Tests

Worker Health
Test basic worker connectivity and health status
Database Connection
Test connection to Supabase database
Main Function
Test sales_summary_full_compat function
Dashboard View
Test v_dashboard_summary view

Results will appear here after running tests...

SQL Functions Test

sales_summary_full_compat
Main function with p_ prefix parameters for compatibility
Parameters
p_ prefix
Returns
Full summary
get_top_categories
Top categories with contribution percentage
Parameters
in_ prefix
Returns
Top N
get_top_sdept
Top sub-departemen with contribution percentage
Parameters
Multiple versions
Status
Not tested
get_top_products_final
Top products based on sales
Parameters
lim, dates
Returns
Top products
get_monthly_summary
Monthly sales summary
Parameters
tahun_filter
Returns
Monthly data
check_duplicate_records
Check duplicate records in database
Parameters
None
Returns
Duplicates
get_sdept_by_category
Get sub-departments by category
Parameters
in_ prefix
Returns
Sdept list
get_sdept_monthly_trend
Monthly trend for sub-departments
Parameters
Multiple versions
Status
Not tested
calculate_working_days
Calculate working days between dates
Parameters
start_date, end_date
Returns
Working days

Function test results will appear here...

SQL Views Test

Important Note

If views return 404 error, the system will automatically try fallback functions:

  • v_dashboard_summaryget_v_dashboard_summary()
  • v_sales_by_sdeptget_v_sales_by_sdept()
  • v_sales_by_principleget_v_sales_by_principle()
  • v_sdept_summaryget_v_sdept_summary()
  • v_sales_summaryget_v_sales_summary()
v_dashboard_summary
Main dashboard view with all metrics
Type
Monthly
Fallback
Available
v_sales_by_sdept
Sales by sub-department with margin percentage
Type
Aggregated
Fallback
Available
v_sales_by_principle
Sales by principle/company
Type
Aggregated
Fallback
Available
v_sdept_summary
Complete summary for sub-departments
Type
Detailed
Fallback
Available
v_sales_summary
Basic sales summary by month
Type
Monthly
Fallback
Available

View test results will appear here...

Raw Data & Structure Test

Sales Data Table
Access raw sales_data table directly
Data Structure
Check field names and data types
Date Columns
Test trigger and date calculations
Filter Test
Test query parameters and filters

Raw data test results will appear here...

Advanced Tests

What's being tested?

Comprehensive test will check:

  • Worker connectivity and response time
  • Database connection and health
  • All SQL functions (11 functions)
  • All SQL views (5 views + fallback functions)
  • Data structure and integrity
  • Error handling and edge cases

Comprehensive test results will appear here...

Test Summary

0
Total Tests
0
Passed
0
Failed
0%
Success Rate

Detailed report will appear here...