- GeminiService (integrations/gemini, @Global): extractDocument (OCR fields) + faceMatch; graceful if no GEMINI_API_KEY - documents: face-match now real via Gemini; POST /admin/documents/:id/ocr extracts fields for CS auto-fill - roles: PATCH /admin/users/:id/role (admin) + POST /platform/users/role (bootstrap via x-platform-secret) - config: gemini + platform.secret; .env.example entries Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
46 lines
1.2 KiB
Dart
46 lines
1.2 KiB
Dart
import 'dart:convert';
|
|
|
|
import 'package:Tripz/constant/box_name.dart';
|
|
import 'package:get/get.dart';
|
|
import 'package:Tripz/constant/links.dart';
|
|
import 'package:Tripz/controller/functions/crud.dart';
|
|
|
|
import '../../../main.dart';
|
|
|
|
class PromosController extends GetxController {
|
|
List<dynamic> promoList = [];
|
|
bool isLoading = true;
|
|
late String promos;
|
|
@override
|
|
void onInit() {
|
|
getPromoByToday();
|
|
super.onInit();
|
|
}
|
|
|
|
Future getPromoByToday() async {
|
|
var res = await CRUD().get(link: AppLink.getPromoBytody, payload: {
|
|
'passengerID': box.read(BoxName.passengerID).toString(),
|
|
});
|
|
if (res.toString() == 'failure') {
|
|
// Get.defaultDialog(
|
|
// title: 'No Promo for today .'.tr,
|
|
// middleText: '',
|
|
// titleStyle: AppStyle.title,
|
|
// confirm: MyElevatedButton(
|
|
// title: 'Back'.tr,
|
|
// onPressed: () {
|
|
// Get.back();
|
|
// Get.back();
|
|
// }));
|
|
isLoading = false;
|
|
update();
|
|
} else {
|
|
var jsonDecoded = jsonDecode(res);
|
|
|
|
promoList = jsonDecoded['message'];
|
|
isLoading = false;
|
|
update();
|
|
}
|
|
}
|
|
}
|