@fadyshawky/react-native-magic 2.0.4 → 2.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (110) hide show
  1. package/package.json +1 -1
  2. package/template/src/common/ImageResources.g.ts +33 -1
  3. package/template/src/common/components/Background.tsx +3 -1
  4. package/template/src/common/components/Container.tsx +1 -1
  5. package/template/src/common/components/OTPInput.tsx +3 -2
  6. package/template/src/common/components/PrimaryButton.tsx +23 -23
  7. package/template/src/common/components/PrimaryTextInput.tsx +189 -199
  8. package/template/src/common/components/RadioIcon.tsx +4 -4
  9. package/template/src/common/components/SafeText.tsx +41 -0
  10. package/template/src/common/components/SearchBar.tsx +19 -17
  11. package/template/src/common/components/TryAgain.tsx +3 -3
  12. package/template/src/common/localization/localization.ts +10 -0
  13. package/template/src/common/localization/translations/commonLocalization.ts +97 -0
  14. package/template/src/common/localization/translations/homeLocalization.ts +24 -0
  15. package/template/src/common/localization/translations/loginLocalization.ts +28 -2
  16. package/template/src/common/localization/translations/mainNavigationLocalization.ts +30 -0
  17. package/template/src/common/localization/translations/navigationLocalization.ts +48 -0
  18. package/template/src/common/localization/translations/otpLocalization.ts +28 -0
  19. package/template/src/common/localization/translations/passwordLocalization.ts +54 -0
  20. package/template/src/common/localization/translations/posLocalization.ts +196 -0
  21. package/template/src/common/utils/FeesCaalculation.tsx +37 -0
  22. package/template/src/common/utils/index.tsx +11 -0
  23. package/template/src/common/utils/printData.tsx +161 -0
  24. package/template/src/common/validations/errorValidations.ts +3 -2
  25. package/template/src/components/PrinterExample.js +226 -0
  26. package/template/src/core/api/serverHeaders.ts +62 -1
  27. package/template/src/core/store/Categories/categoryActions.ts +33 -0
  28. package/template/src/core/store/Categories/categorySlice.ts +75 -0
  29. package/template/src/core/store/Categories/categoryState.ts +41 -0
  30. package/template/src/core/store/Providers/providersActions.ts +102 -0
  31. package/template/src/core/store/Providers/providersSlice.ts +136 -0
  32. package/template/src/core/store/Providers/providersState.ts +37 -0
  33. package/template/src/core/store/Services/servicesActions.ts +191 -0
  34. package/template/src/core/store/Services/servicesSlice.ts +205 -0
  35. package/template/src/core/store/Services/servicesState.ts +466 -0
  36. package/template/src/core/store/app/appSlice.ts +13 -5
  37. package/template/src/core/store/app/appState.ts +10 -2
  38. package/template/src/core/store/rootReducer.ts +6 -1
  39. package/template/src/core/store/store.tsx +55 -2
  40. package/template/src/core/store/user/userActions.ts +164 -26
  41. package/template/src/core/store/user/userSlice.ts +193 -21
  42. package/template/src/core/store/user/userState.ts +148 -25
  43. package/template/src/core/theme/colors.ts +70 -94
  44. package/template/src/core/theme/commonConsts.ts +1 -1
  45. package/template/src/core/theme/commonSizes.ts +94 -119
  46. package/template/src/core/theme/commonStyles.ts +22 -22
  47. package/template/src/core/theme/fonts.ts +14 -13
  48. package/template/src/core/theme/themes.ts +75 -386
  49. package/template/src/core/theme/types.ts +15 -201
  50. package/template/src/core/utils/stringUtils.ts +114 -0
  51. package/template/src/modules/SunmiCard.js +212 -0
  52. package/template/src/modules/SunmiPrepaid.ts +122 -0
  53. package/template/src/navigation/AuthStack.tsx +8 -0
  54. package/template/src/navigation/HeaderComponents.tsx +76 -1
  55. package/template/src/navigation/MainNavigation.tsx +3 -1
  56. package/template/src/navigation/MainStack.tsx +130 -56
  57. package/template/src/navigation/TabBar.tsx +111 -59
  58. package/template/src/navigation/types.ts +24 -0
  59. package/template/src/screens/Categories/Categories.tsx +141 -0
  60. package/template/src/screens/Categories/hooks/useCategoriesData.ts +33 -0
  61. package/template/src/screens/Categories/types.ts +7 -0
  62. package/template/src/screens/Favorites/Favorites.tsx +130 -0
  63. package/template/src/screens/ForceChangePassword/ForceChangePasswordScreen.tsx +155 -0
  64. package/template/src/screens/History/History.tsx +430 -0
  65. package/template/src/screens/History/hooks/useHistoryData.ts +49 -0
  66. package/template/src/screens/History/types.ts +7 -0
  67. package/template/src/screens/InquiredBill/InquiredBill.tsx +443 -0
  68. package/template/src/screens/InquiredBill/hooks/useInquiredData.ts +91 -0
  69. package/template/src/screens/Login/Login.tsx +85 -85
  70. package/template/src/screens/OTP/OTPScreen.tsx +170 -0
  71. package/template/src/screens/PaymentConfirmation/PaymentConfirmation.tsx +326 -0
  72. package/template/src/screens/Providers/Providers.tsx +166 -0
  73. package/template/src/screens/Providers/hooks/useProvidersData.ts +33 -0
  74. package/template/src/screens/Providers/types.ts +7 -0
  75. package/template/src/screens/ReceiptScreen/ReceiptScreen.tsx +181 -0
  76. package/template/src/screens/ReceiptScreen/hooks/useReceiptData.ts +46 -0
  77. package/template/src/screens/ReceiptScreen/utils/utils.tsx +156 -0
  78. package/template/src/screens/Services/Services.tsx +144 -0
  79. package/template/src/screens/Services/hooks/useServicesData.ts +41 -0
  80. package/template/src/screens/SingleService/Components/FawryInputs.tsx +446 -0
  81. package/template/src/screens/SingleService/SingleService.tsx +229 -0
  82. package/template/src/screens/SingleService/hooks/useServiceData.ts +164 -0
  83. package/template/src/screens/home/Components/PayByCode.tsx +129 -0
  84. package/template/src/screens/home/HomeScreen.tsx +268 -77
  85. package/template/src/screens/home/hooks/useHomeData.ts +32 -38
  86. package/template/src/screens/index.tsx +24 -0
  87. package/template/src/screens/profile/Profile.tsx +290 -2
  88. package/template/src/services/SunmiPrinterInternal.js +268 -0
  89. package/template/src/types/sunmiPrepaid.d.ts +20 -0
  90. package/template/src/utils/SunmiPrinter.ts +442 -0
  91. package/template/src/utils/feesCalculator.ts +92 -0
  92. package/template/src/common/components/Stepper.tsx +0 -153
  93. package/template/src/common/components/Svg.tsx +0 -25
  94. package/template/src/common/hooks/useDebounce.ts +0 -17
  95. package/template/src/common/hooks/usePrevious.ts +0 -11
  96. package/template/src/common/localization/intlFormatter.ts +0 -37
  97. package/template/src/common/urls/emailUrl.ts +0 -20
  98. package/template/src/common/urls/mapUrl.ts +0 -22
  99. package/template/src/common/utils/listHandlers.ts +0 -30
  100. package/template/src/common/utils/serializeQueryParams.ts +0 -10
  101. package/template/src/common/validations/hooks/useDatesError.ts +0 -40
  102. package/template/src/common/validations/profileValidations.ts +0 -30
  103. package/template/src/core/theme/shadows.ts +0 -135
  104. package/template/src/navigation/TopTabBar.tsx +0 -77
  105. package/template/src/screens/Settings/Settings.tsx +0 -5
  106. package/template/src/screens/home/components/CarouselSection.tsx +0 -79
  107. package/template/src/screens/home/components/FeaturedCarousel.tsx +0 -128
  108. package/template/src/screens/main/Main.tsx +0 -5
  109. package/template/src/screens/registration/RegistrationScreen.tsx +0 -198
  110. package/template/src/screens/resetPassword/ForgotPasswordScreen.tsx +0 -129
