@timbro/invoices 0.13.0 → 0.14.0-next.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4047,7 +4047,7 @@ export const invoiceApiContract = {
4047
4047
  "authorization_exhausted",
4048
4048
  "authorization_conflicting",
4049
4049
  "authorization_document_type_mismatch",
4050
- "central_assignment_requires_verified_authorization",
4050
+ "sequence_rejected_by_dgii",
4051
4051
  "authorization_expired",
4052
4052
  "authorization_range_overlap",
4053
4053
  "fiscal_number_capacity_exhausted",
@@ -681,7 +681,7 @@ export type FiscalNumberAuthorizationHistoryResource = {
681
681
  /**
682
682
  * Provenance strength of a fiscal-number authorization fact.
683
683
  */
684
- export type FiscalNumberAuthorizationKnowledge = "verified" | "reported";
684
+ export type FiscalNumberAuthorizationKnowledge = "verified" | "reported" | "disputed";
685
685
  export type FiscalNumberAuthorizationLineage = {
686
686
  current: FiscalNumberAuthorizationResource;
687
687
  generations: Array<FiscalNumberAuthorizationResource>;
@@ -721,7 +721,7 @@ export type FiscalNumberAuthorizationResource = {
721
721
  /**
722
722
  * Origin of a fiscal-number authorization fact.
723
723
  */
724
- export type FiscalNumberAuthorizationSourceKind = "official_source_manifest" | "operator_attested" | "caller_reported";
724
+ export type FiscalNumberAuthorizationSourceKind = "official_source_manifest" | "operator_attested" | "caller_reported" | "dgii_response";
725
725
  /**
726
726
  * Lifecycle state of a fiscal-number authorization fact.
727
727
  */
@@ -2254,7 +2254,7 @@ export type InvoiceXmlReadiness = {
2254
2254
  /**
2255
2255
  * One stable reason the authoritative rules refuse to issue.
2256
2256
  */
2257
- export type IssuanceBlocker = "invalid_request" | "unsupported_protocol" | "unsupported_rules_version" | "invalid_resolved_facts" | "numbering_verifier_missing" | "numbering_mode_not_enabled" | "document_type_not_recognized" | "authorization_missing" | "authorization_not_observed_on_effective_date" | "authorization_suspended" | "authorization_cancelled" | "authorization_superseded" | "authorization_exhausted" | "authorization_conflicting" | "authorization_document_type_mismatch" | "central_assignment_requires_verified_authorization" | "authorization_expired" | "authorization_range_overlap" | "fiscal_number_capacity_exhausted" | "invalid_fiscal_number" | "fiscal_number_outside_authorized_range" | "fiscal_number_before_verified_floor" | "sequence_expiration_mismatch";
2257
+ export type IssuanceBlocker = "invalid_request" | "unsupported_protocol" | "unsupported_rules_version" | "invalid_resolved_facts" | "numbering_verifier_missing" | "numbering_mode_not_enabled" | "document_type_not_recognized" | "authorization_missing" | "authorization_not_observed_on_effective_date" | "authorization_suspended" | "authorization_cancelled" | "authorization_superseded" | "authorization_exhausted" | "authorization_conflicting" | "authorization_document_type_mismatch" | "sequence_rejected_by_dgii" | "authorization_expired" | "authorization_range_overlap" | "fiscal_number_capacity_exhausted" | "invalid_fiscal_number" | "fiscal_number_outside_authorized_range" | "fiscal_number_before_verified_floor" | "sequence_expiration_mismatch";
2258
2258
  /**
2259
2259
  * Whether the issuer can issue each e-CF type now in this environment.
2260
2260
  */
@@ -2267,7 +2267,7 @@ export type IssuanceReadiness = {
2267
2267
  environment: FiscalEnvironment;
2268
2268
  issuerTaxId: string;
2269
2269
  };
2270
- export type IssuanceReadinessReason = "legal_issuer_profile_incomplete" | "signing_certificate_missing" | "signing_certificate_expired" | "signing_certificate_not_yet_valid" | "authorization_missing" | "authorization_not_active" | "authorization_not_verified" | "authorization_not_observed" | "range_exhausted" | "authorization_expiration_invalid" | "authorization_expired" | "authorization_range_overlap";
2270
+ export type IssuanceReadinessReason = "legal_issuer_profile_incomplete" | "signing_certificate_missing" | "signing_certificate_expired" | "signing_certificate_not_yet_valid" | "authorization_missing" | "authorization_not_active" | "sequence_rejected_by_dgii" | "authorization_not_observed" | "range_exhausted" | "authorization_expiration_invalid" | "authorization_expired" | "authorization_range_overlap";
2271
2271
  export type LedgerCounter = string;
2272
2272
  export type LegalIssuer = {
2273
2273
  address: string | null;
@@ -2354,10 +2354,20 @@ export type NumberedFiscalDocument = {
2354
2354
  fiscal_number: string;
2355
2355
  sequence_expires_on: string | null;
2356
2356
  };
2357
+ /**
2358
+ * Whether DGII has accepted an e-CF numbered from the range Timbro would assign from. Either way
2359
+ * the range is issuable.
2360
+ */
2361
+ export type NumberingConfirmation = "confirmed" | "not_yet_confirmed";
2357
2362
  /**
2358
2363
  * The range Timbro assigns the next fiscal number of this type from.
2359
2364
  */
2360
2365
  export type NumberingRange = {
2366
+ /**
2367
+ * Whether DGII has accepted an e-CF numbered from this range. A range that is not yet
2368
+ * confirmed still issues; a range DGII rejected is blocked with `sequence_rejected_by_dgii`.
2369
+ */
2370
+ confirmation: NumberingConfirmation;
2361
2371
  /**
2362
2372
  * The sequence expiry, or `null` for a type without one (E32 and E34).
2363
2373
  */
@@ -2669,19 +2679,24 @@ export type ReferenceInformation = {
2669
2679
  issued_on: string;
2670
2680
  modification_code: "4" | "5";
2671
2681
  };
2682
+ /**
2683
+ * The sequence a business records. Timbro, not the caller, decides how far DGII has confirmed it:
2684
+ * a recorded sequence is reported until DGII accepts an e-CF numbered from it. `knowledge` and
2685
+ * `source_kind` are deprecated, accepted so an older caller keeps working, and never trusted.
2686
+ */
2672
2687
  export type RegisterFiscalNumberAuthorizationRequest = {
2673
2688
  document_type: ElectronicFiscalDocumentType;
2674
2689
  ends_at: LedgerCounter;
2675
2690
  environment: FiscalEnvironment;
2676
2691
  expected_head: ExpectedAuthorizationHead;
2677
2692
  expires_on: string | null;
2678
- knowledge: FiscalNumberAuthorizationKnowledge;
2693
+ knowledge?: null | FiscalNumberAuthorizationKnowledge | undefined;
2679
2694
  legal_issuer_id: string;
2680
2695
  observed_at: string;
2681
2696
  provenance_sha256: string;
2682
2697
  series: ElectronicFiscalDocumentSeries;
2683
2698
  source_id: string;
2684
- source_kind: FiscalNumberAuthorizationSourceKind;
2699
+ source_kind?: null | FiscalNumberAuthorizationSourceKind | undefined;
2685
2700
  source_reference: string;
2686
2701
  starts_at: LedgerCounter;
2687
2702
  state: FiscalNumberAuthorizationState;