@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.
@@ -3389,7 +3389,7 @@ export const zFiscalLineWithLegalTip = z.strictObject({
3389
3389
  /**
3390
3390
  * Provenance strength of a fiscal-number authorization fact.
3391
3391
  */
3392
- export const zFiscalNumberAuthorizationKnowledge = z.enum(["verified", "reported"]);
3392
+ export const zFiscalNumberAuthorizationKnowledge = z.enum(["verified", "reported", "disputed"]);
3393
3393
  /**
3394
3394
  * Origin of a fiscal-number authorization fact.
3395
3395
  */
@@ -3397,6 +3397,7 @@ export const zFiscalNumberAuthorizationSourceKind = z.enum([
3397
3397
  "official_source_manifest",
3398
3398
  "operator_attested",
3399
3399
  "caller_reported",
3400
+ "dgii_response",
3400
3401
  ]);
3401
3402
  /**
3402
3403
  * Lifecycle state of a fiscal-number authorization fact.
@@ -5948,7 +5949,7 @@ export const zIssuanceBlocker = z.enum([
5948
5949
  "authorization_exhausted",
5949
5950
  "authorization_conflicting",
5950
5951
  "authorization_document_type_mismatch",
5951
- "central_assignment_requires_verified_authorization",
5952
+ "sequence_rejected_by_dgii",
5952
5953
  "authorization_expired",
5953
5954
  "authorization_range_overlap",
5954
5955
  "fiscal_number_capacity_exhausted",
@@ -5964,7 +5965,7 @@ export const zIssuanceReadinessReason = z.enum([
5964
5965
  "signing_certificate_not_yet_valid",
5965
5966
  "authorization_missing",
5966
5967
  "authorization_not_active",
5967
- "authorization_not_verified",
5968
+ "sequence_rejected_by_dgii",
5968
5969
  "authorization_not_observed",
5969
5970
  "range_exhausted",
5970
5971
  "authorization_expiration_invalid",
@@ -6219,10 +6220,16 @@ export const zNumberedFiscalDocument = z.strictObject({
6219
6220
  fiscal_number: z.string().regex(/^E(31|32|33|34|41|43|44|45|46|47)[0-9]{10}$/),
6220
6221
  sequence_expires_on: z.string().nullable(),
6221
6222
  });
6223
+ /**
6224
+ * Whether DGII has accepted an e-CF numbered from the range Timbro would assign from. Either way
6225
+ * the range is issuable.
6226
+ */
6227
+ export const zNumberingConfirmation = z.enum(["confirmed", "not_yet_confirmed"]);
6222
6228
  /**
6223
6229
  * The range Timbro assigns the next fiscal number of this type from.
6224
6230
  */
6225
6231
  export const zNumberingRange = z.strictObject({
6232
+ confirmation: zNumberingConfirmation,
6226
6233
  expiresOn: z.iso.date().nullable(),
6227
6234
  remaining: z.int().gte(1).lte(9999999999),
6228
6235
  });
@@ -6738,6 +6745,11 @@ export const zReferenceInformation = z.strictObject({
6738
6745
  .regex(/^(?:(?:31-(?:0?[13578]|1[02])|(?:29|30)-(?:0?[13-9]|1[0-2])|(?:0?[1-9]|1[0-9]|2[0-8])-(?:0?[1-9]|1[0-2]))-(?:19|20)[0-9]{2}|29-0?2-(?:(?:19|20)(?:0[48]|[2468][048]|[13579][26])|2000))$/),
6739
6746
  modification_code: z.enum(["4", "5"]),
6740
6747
  });
6748
+ /**
6749
+ * The sequence a business records. Timbro, not the caller, decides how far DGII has confirmed it:
6750
+ * a recorded sequence is reported until DGII accepts an e-CF numbered from it. `knowledge` and
6751
+ * `source_kind` are deprecated, accepted so an older caller keeps working, and never trusted.
6752
+ */
6741
6753
  export const zRegisterFiscalNumberAuthorizationRequest = z.strictObject({
6742
6754
  document_type: zElectronicFiscalDocumentType,
6743
6755
  ends_at: zLedgerCounter,
@@ -6747,7 +6759,7 @@ export const zRegisterFiscalNumberAuthorizationRequest = z.strictObject({
6747
6759
  .string()
6748
6760
  .regex(/^\d{2}-\d{2}-\d{4}$/)
6749
6761
  .nullable(),
6750
- knowledge: zFiscalNumberAuthorizationKnowledge,
6762
+ knowledge: zFiscalNumberAuthorizationKnowledge.nullish(),
6751
6763
  legal_issuer_id: z.uuid(),
6752
6764
  observed_at: z.iso.datetime(),
6753
6765
  provenance_sha256: z.string().regex(/^[0-9a-f]{64}$/),
@@ -6757,7 +6769,7 @@ export const zRegisterFiscalNumberAuthorizationRequest = z.strictObject({
6757
6769
  .refine((text) => Array.from(text).length >= 1)
6758
6770
  .refine((text) => Array.from(text).length <= 128)
6759
6771
  .regex(/^[^\p{White_Space}](?:[\s\S]*[^\p{White_Space}])?$/u),
6760
- source_kind: zFiscalNumberAuthorizationSourceKind,
6772
+ source_kind: zFiscalNumberAuthorizationSourceKind.nullish(),
6761
6773
  source_reference: z
6762
6774
  .string()
6763
6775
  .refine((text) => Array.from(text).length >= 1)
@@ -22,7 +22,6 @@ export declare const problemBodySchema: z.ZodObject<{
22
22
  authorization_range_overlap: "authorization_range_overlap";
23
23
  authorization_superseded: "authorization_superseded";
24
24
  authorization_suspended: "authorization_suspended";
25
- central_assignment_requires_verified_authorization: "central_assignment_requires_verified_authorization";
26
25
  document_type_not_recognized: "document_type_not_recognized";
27
26
  fiscal_number_before_verified_floor: "fiscal_number_before_verified_floor";
28
27
  fiscal_number_capacity_exhausted: "fiscal_number_capacity_exhausted";
@@ -33,6 +32,7 @@ export declare const problemBodySchema: z.ZodObject<{
33
32
  numbering_mode_not_enabled: "numbering_mode_not_enabled";
34
33
  numbering_verifier_missing: "numbering_verifier_missing";
35
34
  sequence_expiration_mismatch: "sequence_expiration_mismatch";
35
+ sequence_rejected_by_dgii: "sequence_rejected_by_dgii";
36
36
  unsupported_protocol: "unsupported_protocol";
37
37
  unsupported_rules_version: "unsupported_rules_version";
38
38
  }>>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@timbro/invoices",
3
- "version": "0.13.0",
3
+ "version": "0.14.0-next.0",
4
4
  "license": "SEE LICENSE IN LICENSE",
5
5
  "private": false,
6
6
  "type": "module",