refactor: إعادة تسمية التطبيقات الأربعة siro_* → intaleq_*
المجلدات وأسماء حزم 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>
This commit is contained in:
co-authored by
Claude Opus 5
parent
92dc6b3641
commit
0aab85c732
@@ -0,0 +1,110 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
|
||||
import '../../../constant/box_name.dart';
|
||||
import '../../../constant/links.dart';
|
||||
import '../../../controller/functions/crud.dart';
|
||||
import '../../../main.dart';
|
||||
import '../../widgets/error_snakbar.dart';
|
||||
|
||||
class DriverCarController extends GetxController {
|
||||
bool isLoading = false;
|
||||
List cars = [];
|
||||
// int? carId;
|
||||
fetchCatrsForDrivers() async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().get(link: AppLink.getNewCarsDrivers, payload: {
|
||||
"driverID": box.read(BoxName.driverID).toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
var d = jsonDecode(res)['message'];
|
||||
cars = d;
|
||||
// carId = cars.isEmpty ? 1 : cars.length + 1;
|
||||
}
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
addCarsForDrivers(
|
||||
String vin,
|
||||
String carPlate,
|
||||
String make,
|
||||
String model,
|
||||
String year,
|
||||
String expirationDate,
|
||||
String color,
|
||||
String colorHex,
|
||||
String address,
|
||||
String owner,
|
||||
String registrationDate,
|
||||
String displacement,
|
||||
String fuel) async {
|
||||
var res = await CRUD().post(
|
||||
link: AppLink.addRegisrationCar,
|
||||
payload: {
|
||||
"driverID": box.read(BoxName.driverID).toString(),
|
||||
"vin": vin ?? 'unknown',
|
||||
"car_plate": carPlate.toString(),
|
||||
"make": make ?? 'unknown',
|
||||
"model": model ?? 'unknown',
|
||||
"year": year ?? 'unknown',
|
||||
"expiration_date": expirationDate ?? 'unknown',
|
||||
"color": color ?? 'unknown',
|
||||
"owner": owner ?? 'unknown',
|
||||
"color_hex": colorHex ?? '#000000',
|
||||
"address": address ?? 'unknown',
|
||||
"displacement": displacement ?? 'unknown',
|
||||
"fuel": fuel ?? 'unknown',
|
||||
"registration_date": registrationDate ?? 'unknown',
|
||||
},
|
||||
);
|
||||
if (res != 'failure') {
|
||||
mySnackbarSuccess('');
|
||||
|
||||
fetchCatrsForDrivers();
|
||||
} else {
|
||||
mySnackbarError('');
|
||||
}
|
||||
}
|
||||
|
||||
// update carRegistration only and insert on it without tow column
|
||||
Future<void> updateCarRegistration(String id, String driverID) async {
|
||||
final body = {
|
||||
'id': id,
|
||||
'driverID': driverID,
|
||||
};
|
||||
// remove default before update
|
||||
var response = await CRUD().post(
|
||||
link: AppLink.makeDefaultCar,
|
||||
payload: body,
|
||||
);
|
||||
|
||||
if (response != 'failure') {
|
||||
mySnackbarSuccess('Updated'.tr);
|
||||
} else {
|
||||
mySnackbarError('Not updated'.tr);
|
||||
}
|
||||
}
|
||||
|
||||
//todo need review
|
||||
removeCar(String carId) async {
|
||||
isLoading = true;
|
||||
update();
|
||||
var res = await CRUD().post(link: AppLink.deleteNewCarsDrivers, payload: {
|
||||
"id": carId.toString(),
|
||||
});
|
||||
if (res != 'failure') {
|
||||
mySnackbarSuccess('deleted'.tr);
|
||||
}
|
||||
isLoading = false;
|
||||
update();
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
fetchCatrsForDrivers();
|
||||
super.onInit();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user