# Path: fedocal/fedocallib/model.py
# BASE = declarative_base()
#     CONFIG = ConfigParser.ConfigParser()
# def create_tables(db_url, alembic_ini=None, debug=False):
# def drop_tables(db_url, engine):  # pragma: no cover
# def fill_default_status(session):
#     def __init__(self, status):
#     def __repr__(self):  # pragma: no cover
#     def all(cls, session):
#     def __init__(
#             self, calendar_name, calendar_contact, calendar_description,
#             calendar_editor_group=None, calendar_admin_group=None,
#             calendar_status='Enabled'):
#     def __repr__(self):
#     def to_json(self):
#     def save(self, session):
#     def delete(self, session):
#     def admin_groups(self):
#     def editor_groups(self):
#     def by_id(cls, session, identifier):
#     def get_editor_groups(cls, session, identifier):
#     def get_admin_groups(cls, session, identifier):
#     def get_all(cls, session):
#     def by_status(cls, session, status):
#     def __repr__(self):
#     def get_or_create(cls, session, username):
#     def create(cls, session, username):
#     def __repr__(self):
#     def get_or_create(cls, session, meeting, user):
#     def create(cls, session, meeting, user):
#     def __init__(
#             self, meeting_name,
#             meeting_date, meeting_date_end,
#             meeting_time_start, meeting_time_stop,
#             meeting_information, calendar_name, meeting_timezone='UTC',
#             reminder_id=None, meeting_location=None, recursion_frequency=None,
#             recursion_ends=None, full_day=False):
#     def __repr__(self):
#     def save(self, session):
#     def to_json(self):
#     def add_manager(self, session, meeting_manager):
#     def clear_managers(self, session):
#     def meeting_manager(self):
#     def delete(self, session):
#     def copy(self, meeting=None):
#     def by_id(cls, session, identifier):
#     def get_by_date(
#             cls, session, calendar, start_date, stop_date,
#             full_day=None, no_recursive=False,
#             name=None):
#     def get_by_date_and_location(
#             cls, session, calendar, start_date, stop_date, location):
#     def get_by_date_at_location(
#             cls, session, location, start_date, stop_date, full_day=None,
#             no_recursive=False):
#     def get_overlaping_meetings(
#             cls, session, calendar, start_date, stop_date):
#     def get_at_date(cls, session, calendar, meeting_date, full_day=None):
#     def get_active_regular_meeting(
#             cls, session, calendar, start_date, end_date, full_day=None):
#     def get_active_regular_meeting_at_location(
#             cls, session, location, start_date, end_date, full_day=None):
#     def get_regular_meeting_at_date(
#             cls, session, calendar, end_date, full_day=None):
#     def get_active_regular_meeting_by_date(
#             cls, session, calendar, start_date, full_day=None, name=None):
#     def get_active_regular_meeting_by_date_at_location(
#             cls, session, location, start_date, full_day=None):
#     def get_regular_meeting_by_date(
#             cls, session, calendar, start_date, end_date, full_day=None,
#             name=None):
#     def get_regular_meeting_by_date_at_location(
#             cls, session, location, start_date, end_date, full_day=None):
#     def get_past_meeting_of_user(cls, session, username, start_date):
#     def get_future_single_meeting_of_user(
#             cls, session, username, start_date=date.today()):
#     def get_future_regular_meeting_of_user(
#             cls, session, username, start_date=date.today()):
#     def get_meeting_with_reminder(
#             cls, session, start_date, start_time, stop_time, offset):
#     def expand_regular_meetings(
#             meetings_in, start_date=None, end_date=None):
#     def search(cls, session, keyword):
#     def search_locations(cls, session, keyword):
#     def get_locations(cls, session):
#     def clear_from_calendar(cls, session, calendar):
#     def __init__(
#             self, reminder_offset, reminder_from,
#             reminder_to, reminder_text):
#     def __repr__(self):
#     def save(self, session):
#     def by_id(cls, session, identifier):
# class CalendarStatus(BASE):
# class Calendar(BASE):
# class User(BASE):
# class MeetingsUsers(BASE):
# class Meeting(BASE):
# class Reminder(BASE):


from datetime import date
from fedocal.fedocallib import  model
# pylint: disable=R0913,R0914
def add_meeting(
        session,
        meeting_name,
        meeting_manager,
        meeting_date,
        meeting_date_end,
        meeting_time_start,
        meeting_time_stop,
        meeting_information,
        calendarobj,
        meeting_timezone='UTC',
        reminder_id=None,
        meeting_location=None,
        recursion_frequency=None,
        recursion_ends=None,
        full_day=False):
    """ Logic to add a meeting to the database.
    """

    if not recursion_frequency:
        recursion_frequency = None
    if not recursion_ends and recursion_frequency:
        recursion_ends = date(2025, 12, 31)

    # Unless we test directly dbaction we will never hit this as
    # fedocallib.add_meeting already covers it
    if not meeting_date_end:  # pragma: no cover
        meeting_date_end = meeting_date


