hostelReportsMenu function

Future<void> hostelReportsMenu(
  1. VtopClient client
)

Implementation

Future<void> hostelReportsMenu(VtopClient client) async {
  try {
    print('=== Hostel Reports ===');
    print('1. Hostel Outing Report');
    print('2. Hostel Leave Report');
    print('3. Submit Outing Form');
    print('0. Back to main menu');
    stdout.write('Select option (0-3): ');

    final choice = stdin.readLineSync() ?? '';

    switch (choice) {
      case '1':
        await fetchAndDisplayHostelReport(client);
        break;
      case '2':
        await fetchAndDisplayHostelLeaveReport(client);
        break;
      case '3':
        await submitOutingForm(client);
        break;
      case '0':
        return;
      default:
        print('Invalid option.\n');
    }
  } catch (e) {
    print('Error in hostel reports menu: $e\n');
  }
}