Skip to content

Latest commit

 

History

History
42 lines (33 loc) · 1.18 KB

README.md

File metadata and controls

42 lines (33 loc) · 1.18 KB

PG

A program that takes a CSV file as input, and returns either a Customer record or an error for each row

iex Usage

  • Run mix deps.get to install dependencies
  • Run tests with mix test
  • The following example shows how to parse a CSV file, open iex with iex -S mix
  • You can also run h CustomerRecordParser.parse_csv_file in iex
{:ok, records} = CustomerRecordParser.parse_csv_file("test/fixtures/record.csv")
#=> {:ok,[
#=>   ok: %{
#=>     country_id: 2,
#=>     dob: ~D[1990-01-01],
#=>     name: "John Doe",
#=>     national_id: "123456789",
#=>     phone: "254722000000",
#=>     site_code: 772
#=>     },
#=>   ]
#=> }

HTTP

Endpoints

    GET /

    GET /pg/valid_records 

    GET /pg/with_invalid_records