diff --git a/hesabixUI/hesabix_ui/lib/main.dart b/hesabixUI/hesabix_ui/lib/main.dart index bb4102c..0b2183c 100644 --- a/hesabixUI/hesabix_ui/lib/main.dart +++ b/hesabixUI/hesabix_ui/lib/main.dart @@ -36,6 +36,8 @@ import 'pages/business/price_lists_page.dart'; import 'pages/business/price_list_items_page.dart'; import 'pages/business/cash_registers_page.dart'; import 'pages/business/petty_cash_page.dart'; +import 'pages/business/checks_page.dart'; +import 'pages/business/check_form_page.dart'; import 'pages/error_404_page.dart'; import 'core/locale_controller.dart'; import 'core/calendar_controller.dart'; @@ -792,6 +794,63 @@ class _MyAppState extends State { ); }, ), + // Checks: list, new, edit + GoRoute( + path: 'checks', + name: 'business_checks', + builder: (context, state) { + final businessId = int.parse(state.pathParameters['business_id']!); + return BusinessShell( + businessId: businessId, + authStore: _authStore!, + localeController: controller, + calendarController: _calendarController!, + themeController: themeController, + child: ChecksPage( + businessId: businessId, + authStore: _authStore!, + ), + ); + }, + ), + GoRoute( + path: 'checks/new', + name: 'business_new_check', + builder: (context, state) { + final businessId = int.parse(state.pathParameters['business_id']!); + return BusinessShell( + businessId: businessId, + authStore: _authStore!, + localeController: controller, + calendarController: _calendarController!, + themeController: themeController, + child: CheckFormPage( + businessId: businessId, + authStore: _authStore!, + ), + ); + }, + ), + GoRoute( + path: 'checks/:check_id/edit', + name: 'business_edit_check', + builder: (context, state) { + final businessId = int.parse(state.pathParameters['business_id']!); + final checkId = int.tryParse(state.pathParameters['check_id'] ?? '0'); + return BusinessShell( + businessId: businessId, + authStore: _authStore!, + localeController: controller, + calendarController: _calendarController!, + themeController: themeController, + child: CheckFormPage( + businessId: businessId, + authStore: _authStore!, + checkId: checkId, + ), + ); + }, + ), // TODO: Add other business routes (sales, accounting, etc.) ], ), diff --git a/hesabixUI/hesabix_ui/lib/pages/business/business_shell.dart b/hesabixUI/hesabix_ui/lib/pages/business/business_shell.dart index 572ec8d..90a86bc 100644 --- a/hesabixUI/hesabix_ui/lib/pages/business/business_shell.dart +++ b/hesabixUI/hesabix_ui/lib/pages/business/business_shell.dart @@ -951,6 +951,9 @@ class _BusinessShellState extends State { } else if (item.label == t.invoice) { // Navigate to add invoice context.go('/business/${widget.businessId}/invoice/new'); + } else if (item.label == t.checks) { + // Navigate to add check + context.go('/business/${widget.businessId}/checks/new'); } // سایر مسیرهای افزودن در آینده متصل می‌شوند }, @@ -1050,6 +1053,9 @@ class _BusinessShellState extends State { } else if (item.label == t.invoice) { // Navigate to add invoice context.go('/business/${widget.businessId}/invoice/new'); + } else if (item.label == t.checks) { + // Navigate to add check + context.go('/business/${widget.businessId}/checks/new'); } }, child: Container( diff --git a/hesabixUI/hesabix_ui/lib/pages/business/check_form_page.dart b/hesabixUI/hesabix_ui/lib/pages/business/check_form_page.dart new file mode 100644 index 0000000..9d46bbd --- /dev/null +++ b/hesabixUI/hesabix_ui/lib/pages/business/check_form_page.dart @@ -0,0 +1,22 @@ +import 'package:flutter/material.dart'; +import '../../core/auth_store.dart'; + +class CheckFormPage extends StatelessWidget { + final int businessId; + final AuthStore authStore; + final int? checkId; // null => new, not null => edit + + const CheckFormPage({ + super.key, + required this.businessId, + required this.authStore, + this.checkId, + }); + + @override + Widget build(BuildContext context) { + return const SizedBox.expand(); + } +} + + diff --git a/hesabixUI/hesabix_ui/lib/pages/business/checks_page.dart b/hesabixUI/hesabix_ui/lib/pages/business/checks_page.dart new file mode 100644 index 0000000..43ec8ee --- /dev/null +++ b/hesabixUI/hesabix_ui/lib/pages/business/checks_page.dart @@ -0,0 +1,20 @@ +import 'package:flutter/material.dart'; +import '../../core/auth_store.dart'; + +class ChecksPage extends StatelessWidget { + final int businessId; + final AuthStore authStore; + + const ChecksPage({ + super.key, + required this.businessId, + required this.authStore, + }); + + @override + Widget build(BuildContext context) { + return const SizedBox.expand(); + } +} + + diff --git a/hesabix_ui/lib/pages/business/check_form_page.dart b/hesabix_ui/lib/pages/business/check_form_page.dart new file mode 100644 index 0000000..bfb7d10 --- /dev/null +++ b/hesabix_ui/lib/pages/business/check_form_page.dart @@ -0,0 +1,24 @@ +import 'package:flutter/material.dart'; +import '../../core/auth_store.dart'; + +class CheckFormPage extends StatelessWidget { + final int businessId; + final AuthStore authStore; + final int? checkId; // null => new, not null => edit + + const CheckFormPage({ + super.key, + required this.businessId, + required this.authStore, + this.checkId, + }); + + @override + Widget build(BuildContext context) { + return const Scaffold( + body: SizedBox.expand(), + ); + } +} + +