Skip to content

Conversation

@hasnain-saeed
Copy link

Replaces the MandateHistory model with an Appointment model that serves as a through table between Member and Position.

Changes:

  • Remove MandateHistory model and mandate_history field from Position
  • Add Appointment model with:
    • member and position (ForeignKeys)
    • appointed_by (nullable ForeignKey to Member)
    • appointed_date, status, resignation_date, resignation_reason, notes
  • Add ManyToManyField relationship between Member and Position using Appointment as the through table

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the mandate history tracking system by replacing the MandateHistory model with a more feature-rich Appointment model that serves as a through table for a many-to-many relationship between Member and Position.

Key Changes

  • Introduces the Appointment model with appointment tracking, status management, and resignation handling
  • Removes the MandateHistory model and replaces it with a proper many-to-many relationship using Appointment as the through table
  • Adds status tracking for appointments (appointed, resigned, terminated) and related metadata fields

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 10 comments.

File Description
backend/backend/models.py Removed MandateHistory model; added Appointment model with member/position relationships, status tracking, and resignation fields; added positions ManyToManyField to Member; removed mandate_history field from Position; includes code formatting improvements throughout
backend/backend/migrations/0002_appointment_remove_position_mandate_history_and_more.py Django migration that creates the Appointment model, removes the mandate_history field from Position, deletes the MandateHistory model, and establishes the new many-to-many relationship between Member and Position

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@ebinbellini ebinbellini merged commit f89587b into dev Dec 4, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants