fleencorp / fleen-feen

Fleen Feen connects you with the world
GNU General Public License v3.0
0 stars 1 forks source link

Refactor Stream and Event Services, and Add New Functionalities #64

Closed aalamu closed 2 days ago

aalamu commented 4 days ago

Description

This issue focuses on refactoring the existing Stream and Event services to improve maintainability, and introducing new functionalities related to stream speakers, event attendance, and stream reviews.

Tasks

  1. Stream and Event Service Improvements:

    • Add filtering of non-null elements when using stream() method.
    • Disable the ability for guests to view other guests in events or streams.
    • Refactor DeleteStreamSpeakerDto to handle objects of speakers.
    • Add final modifiers to method parameters and variables where applicable.
    • Replace FleenStream.getFleenStreamId() with getStreamId() to simplify the code.
    • Refactor FleenFeenResponse, GoogleCalendarEventService, and LiveBroadcastServiceImpl for more maintainable and concise code.
  2. Join Status and UI Enhancements:

    • Add JoinStatus to manage UI labels for user events or attendance statuses.
    • Add StreamAttendeeSelect projection class for retrieving event or stream IDs with join status.
  3. Stream Speaker Management:

    • Add new methods in StreamService to determine user join status for events or streams (determineUserJoinStatusForEventOrStream) and scheduling status (determineScheduleStatus).
    • Add update() method in StreamSpeaker to update basic speaker details.
    • Add @JsonProperty() for the email address field in StreamSpeakerDto.
    • Update fields in StreamSpeakerMapper.
    • Add repository method StreamSpeakerRepository.findByFleenStreamAndMember() for finding a speaker based on stream and member.
  4. Event and Stream Attendance:

    • Refactor EventController to include JoinEventOrStreamDto for handling user joining of events or streams.
    • Add EventAttendeeDecisionToJoin for tracking attendee decisions when joining events or streams.
    • Allow users to submit comments when joining an event or stream.
  5. General Refactoring:

    • Refactor StreamSpeakerServiceImpl and EventServiceImpl to reduce code complexity and improve readability.
    • Rename findEvents() method in UserEventController to findMyEvents() for clarity.
    • Rename StreamAttendee.getAttendeeMemberId() to getMemberId() and refactor associated repository and service implementations.
  6. Stream Review System:

    • Add StreamReviewService to allow users to add and manage reviews for streams or events.
    • Create response classes for stream review actions (AddStreamReviewResponse, DeleteStreamReviewResponse).
    • Add StreamReviewController for managing stream or event reviews.
    • Add mapper classes for StreamSpeaker and StreamReview.
  7. Dependency and Version Updates:

    • Upgrade Spring Boot version and other dependencies including Liquibase and AWS packages.
  8. Documentation and Localization:

    • Add and update documentation for new and refactored classes.
    • Update message source files (messages_fr.properties, messages_en_US.properties) for localization.
    • Update ValidationMessages.properties for improved validation messages.
  9. User Timezone Handling:

    • Set user timezone on FleenUser after successful authentication.
    • Add timezone claim to FleenUser's access token.
  10. Country Timezone Support:

    • Add a new column timezone to the Country entity.
    • Update the Liquibase init-data schema to include country timezones.
    • Update CountryMapper to include timezone information in CountryResponse.
    • Add a new method CountryService.getCountryFromCache() to retrieve country data.
  11. Service and Controller Refactoring:

    • Refactor CountryServiceImpl, EventServiceImpl, and LiveBroadcastServiceImpl to include AuthenticatedPrincipal.
    • Refactor LiveBroadcastController.findLiveBroadcasts to use EventMapper.
  12. Timezone and Schedule Management:

    • Update DateTimeUtil to:
      • Convert timezones (e.g., from Africa/Lagos to WAT).
      • Get the GMT offset for a given timezone.
      • Convert times from one timezone to another for scheduling.
      • Refactor FleenStreamResponse:
      • Remove timezone, scheduledStartDate, and scheduledEndDate.
      • Replace with a new Schedule object containing detailed scheduling information.
    • Update StreamService to create schedule details for streams or events based on user timezone.
  13. Liquibase and Data Migration:

    • Update Liquibase migration script to ensure that code and timezone fields are non-null in relevant tables.
  14. Validation and Token Claims:

    • Refactor TimezoneValidValidator to support the new timezone logic.
    • Update TokenClaimField to include the timezone information.

Action Required