Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arprompt2 #2984

Merged
merged 2 commits into from
Sep 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions colin-api/src/colin_api/resources/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -296,18 +296,18 @@ def post(identifier, **kwargs):
except Exception as err: # pylint: disable=broad-except
current_app.logger.error(f'Error updating AR status for {identifier}: {str(err)}')
return jsonify({'message': 'Error updating AR status.'}), HTTPStatus.INTERNAL_SERVER_ERROR
@cors_preflight('POST')
@API.route('/string:identifier/filings')


@cors_preflight('DELETE')
@API.route('/<string:legal_type>/<string:identifier>/filings/reminder')
# pylint: disable=too-few-public-methods
class DeleteARPrompt(Resource):
"""Delete AR Prompt for corporation."""

@staticmethod
@cors.crossdomain(origin='*')
@jwt.requires_roles([COLIN_SVC_ROLE])
def post(identifier, **kwargs):
def delete(identifier, **kwargs):
"""Clean up data in Colin for the corporation."""
# pylint: disable=unused-argument
try:
Expand All @@ -318,13 +318,12 @@ def post(identifier, **kwargs):
DELETE FROM AR_PROMPT
WHERE corp_num = :identifier
"""
cursor.execute(delete_ar_prompt, {'identifier': identifier})

cursor.execute(delete_ar_prompt, {'identifier': identifier})
# Commit the transaction
con.commit()
current_app.logger.info(f'Successfully deleted AR prompt for corporation {identifier}.')
return jsonify({'message': f'AR prompt deleted for corporation {identifier}.'}), HTTPStatus.OK

except Exception as err: # pylint: disable=broad-except
current_app.logger.error(f'Error Deleteing AR status for {identifier}: {str(err)}')
return jsonify({'message': 'Error Deleteing AR status.'}), HTTPStatus.INTERNAL_SERVER_ERROR
return jsonify({'message': 'Error Deleteing AR status.'}), HTTPStatus.INTERNAL_SERVER_ERROR