| | 1 | = UC0001 - View Member Profile and Membership History = |
| | 2 | |
| | 3 | '''Initiating actor:''' Board Member |
| | 4 | |
| | 5 | A Board Member views the stored data for a selected BEST Skopje member. The goal is to see the member's profile, current membership stage, mentor, current organisational function, previous membership stages, and applications. |
| | 6 | |
| | 7 | == Scenario == |
| | 8 | |
| | 9 | 1. The Board Member opens the administration page and searches for members named Dario. |
| | 10 | |
| | 11 | 2. The application shows a list of members that include the name Dario in their first or last name. |
| | 12 | |
| | 13 | {{{#!sql |
| | 14 | SELECT |
| | 15 | s.student_index, |
| | 16 | s.first_name, |
| | 17 | s.last_name, |
| | 18 | s.faculty, |
| | 19 | hs.ms_name AS current_membership_stage |
| | 20 | FROM students s |
| | 21 | JOIN members m |
| | 22 | ON m.student_index = s.student_index |
| | 23 | LEFT JOIN has_stage hs |
| | 24 | ON hs.student_index = s.student_index |
| | 25 | AND hs.valid_to IS NULL |
| | 26 | WHERE lower(s.first_name) LIKE lower('%Dario%') |
| | 27 | OR lower(s.last_name) LIKE lower('%Dario%') |
| | 28 | ORDER BY s.last_name, s.first_name; |
| | 29 | }}} |
| | 30 | |
| | 31 | 3. The Board Member selects Dario Petreski. |
| | 32 | |
| | 33 | 4. The application shows the selected member profile. |
| | 34 | |
| | 35 | {{{#!sql |
| | 36 | SELECT |
| | 37 | s.student_index, |
| | 38 | s.first_name, |
| | 39 | s.last_name, |
| | 40 | s.faculty, |
| | 41 | s.field_of_studies, |
| | 42 | s.year_of_studies, |
| | 43 | s.email, |
| | 44 | s.phone_number, |
| | 45 | hs.ms_name AS current_membership_stage, |
| | 46 | hs.valid_from AS current_stage_valid_from, |
| | 47 | ym.mentor_index, |
| | 48 | mentor.first_name AS mentor_first_name, |
| | 49 | mentor.last_name AS mentor_last_name, |
| | 50 | iof.of_title AS current_organizational_function, |
| | 51 | iof.mandate |
| | 52 | FROM students s |
| | 53 | JOIN members m |
| | 54 | ON m.student_index = s.student_index |
| | 55 | LEFT JOIN has_stage hs |
| | 56 | ON hs.student_index = s.student_index |
| | 57 | AND hs.valid_to IS NULL |
| | 58 | LEFT JOIN young_members ym |
| | 59 | ON ym.student_index = s.student_index |
| | 60 | LEFT JOIN students mentor |
| | 61 | ON mentor.student_index = ym.mentor_index |
| | 62 | LEFT JOIN is_organizational_function iof |
| | 63 | ON iof.student_index = s.student_index |
| | 64 | AND iof.mandate = '2025/2026' |
| | 65 | WHERE s.student_index = 230024; |
| | 66 | }}} |
| | 67 | |
| | 68 | 5. The application shows the member's membership stage history. |
| | 69 | |
| | 70 | {{{#!sql |
| | 71 | SELECT |
| | 72 | hs.ms_name, |
| | 73 | hs.valid_from, |
| | 74 | hs.valid_to |
| | 75 | FROM has_stage hs |
| | 76 | WHERE hs.student_index = 230024 |
| | 77 | ORDER BY hs.valid_from; |
| | 78 | }}} |
| | 79 | |
| | 80 | 6. The application shows the member's applications. |
| | 81 | |
| | 82 | {{{#!sql |
| | 83 | SELECT |
| | 84 | a.application_id, |
| | 85 | a.et_name, |
| | 86 | a.event_title, |
| | 87 | a.event_start_time, |
| | 88 | a.function_name, |
| | 89 | a.application_type, |
| | 90 | a.application_status |
| | 91 | FROM applications a |
| | 92 | WHERE a.student_index = 230024 |
| | 93 | ORDER BY a.event_start_time, a.application_id; |
| | 94 | }}} |