Fruga-Budget / Fruga-be

0 stars 0 forks source link

Setup/schema and service #7

Closed NicoShanstrom closed 2 weeks ago

NicoShanstrom commented 2 weeks ago

What I did: I created and migrated the initial schema, but that is straightforward. Begins the setup for the service to call fast api python app, endpoint or url may need to be modified once main.py on fruga-py-service app is finalized. Creates files and logic for advice_generator poro and advice serializer as to prepare to keep controller minimal for when we can get data back from fruga-py-service app. These files were created based off of the json contract format and logic for 50/30/20 rule. If the user's budget is within the logic for 50/30/20 rule then the fastapi service will not be called and they will get a hard coded response saying something like "Congratulations, youre on the right track for the 50/30/20 rule of budgeting!".... IF the user's budget is not within the valid_allocation? method logic parameters upon generating advice object, then the fastapi service will be called for the advice from the chatgpt based off of parameters used in main.py file on fruga-py-service app. The advicegenerator and check check_to_call_api method and adviceserializer would be used in the AdvicesController once that is created.

Did this break anything? No This should not break anything as there really isn't anything to break yet, just setting up the foundation for requests from the fruga-be to the fruga-py-service app. I think it should work, but I wont know how much modifying in the service is needed until we can make calls to the fruga-py-service app. Type of change New feature (non-breaking change which adds functionality)

Requested feedback: Yes Let me know if you have any questions about what is going on here or why it was done in this way.

Checklist: I reviewed the code before pushing

What's next? main.py file on fruga-py-service app could be updated to post requests to openai for what we are looking for. Tests need to then be created to call the py-service and use VCR for future api call mocks. Create controllers Create routes Make sure schema and databases are up to date. Will need to create a users tests, model, serializer, controller for actions necessary. Create any other models and associated files based on finalized schema.

NicoShanstrom commented 2 weeks ago

checks are resolved.