"feat: enhance invoice management with schema updates, seed data, and new APIs"

This commit is contained in:
louiscklaw
2025-05-30 16:48:54 +08:00
parent 5a707427c6
commit fd20a3531b
48 changed files with 1541 additions and 179 deletions

View File

@@ -1,3 +1,4 @@
// src/sections/product/product-new-edit-form.tsx
import { zodResolver } from '@hookform/resolvers/zod';
import Box from '@mui/material/Box';
import Button from '@mui/material/Button';
@@ -193,8 +194,8 @@ export function ProductNewEditForm({ currentProduct }: Props) {
};
try {
await new Promise((resolve) => setTimeout(resolve, 500));
reset();
// await new Promise((resolve) => setTimeout(resolve, 500));
// reset();
// sanitize file field
for (let i = 0; i < values.images.length; i++) {

View File

@@ -44,8 +44,6 @@ export function RenderCellCreatedAt({ params }: ParamsProps) {
}
export function RenderCellStock({ params }: ParamsProps) {
return <>helloworld</>;
return (
<Box sx={{ width: 1, typography: 'caption', color: 'text.secondary' }}>
<LinearProgress

View File

@@ -58,6 +58,18 @@ const HIDE_COLUMNS_TOGGLABLE = ['category', 'actions'];
export function ProductListView() {
const { t } = useTranslation();
const PRODUCT_STOCK_OPTIONS = [
{ value: 'in stock', label: t('In stock') },
{ value: 'low stock', label: t('Low stock') },
{ value: 'out of stock', label: t('Out of stock') },
];
const PUBLISH_OPTIONS = [
{ value: 'published', label: t('Published') },
{ value: 'draft', label: t('Draft') },
];
const confirmDeleteMultiItemsDialog = useBoolean();
const confirmDeleteSingleItemDialog = useBoolean();
@@ -75,17 +87,6 @@ export function ProductListView() {
const [columnVisibilityModel, setColumnVisibilityModel] =
useState<GridColumnVisibilityModel>(HIDE_COLUMNS);
const PRODUCT_STOCK_OPTIONS = [
{ value: 'in stock', label: t('In stock') },
{ value: 'low stock', label: t('Low stock') },
{ value: 'out of stock', label: t('Out of stock') },
];
const PUBLISH_OPTIONS = [
{ value: 'published', label: t('Published') },
{ value: 'draft', label: t('Draft') },
];
useEffect(() => {
if (products.length) {
setTableData(products);