Frontend Sale Order Management App
Frontend Sale Order Management App
The application should use Tanstack React Query to manage the server state, and updates to sale orders should be synchronized with the UI without requiring a refresh, especially when new sale orders are created or existing ones are edited.
Unauthenticated users should be redirected to the login page, which uses a dummy username and password for access control. This ensures that only authenticated users can access the application’s main features.
The document specifies using a date picker for the invoice_date field to enhance user experience by simplifying date selection and minimizing input errors. This approach improves accuracy and efficiency in form submissions.
The document specifies that the toggle switch for the dark theme should allow the theme to persist on reloads, implying that the theme selection should be stored and recalled when the page is reloaded.
The form for creating a new sale order must include validation rules to ensure data integrity. Upon submission, a valid sale order should be created and displayed in the active sale orders synchronously without a page refresh.
The frontend design for the sale order management application must include a login page with redirection for unauthenticated users, a dark theme toggle switch that persists on reloads, tabs for active and completed sale orders, a modal form for creating sale orders, and editable or read-only forms for active and completed orders respectively.
The sale order form schema includes fields for customer_id, a list of items with sku_ids, prices and quantities, a boolean for payment status, an invoice number, and invoice date.
The document mandates using Chakra-UI for styling, which is significant due to its modularity and ease of integration with React, enhancing development efficiency and UI consistency.
The required technology stack includes React 18+ with optimization hooks, React Router DOM for routing, Tanstack React Query for server state management, React Hook Form for managing form state, Chakra-UI for styling, and Chakra MultiSelect (or a compatible alternative) for multi-select options.
The triple horizontal dots icon in the active sale orders table serves as a trigger for a modal that allows editing of that sale order, with the form prefilled with existing details.