@@ -25,5 +25,102 @@ export const commonLocalization = {
25
25
  settings: 'Settings',
26
26
  required: ' (required)',
27
27
  optional: ' (optional)',
28
+ currency: 'EGP',
29
+ seeMore: 'See More',
30
+ restartRequired: 'Restart Required',
31
+ restartAppMessage: 'The app needs to restart to apply language changes.',
32
+ restart: 'Restart',
33
+ change: 'Change',
34
+ submit: 'Submit',
35
+ billAmount: 'Bill Amount',
36
+ fullAmount: 'Full Amount',
37
+ partialAmount: 'Other Amount',
38
+ enterAmount: 'Enter Amount',
39
+ paymentDetails: 'Payment Details',
40
+ amount: 'Amount',
41
+ fees: 'Fees',
42
+ total: 'Total',
43
+ favoriteCategories: 'Favorite Categories',
44
+ favoriteProviders: 'Favorite Providers',
45
+ noFavoriteCategories: 'No favorite categories yet',
46
+ noFavoriteProviders: 'No favorite providers yet',
47
+ commission: 'Commission',
48
+ dueDate: 'Due Date',
49
+ issueDate: 'Issue Date',
50
+ print: 'Print',
51
+ allServices: 'All Services',
52
+ totalAfterFees: 'Total after service fees',
53
+ quantity: 'Quantity',
54
+ amountToPay: 'Amount to Pay',
55
+ voucher: 'Voucher',
56
+ invalidAccountNumber: 'Invalid account number',
57
+ otherAmount: 'Other Amount',
58
+ error: 'Error',
59
+ invalid_format: 'Invalid format',
60
+ otherAmountLabel: 'Other Amount',
61
+ backToHome: 'Back to Home',
62
+ confirm: 'Confirm',
63
+ },
64
+ ar: {
65
+ search: 'بحث',
66
+ selectPhoto: 'اختر صورة',
67
+ takePhoto: 'التقط صورة',
68
+ chooseFromLibrary: 'اختر من المكتبة',
69
+ cancel: 'إلغاء',
70
+ reject: 'رفض',
71
+ delete: 'حذف',
72
+ back: 'رجوع',
73
+ next: 'التالي',
74
+ done: 'تم',
75
+ ok: 'موافق',
76
+ continue: 'استمرار',
77
+ save: 'حفظ',
78
+ loading: 'جاري التحميل',
79
+ photo: 'صورة',
80
+ yes: 'نعم',
81
+ no: 'لا',
82
+ areYouSure: 'هل أنت متأكد؟',
83
+ warning: 'تحذير',
84
+ success: 'نجاح',
85
+ select: 'اختر',
86
+ dataSuccessfullyUpdated: 'تم تحديث البيانات بنجاح',
87
+ settings: 'الإعدادات',
88
+ required: ' (مطلوب)',
89
+ optional: ' (اختياري)',
90
+ currency: 'ج.م',
91
+ seeMore: 'عرض المزيد',
92
+ restartRequired: 'إعادة التشغيل مطلوبة',
93
+ restartAppMessage: 'يحتاج التطبيق إلى إعادة التشغيل لتطبيق تغييرات اللغة.',
94
+ restart: 'إعادة تشغيل',
95
+ change: 'تغيير',
96
+ submit: 'إرسال',
97
+ billAmount: 'مبلغ الفاتورة',
98
+ fullAmount: 'المبلغ الكامل',
99
+ partialAmount: 'مبلغ آخر',
100
+ enterAmount: 'أدخل المبلغ',
101
+ paymentDetails: 'تفاصيل الدفع',
102
+ amount: 'المبلغ',
103
+ fees: 'الرسوم',
104
+ total: 'الإجمالي',
105
+ favoriteCategories: 'الفئات المفضلة',
106
+ favoriteProviders: 'مقدمي الخدمات المفضلين',
107
+ noFavoriteCategories: 'لا توجد فئات مفضلة بعد',
108
+ noFavoriteProviders: 'لا يوجد مقدمي خدمات مفضلين بعد',
109
+ commission: 'العمولة',
110
+ dueDate: 'الموعد المستحق',
111
+ issueDate: 'التاريخ الصادر',
112
+ print: 'طباعة',
113
+ allServices: 'جميع الخدمات',
114
+ totalAfterFees: 'بعد رسوم الخدمة',
115
+ quantity: 'الكمية',
116
+ amountToPay: 'قيمة الدفع',
117
+ voucher: 'القسيمة',
118
+ otherAmount: 'مبلغ آخر',
119
+ invalidAccountNumber: 'رقم الحساب غير صالح',
120
+ error: 'خطأ',
121
+ invalid_format: 'صيغة غير صالحة',
122
+ otherAmountLabel: 'مبلغ آخر',
123
+ backToHome: 'العودة للرئيسية',
124
+ confirm: 'تأكيد',
28
125
  },
