generated from cfpb/open-source-project-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22a7e99
commit 5577472
Showing
7 changed files
with
141 additions
and
47 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from fastapi import FastAPI | ||
|
||
from routers import filing_router | ||
|
||
app = FastAPI() | ||
|
||
|
||
@app.get("/test") | ||
def test(): | ||
return "test" | ||
app.include_router(filing_router, prefix="/v1/filing") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
__all__ = ["filing_router"] | ||
|
||
from .filing import router as filing_router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from http import HTTPStatus | ||
from fastapi import Request, UploadFile, BackgroundTasks | ||
from regtech_api_commons.api import Router | ||
from services import submission_processor | ||
|
||
router = Router() | ||
|
||
|
||
@router.post("/{lei}/submissions/{submission_id}", status_code=HTTPStatus.ACCEPTED) | ||
async def upload_file( | ||
request: Request, lei: str, submission_id: str, file: UploadFile, background_tasks: BackgroundTasks | ||
): | ||
content = await file.read() | ||
await submission_processor.upload_to_storage(lei, submission_id, content) | ||
background_tasks.add_task(submission_processor.validate_submission, lei, submission_id, content) |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
async def upload_to_storage(lei: str, submission_id: str, content: bytes): | ||
# implement uploading process here | ||
pass | ||
|
||
|
||
async def validate_submission(lei: str, submission_id: str, content: bytes): | ||
# implement validation process here | ||
pass |