# Path: fedocal/fedocallib/model.py
# BASE = declarative_base()
#     CONFIG = ConfigParser.ConfigParser()
# def create_tables(db_url, alembic_ini=None, debug=False):
# def drop_tables(db_url, engine):  # pragma: no cover
# def fill_default_status(session):
#     def __init__(self, status):
#     def __repr__(self):  # pragma: no cover
#     def all(cls, session):
#     def __init__(
#             self, calendar_name, calendar_contact, calendar_description,
#             calendar_editor_group=None, calendar_admin_group=None,
#             calendar_status='Enabled'):
#     def __repr__(self):
#     def to_json(self):
#     def save(self, session):
#     def delete(self, session):
#     def admin_groups(self):
#     def editor_groups(self):
#     def by_id(cls, session, identifier):
#     def get_editor_groups(cls, session, identifier):
#     def get_admin_groups(cls, session, identifier):
#     def get_all(cls, session):
#     def by_status(cls, session, status):
#     def __repr__(self):
#     def get_or_create(cls, session, username):
#     def create(cls, session, username):
#     def __repr__(self):
#     def get_or_create(cls, session, meeting, user):
#     def create(cls, session, meeting, user):
#     def __init__(
#             self, meeting_name,
#             meeting_date, meeting_date_end,
#             meeting_time_start, meeting_time_stop,
#             meeting_information, calendar_name, meeting_timezone='UTC',
#             reminder_id=None, meeting_location=None, recursion_frequency=None,
#             recursion_ends=None, full_day=False):
#     def __repr__(self):
#     def save(self, session):
#     def to_json(self):
#     def add_manager(self, session, meeting_manager):
#     def clear_managers(self, session):
#     def meeting_manager(self):
#     def delete(self, session):
#     def copy(self, meeting=None):
#     def by_id(cls, session, identifier):
#     def get_by_date(
#             cls, session, calendar, start_date, stop_date,
#             full_day=None, no_recursive=False,
#             name=None):
#     def get_by_date_and_location(
#             cls, session, calendar, start_date, stop_date, location):
#     def get_by_date_at_location(
#             cls, session, location, start_date, stop_date, full_day=None,
#             no_recursive=False):
#     def get_overlaping_meetings(
#             cls, session, calendar, start_date, stop_date):
#     def get_at_date(cls, session, calendar, meeting_date, full_day=None):
#     def get_active_regular_meeting(
#             cls, session, calendar, start_date, end_date, full_day=None):
#     def get_active_regular_meeting_at_location(
#             cls, session, location, start_date, end_date, full_day=None):
#     def get_regular_meeting_at_date(
#             cls, session, calendar, end_date, full_day=None):
#     def get_active_regular_meeting_by_date(
#             cls, session, calendar, start_date, full_day=None, name=None):
#     def get_active_regular_meeting_by_date_at_location(
#             cls, session, location, start_date, full_day=None):
#     def get_regular_meeting_by_date(
#             cls, session, calendar, start_date, end_date, full_day=None,
#             name=None):
#     def get_regular_meeting_by_date_at_location(
#             cls, session, location, start_date, end_date, full_day=None):
#     def get_past_meeting_of_user(cls, session, username, start_date):
#     def get_future_single_meeting_of_user(
#             cls, session, username, start_date=date.today()):
#     def get_future_regular_meeting_of_user(
#             cls, session, username, start_date=date.today()):
#     def get_meeting_with_reminder(
#             cls, session, start_date, start_time, stop_time, offset):
#     def expand_regular_meetings(
#             meetings_in, start_date=None, end_date=None):
#     def search(cls, session, keyword):
#     def search_locations(cls, session, keyword):
#     def get_locations(cls, session):
#     def clear_from_calendar(cls, session, calendar):
#     def __init__(
#             self, reminder_offset, reminder_from,
#             reminder_to, reminder_text):
#     def __repr__(self):
#     def save(self, session):
#     def by_id(cls, session, identifier):
# class CalendarStatus(BASE):
# class Calendar(BASE):
# class User(BASE):
# class MeetingsUsers(BASE):
# class Meeting(BASE):
# class Reminder(BASE):


# Path: fedocal/fedocallib/dbaction.py
from datetime import date
from fedocal.fedocallib import  model

# pylint: disable=R0913,R0914
def add_meeting(
        session,
        meeting_name,
        meeting_manager,
        meeting_date,
        meeting_date_end,
        meeting_time_start,
        meeting_time_stop,
        meeting_information,
        calendarobj,
        meeting_timezone='UTC',
        reminder_id=None,
        meeting_location=None,
        recursion_frequency=None,
        recursion_ends=None,
        full_day=False):
    """ Logic to add a meeting to the database.
    """

    if not recursion_frequency:
        recursion_frequency = None
    if not recursion_ends and recursion_frequency:
        recursion_ends = date(2025, 12, 31)

    # Unless we test directly dbaction we will never hit this as
    # fedocallib.add_meeting already covers it
    if not meeting_date_end:  # pragma: no cover
        meeting_date_end = meeting_date


    meeting = model.Meeting(