المجلدات وأسماء حزم dart واستيراداتها: siro_rider → intaleq_rider siro_driver → intaleq_driver siro_admin → intaleq_admin siro_service → intaleq_service شمل ذلك `name:` في كل pubspec وكل `package:siro_*` في الاستيرادات (115 ملفاً في rider وحده)، وإشارات أسماء المجلدات في docs/ وتعليق في backend/Admin/notifications/broadcast.php. لم تبقَ إشارة واحدة (تحقّقت). + ضُمّت حزم get و get_storage داخل intaleq_driver/packages/ وحُوّلت مساراتها الثلاثة من `../../Intaleq/packages/*` إلى `./packages/*`. كانت تُحل عرضاً إلى مجلد App/Intaleq القديم المجاور — تبعية خارج المستودع تنكسر بأول نقل. لم يبقَ في أي تطبيق تبعية مسار خارج الشجرة. ⚠️ لم تُمسّ بعد: هويات المتاجر (applicationId · PRODUCT_BUNDLE_IDENTIFIER · shorebird app_id) ولا الألوان ولا النصوص المرئية ولا النطاقات — كل منها كوميت منفصل، والهويات تحتاج قرار المالك. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
67 lines
1.8 KiB
Dart
67 lines
1.8 KiB
Dart
import 'package:get/get.dart';
|
|
import 'package:intaleq_rider/constant/box_name.dart';
|
|
import 'package:intaleq_rider/main.dart';
|
|
|
|
class PaymentTier {
|
|
final double amount;
|
|
final double bonus;
|
|
const PaymentTier(this.amount, this.bonus);
|
|
}
|
|
|
|
class PaymentTierConfig {
|
|
final String currencyCode;
|
|
final List<PaymentTier> tiers;
|
|
const PaymentTierConfig({required this.currencyCode, required this.tiers});
|
|
|
|
static const Map<String, PaymentTierConfig> _configs = {
|
|
'Jordan': PaymentTierConfig(
|
|
currencyCode: 'JOD',
|
|
tiers: [
|
|
PaymentTier(5, 0),
|
|
PaymentTier(10, 0.5),
|
|
PaymentTier(20, 1),
|
|
PaymentTier(50, 3),
|
|
],
|
|
),
|
|
'Egypt': PaymentTierConfig(
|
|
currencyCode: 'EGP',
|
|
tiers: [
|
|
PaymentTier(100, 0),
|
|
PaymentTier(200, 10),
|
|
PaymentTier(400, 20),
|
|
PaymentTier(1000, 50),
|
|
],
|
|
),
|
|
'Syria': PaymentTierConfig(
|
|
currencyCode: 'SYP',
|
|
tiers: [
|
|
PaymentTier(100, 0),
|
|
PaymentTier(200, 10),
|
|
PaymentTier(400, 20),
|
|
PaymentTier(1000, 50),
|
|
],
|
|
),
|
|
};
|
|
|
|
static PaymentTierConfig get current {
|
|
final country = box.read(BoxName.countryCode) ?? 'Jordan';
|
|
return _configs[country] ?? _configs['Jordan']!;
|
|
}
|
|
|
|
static List<PaymentTier> get currentTiers => current.tiers;
|
|
static String get currentCurrency => current.currencyCode;
|
|
|
|
static String formatAmount(double v) {
|
|
return v == v.roundToDouble() ? v.toInt().toString() : v.toStringAsFixed(1);
|
|
}
|
|
|
|
static String tierLabel(int index) {
|
|
final t = currentTiers[index];
|
|
final cur = currentCurrency;
|
|
if (t.bonus > 0) {
|
|
return '${'Pay'.tr} ${formatAmount(t.amount)} $cur, ${'Get'.tr} ${formatAmount(t.amount + t.bonus)} $cur';
|
|
}
|
|
return '${formatAmount(t.amount)} $cur';
|
|
}
|
|
}
|