-
Notifications
You must be signed in to change notification settings - Fork 0
Sequence Diagrams
This page documents the dynamic behavior of the Neighborhood Accessibility Mapper system. Each section below represents a core use case scenario modeled using UML Sequence Diagrams.
The diagrams illustrate the interaction between Actors (Users, Admins) and System Components (Objects, Services), focusing on the message flow and focus of control.
-
Constructor Definition: The Sequence Diagram depicts the instantiation of
RegisteredUserfollowing a successful registration submission. The Class Diagram should be updated to include a constructor method:+RegisteredUser(email: String, fullName: String, passwordHash: String). -
Registration Data Collection:
GuestUser.register()is shown triggering a self-callcollectRegistrationData()to represent the form-filling step before credentials are submitted. This method is currently implied by theregister()interaction but not explicitly defined in the Class Diagram. The Class Diagram should be updated to include:+collectRegistrationData() : voidonGuestUser. -
Input Validation Abstraction: The
login()method onRegisteredUseris reused as the entry point for credential submission during registration. A self-callvalidateInputs(email, passwordHash, fullName)is introduced to represent pre-persistence validation logic (format checks, required fields). This should be considered a private helper method and added to the Class Diagram as:+validateInputs(email: String, passwordHash: String, fullName: String) : Boolean. -
MobilityProfile Factory Access:
MobilityProfilesetup is shown as a direct creation step following account activation, calledcreateMobilityProfile(mobilityAid, preferences). The Class Diagram definesMobilityProfileattributes and a0..1association toRegisteredUserbut includes no constructor or factory method. The Class Diagram should be updated to include:+MobilityProfile(mobilityAid: MobilityAidType, avoidStairs: Boolean, avoidSteepSlopes: Boolean, maxSlopeGradient: Double). -
Missing NotificationType Value: The welcome notification sent at the end of registration uses
NotificationType.REPORT_VERIFIEDas the closest available enum value. NoREGISTRATION_COMPLETEvalue currently exists in theNotificationTypeenum. It is assumed this value will be added. The Class DiagramNotificationTypeenum should be updated to include:REGISTRATION_COMPLETE. -
Database Abstraction: Since no specific Service or DAO classes exist in the Class Diagram, the
VerificationEnginelifeline is used to represent both spam detection and trust scoring logic, acting as the controller for all validation-related data operations during registration. Internal calls such ascheckPassiveTimeout()andcalculateValidationScore()are represented as self-calls and should be considered private helper methods withinVerificationEngine.
-
Constructor Definition: The Sequence Diagram depicts the instantiation of
RouteRequestusing acreate(origin, destination)message. The Class Diagram should be updated to include a constructor method:+RouteRequest(origin: GeoPoint, destination: GeoPoint). -
User-Profile Access:
RouteRequestrequires access to the user'sMobilityProfileto apply accessibility filters. We assumedRegisteredUserhas a public accessor method like+getMobilityProfile(), which is currently implied but not explicitly defined in the Class Diagram interactions. -
Search & Pin Return Values: The
search()anddropPin()methods inMapVieware shown returning specific coordinate objects (destination_point,origin_point) to be used as inputs for the route request. -
Internal Logic Abstraction: The
calculate()method logic is visualized using self-calls (checkAccessibility,excludePathSegment) to represent the internal filtering algorithms required by SRS 1.2.2. These should be considered as private helper methods within theRouteRequestclass logic. -
Database Abstraction: Since no specific "Service" or "DAO" classes exist in the Class Diagram, a generic
Databaselifeline is used to represent the retrieval ofObstacleReportobjects.RouteRequestacts as the controller managing this data retrieval.
- Deduplication Logic: The system uses a Proximity Service to check a 20-meter radius before creation; if a match is found, the user confirms the existing issue instead of creating a duplicate pin.
- Media Optimization: Photos are compressed and stored via Cloud Storage, with the database saving only the URI to maintain high performance.
- Smart Status Transition: Reports are initialized as "Unverified" by default, but the system triggers Auto-Verify if the registered user's Trust Score exceeds the threshold.
- Unique Identification: Every submission is assigned a Unique ID by the database for municipal tracking and resolution.
- Authentication & Profile: It is assumed the user is logged in, allowing the system to verify their identity and current trust level.
- Hardware & Connectivity: The device is assumed to have active GPS and Camera permissions, with a stable network available for real-time cloud and server interaction.
- Spatial Infrastructure: The central database is assumed to support geospatial indexing to handle proximity queries efficiently.
-
Interaction Constructor: The sequence diagram instantiates an
Interactionobject for theUPVOTE. The Class Diagram should explicitly add a constructor to handle this:+Interaction(type: InteractionType, target: ObstacleReport). -
Data Retrieval for Scoring: To calculate the validation score accurately,
VerificationEngineneeds to evaluate existing votes. It is assumedObstacleReporthas an implied accessor method like+getInteractions(): List<Interaction>. -
Audit Trail: When a report's status changes to
VERIFIED, aStatusChangeobject must be created to log the transition, maintaining the Class Diagram'sObstacleReport "1" *-- "*" StatusChangecomposition relationship. -
Duplicate Prevention: It is assumed
upvoteReport()contains internal business logic to prevent users from upvoting their own submissions or voting multiple times on the same report. -
Notification Trigger: Upon successful verification, the system is assumed to trigger a message to the original reporter utilizing the existing
NotificationType.REPORT_VERIFIEDenum value.
## Refinement Notes & Assumptions
-
Dashboard as Shared Resource: The Sequence Diagram shows
InfrastructureAuthorityaccessing a single sharedDashboardinstance. This is consistent with the Class Diagram's many-to-one relationship (InfrastructureAuthority "*" -- "1" Dashboard), where all officers share one dashboard and filter issues individually rather than having separate dashboard instances. -
Photo Creation & Attachment: The diagram depicts a two-step process: first creating a
Photoobject withPhotoType = POST_REPAIR, then attaching it to theObstacleReportviaaddPhoto(). The Class Diagram's composition relationship (ObstacleReport "1" *-- "1..*" Photo) supports this, but theObstacleReportclass should be updated to include an explicit+addPhoto(photo: Photo)method if not already present. -
StatusChange as Audit Trail: When the status is updated to
RESOLVED_AWAITING_VALIDATION, aStatusChangeobject is created withfromStatus = VERIFIEDandtoStatus = RESOLVED_AWAITING_VALIDATION. This relies on the composition relationship (ObstacleReport "1" *-- "*" StatusChange) in the Class Diagram. TheStatusChangeclass currently lacks a constructor; it should include+StatusChange(from: ReportStatus, to: ReportStatus, notes: String). -
Mandatory Pre-conditions for Resolution: The
altfragment enforces that both a post-repair photo and official notes must be provided before the status can change. This business rule is implied by SRS 1.5.3 but is not explicitly modeled in the Class Diagram. A validation method such as-validateResolutionRequirements(): Booleancould be added toInfrastructureAuthorityas a private helper. -
Notification Triggering: The
VerificationEngineis used to trigger notifications to the original reporter and all users who previously upvoted the report. This assumesVerificationEnginehas access to theInteractionrecords (type = UPVOTE) to identify affected users. The Class Diagram's dependency (VerificationEngine ..> ObstacleReport) supports reading report data, but an additional dependency onInteractionmay be needed:VerificationEngine ..> Interaction. -
Repair Notes Storage: The
addRepairNotes()method is shown onInfrastructureAuthority, but the notes themselves are stored in theStatusChange.notesfield when the status transition is recorded. No separate "RepairNotes" entity exists in the Class Diagram; theStatusChangeclass serves this purpose.
-
ModerationQueue as an Implicit Object: The Class Diagram does not define a dedicated
ModerationQueueclass. In the Sequence Diagram, it is introduced as a conceptual lifeline to represent the admin's view of flagged reports. In practice, this could be implemented as a filtered query onObstacleReportobjects where associatedInteractionrecords havetype = FLAG. The Class Diagram may benefit from either a dedicated class or a method onAdministratorsuch as+viewModerationQueue(): List<ObstacleReport>(which already exists). -
Flagging via Interaction: The
flagReport()method onRegisteredUsercreates anInteractionobject withtype = FLAG. This is consistent with the Class Diagram'sInteractionTypeenum which includesFLAG, and theRegisteredUser→Interaction("performs") association. The flag count for a given report can be derived by countingInteractionrecords of typeFLAGtargeting thatObstacleReport. -
VerificationEngine for Spam Detection: The
detectSpam()method onVerificationEngineis used by theAdministratorto assist in content review. The Class Diagram already defines this method onVerificationEngine. The dependencyVerificationEngine ..> ObstacleReportsupports reading report data for analysis. -
StatusChange as Audit Trail for Deletion: When a report is deleted (status set to
CLOSED), aStatusChangeobject is created withfromStatus = REPORTEDandtoStatus = CLOSEDalong with admin notes. This is consistent with the composition relationshipObstacleReport "1" *-- "*" StatusChange. TheStatusChangeclass should include a constructor:+StatusChange(from: ReportStatus, to: ReportStatus, notes: String)— the same recommendation noted in Section 5. -
banUser() and Account Status Transition: The
banUser()method onAdministratorchanges the targetRegisteredUser'sstatusattribute fromACTIVEtoBANNED, using theAccountStatusenum. A correspondingStatusChange-like audit record is created for the user ban. Note: The current Class Diagram tracksStatusChangeonly forObstacleReport; if user account status changes also need an audit trail, a similar mechanism (or a generalizedStatusChange) should be introduced forRegisteredUser. -
suspendUser() as an Alternative Path: The Class Diagram defines both
+banUser()and+suspendUser()onAdministrator. The Sequence Diagram models thebanUser()path (permanent ban,AccountStatus = BANNED). A similar alternative flow could usesuspendUser()withAccountStatus = SUSPENDEDfor less severe violations. This could be modeled with analtfragment if needed. -
Notification with SPAM_WARNING Type: The
NotificationTypeenum includesSPAM_WARNING, which is used to notify the offending user about the moderation action. TheNotificationclass's+send()method handles delivery. The diagram assumesNotificationcan be created with a recipient reference, though the Class Diagram does not explicitly show arecipientattribute — this could be added as-recipient: RegisteredUseror derived from the report's submitter. -
Database Lifeline: As with other sequence diagrams in this project, a generic
Databaselifeline is used to represent persistence operations. This is not modeled in the Class Diagram but is necessary to show where state changes (report status, user status, interaction records, notifications) are committed.
- RegisteredUser.incrementTrustScore() — New method. The class diagram defines trustScore : Integer as an attribute but has no dedicated method to modify it. This method encapsulates the trust score increment logic.
- Database lifeline — Added to explicitly represent persistence operations. Not modeled in the class diagram but necessary to show where state changes (status, trustScore, badge, notifications) are committed.
- Elicitation Questions
- Requirements
- Implementation Plan
- Test Plan & Coverage
- MVP Demo Plan
- Communication Plan
- Responsibility Assignment Matrix
- Use of Standards
- Project Retrospective
- Final Demo Plan
- Final Milestone Deliverables
- Report 1 - Requirements Elicitation & Repository Setup
- Report 2 - SRS Through Scenarios & Mock-ups
- Report 3 - From Scenarios to Use Case Diagrams
- Report 4 - Class Diagrams & Use-case Diagrams
- Report 5 - Git Workflow, Stub Application, and Planning
- Report 6 - Planning for Implementations & Tests
- Report 7 - Finalizing Plan for MVP Milestone Demo
- Report 8 - Standards & Plan Revision
- Report 9 - Requirements Review & Acceptance Testing
- Report 10 - Finalizing Plan for Final Milestone Demo
- 2026-02-18: Weekly Meeting #1
- 2026-02-18: Customer Meeting #1
- 2026-02-25: Stakeholder Meeting
- 2026-02-25: Weekly Meeting #2
- 2026-03-04: Weekly Meeting #3
- 2026-03-11: Weekly Meeting #4
- 2026-04-01: Weekly Meeting #5
- 2026-04-15: Weekly Meeting #6
- 2026-04-22: Weekly Meeting #7
- 2026-04-29: Weekly Meeting #8
- 2026-05-06: Weekly Meeting #9