rubyforgood / human-essentials

Human Essentials is an inventory management system for diaper, incontinence, and period-supply banks. It supports them in distributing to partners, tracking inventory, and reporting stats and analytics.
https://humanessentials.app
MIT License
464 stars 492 forks source link

Pull partner details from partner API and Display it #545

Closed seanmarcia closed 6 years ago

seanmarcia commented 6 years ago

After a partner agency has been created in the system it sends a notification off to our companion app and the partner creates an account there. After the partner creates the account there the diaper bank is notified that their application is ready to be reviewed.

We need to pull the details from the partner api https://partner.diaper.app/api/v1/partners/[:id] and then populate the approve_partner page in the partner view.

Hit us up in our slack in the #diaper channel if you have questions or need clarification from one of the non-profits we're working with! :)

seanmarcia commented 6 years ago

This is what the payload you can expect to get back from the API will look like:

{
    "agency": {
        "name": "some name",
        "distributor_type": "Food Pantry",
        "agency_type": "Some type",
        "proof_of_agency_status": "",
        "agency_mission": "Help people",
        "address": {
            "address1": "123 Some address",
            "address2": "Apt 123",
            "city": "Eugene",
            "state": "Oregon",
            "zip_code": "97405"
        },
        "media": {
            "website": "https://www.example.com",
            "facebook": "https://facebook.com/example",
            "twitter": "https://twitter.com/example"
        },
        "stability": {
            "founded": 1999,
            "form_990": true,
            "form_990_link": "",
            "program_name": "Helping kids",
            "program_description": "Help kids program",
            "program_age": "4 years",
            "case_management": true,
            "evidence_based": true,
            "evidence_based_description": "Evidence description",
            "program_client_improvement": "Program client example",
            "diaper_use": "Diaper User Example",
            "other_diaper_use": "Other Diaper User Example",
            "currently_provide_diapers": true,
            "turn_away_child_care": true
        },
        "program_address": {
            "program_address1": "456 Some Avenue",
            "program_address2": "Apt 5",
            "program_city": "Florence",
            "program_state": "Oregon",
            "program_zip_code": 97405
        },
        "capacity": {
            "max_serve": "500",
            "incorporate_plan": "Example Incorporate Plan",
            "responsible_staff_position": true,
            "storage_space": true,
            "storage_space_description": null
        },
        "population_served": {
            "income_requirement_description": null,
            "serve_income_circumstances": true,
            "income_verification": true,
            "internal_db": true,
            "maac": true,
            "enthnic_composition": {
                "african_american": 19,
                "caucasian": 20,
                "hispanic": 21,
                "asian": 22,
                "american_indain": 23,
                "pacific_island": 24,
                "multi_racial": 25,
                "other": 26
            },
            "zip_codes_served": "97405, 97406, 97407",
            "poverty_information": {
                "at_fpl_or_below": 30,
                "above_1_2_times_fpl": 25,
                "greater_2_times_fpl": 35,
                "poverty_unknown": 40
            },
            "ages_served": "0-4"
        },
        "executive_director": {
            "name": "Some Name",
            "phone": "123-456-7890",
            "email": "test@example.com"
        },
        "contact_person": {
            "name": "Contact Name",
            "phone": "234-567-8901",
            "mobile": "345-678-9012",
            "email": "test2@example.com"
        },
        "pick_up_person": {
            "method": "Truck",
            "name": "Joe the Trucker",
            "phone": "678-901-2345",
            "email": "test3@example.com"
        },
        "distribution": {
            "distribution_times": "M-F 8-6",
            "new_client_times": "Wednesdays 10-5",
            "more_docs_required": "More Docs"
        },
        "funding": {
            "source": "Scratch and win tickets",
            "diapers": "Shoplifting from Walmart",
            "budget": "$750",
            "diaper_funding_source": "Loose change in couches"
        }
    }
}
sbpipb commented 6 years ago

dibs

armahillo commented 6 years ago

@sbpipb Removing help wanted -- have at it! Please let us know if you can't finish it so we can re-tag it and assign to someone else :)

sbpipb commented 6 years ago

@armahillo it would take me the next 24hours to this, so I guess you can assign it to someone else now.. sorry

sbpipb commented 6 years ago

I would like to resume on this one :) @armahillo will be able to send a PR later. @seanmarcia