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

docker docs don't work for reformat endpoint #84

Open
honeykjoule opened this issue Nov 22, 2023 · 0 comments
Open

docker docs don't work for reformat endpoint #84

honeykjoule opened this issue Nov 22, 2023 · 0 comments

Comments

@honeykjoule
Copy link

honeykjoule commented Nov 22, 2023

FinCEN Version: 0.3.6

What were you trying to do?

  • learn the repo by running through the docs

What did you expect to see?

from the docs:

Reformat the file with generated attributes:

curl -X POST --data-binary "@./data/samples/ctr_batch.txt" http://localhost:8088/reformat

<EFilingBatchXML ActivityCount="1" TotalAmount="47000" PartyCount="6" SeqNum="1"
                     xsi:schemaLocation="www.fincen.gov/base https://www.fincen.gov/base https://www.fincen.gov/base/EFL_8300XBatchSchema.xsd"
                     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                     xmlns:fc2="www.fincen.gov/base">
    <Activity SeqNum="1">

What did you see?

  • no text file in data/samples
  • even when i supplied my own dummy data, i still had to change the localhost from 8088 to 8206

How can we reproduce the problem?

  • run the commands in the docs
  • run my python code that seems to get a valid response
import requests
import json
import io

url = "http://localhost:8206/reformat"

data = {
    "SeqNum": 123,
    "StatusCode": "OK",
    "TotalAmount": 100.0,
    "PartyCount": 1,
    "ActivityCount": 1,
    "AccountCount": 1,
    "ActivityAttachmentCount": 1,
    "AttachmentCount": 1,
    "JointlyOwnedOwnerCount": 1,
    "NoFIOwnerCount": 1,
    "ConsolidatedOwnerCount": 1,
    "FormTypeCode": "FTC",
    "Activity": [],
    "EFilingSubmissionXML": {"SubmissionType": "ST", "SubmissionDate": "2022-01-01"}
}

data_json = json.dumps(data)

data_file = io.StringIO(data_json)

files = { 'input': ('data.json', data_file, 'application/json') }
response = requests.post(url, files=files)
print(response.text)
<EFilingBatchXML SeqNum="123" StatusCode="OK" TotalAmount="100" PartyCount="1" ActivityCount="1" AccountCount="1" ActivityAttachmentCount="1" AttachmentCount="1" JointlyOwnedOwnerCount="1" NoFIOwnerCount="1" ConsolidatedOwnerCount="1"><fc2:FormTypeCode>FTC</fc2:FormTypeCode><EFilingSubmissionXML SeqNum="0"></EFilingSubmissionXML></EFilingBatchXML>
(fincen-py3.10) honey@honeyair fincen-python % 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant