GitXplorerGitXplorer
j

fcm_elixir

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
01fdee3c421ee4e998004abec02a3e4fe483c78b

chore: fix unused out var in tests

jjacano committed a year ago
Unverified
f96d5e02e12f653599246da95996ecdb3508065b

chore: add trip_generator unit test for remove_connection function. clean unit tests

jjacano committed a year ago
Unverified
1d961b921602661d9e99307856492549d50c0dca

chore: format code again

jjacano committed a year ago
Unverified
54ea5194bef2dfaaf419adf7f621729c953b8cac

chore: cleanup

jjacano committed a year ago
Unverified
62d4f025867cc107d94b3cdf2ca2ad4488f50999

chore: fix warning

jjacano committed a year ago
Unverified
488dfbde1f5b6e8d083f0f0ff0136507b62b0064

chore: format Elixir code with mix format

jjacano committed a year ago

README

The README file for this repository.

Reservation Transformer (FCM Technical challenge)

This Elixir app processes reservation data from an input file and shows the transformed data on the console. For complete details, refer to the challenge description here.

Getting Started

Make sure you have Erlang and Elixir installed. Clone the repository and navigate to the project directory in your terminal.

Usage

  1. Compiling and Running:

    • Compile the project: mix compile.
    • Run the app: mix run.
  2. Escript Execution:

    • Generate an escript executable:
      mix escript.build
    • Run the escript with the input file path:
      ./fcm_challenge --input <input_file_path>

Code Structure

  • Test.MixProject Module:
    • Holds project configuration settings for dependencies, versions, Elixir compatibility, and escript creation.
  • ReservationTransformer Module:
    • Handles processing and transforming the input file in multiple steps:
      1. Reading and Filtering:

        • Reads and filters valid reservation lines based on predefined criteria.
      2. Segmentation and Sorting:

        • Splits reservations into 'based' and trip 'segments', sorting segments using a comparison function.
      3. Trip Grouping and Summary:

        • Groups segments into trips and creates trip summaries by excluding base segments and detailing trip destinations.
      4. Formatting and Output:

        • Formats trip summaries and segments into a final output string for display.

Testing

test/ directory holds the test suite with input files and expected output along with unit tests for modules.

Dependencies

  • Erlang 24 (Ensure binaries are included in the Path environment variable)
  • Elixir 1.15.7

IDE

  • VScode 1.84.2
    • ElixirLS: Elixir support and debugger v0.17.10
    • Elixir Test v1.8.0