2016-01-21 11:41:24 +01:00
|
|
|
class DossiersSerializer < ActiveModel::Serializer
|
2018-11-06 18:46:17 +01:00
|
|
|
include DossierHelper
|
|
|
|
|
2016-01-21 11:41:24 +01:00
|
|
|
attributes :id,
|
2017-10-05 10:50:44 +02:00
|
|
|
:updated_at,
|
2018-10-08 17:56:18 +02:00
|
|
|
:initiated_at,
|
|
|
|
:state
|
2017-12-14 15:51:45 +01:00
|
|
|
|
2018-10-31 10:29:03 +01:00
|
|
|
def updated_at
|
|
|
|
object.updated_at&.in_time_zone('UTC')
|
|
|
|
end
|
|
|
|
|
2017-12-14 15:51:45 +01:00
|
|
|
def initiated_at
|
2018-10-31 10:29:03 +01:00
|
|
|
object.en_construction_at&.in_time_zone('UTC')
|
2017-12-14 15:51:45 +01:00
|
|
|
end
|
2018-10-08 17:56:18 +02:00
|
|
|
|
|
|
|
def state
|
2018-11-06 18:46:17 +01:00
|
|
|
dossier_legacy_state(object)
|
2018-10-08 17:56:18 +02:00
|
|
|
end
|
2017-04-04 15:27:04 +02:00
|
|
|
end
|