Skip to content

Alex porter #117

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

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open

Alex porter #117

wants to merge 11 commits into from

Conversation

Alex-Porter1
Copy link

@Alex-Porter1 Alex-Porter1 commented Dec 8, 2022

Here is my updated work to the Web-Homework:

Tasks I was able to accomplish:

  • Write filtering options for transactions, users, and/or merchants. This could include:

    • fuzzy searching for a user by first and last name
    • fuzzy searching for a merchant by name
    • getting back transactions with an amount between min and max arguments
  • Write a new schema, queries, and mutations to add companies to the app

    • users should belong to a company and we should require transactions to pass in a company_id
    • company should have a name, credit_line, and available_credit which would be the credit_line minus the total amount of
      transactions for the company
  • Seed the database. Possible solutions include:

    • Implement provided seeds.ex file
    • Write a .sql file that can be ingested by the database

I will also include my approach, and notes I took along the way in the attached files.

ElixirNotes.odt

HomeworkApproach.odt

Alex Porter added 11 commits December 7, 2022 08:40
…name function to search for users using ilike with wildcard characters, resulting in a list of users that contain names, or characters searched for in GraphQL
…ed search_merchant resolver that accomplished the same goal as the search_user resolver. Resulting in an empty list if no merchants are found, or a list of merchants that have been found. Also included the ilike with wildcard functionality for the get_merchant_by_name function.

exit
… maximum integer values, created a search_transaction function, using the map for minimum and maximum arguments, which searches for all transaction amounts within the minimum and maximum values. I then sorted the list of transactions from smallest amount to largest, if no transactions are found, it returns an empty list. This function calls on my filter_transaction function, which compares every transaction amount and returns only transactions with amounts between the specified values.
…, still need to adjust the available credit, but wanted to get a working product pushed up before I make any more changes
… the schema instead of credit_line, working correctly now.
…lso fixed failing test in transactions_test.exs. The changeset in transaction didn't have the :check in either the cast or validate_required, causing :credit to not be set in the database. All tests are now passing.
…he companies available_credit each time a new transaction occurs associated with a specific company_id
…ting 5 of each user, merchant, transaction and company
…company_credit inside of my create_transaction function. All tests are now passing with the database being seeded.
…nt to no longer have warnings with transactions 1,2,3,4 not being used.
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

Successfully merging this pull request may close these issues.

1 participant