aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/neptune_export.rb
blob: 45c2aa4ea9804b208998a786c674c1b27ec5daf6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
class NeptuneExport < ExportTask

  attr_accessor :start_date, :end_date, :extensions, :export_type
  enumerize :references_type, in: %w( network line company group_of_line )

  validates :start_date, presence: true , if: "end_date.present?"   
  validates :end_date, presence: true, if: "start_date.present?" 
  
  def action_params
    {
      "neptune-export" => {
        "name" => name,
        "references_type" => references_type,
        "reference_ids" => reference_ids,
        "user_name" => user_name,
        "organisation_name" => organisation.name,
        "referential_name" => referential.name,
        "projection_type" => projection_type || "",
        "start_date" => start_date,
        "end_date" => end_date
      }
    }
  end

  def data_format
    "neptune"
  end

end