Exemple #1
0
    def get(corp_type, filing_type_code):
        """Calculate the fee for the filing using the corp type/filing type and return fee."""
        date = request.args.get('date', datetime.today().strftime('%Y-%m-%d'))
        is_priority = convert_to_bool(request.args.get('priority', 'False'))
        is_future_effective = convert_to_bool(request.args.get('futureEffective', 'False'))
        jurisdiction = request.args.get('jurisdiction', DEFAULT_JURISDICTION)
        waive_fees = False
        if _jwt.validate_roles([Role.STAFF.value]):
            waive_fees = convert_to_bool(request.args.get('waiveFees', 'False'))

        try:
            response, status = (
                FeeSchedule.find_by_corp_type_and_filing_type(
                    corp_type=corp_type,
                    filing_type_code=filing_type_code,
                    valid_date=date,
                    jurisdiction=jurisdiction,
                    is_priority=is_priority,
                    is_future_effective=is_future_effective,
                    waive_fees=waive_fees
                ).asdict(),
                HTTPStatus.OK,
            )
        except BusinessException as exception:
            response, status = {'code': exception.code, 'message': exception.message}, exception.status
        return jsonify(response), status
Exemple #2
0
 def get():
     """Calculate the fee for the filing using the corp type/filing type and return fee."""
     try:
         corp_type = request.args.get('corp_type', None)
         filing_type = request.args.get('filing_type', None)
         response, status = (
             FeeSchedule.find_all(corp_type=corp_type,
                                  filing_type_code=filing_type),
             HTTPStatus.OK,
         )
     except BusinessException as exception:
         return exception.response()
     return jsonify(response), status
Exemple #3
0
    def get(corp_type, filing_type_code):
        """Calculate the fee for the filing using the corp type/filing type and return fee."""
        date = request.args.get('date', datetime.today().strftime('%Y-%m-%d'))
        jurisdiction = request.args.get('jurisdiction', DEFAULT_JURISDICTION)
        priority = request.args.get('priority', False)
        try:

            response, status = (
                FeeSchedule.find_by_corp_type_and_filing_type(
                    corp_type=corp_type,
                    filing_type_code=filing_type_code,
                    valid_date=date,
                    jurisdiction=jurisdiction,
                    priority=priority,
                ).asdict(),
                HTTPStatus.OK,
            )
        except BusinessException as exception:
            response, status = {'code': exception.code, 'message': exception.message}, exception.status
        return jsonify(response), status