@placeshakr/config 10.30.2-alpha.1 → 10.31.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.
package/src/types.ts CHANGED
@@ -527,7 +527,7 @@ export interface Enterprise extends Resource {
527
527
  whatsapp?: boolean;
528
528
  marketplace?: boolean;
529
529
  multiProfessionals?: boolean;
530
- /** Integracion con PennyLane: activa el listado Bills y el sync. */
530
+ /** PennyLane integration: enables the Bills listing and the sync. */
531
531
  pennylane?: boolean;
532
532
  };
533
533
 
@@ -693,9 +693,9 @@ type Permissions = Record<string, boolean>;
693
693
 
694
694
  export interface Profile extends Resource {
695
695
  /**
696
- * Datos de facturacion del tercero. Vive en Profile —y no en Client, Pro y
697
- * Seller por separado— porque los tres lo heredan y el SDK escribe contra
698
- * este tipo. Ver [[BillingIdentity]] y `config/src/billing`.
696
+ * The third party's billing data. It lives on Profile — and not on Client,
697
+ * Pro and Seller separately — because all three inherit from it and the SDK
698
+ * writes against this type. See [[BillingIdentity]] and `config/src/billing`.
699
699
  */
700
700
  billing?: BillingIdentity;
701
701
 
@@ -2508,30 +2508,31 @@ export type Bill = Resource & {
2508
2508
  // used to save information related with any possible external system
2509
2509
  metadata?: {
2510
2510
  sentToIpaidthat?: boolean;
2511
- /** @deprecated usar metadata.pennylane. Se mantiene hasta retirar el envio por email. */
2511
+ /** @deprecated use metadata.pennylane. Kept until email delivery is retired. */
2512
2512
  sentToPennyLane?: boolean;
2513
2513
  /** @deprecated usar metadata.pennylane.lastSyncAt */
2514
2514
  sentToPennyLaneDate?: number;
2515
2515
  /**
2516
- * Estado de sincronizacion con PennyLane. Sustituye a los dos booleanos
2517
- * de arriba: guarda el id contable, el hash del ultimo payload enviado
2518
- * (idempotencia) y el error, para poder reintentar sin duplicar.
2516
+ * PennyLane sync state. Replaces the two booleans above: it holds the
2517
+ * accounting id, the hash of the last payload sent (idempotency) and the
2518
+ * error, so a retry never duplicates.
2519
2519
  */
2520
2520
  pennylane?: PennylaneBillSync;
2521
2521
  };
2522
2522
 
2523
2523
  /**
2524
- * Origen del documento cuando no se ha creado en Articho. Las facturas con
2525
- * source distinto de undefined no se editan ni se borran desde la app: la
2526
- * autoridad esta en firestore.rules.
2524
+ * Where the document came from when it was not created in Articho. Bills
2525
+ * whose source is not undefined are neither edited nor deleted from the app:
2526
+ * the authority on that is firestore.rules.
2527
2527
  */
2528
2528
  source?: 'pennylane';
2529
2529
  imported?: boolean;
2530
2530
 
2531
2531
  /**
2532
- * Datos de facturacion del destinatario, cuando este no tiene ficha propia
2533
- * (fournisseur de materiaux, de services y personnalise). Para CLIENT, PRO y
2534
- * PROVIDER viven en la ficha del tercero. Ver `config/src/billing`.
2532
+ * Billing data of the recipient when they have no record of their own
2533
+ * (fournisseur de matériaux, de services and personnalisé). For CLIENT, PRO
2534
+ * and PROVIDER it lives on the third party's record. See
2535
+ * `config/src/billing`.
2535
2536
  */
2536
2537
  billing?: BillingIdentity;
2537
2538
  };
@@ -4612,24 +4613,24 @@ export enum EmailEventsEnum {
4612
4613
  /* PennyLane */
4613
4614
  /* -------------------------------------------------------------------------- */
4614
4615
 
4615
- /** Estado de la sincronizacion de una factura concreta con PennyLane. */
4616
+ /** Sync state of one specific bill against PennyLane. */
4616
4617
  export type PennylaneBillSync = {
4617
4618
  status: 'PENDING' | 'SYNCED' | 'FAILED' | 'SKIPPED';
4618
- /** Id de la factura en PennyLane. */
4619
+ /** Invoice id in PennyLane. */
4619
4620
  invoiceId?: string;
4620
- /** Id de la factura acreditada en PennyLane (para avoirs). */
4621
+ /** Id of the credited invoice in PennyLane (for credit notes). */
4621
4622
  creditedInvoiceId?: string;
4622
- /** Id del avoir en PennyLane que cancela esta factura. */
4623
+ /** Id of the PennyLane credit note that cancels this invoice. */
4623
4624
  creditNoteId?: string;
4624
4625
  creditNoteNumber?: string;
4625
4626
  creditNoteStatus?: 'PENDING' | 'SYNCED' | 'FAILED' | 'SKIPPED';
4626
4627
  creditNoteError?: string;
4627
- /** Documento espejo en enterprises/{id}/importedBills. */
4628
+ /** Mirror document under enterprises/{id}/importedBills. */
4628
4629
  importedBillId?: string;
4629
4630
  fileAttachmentId?: string;
4630
4631
  /**
4631
- * Hash del payload enviado. PennyLane no ofrece Idempotency-Key, asi que la
4632
- * deduplicacion es nuestra: mismo hash que el ultimo SYNCED, no se reenvia.
4632
+ * Hash of the payload sent. PennyLane offers no Idempotency-Key, so
4633
+ * deduplication is ours: same hash as the last SYNCED, nothing is resent.
4633
4634
  */
4634
4635
  payloadHash?: string;
4635
4636
  attempts?: number;
@@ -4639,13 +4640,13 @@ export type PennylaneBillSync = {
4639
4640
  error?: { code: string; message: string; status?: number };
4640
4641
  };
4641
4642
 
4642
- /** De que campo de la factura de PennyLane se lee cada referencia. */
4643
+ /** Which field of the PennyLane invoice each reference is read from. */
4643
4644
  export type PennylaneReferenceConfig = {
4644
- /** Campo donde el proveedor escribe la referencia de chantier. */
4645
+ /** Field where the supplier writes the chantier reference. */
4645
4646
  projectField: 'label' | 'invoice_number' | 'lines';
4646
- /** Campo donde el proveedor escribe la referencia de devis. */
4647
+ /** Field where the supplier writes the devis reference. */
4647
4648
  devisField: 'label' | 'invoice_number' | 'lines';
4648
- /** Expresion regular con un grupo de captura. */
4649
+ /** Regular expression with a single capture group. */
4649
4650
  projectPattern?: string;
4650
4651
  devisPattern?: string;
4651
4652
  };
@@ -4658,29 +4659,29 @@ export type PennylaneIgnoredSupplier = {
4658
4659
  ignoredBy?: string | null;
4659
4660
  };
4660
4661
 
4661
- /** Configuracion de PennyLane por empresa: enterprises/{id}/configurations/pennylane */
4662
+ /** Per-enterprise PennyLane configuration: enterprises/{id}/configurations/pennylane */
4662
4663
  export type PennylaneConfiguration = {
4663
4664
  enabled: boolean;
4664
- /** Identificador numérico de la empresa en PennyLane (ej. '156553'). */
4665
+ /** Numeric id of the company in PennyLane (e.g. '156553'). */
4665
4666
  companyId?: string;
4666
4667
  push: { issued: boolean; received: boolean };
4667
4668
  pull: { supplierInvoices: boolean };
4668
- /** false = enviar solo importes agregados + PDF. */
4669
+ /** false = send aggregate amounts + PDF only. */
4669
4670
  sendLineItems: boolean;
4670
- /** true mientras el mapeo contable no este cerrado con el contable. */
4671
+ /** true while the accounting mapping is not settled with the accountant. */
4671
4672
  importAsIncomplete: boolean;
4672
4673
  references: PennylaneReferenceConfig;
4673
- /** Estados de PennyLane que no se traen (borradores y ruido inicial). */
4674
+ /** PennyLane states that are not pulled (drafts and initial noise). */
4674
4675
  excludedStates?: string[];
4675
- /** Dias hacia atras en la carga inicial o el resync completo. */
4676
+ /** Days to look back on the initial load or a full resync. */
4676
4677
  lookbackDays?: number;
4677
4678
  defaultLedgerAccountId?: string;
4678
4679
  ledgerAccountByCategory?: Record<string, string>;
4679
- /** Analitico por chantier. Ver [[PennylaneCategoryConfig]]. */
4680
+ /** Analytical breakdown per chantier. See [[PennylaneCategoryConfig]]. */
4680
4681
  categories?: PennylaneCategoryConfig;
4681
- /** Lista de proveedores cuyas facturas se ignoran automáticamente al sincronizar. */
4682
+ /** Suppliers whose invoices are ignored automatically on sync. */
4682
4683
  ignoredSuppliers?: PennylaneIgnoredSupplier[];
4683
- /** Estado del sync. Solo lo escriben las Cloud Functions. */
4684
+ /** Sync state. Written by the Cloud Functions only. */
4684
4685
  sync?: {
4685
4686
  supplierInvoices?: PennylaneSyncState;
4686
4687
  customerInvoices?: PennylaneSyncState;
@@ -4688,47 +4689,69 @@ export type PennylaneConfiguration = {
4688
4689
  };
4689
4690
 
4690
4691
  /**
4691
- * Analitico por chantier: una categoria de PennyLane por proyecto de Articho,
4692
- * la misma para las facturas emitidas y las recibidas de ese proyecto.
4692
+ * Analytical breakdown per chantier: one PennyLane category per Articho
4693
+ * project, the same one for that project's issued and received invoices.
4693
4694
  *
4694
- * El GRUPO de categorias no se puede crear por API: lo da de alta una persona
4695
- * en PennyLane y su id se pega aqui. Y las categorias, una vez creadas, NO se
4696
- * pueden borrar por API —solo renombrar—, asi que se crean perezosamente: la
4697
- * primera vez que un proyecto recibe o emite una factura, nunca al crear el
4698
- * proyecto. Un proyecto que nunca factura no ensucia el plan analitico.
4695
+ * The category GROUP cannot be created through the API: a person creates it in
4696
+ * PennyLane and its id is pasted here. And categories, once created, can NOT
4697
+ * be deleted through the API — only renamed — so they are created lazily: the
4698
+ * first time a project receives or issues an invoice, never when the project
4699
+ * is created. A project that never invoices does not pollute the chart.
4699
4700
  */
4700
4701
  export type PennylaneCategoryConfig = {
4701
- /** Interruptor. Sin esto el sync no toca categorias. */
4702
+ /** Master switch. Without it the sync never touches categories. */
4702
4703
  enabled: boolean;
4703
4704
  /**
4704
- * Id del grupo creado a mano en PennyLane (p. ej. "Chantiers Articho").
4705
- * Es distinto en cada empresa: son espacios de PennyLane distintos.
4705
+ * Id of the group created by hand in PennyLane (e.g. "Chantiers Articho").
4706
+ * It differs per enterprise: they are separate PennyLane workspaces.
4706
4707
  */
4707
4708
  groupId: number;
4708
- /** Categorizar tambien las facturas que Articho emite. */
4709
+ /** Also categorise the invoices Articho issues. */
4709
4710
  includeCustomerInvoices?: boolean;
4710
4711
  };
4711
4712
 
4712
4713
  export type PennylaneSyncState = {
4713
4714
  /**
4714
- * Marca de tiempo del ultimo cambio procesado. El changelog de PennyLane
4715
- * solo retiene 4 semanas: si esto se queda atras, hay perdida de datos.
4715
+ * Timestamp of the last change processed. PennyLane's changelog only retains
4716
+ * 4 weeks: if this falls behind, data is lost.
4716
4717
  */
4717
4718
  checkpoint: number;
4718
4719
  lastRunAt: number;
4719
4720
  lastError?: string | null;
4721
+ /**
4722
+ * Invoices that failed and must be retried on the next run.
4723
+ *
4724
+ * It exists so the checkpoint can advance even when an invoice fails. The
4725
+ * alternative — holding the checkpoint back whenever there are errors —
4726
+ * looks safer and is not: a single invoice that always fails (a corrupt PDF,
4727
+ * a supplier that never resolves) would freeze the whole enterprise's sync,
4728
+ * reprocessing an ever-growing window until the function times out.
4729
+ */
4730
+ pending?: PennylanePendingInvoice[];
4731
+ };
4732
+
4733
+ /** An invoice awaiting retry, with its attempt count. */
4734
+ export type PennylanePendingInvoice = {
4735
+ /** Invoice id in PennyLane. */
4736
+ id: string;
4737
+ /** Attempts used. On reaching [[PENNYLANE_MAX_RETRIES]] it is abandoned. */
4738
+ attempts: number;
4739
+ /** Last error, so the reason is visible without opening the logs. */
4740
+ lastError: string;
4741
+ /** When it last failed. */
4742
+ lastAttemptAt: number;
4720
4743
  };
4721
4744
 
4722
4745
  export enum ImportedBillStatus {
4723
- /** Llego de PennyLane y no se ha podido resolver proyecto o devis. */
4746
+ /** Arrived from PennyLane; project or devis could not be resolved. */
4724
4747
  PENDING_ASSIGNMENT = 'PENDING_ASSIGNMENT',
4725
- /** Proyecto y devis resueltos: falta que un administrador confirme. */
4748
+ /** Project and devis resolved: waiting for an administrator to confirm. */
4726
4749
  READY_TO_ASSIGN = 'READY_TO_ASSIGN',
4727
- /** Ya tiene una factura creada dentro de un proyecto. */
4750
+ /** Already has a bill created inside a project. */
4728
4751
  ASSIGNED = 'ASSIGNED',
4729
- /** Descartada a mano. */
4752
+ /** Discarded by hand. */
4730
4753
  IGNORED = 'IGNORED',
4731
- /** Duplicado de otra factura importada. */
4754
+ /** Duplicate of another imported invoice. */
4732
4755
  DUPLICATE = 'DUPLICATE',
4733
4756
  }
4734
4757
 
@@ -4742,8 +4765,8 @@ export enum PennylaneSyncEventType {
4742
4765
  }
4743
4766
 
4744
4767
  /**
4745
- * Un evento por cada cosa que le pasa a una factura importada. Sin esto, una
4746
- * factura que cambia sola de estado es indistinguible de un bug.
4768
+ * One event per thing that happens to an imported invoice. Without this, an
4769
+ * invoice that changes status on its own is indistinguishable from a bug.
4747
4770
  */
4748
4771
  export type PennylaneSyncEvent = {
4749
4772
  id: string;
@@ -4756,17 +4779,17 @@ export type PennylaneSyncEvent = {
4756
4779
  };
4757
4780
 
4758
4781
  /**
4759
- * Espejo de una factura de PennyLane dentro de Articho.
4782
+ * Mirror of a PennyLane invoice inside Articho.
4760
4783
  *
4761
- * Vive a nivel de empresa y no dentro de un proyecto a proposito: una factura
4762
- * que entra electronicamente no sabe a que proyecto pertenece. Es tambien la
4763
- * fuente del listado "Bills" del menu de administradores.
4784
+ * It deliberately lives at enterprise level and not inside a project: an
4785
+ * invoice arriving electronically does not know which project it belongs to.
4786
+ * It is also the source of the "Bills" listing in the administrator menu.
4764
4787
  */
4765
4788
  export type ImportedBill = {
4766
4789
  id: string;
4767
4790
  source: 'pennylane';
4768
4791
  direction: 'supplier' | 'customer';
4769
- /** Id en PennyLane. Clave de deduplicacion. */
4792
+ /** Id in PennyLane. The deduplication key. */
4770
4793
  externalId: string;
4771
4794
  enterpriseId: string;
4772
4795
  status: ImportedBillStatus;
@@ -4783,7 +4806,7 @@ export type ImportedBill = {
4783
4806
  isPaid: boolean;
4784
4807
  paidAt?: number | null;
4785
4808
  externalStatus?: string | null;
4786
- /** Origen de la importacion en PennyLane: Email, API, PA/PDP... */
4809
+ /** How it got into PennyLane: Email, API, PA/PDP… */
4787
4810
  externalSource?: string | null;
4788
4811
  fileUrl?: string | null;
4789
4812
  };
@@ -4794,21 +4817,21 @@ export type ImportedBill = {
4794
4817
  pennylaneId?: string | null;
4795
4818
  };
4796
4819
 
4797
- /** Referencias tal y como venian en la factura, y de que campo salieron. */
4820
+ /** References exactly as they came on the invoice, and which field they came from. */
4798
4821
  references: {
4799
4822
  projectRef?: string | null;
4800
4823
  devisRef?: string | null;
4801
4824
  sources?: { project?: string; devis?: string };
4802
4825
  };
4803
4826
 
4804
- /** Resolucion automatica. Nunca crea la factura por si sola. */
4827
+ /** Automatic resolution. It never creates the bill on its own. */
4805
4828
  suggestion?: {
4806
4829
  projectId?: string | null;
4807
4830
  devisId?: string | null;
4808
4831
  reasons: string[];
4809
4832
  };
4810
4833
 
4811
- /** Asociacion confirmada por un administrador. */
4834
+ /** Association confirmed by an administrator. */
4812
4835
  assignment?: {
4813
4836
  projectId: string;
4814
4837
  devisId: string;
@@ -4825,22 +4848,22 @@ export type ImportedBill = {
4825
4848
  };
4826
4849
 
4827
4850
  /* -------------------------------------------------------------------------- */
4828
- /* Identidad de facturacion */
4851
+ /* Billing identity */
4829
4852
  /* -------------------------------------------------------------------------- */
4830
4853
 
4831
4854
  /**
4832
- * Direccion postal desglosada.
4855
+ * Postal address, broken down.
4833
4856
  *
4834
- * El campo `address` suelto que ya existe en varias entidades no sirve para
4835
- * facturar: PennyLane —y la facturacion electronica en general— exige calle,
4836
- * codigo postal, ciudad y pais como campos separados. Y `GeoLocation` solo
4837
- * guarda lat/lng, asi que no hay de donde derivarlos.
4857
+ * The loose `address` field several entities already carry is not usable for
4858
+ * invoicing: PennyLane — and e-invoicing in general — requires street, postal
4859
+ * code, city and country as separate fields. And `GeoLocation` only stores
4860
+ * lat/lng, so there is nothing to derive them from.
4838
4861
  */
4839
4862
  export type PostalAddress = {
4840
4863
  address: string;
4841
4864
  postalCode: string;
4842
4865
  city: string;
4843
- /** Codigo ISO de dos letras: FR, ES, BE... */
4866
+ /** Two-letter ISO code: FR, ES, BE… */
4844
4867
  countryAlpha2: string;
4845
4868
  };
4846
4869
 
@@ -4863,80 +4886,79 @@ export enum BillingLanguage {
4863
4886
  }
4864
4887
 
4865
4888
  /**
4866
- * Datos necesarios para emitir una factura a esta entidad.
4889
+ * Everything needed to issue an invoice to this entity.
4867
4890
  *
4868
- * Es el mismo objeto para las cinco entidades facturables (Client, Pro,
4869
- * Seller, Provider, MaterialsProvider) a proposito: un solo tipo, un solo
4870
- * validador y un solo formulario, en lugar de cinco variantes que divergen.
4891
+ * It is deliberately the same object for the five billable entities (Client,
4892
+ * Pro, Seller, Provider, MaterialsProvider): one type, one validator and one
4893
+ * form, instead of five variants that drift apart.
4871
4894
  *
4872
- * Se rellena de forma incremental: el modal de envio a PennyLane pide lo que
4873
- * falte justo antes de facturar y lo guarda aqui, de modo que solo se completa
4874
- * para las entidades a las que de verdad se les factura.
4895
+ * It is filled in incrementally: the PennyLane sending modal asks for whatever
4896
+ * is missing right before invoicing and saves it here, so it only ever gets
4897
+ * completed for the entities that actually get invoiced.
4875
4898
  */
4876
4899
  /**
4877
- * Persona juridica o persona fisica.
4900
+ * Legal person or natural person.
4878
4901
  *
4879
- * No es un detalle de forma: decide que exige la ley y que endpoint de
4880
- * PennyLane se usa. Una factura a una empresa entra en la facturacion
4881
- * electronica —SIREN obligatorio, transmision por la red—; una a un particular
4882
- * queda fuera del ambito y solo genera e-reporting, sin identificar al cliente.
4902
+ * Not a cosmetic detail: it decides what the law requires and which PennyLane
4903
+ * endpoint is used. An invoice to a company falls under e-invoicing — SIREN
4904
+ * mandatory, transmitted over the network; one to a private individual is out
4905
+ * of scope and only produces e-reporting, with no client identity.
4883
4906
  *
4884
- * Un `undefined` significa "todavia no lo sabemos", que es distinto de las
4885
- * otras dos: el formulario tiene que preguntarlo, no suponerlo.
4907
+ * `undefined` means "we do not know yet", which is different from the other
4908
+ * two: the form has to ask, not assume.
4886
4909
  */
4887
4910
  export type BillingLegalType = 'company' | 'individual';
4888
4911
 
4889
4912
  export type BillingIdentity = {
4890
- /** Empresa o particular. Ver [[BillingLegalType]]. */
4913
+ /** Company or private individual. See [[BillingLegalType]]. */
4891
4914
  legalType?: BillingLegalType;
4892
4915
 
4893
4916
  /**
4894
- * Razon social. Obligatoria en empresas.
4917
+ * Legal name. Mandatory for companies.
4895
4918
  *
4896
- * En un particular no se pide: se compone de nombre y apellidos con
4897
- * [[billingDisplayName]], para no tener dos sitios donde vive el mismo dato
4898
- * y que acaben diciendo cosas distintas.
4919
+ * It is not asked of an individual: it is composed from first and last name
4920
+ * by [[billingDisplayName]], so the same fact does not live in two places
4921
+ * and end up saying different things.
4899
4922
  */
4900
4923
  legalName: string;
4901
4924
 
4902
- /** Nombre. Obligatorio en particulares; PennyLane lo pide separado. */
4925
+ /** First name. Mandatory for individuals; PennyLane wants it separate. */
4903
4926
  firstName?: string;
4904
- /** Apellidos. Obligatorio en particulares. */
4927
+ /** Last name. Mandatory for individuals. */
4905
4928
  lastName?: string;
4906
- /** Direccion de facturacion. Obligatoria. */
4929
+ /** Billing address. Mandatory. */
4907
4930
  address: PostalAddress;
4908
- /** Direccion de entrega, si difiere de la de facturacion. */
4931
+ /** Delivery address, when it differs from the billing one. */
4909
4932
  deliveryAddress?: PostalAddress;
4910
- /** SIREN (9 digitos) o SIRET (14). */
4933
+ /** SIREN (9 digits) or SIRET (14). */
4911
4934
  registrationNumber?: string;
4912
- /** Numero de TVA intracomunitario. No confundir con el tipo de IVA. */
4935
+ /** Intra-community VAT number. Not to be confused with the VAT rate. */
4913
4936
  vatNumber?: string;
4914
- /** Correos a los que enviar la factura. */
4937
+ /** Addresses the invoice is sent to. */
4915
4938
  emails?: string[];
4916
4939
  phone?: string;
4917
- /** Persona o servicio destinatario dentro de la empresa. */
4940
+ /** Recipient person or department inside the company. */
4918
4941
  recipient?: string;
4919
4942
  paymentConditions?: BillingPaymentConditions;
4920
4943
  language?: BillingLanguage;
4921
- /** Notas que acompanan a la ficha del tercero. */
4944
+ /** Notes attached to the third party's record. */
4922
4945
  notes?: string;
4923
4946
  /**
4924
- * Id del tercero en PennyLane, cacheado tras la primera factura. Evita
4925
- * volver a buscarlo y, sobre todo, evita duplicar la ficha.
4947
+ * The third party's id in PennyLane, cached after the first invoice. It
4948
+ * avoids looking it up again and, above all, avoids duplicating the record.
4926
4949
  */
4927
4950
  pennylaneCustomerId?: string;
4928
4951
 
4929
4952
  /**
4930
- * Lo que dice el registro publico de la empresa, tal y como se leyo la
4931
- * ultima vez. No va impreso en la factura: es la procedencia de lo que hay
4932
- * arriba. Ver [[BillingInseeData]].
4953
+ * What the public register says about the company, exactly as it was last
4954
+ * read. It is not printed on the invoice: it is the provenance of what is
4955
+ * above. See [[BillingInseeData]].
4933
4956
  */
4934
4957
  insee?: BillingInseeData;
4935
4958
 
4936
4959
  /**
4937
- * Que problemas se encontraron la ultima vez que se intento completar esta
4938
- * ficha desde los registros publicos. Pensado para pintarse como tooltip.
4939
- * Ver [[BillingEnrichment]].
4960
+ * What went wrong the last time this record was completed from the public
4961
+ * registers. Meant to be rendered as a tooltip. See [[BillingEnrichment]].
4940
4962
  */
4941
4963
  enrichment?: BillingEnrichment;
4942
4964
 
@@ -4945,57 +4967,58 @@ export type BillingIdentity = {
4945
4967
  };
4946
4968
 
4947
4969
  /**
4948
- * Lo que el registro publico dice de la empresa de un tercero.
4970
+ * What the public register says about a third party's company.
4949
4971
  *
4950
- * Lo escribe `scripts/enrich-billing-from-insee.js`. Cuelga de
4951
- * [[BillingIdentity]] junto al resto de lo que hace falta para facturar, pero
4952
- * en su propio bloque: los campos de arriba son lo que va impreso en la
4953
- * factura y los puede corregir una persona; esto es lo que dice el registro y
4954
- * se reescribe en cada pasada.
4972
+ * Written by `scripts/enrich-billing-from-insee.js`. It hangs off
4973
+ * [[BillingIdentity]] alongside the rest of what invoicing needs, but in its
4974
+ * own block: the fields above are what gets printed on the invoice and a human
4975
+ * may correct them; this is what the register says and it is rewritten on
4976
+ * every pass.
4955
4977
  */
4956
4978
  export interface BillingInseeData {
4957
- /** SIREN, 9 digitos. */
4979
+ /** SIREN, 9 digits. */
4958
4980
  siren?: string;
4959
- /** SIRET del establecimiento consultado, 14 digitos. */
4981
+ /** SIRET of the establishment queried, 14 digits. */
4960
4982
  siret?: string;
4961
- /** Si el establecimiento consultado es el domicilio social. */
4983
+ /** Whether the establishment queried is the registered office. */
4962
4984
  siege?: boolean;
4963
- /** Categoria juridica (`categorieJuridiqueUniteLegale`). */
4985
+ /** Legal form (`categorieJuridiqueUniteLegale`). */
4964
4986
  legalForm?: string | null;
4965
- /** Codigo APE/NAF (`activitePrincipaleUniteLegale`). */
4987
+ /** APE/NAF code (`activitePrincipaleUniteLegale`). */
4966
4988
  nafCode?: string | null;
4967
- /** Estado de la unidad legal: `A` activa, `C` cesada. */
4989
+ /** Legal unit state: `A` active, `C` ceased. */
4968
4990
  state?: string | null;
4969
- /** Estado del establecimiento: `A` activo, `F` cerrado. */
4991
+ /** Establishment state: `A` open, `F` closed. */
4970
4992
  establishmentState?: string | null;
4971
- /** Nombre comercial, si difiere de la razon social. */
4993
+ /** Trade name, when it differs from the legal name. */
4972
4994
  tradeName?: string | null;
4973
- /** Como se resolvio: `siret`, `siege` o `siege-fallback`. */
4995
+ /** How it was resolved: `siret`, `siege` or `siege-fallback`. */
4974
4996
  matchedBy?: string;
4975
4997
  /**
4976
- * Presente solo si el SIREN no venia en la ficha y se dedujo buscando por
4977
- * razon social. Sirve para no confundir un dato aportado con uno inferido.
4998
+ * Set only when the SIREN was absent from the record and was deduced by
4999
+ * searching on the legal name. It keeps a supplied fact distinguishable from
5000
+ * an inferred one.
4978
5001
  */
4979
5002
  sirenFoundBy?: string;
4980
- /** Resultado de validar el numero de TVA contra VIES. */
5003
+ /** Result of checking the VAT number against VIES. */
4981
5004
  vatCheck?: BillingVatCheck;
4982
- /** Cuando se consulto el registro por ultima vez. */
5005
+ /** When the register was last queried. */
4983
5006
  checkedAt?: number;
4984
5007
  }
4985
5008
 
4986
5009
  /**
4987
- * Validacion del numero de TVA intracomunitario contra el registro VIES.
5010
+ * Validation of the intra-community VAT number against the VIES register.
4988
5011
  *
4989
- * El numero no lo publica el INSEE: se calcula a partir del SIREN, y la
4990
- * formula siempre devuelve algo bien formado, tambien para quien esta en
4991
- * franquicia en base y no tiene numero real. `valid: false` significa que el
4992
- * numero no existe, no que este mal escrito.
5012
+ * INSEE does not publish the number: it is computed from the SIREN, and the
5013
+ * formula always returns something well-formed, including for someone under
5014
+ * franchise en base who has no real number. `valid: false` means the number
5015
+ * does not exist, not that it is malformed.
4993
5016
  */
4994
5017
  export interface BillingVatCheck {
4995
- /** El numero que se comprobo. */
5018
+ /** The number that was checked. */
4996
5019
  number: string;
4997
5020
  status: 'VALID' | 'INVALID' | 'UNAVAILABLE';
4998
- /** `null` cuando VIES no contesto: no se sabe, que no es lo mismo que no. */
5021
+ /** `null` when VIES did not answer: unknown, which is not the same as no. */
4999
5022
  valid: boolean | null;
5000
5023
  reason?: string | null;
5001
5024
  source: string;
@@ -5003,64 +5026,64 @@ export interface BillingVatCheck {
5003
5026
  }
5004
5027
 
5005
5028
  /**
5006
- * Gravedad de una incidencia de enriquecimiento.
5029
+ * Severity of an enrichment issue.
5007
5030
  *
5008
- * - `ok` la ficha se completo sin nada que senalar.
5009
- * - `warning` se completo, pero hay algo que conviene mirar.
5010
- * - `error` no se pudo completar: falta el identificador, no esta en el
5011
- * registro, o la consulta fallo.
5031
+ * - `ok` the record was completed with nothing worth flagging.
5032
+ * - `warning` it was completed, but something is worth a look.
5033
+ * - `error` it could not be completed: the identifier is missing, it is not
5034
+ * in the register, or the lookup failed.
5012
5035
  */
5013
5036
  export type BillingEnrichmentLevel = 'ok' | 'warning' | 'error';
5014
5037
 
5015
5038
  /**
5016
- * Codigo de cada incidencia. Existe para poder filtrar y contar sin parsear
5017
- * el texto, que esta escrito para leerse y puede cambiar de redaccion.
5039
+ * Code for each issue. It exists so they can be filtered and counted without
5040
+ * parsing the text, which is written to be read and may be reworded.
5018
5041
  */
5019
5042
  export enum BillingEnrichmentCode {
5020
- /** La ficha no trae ni SIREN ni SIRET. */
5043
+ /** The record carries neither SIREN nor SIRET. */
5021
5044
  NO_IDENTIFIER = 'NO_IDENTIFIER',
5022
- /** Hay varias empresas con esa razon social: hace falta elegir a mano. */
5045
+ /** Several companies share that legal name: a human must choose. */
5023
5046
  SIREN_AMBIGUOUS = 'SIREN_AMBIGUOUS',
5024
- /** El identificador no aparece en el registro. */
5047
+ /** The identifier does not appear in the register. */
5025
5048
  NOT_FOUND = 'NOT_FOUND',
5026
- /** La unidad legal figura cesada. */
5049
+ /** The legal unit is recorded as ceased. */
5027
5050
  COMPANY_CLOSED = 'COMPANY_CLOSED',
5028
- /** El establecimiento figura cerrado; la empresa puede seguir viva. */
5051
+ /** The establishment is closed; the company may still be alive. */
5029
5052
  ESTABLISHMENT_CLOSED = 'ESTABLISHMENT_CLOSED',
5030
- /** El numero de TVA no consta en VIES. Probable franquicia en base. */
5053
+ /** The VAT number is unknown to VIES. Likely franchise en base. */
5031
5054
  VAT_NOT_REGISTERED = 'VAT_NOT_REGISTERED',
5032
- /** VIES no contesto: el numero se guardo sin verificar. */
5055
+ /** VIES did not answer: the number was stored unverified. */
5033
5056
  VAT_UNVERIFIED = 'VAT_UNVERIFIED',
5034
- /** VIES devuelve una razon social distinta de la del INSEE. */
5057
+ /** VIES returns a legal name different from INSEE's. */
5035
5058
  VAT_NAME_MISMATCH = 'VAT_NAME_MISMATCH',
5036
- /** Establecimiento fuera de Francia: falta informar el pais. */
5059
+ /** Establishment outside France: the country must be filled in by hand. */
5037
5060
  FOREIGN_ADDRESS = 'FOREIGN_ADDRESS',
5038
5061
  MISSING_POSTAL_CODE = 'MISSING_POSTAL_CODE',
5039
5062
  MISSING_STREET = 'MISSING_STREET',
5040
- /** La consulta al registro fallo (red, cuota, credenciales). */
5063
+ /** The register lookup failed (network, quota, credentials). */
5041
5064
  LOOKUP_ERROR = 'LOOKUP_ERROR',
5042
5065
  }
5043
5066
 
5044
5067
  /**
5045
- * Que paso la ultima vez que se intento completar los datos de facturacion de
5046
- * esta ficha desde los registros publicos.
5068
+ * What happened the last time this record's billing data was completed from
5069
+ * the public registers.
5047
5070
  *
5048
- * `text` es el campo que se pinta: texto plano, un mensaje por linea, listo
5049
- * para un `title` o un tooltip. `messages` y `codes` estan para quien prefiera
5050
- * pintarlos sueltos o filtrar por tipo de incidencia.
5071
+ * `text` is the field meant to be displayed: plain text, one message per line,
5072
+ * ready for a `title` or a tooltip. `messages` and `codes` are there for
5073
+ * whoever prefers to render them separately or filter by issue type.
5051
5074
  *
5052
- * El bloque se reescribe entero en cada pasada. Que este ausente significa que
5053
- * la ficha nunca se reviso; que `level` sea `ok` significa que se reviso y no
5054
- * habia nada que senalar.
5075
+ * The whole block is rewritten on every pass. Its absence means the record was
5076
+ * never reviewed; `level` being `ok` means it was reviewed and there was
5077
+ * nothing to flag.
5055
5078
  */
5056
5079
  export interface BillingEnrichment {
5057
- /** Un mensaje por linea, separados por `\n`. Vacio cuando `level` es `ok`. */
5080
+ /** One message per line, separated by `\n`. Empty when `level` is `ok`. */
5058
5081
  text: string;
5059
- /** Los mismos mensajes, sin unir. */
5082
+ /** The same messages, unjoined. */
5060
5083
  messages: string[];
5061
5084
  codes: BillingEnrichmentCode[];
5062
5085
  level: BillingEnrichmentLevel;
5063
- /** Quien lo escribio, p. ej. `insee-script`. */
5086
+ /** Who wrote it, e.g. `insee-script`. */
5064
5087
  source: string;
5065
5088
  checkedAt: number;
5066
5089
  }