Module: Nfe::FlowStatus
- Defined in:
- lib/nfe/flow_status.rb,
sig/nfe/flow_status.rbs
Overview
Lifecycle status of an asynchronously-processed fiscal document.
Terminal states stop polling; non-terminal states mean processing is still in flight. The discriminated 202 Pending/Issued contract (modeled in the resource changes) uses FlowStatus.terminal? to decide when a document is settled.
Constant Summary collapse
- TERMINAL =
States in which processing has finished (success or failure).
%w[Issued IssueFailed Cancelled CancelFailed].freeze
- NON_TERMINAL =
States in which processing is still in progress.
%w[ PullFromCityHall WaitingCalculateTaxes WaitingDefineRpsNumber WaitingSend WaitingSendCancel WaitingReturn WaitingDownload ].freeze
- ALL =
Every known flow status.
(TERMINAL + NON_TERMINAL).freeze
Class Method Summary collapse
-
.terminal?(status) ⇒ Boolean
Returns
truewhenstatusis a terminal flow state.
Instance Method Summary collapse
Class Method Details
.terminal?(status) ⇒ Boolean
Returns true when status is a terminal flow state.
31 32 33 |
# File 'lib/nfe/flow_status.rb', line 31 def terminal?(status) TERMINAL.include?(status.to_s) end |
Instance Method Details
#self?.terminal? ⇒ Boolean
7 |
# File 'sig/nfe/flow_status.rbs', line 7
def self?.terminal?: (untyped status) -> bool
|