Add dossier workflow dates to the API

This commit is contained in:
Mathieu Magnin 2017-04-14 17:48:13 +02:00
parent 822c7cdd96
commit bf67b3f7ad
3 changed files with 8 additions and 2 deletions

View file

@ -5,7 +5,10 @@ class DossierSerializer < ActiveModel::Serializer
:archived,
:mandataire_social,
:state,
:simplified_state
:simplified_state,
:initiated_at,
:received_at,
:processed_at
has_one :entreprise
has_one :etablissement

View file

@ -47,6 +47,9 @@
"mandataire_social": false,
"state": "updated",
"simplified_state": "En construction",
"initiated_at": "2017-04-11T12:00:12.000Z",
"received_at": null,
"processed_at": null,
"entreprise": {
"siren": "440117620",
"capital_social": 537100000,

View file

@ -115,7 +115,7 @@ describe API::V1::DossiersController do
let!(:dossier) { Timecop.freeze(date_creation) { create(:dossier, :with_entreprise, procedure: procedure) } }
let(:dossier_id) { dossier.id }
let(:body) { JSON.parse(retour.body, symbolize_names: true) }
let(:field_list) { [:id, :created_at, :updated_at, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state] }
let(:field_list) { [:id, :created_at, :updated_at, :archived, :mandataire_social, :entreprise, :etablissement, :cerfa, :types_de_piece_justificative, :pieces_justificatives, :champs, :champs_private, :commentaires, :state, :simplified_state, :initiated_at, :processed_at, :received_at] }
subject { body[:dossier] }
it 'return REST code 200', :show_in_doc do