PropSchema v0.3.0 Animagus.CSVMapping

A model for the csv_mappings table. Include functionality for changeset validations and display/index lookups.

Link to this section Summary

Functions

Creates a changeset from the data and params. Runs several validations on the changes

Returns the fields in the schema and their type

Returns the allowed regexes for printing out in the new endpoint

Link to this section Types

Link to this type t()
t() :: %Animagus.CSVMapping{
  __meta__: term(),
  date_format: term(),
  email: term(),
  event_date: term(),
  event_name: term(),
  expected_columns: term(),
  external_location_id: term(),
  file_regex: term(),
  id: term(),
  inserted_at: term(),
  integration_name: term(),
  name_regex: term(),
  parser: term(),
  primary_name: term(),
  primary_phone: term(),
  secondary_name: term(),
  secondary_phone: term(),
  tertiary_phone: term(),
  updated_at: term()
}

Link to this section Functions

Link to this function changeset(data, params \\ %{})
changeset(t(), map()) :: Ecto.Changeset.t()

Creates a changeset from the data and params. Runs several validations on the changes:

  1. Required fields
  2. The integer fields should be positive
  3. The name_regex field should only have the allowed values
  4. No two integer fields should have the same value
  5. All integer fields should be less than the expected_columns field’s value
  6. The combination of integration_name and event_name should be unique
Link to this function fields()
fields() :: %{required(atom()) => atom()}

Returns the fields in the schema and their type

Link to this function regexes()
regexes() :: [%{required(String.t()) => String.t()}]

Returns the allowed regexes for printing out in the new endpoint.