29
126
  };
@@ -2,5 +2,29 @@ export const homeLocalization = {
2
2
  en: {
3
3
  welcome: 'Hi ',
4
4
  home: 'Home',
5
+ currentBalance: 'Current\nBalance',
6
+ dailyCommission: 'Daily\nCommission',
7
+ services: 'Services',
8
+ categories: 'Categories',
9
+ providers: 'Providers',
10
+ seeAll: 'See All',
11
+ enterCode: 'Enter Code',
12
+ cancel: 'Cancel',
13
+ search: 'Search',
14
+ payByCode: 'Pay by Code',
15
+ },
16
+ ar: {
17
+ welcome: 'مرحباً ',
18
+ home: 'الرئيسية',
19
+ currentBalance: 'الرصيد\nالحالي',
20
+ dailyCommission: 'العمولة\nاليومية',
21
+ services: 'الخدمات',
22
+ categories: 'الفئات',
23
+ providers: 'مقدمي الخدمات',
24
+ seeAll: 'عرض الكل',
25
+ enterCode: 'أدخل الرمز',
26
+ cancel: 'إلغاء',
27
+ search: 'بحث',
28
+ payByCode: 'دفع بكود الخدمة',
5
29
  },
6
30
  };
@@ -3,13 +3,12 @@ export const loginLocalization = {
3
3
  Login: 'Login',
4
4
  welcome: 'Welcome',
5
5
  Email: 'Email',
6
- EnterEmail: 'Enter email',
6
+ EnterPhone: 'Enter phone',
7
7
  Password: 'Password',
8
8
  EnterPassword: 'Enter password',
9
9
  forgetPassword: 'Forgot Password?',
10
10
  continue: 'continue',
11
11
  notMember: 'Not a member? Register now',
12
- findNursery: 'Find nursery',
13
12
  registration: {
14
13
  title: 'Create Account',
15
14
  fullName: 'Full Name',
@@ -27,4 +26,31 @@ export const loginLocalization = {
27
26
  backToLogin: 'Back to Login',
28
27
  },
29
28
  },
29
+ ar: {
30
+ Login: 'تسجيل الدخول',
31
+ welcome: 'مرحباً',
32
+ Email: 'البريد الإلكتروني',
33
+ EnterPhone: 'أدخل الهاتف',
34
+ Password: 'كلمة المرور',
35
+ EnterPassword: 'أدخل كلمة المرور',
36
+ forgetPassword: 'نسيت كلمة المرور؟',
37
+ continue: 'استمرار',
38
+ notMember: 'لست عضواً؟ سجل الآن',
39
+ registration: {
40
+ title: 'إنشاء حساب',
41
+ fullName: 'الاسم الكامل',
42
+ email: 'البريد الإلكتروني',
43
+ password: 'كلمة المرور',
44
+ confirmPassword: 'تأكيد كلمة المرور',
45
+ register: 'تسجيل',
46
+ alreadyHaveAccount: 'لديك حساب بالفعل؟ تسجيل الدخول',
47
+ },
48
+ forgotPassword: {
49
+ title: 'نسيت كلمة المرور',
50
+ description:
51
+ 'أدخل بريدك الإلكتروني وسنرسل لك تعليمات لإعادة تعيين كلمة المرور.',
52
+ resetPassword: 'إعادة تعيين كلمة المرور',
53
+ backToLogin: 'العودة إلى تسجيل الدخول',
54
+ },
55
+ },
30
56
  };
