Class: Cpro::Entities::StatutFlux
- Inherits:
-
Base
- Object
- Base
- Cpro::Entities::StatutFlux
show all
- Defined in:
- lib/cpro/entities/statut_flux.rb
Constant Summary
collapse
- RECEVABLE =
"RECEVABLE"
- IRRECEVABLE =
"IRRECEVABLE"
- EN_COURS =
"ENTRANT_ENVELOPPE_VALIDE"
Instance Attribute Summary
Attributes inherited from Base
#payload
Instance Method Summary
collapse
Methods inherited from Base
#==, #hash, #initialize, #to_h
Instance Method Details
#code_statut ⇒ Object
500 recevable, 501 irrecevable. Ajouté par Chorus Pro 5.2.2 (19/08/2026).
15
16
17
|
# File 'lib/cpro/entities/statut_flux.rb', line 15
def code_statut
payload["codeStatut"]
end
|
#date_maj_statut ⇒ Object
37
38
39
|
# File 'lib/cpro/entities/statut_flux.rb', line 37
def date_maj_statut
@date_maj_statut ||= parse_time(payload["dateMajStatut"])
end
|
#en_cours? ⇒ Boolean
27
28
29
|
# File 'lib/cpro/entities/statut_flux.rb', line 27
def en_cours?
statut == EN_COURS
end
|
#irrecevable? ⇒ Boolean
23
24
25
|
# File 'lib/cpro/entities/statut_flux.rb', line 23
def irrecevable?
statut == IRRECEVABLE
end
|
#motifs_rejet ⇒ Object
41
42
43
|
# File 'lib/cpro/entities/statut_flux.rb', line 41
def motifs_rejet
@motifs_rejet ||= Array(payload["detailStatut"]).map { |detail| MotifRejet.new(detail) }
end
|
#nom_flux ⇒ Object
Renseigné par le PPF uniquement lorsque le flux est recevable ; c'est cette valeur qui
permet ensuite de retrouver la facture via l'API Recherche Factures G2B.
33
34
35
|
# File 'lib/cpro/entities/statut_flux.rb', line 33
def nom_flux
payload["nomFlux"]
end
|
#recevable? ⇒ Boolean
19
20
21
|
# File 'lib/cpro/entities/statut_flux.rb', line 19
def recevable?
statut == RECEVABLE
end
|
#rejet? ⇒ Boolean
45
46
47
|
# File 'lib/cpro/entities/statut_flux.rb', line 45
def rejet?
!motifs_rejet.empty?
end
|
#statut ⇒ Object
10
11
12
|
# File 'lib/cpro/entities/statut_flux.rb', line 10
def statut
payload["statut"]
end
|
#to_s ⇒ Object
49
50
51
|
# File 'lib/cpro/entities/statut_flux.rb', line 49
def to_s
statut.to_s
end
|