feat: enhance order submission flow and UI improvements

- Updated categories component to improve loading state and category display.
- Modified order section to handle payment submission with event payload.
- Refactored payment form dialog to emit order response on successful payment.
- Adjusted order response model to enforce required fields.
- Improved root component layout and added success dialog for order submission.
- Enhanced sale invoice card component to use new TSP API methods.
- Updated API routes for sale invoices to reflect TSP changes.
- Improved user interface for business activities and partners sections.
- Added card shadow styling for better visual hierarchy.
- Introduced new order submitted dialog component for post-order actions.
- Cleaned up console logs and improved code readability across components.
This commit is contained in:
2026-05-08 18:08:57 +03:30
parent ce40bd8c75
commit a138034c06
40 changed files with 375 additions and 212 deletions
@@ -70,19 +70,19 @@ export class NativeBridgeService {
pay(request: INativePayRequest): any {
if (request.amount <= 10_000) {
const errorMessage = 'برای مقادیر زیر ۱۰۰ هزار ریال، پرداخت ممکن نیست.';
this.toastService.error({ text: errorMessage, life: 3000 });
this.toastService.warn({ text: errorMessage, life: 3000 });
return {
success: false,
error: errorMessage,
};
}
this.toastService.info({ text: 'در حال پردازش پرداخت...', life: 3000 });
this.toastService.info({ text: 'در حال پردازش پرداخت...' });
try {
// @ts-ignore
window.NativeBridge.pay(request.amount, request.id || '');
return { success: true };
} catch (error) {
this.toastService.info({ text: (error as Error).message, life: 30000 });
this.toastService.info({ text: (error as Error).message });
return { success: false, error: (error as Error).message };
}
// const fn = window.NativeBridge.pay(123, 'test');
@@ -99,7 +99,7 @@ export class NativeBridgeService {
// // return { success: true, data: parsed ?? raw };
// } catch (error) {
// this.toastService.info({ text: (error as Error).message, life: 30000 });
// this.toastService.info({ text: (error as Error).message, });
// return { success: false, error: (error as Error).message };
// }
}
@@ -109,12 +109,16 @@ export class NativeBridgeService {
}
private invokePrint(payload: INativePrintRequest): INativeBridgeResult {
if (!this.isEnabled() || !this.canPrint()) {
this.toastService.warn({ text: 'متاسفانه ارتباط با چاپگر برقرار نیست.' });
return { success: false, error: 'متاسفانه ارتباط با چاپگر برقرار نیست.' };
}
try {
// @ts-ignore
window.NativeBridge.print(JSON.stringify([payload]));
return { success: true };
} catch (error) {
this.toastService.info({ text: (error as Error).message, life: 30000 });
this.toastService.warn({ text: 'متاسفانه ارتباط با چاپگر برقرار نیست.' });
return { success: false, error: (error as Error).message };
}
}