@@ -0,0 +1,30 @@
1
+ export const mainNavigationLocalization = {
2
+ en: {
3
+ tabs: {
4
+ Main: 'Services',
5
+ Favorites: 'Favorites',
6
+ Financials: 'Financials',
7
+ Account: 'Account',
8
+ },
9
+ screens: {
10
+ Home: 'Home',
11
+ Settings: 'Settings',
12
+ ForceChangePassword: 'Change Password',
13
+ Services: 'Services',
14
+ },
15
+ },
16
+ ar: {
17
+ tabs: {
18
+ Main: 'الخدمات',
19
+ Favorites: 'المفضلة',
20
+ Financials: 'المالية',
21
+ Account: 'الحساب',
22
+ },
23
+ screens: {
24
+ Home: 'الرئيسية',
25
+ Settings: 'الإعدادات',
26
+ ForceChangePassword: 'تغيير كلمة المرور',
27
+ Services: 'الخدمات',
28
+ },
29
+ },
30
+ };
@@ -0,0 +1,48 @@
1
+ export const navigationLocalization = {
2
+ en: {
3
+ screens: {
4
+ // Auth Stack
5
+ Splash: 'Splash',
6
+ Login: 'Login',
7
+ OTP: 'Verification',
8
+ ForceChangePassword: 'Change Password',
9
+ ForgotPassword: 'Forgot Password',
10
+ Registration: 'Registration',
11
+
12
+ // Main Stack
13
+ Home: 'Home',
14
+ Profile: 'Profile',
15
+ Settings: 'Settings',
16
+ Notifications: 'Notifications',
17
+
18
+ // Tab Bar
19
+ HomeTab: 'Home',
20
+ ProfileTab: 'Profile',
21
+ SettingsTab: 'Settings',
22
+ NotificationsTab: 'Notifications',
23
+ },
24
+ },
25
+ ar: {
26
+ screens: {
27
+ // Auth Stack
28
+ Splash: 'البداية',
29
+ Login: 'تسجيل الدخول',
30
+ OTP: 'التحقق',
31
+ ForceChangePassword: 'تغيير كلمة المرور',
32
+ ForgotPassword: 'نسيت كلمة المرور',
33
+ Registration: 'التسجيل',
34
+
35
+ // Main Stack
36
+ Home: 'الرئيسية',
37
+ Profile: 'الملف الشخصي',
38
+ Settings: 'الإعدادات',
39
+ Notifications: 'الإشعارات',
40
+
41
+ // Tab Bar
42
+ HomeTab: 'الرئيسية',
43
+ ProfileTab: 'الملف الشخصي',
44
+ SettingsTab: 'الإعدادات',
45
+ NotificationsTab: 'الإشعارات',
46
+ },
47
+ },
48
+ };
@@ -0,0 +1,28 @@
1
+ export const otpLocalization = {
2
+ en: {
3
+ title: 'Verification',
4
+ subtitle: 'Enter the verification code sent to your phone',
5
+ didntReceiveCode: "Didn't receive code?",
6
+ resendIn: 'Resend code in {0}s',
7
+ resend: 'Resend',
8
+ verify: 'Verify',
9
+ invalidCode: 'Invalid verification code',
10
+ verificationFailed: 'Verification failed',
11
+ verificationSuccess: 'Verification successful',
12
+ resendSuccess: 'Code resent successfully',
13
+ resendFailed: 'Failed to resend code',
14
+ },
15
+ ar: {
16
+ title: 'التحقق',
17
+ subtitle: 'أدخل رمز التحقق المرسل إلى هاتفك',
18
+ didntReceiveCode: 'لم تستلم الرمز؟',
19
+ resendIn: 'إعادة إرسال الرمز خلال {0} ثانية',
20
+ resend: 'إعادة إرسال',
21
+ verify: 'تحقق',
22
+ invalidCode: 'رمز التحقق غير صالح',
23
+ verificationFailed: 'فشل التحقق',
24
+ verificationSuccess: 'تم التحقق بنجاح',
25
+ resendSuccess: 'تم إعادة إرسال الرمز بنجاح',
26
+ resendFailed: 'فشل إعادة إرسال الرمز',
27
+ },
28
+ };
@@ -0,0 +1,54 @@
1
+ export const passwordLocalization = {
2
+ en: {
3
+ forceChange: {
4
+ title: 'Change Password',
5
+ subtitle: 'Please change your password to continue',
6
+ currentPassword: 'Current Password',
7
+ enterCurrentPassword: 'Enter current password',
8
+ newPassword: 'New Password',
9
+ enterNewPassword: 'Enter new password',
10
+ confirmPassword: 'Confirm Password',
11
+ confirmNewPassword: 'Confirm new password',
12
+ changePassword: 'Change Password',
13
+ passwordChanged: 'Password changed successfully',
14
+ passwordChangeFailed: 'Failed to change password',
15
+ passwordsDoNotMatch: 'Passwords do not match',
16
+ invalidCurrentPassword: 'Invalid current password',
17
+ invalidNewPassword: 'Invalid new password',
18
+ },
19
+ forgot: {
20
+ title: 'Forgot Password',
21
+ subtitle: 'Enter your email to reset your password',
22
+ resetPassword: 'Reset Password',
23
+ backToLogin: 'Back to Login',
24
+ resetEmailSent: 'Password reset email sent',
25
+ resetEmailFailed: 'Failed to send reset email',
26
+ },
27
+ },
28
+ ar: {
29
+ forceChange: {
30
+ title: 'تغيير كلمة المرور',
31
+ subtitle: 'يرجى تغيير كلمة المرور للمتابعة',
32
+ currentPassword: 'كلمة المرور الحالية',
33
+ enterCurrentPassword: 'أدخل كلمة المرور الحالية',
34
+ newPassword: 'كلمة المرور الجديدة',
35
+ enterNewPassword: 'أدخل كلمة المرور الجديدة',
36
+ confirmPassword: 'تأكيد كلمة المرور',
37
+ confirmNewPassword: 'تأكيد كلمة المرور الجديدة',
38
+ changePassword: 'تغيير كلمة المرور',
39
+ passwordChanged: 'تم تغيير كلمة المرور بنجاح',
40
+ passwordChangeFailed: 'فشل تغيير كلمة المرور',
41
+ passwordsDoNotMatch: 'كلمات المرور غير متطابقة',
42
+ invalidCurrentPassword: 'كلمة المرور الحالية غير صحيحة',
43
+ invalidNewPassword: 'كلمة المرور الجديدة غير صالحة',
44
+ },
45
+ forgot: {
46
+ title: 'نسيت كلمة المرور',
47
+ subtitle: 'أدخل بريدك الإلكتروني لإعادة تعيين كلمة المرور',
48
+ resetPassword: 'إعادة تعيين كلمة المرور',
49
+ backToLogin: 'العودة إلى تسجيل الدخول',
50
+ resetEmailSent: 'تم إرسال بريد إلكتروني لإعادة تعيين كلمة المرور',
51
+ resetEmailFailed: 'فشل إرسال بريد إعادة تعيين كلمة المرور',
52
+ },
53
+ },
54
+ };
@@ -0,0 +1,196 @@
1
+ export const posLocalization = {
2
+ en: {
3
+ // Common Labels
4
+ serialNumber: 'Serial Number',
5
+ serviceName: 'Service Name',
6
+ providerName: 'Provider Name',
7
+ customerNumber: 'Customer Number',
8
+ value: 'Value',
9
+ serviceCost: 'Service Cost',
10
+ operationNumber: 'Operation Number',
11
+ referenceNumber: 'Reference Number',
12
+ time: 'Time',
13
+ total: 'Total',
14
+
15
+ // Input Methods
16
+ scanner: 'Scanner',
17
+ keypad: 'Keypad',
18
+ keyboard: 'Keyboard',
19
+ touchPanel: 'Touch Panel',
20
+ button: 'Button',
21
+
22
+ // Actions
23
+ print: 'Print',
24
+ save: 'Save',
25
+ cancel: 'Cancel',
26
+ delete: 'Delete',
27
+ submit: 'Submit',
28
+
29
+ // Messages
30
+ success: 'Success',
31
+ error: 'Error',
32
+ required: 'This field is required',
33
+ invalidInput: 'Invalid input',
34
+
35
+ // Validation
36
+ enterValidAmount: 'Please enter a valid amount',
37
+ enterValidNumber: 'Please enter a valid number',
38
+ enterValidDate: 'Please enter a valid date',
39
+
40
+ // Printer
41
+ printerError: 'Printer Error',
42
+ printingError: 'Printing Error',
43
+ paperFeedError: 'Paper Feed Error',
44
+ qrCodeError: 'QR Code Error',
45
+ barcodeError: 'Barcode Error',
46
+ tableError: 'Table Error',
47
+ bufferError: 'Buffer Error',
48
+
49
+ // Bill
50
+ billAmount: 'Bill Amount',
51
+ billDetails: 'Bill Details',
52
+ billNumber: 'Bill Number',
53
+ billDate: 'Bill Date',
54
+ billStatus: 'Bill Status',
55
+
56
+ // Service
57
+ serviceDetails: 'Service Details',
58
+ serviceType: 'Service Type',
59
+ serviceStatus: 'Service Status',
60
+ serviceDate: 'Service Date',
61
+
62
+ // Customer
63
+ customerDetails: 'Customer Details',
64
+ customerName: 'Customer Name',
65
+ customerPhone: 'Customer Phone',
66
+ customerEmail: 'Customer Email',
67
+
68
+ // Payment
69
+ paymentMethod: 'Payment Method',
70
+ paymentStatus: 'Payment Status',
71
+ paymentDate: 'Payment Date',
72
+ paymentAmount: 'Payment Amount',
73
+
74
+ // Receipt
75
+ receiptNumber: 'Receipt Number',
76
+ receiptDate: 'Receipt Date',
77
+ receiptTime: 'Receipt Time',
78
+ receiptTotal: 'Receipt Total',
79
+ receiptStatus: 'Receipt Status',
80
+ expiryDate: 'Expiry Date',
81
+
82
+ // Printer Status
83
+ printerStatus_1: 'The printer works normally',
84
+ printerStatus_2: 'Preparing printer',
85
+ printerStatus_3: 'Abnormal communication',
86
+ printerStatus_4: 'The printer is out of paper',
87
+ printerStatus_5: 'Printer overheated',
88
+ printerStatus_6: 'Printer cover is open',
89
+ printerStatus_7: 'Unknown printer error',
90
+
91
+ title: 'Transaction Details',
92
+ trans_id: 'Transaction ID',
93
+ service: 'Service',
94
+ service_type: 'Service Type',
95
+ amount: 'Amount',
96
+ fees: 'Fees',
97
+ info_text: 'Details',
98
+ },
99
+ ar: {
100
+ // Common Labels
101
+ serialNumber: 'الرقم التسلسلي',
102
+ serviceName: 'اسم الخدمة',
103
+ providerName: 'اسم المقدم',
104
+ customerNumber: 'رقم العميل',
105
+ value: 'القيمة',
106
+ serviceCost: 'تكلفة الخدمة',
107
+ operationNumber: 'رقم العملية',
108
+ referenceNumber: 'الرقم المرجعي',
109
+ time: 'الوقت',
110
+ total: 'الإجمالي',
111
+
112
+ // Input Methods
113
+ scanner: 'الماسح الضوئي',
114
+ keypad: 'لوحة المفاتيح الرقمية',
115
+ keyboard: 'لوحة المفاتيح',
116
+ touchPanel: 'شاشة اللمس',
117
+ button: 'زر',
118
+
119
+ // Actions
120
+ print: 'طباعة',
121
+ save: 'حفظ',
122
+ cancel: 'إلغاء',
123
+ delete: 'حذف',
124
+ submit: 'إرسال',
125
+
126
+ // Messages
127
+ success: 'نجاح',
128
+ error: 'خطأ',
129
+ required: 'هذا الحقل مطلوب',
130
+ invalidInput: 'إدخال غير صالح',
131
+
132
+ // Validation
133
+ enterValidAmount: 'الرجاء إدخال مبلغ صحيح',
134
+ enterValidNumber: 'الرجاء إدخال رقم صحيح',
135
+ enterValidDate: 'الرجاء إدخال تاريخ صحيح',
136
+
137
+ // Printer
138
+ printerError: 'خطأ في الطابعة',
139
+ printingError: 'خطأ في الطباعة',
140
+ paperFeedError: 'خطأ في تغذية الورق',
141
+ qrCodeError: 'خطأ في رمز QR',
142
+ barcodeError: 'خطأ في الباركود',
143
+ tableError: 'خطأ في الجدول',
144
+ bufferError: 'خطأ في المخزن المؤقت',
145
+
146
+ // Bill
147
+ billAmount: 'مبلغ الفاتورة',
148
+ billDetails: 'تفاصيل الفاتورة',
149
+ billNumber: 'رقم الفاتورة',
150
+ billDate: 'تاريخ الفاتورة',
151
+ billStatus: 'حالة الفاتورة',
152
+
153
+ // Service
154
+ serviceDetails: 'تفاصيل الخدمة',
155
+ serviceType: 'نوع الخدمة',
156
+ serviceStatus: 'حالة الخدمة',
157
+ serviceDate: 'تاريخ الخدمة',
158
+
159
+ // Customer
160
+ customerDetails: 'تفاصيل العميل',
161
+ customerName: 'اسم العميل',
162
+ customerPhone: 'هاتف العميل',
163
+ customerEmail: 'بريد العميل',
164
+
165
+ // Payment
166
+ paymentMethod: 'طريقة الدفع',
167
+ paymentStatus: 'حالة الدفع',
168
+ paymentDate: 'تاريخ الدفع',
169
+ paymentAmount: 'مبلغ الدفع',
170
+
171
+ // Receipt
172
+ receiptNumber: 'رقم الإيصال',
173
+ receiptDate: 'تاريخ الإيصال',
174
+ receiptTime: 'وقت الإيصال',
175
+ receiptTotal: 'إجمالي الإيصال',
176
+ receiptStatus: 'حالة الإيصال',
177
+ expiryDate: 'تاريخ الانتهاء',
178
+
179
+ // Printer Status
180
+ printerStatus_1: 'الطابعة تعمل بشكل طبيعي',
181
+ printerStatus_2: 'جاري تجهيز الطابعة',
182
+ printerStatus_3: 'خطأ في الاتصال بالطابعة',
183
+ printerStatus_4: 'نفذ الورق من الطابعة',
184
+ printerStatus_5: 'الطابعة ساخنة جداً',
185
+ printerStatus_6: 'غطاء الطابعة مفتوح',
186
+ printerStatus_7: 'خطأ غير معروف في الطابعة',
187
+
188
+ title: 'تفاصيل المعاملة',
189
+ trans_id: 'معرف المعاملة',
190
+ service: 'الخدمة',
191
+ service_type: 'نوع الخدمة',
192
+ amount: 'المبلغ',
193
+ fees: 'مصاريف',
194
+ info_text: 'التفاصيل',
195
+ },
196
+ };
@@ -0,0 +1,37 @@
1
+ import {
2
+ Service,
3
+ TierEntity,
4
+ Percent1,
5
+ } from '../../core/store/Services/servicesState';
6
+
7
+ export function initFees(service: Service, amount: string) {
8
+ let fee = 0;
9
+ if (service?.Fees) {
10
+ for (const f of service.Fees) {
11
+ if (f.AcctType && f.AcctType !== 'SDA') continue;
12
+ fee = fee + calculateFees(Number(amount), f.Tier as TierEntity[]);
13
+ }
14
+ }
15
+ return fee;
16
+ }
17
+
18
+ export function calculateFees(amount: number, tiers: TierEntity[]) {
19
+ if (!tiers || !amount || amount < 0) return 0;
20
+
21
+ const tier = tiers.find(t => amount >= t.LowerAmt && amount <= t.UpperAmt);
22
+
23
+ if (!tier) return 0;
24
+
25
+ const fixed = tier.FixedAmt?.Amt || 0;
26
+ const percent = tier.Percent?.Value ? tier.Percent.Value / 100 : 0;
27
+ const minPercentFee = (tier.Percent as Percent1)?.MinAmt || 0;
28
+ const maxPercentFee = tier.Percent?.MaxAmt || 0;
29
+ const calculatedPercentFee = Number((percent * amount).toFixed(2));
30
+
31
+ const percentFee = Math.min(
32
+ Math.max(calculatedPercentFee, minPercentFee),
33
+ maxPercentFee,
34
+ );
35
+
36
+ return fixed + percentFee;
37
+ }
@@ -0,0 +1,11 @@
1
+ // Fee calculation utilities
2
+ export {initFees, calculateFees} from './FeesCaalculation';
3
+
4
+ // State management utility
5
+ export {newState} from './newState';
6
+
7
+ // Size calculation utility
8
+ export {createPerfectSize} from './createPerfectSize';
9
+
10
+ // Print data utility
11
+ export {makePrintData} from './printData';