from sysactions import action

from .service_period_commons import get_selection_service_period, set_services_period_all_pos


@action
def do_service_period_pos(pos_id):
    # type: (int) -> bool

    service_period = get_selection_service_period(pos_id)
    if service_period is None:
        return False

    set_services_period_all_pos(pos_id, service_period)
    return True
