@placeshakr/config 10.30.2-alpha.1 → 10.31.0-alpha.2

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.
@@ -396,7 +396,7 @@ export interface Enterprise extends Resource {
396
396
  whatsapp?: boolean;
397
397
  marketplace?: boolean;
398
398
  multiProfessionals?: boolean;
399
- /** Integracion con PennyLane: activa el listado Bills y el sync. */
399
+ /** PennyLane integration: enables the Bills listing and the sync. */
400
400
  pennylane?: boolean;
401
401
  };
402
402
  /**
@@ -535,9 +535,9 @@ export interface User extends Resource {
535
535
  type Permissions = Record<string, boolean>;
536
536
  export interface Profile extends Resource {
537
537
  /**
538
- * Datos de facturacion del tercero. Vive en Profile —y no en Client, Pro y
539
- * Seller por separado— porque los tres lo heredan y el SDK escribe contra
540
- * este tipo. Ver [[BillingIdentity]] y `config/src/billing`.
538
+ * The third party's billing data. It lives on Profile — and not on Client,
539
+ * Pro and Seller separately — because all three inherit from it and the SDK
540
+ * writes against this type. See [[BillingIdentity]] and `config/src/billing`.
541
541
  */
542
542
  billing?: BillingIdentity;
543
543
  /**
@@ -2054,28 +2054,29 @@ export type Bill = Resource & {
2054
2054
  files?: File[];
2055
2055
  metadata?: {
2056
2056
  sentToIpaidthat?: boolean;
2057
- /** @deprecated usar metadata.pennylane. Se mantiene hasta retirar el envio por email. */
2057
+ /** @deprecated use metadata.pennylane. Kept until email delivery is retired. */
2058
2058
  sentToPennyLane?: boolean;
2059
2059
  /** @deprecated usar metadata.pennylane.lastSyncAt */
2060
2060
  sentToPennyLaneDate?: number;
2061
2061
  /**
2062
- * Estado de sincronizacion con PennyLane. Sustituye a los dos booleanos
2063
- * de arriba: guarda el id contable, el hash del ultimo payload enviado
2064
- * (idempotencia) y el error, para poder reintentar sin duplicar.
2062
+ * PennyLane sync state. Replaces the two booleans above: it holds the
2063
+ * accounting id, the hash of the last payload sent (idempotency) and the
2064
+ * error, so a retry never duplicates.
2065
2065
  */
2066
2066
  pennylane?: PennylaneBillSync;
2067
2067
  };
2068
2068
  /**
2069
- * Origen del documento cuando no se ha creado en Articho. Las facturas con
2070
- * source distinto de undefined no se editan ni se borran desde la app: la
2071
- * autoridad esta en firestore.rules.
2069
+ * Where the document came from when it was not created in Articho. Bills
2070
+ * whose source is not undefined are neither edited nor deleted from the app:
2071
+ * the authority on that is firestore.rules.
2072
2072
  */
2073
2073
  source?: 'pennylane';
2074
2074
  imported?: boolean;
2075
2075
  /**
2076
- * Datos de facturacion del destinatario, cuando este no tiene ficha propia
2077
- * (fournisseur de materiaux, de services y personnalise). Para CLIENT, PRO y
2078
- * PROVIDER viven en la ficha del tercero. Ver `config/src/billing`.
2076
+ * Billing data of the recipient when they have no record of their own
2077
+ * (fournisseur de matériaux, de services and personnalisé). For CLIENT, PRO
2078
+ * and PROVIDER it lives on the third party's record. See
2079
+ * `config/src/billing`.
2079
2080
  */
2080
2081
  billing?: BillingIdentity;
2081
2082
  };
@@ -3840,24 +3841,24 @@ export declare enum EmailEventsEnum {
3840
3841
  RESET_USER_PASSWORD = "RESET_USER_PASSWORD",
3841
3842
  DOCUMENTS_ISSUES = "DOCUMENTS_ISSUES"
3842
3843
  }
3843
- /** Estado de la sincronizacion de una factura concreta con PennyLane. */
3844
+ /** Sync state of one specific bill against PennyLane. */
3844
3845
  export type PennylaneBillSync = {
3845
3846
  status: 'PENDING' | 'SYNCED' | 'FAILED' | 'SKIPPED';
3846
- /** Id de la factura en PennyLane. */
3847
+ /** Invoice id in PennyLane. */
3847
3848
  invoiceId?: string;
3848
- /** Id de la factura acreditada en PennyLane (para avoirs). */
3849
+ /** Id of the credited invoice in PennyLane (for credit notes). */
3849
3850
  creditedInvoiceId?: string;
3850
- /** Id del avoir en PennyLane que cancela esta factura. */
3851
+ /** Id of the PennyLane credit note that cancels this invoice. */
3851
3852
  creditNoteId?: string;
3852
3853
  creditNoteNumber?: string;
3853
3854
  creditNoteStatus?: 'PENDING' | 'SYNCED' | 'FAILED' | 'SKIPPED';
3854
3855
  creditNoteError?: string;
3855
- /** Documento espejo en enterprises/{id}/importedBills. */
3856
+ /** Mirror document under enterprises/{id}/importedBills. */
3856
3857
  importedBillId?: string;
3857
3858
  fileAttachmentId?: string;
3858
3859
  /**
3859
- * Hash del payload enviado. PennyLane no ofrece Idempotency-Key, asi que la
3860
- * deduplicacion es nuestra: mismo hash que el ultimo SYNCED, no se reenvia.
3860
+ * Hash of the payload sent. PennyLane offers no Idempotency-Key, so
3861
+ * deduplication is ours: same hash as the last SYNCED, nothing is resent.
3861
3862
  */
3862
3863
  payloadHash?: string;
3863
3864
  attempts?: number;
@@ -3870,13 +3871,13 @@ export type PennylaneBillSync = {
3870
3871
  status?: number;
3871
3872
  };
3872
3873
  };
3873
- /** De que campo de la factura de PennyLane se lee cada referencia. */
3874
+ /** Which field of the PennyLane invoice each reference is read from. */
3874
3875
  export type PennylaneReferenceConfig = {
3875
- /** Campo donde el proveedor escribe la referencia de chantier. */
3876
+ /** Field where the supplier writes the chantier reference. */
3876
3877
  projectField: 'label' | 'invoice_number' | 'lines';
3877
- /** Campo donde el proveedor escribe la referencia de devis. */
3878
+ /** Field where the supplier writes the devis reference. */
3878
3879
  devisField: 'label' | 'invoice_number' | 'lines';
3879
- /** Expresion regular con un grupo de captura. */
3880
+ /** Regular expression with a single capture group. */
3880
3881
  projectPattern?: string;
3881
3882
  devisPattern?: string;
3882
3883
  };
@@ -3887,10 +3888,10 @@ export type PennylaneIgnoredSupplier = {
3887
3888
  ignoredAt: number;
3888
3889
  ignoredBy?: string | null;
3889
3890
  };
3890
- /** Configuracion de PennyLane por empresa: enterprises/{id}/configurations/pennylane */
3891
+ /** Per-enterprise PennyLane configuration: enterprises/{id}/configurations/pennylane */
3891
3892
  export type PennylaneConfiguration = {
3892
3893
  enabled: boolean;
3893
- /** Identificador numérico de la empresa en PennyLane (ej. '156553'). */
3894
+ /** Numeric id of the company in PennyLane (e.g. '156553'). */
3894
3895
  companyId?: string;
3895
3896
  push: {
3896
3897
  issued: boolean;
@@ -3899,67 +3900,88 @@ export type PennylaneConfiguration = {
3899
3900
  pull: {
3900
3901
  supplierInvoices: boolean;
3901
3902
  };
3902
- /** false = enviar solo importes agregados + PDF. */
3903
+ /** false = send aggregate amounts + PDF only. */
3903
3904
  sendLineItems: boolean;
3904
- /** true mientras el mapeo contable no este cerrado con el contable. */
3905
+ /** true while the accounting mapping is not settled with the accountant. */
3905
3906
  importAsIncomplete: boolean;
3906
3907
  references: PennylaneReferenceConfig;
3907
- /** Estados de PennyLane que no se traen (borradores y ruido inicial). */
3908
+ /** PennyLane states that are not pulled (drafts and initial noise). */
3908
3909
  excludedStates?: string[];
3909
- /** Dias hacia atras en la carga inicial o el resync completo. */
3910
+ /** Days to look back on the initial load or a full resync. */
3910
3911
  lookbackDays?: number;
3911
3912
  defaultLedgerAccountId?: string;
3912
3913
  ledgerAccountByCategory?: Record<string, string>;
3913
- /** Analitico por chantier. Ver [[PennylaneCategoryConfig]]. */
3914
+ /** Analytical breakdown per chantier. See [[PennylaneCategoryConfig]]. */
3914
3915
  categories?: PennylaneCategoryConfig;
3915
- /** Lista de proveedores cuyas facturas se ignoran automáticamente al sincronizar. */
3916
+ /** Suppliers whose invoices are ignored automatically on sync. */
3916
3917
  ignoredSuppliers?: PennylaneIgnoredSupplier[];
3917
- /** Estado del sync. Solo lo escriben las Cloud Functions. */
3918
+ /** Sync state. Written by the Cloud Functions only. */
3918
3919
  sync?: {
3919
3920
  supplierInvoices?: PennylaneSyncState;
3920
3921
  customerInvoices?: PennylaneSyncState;
3921
3922
  };
3922
3923
  };
3923
3924
  /**
3924
- * Analitico por chantier: una categoria de PennyLane por proyecto de Articho,
3925
- * la misma para las facturas emitidas y las recibidas de ese proyecto.
3925
+ * Analytical breakdown per chantier: one PennyLane category per Articho
3926
+ * project, the same one for that project's issued and received invoices.
3926
3927
  *
3927
- * El GRUPO de categorias no se puede crear por API: lo da de alta una persona
3928
- * en PennyLane y su id se pega aqui. Y las categorias, una vez creadas, NO se
3929
- * pueden borrar por API —solo renombrar—, asi que se crean perezosamente: la
3930
- * primera vez que un proyecto recibe o emite una factura, nunca al crear el
3931
- * proyecto. Un proyecto que nunca factura no ensucia el plan analitico.
3928
+ * The category GROUP cannot be created through the API: a person creates it in
3929
+ * PennyLane and its id is pasted here. And categories, once created, can NOT
3930
+ * be deleted through the API — only renamed — so they are created lazily: the
3931
+ * first time a project receives or issues an invoice, never when the project
3932
+ * is created. A project that never invoices does not pollute the chart.
3932
3933
  */
3933
3934
  export type PennylaneCategoryConfig = {
3934
- /** Interruptor. Sin esto el sync no toca categorias. */
3935
+ /** Master switch. Without it the sync never touches categories. */
3935
3936
  enabled: boolean;
3936
3937
  /**
3937
- * Id del grupo creado a mano en PennyLane (p. ej. "Chantiers Articho").
3938
- * Es distinto en cada empresa: son espacios de PennyLane distintos.
3938
+ * Id of the group created by hand in PennyLane (e.g. "Chantiers Articho").
3939
+ * It differs per enterprise: they are separate PennyLane workspaces.
3939
3940
  */
3940
3941
  groupId: number;
3941
- /** Categorizar tambien las facturas que Articho emite. */
3942
+ /** Also categorise the invoices Articho issues. */
3942
3943
  includeCustomerInvoices?: boolean;
3943
3944
  };
3944
3945
  export type PennylaneSyncState = {
3945
3946
  /**
3946
- * Marca de tiempo del ultimo cambio procesado. El changelog de PennyLane
3947
- * solo retiene 4 semanas: si esto se queda atras, hay perdida de datos.
3947
+ * Timestamp of the last change processed. PennyLane's changelog only retains
3948
+ * 4 weeks: if this falls behind, data is lost.
3948
3949
  */
3949
3950
  checkpoint: number;
3950
3951
  lastRunAt: number;
3951
3952
  lastError?: string | null;
3953
+ /**
3954
+ * Invoices that failed and must be retried on the next run.
3955
+ *
3956
+ * It exists so the checkpoint can advance even when an invoice fails. The
3957
+ * alternative — holding the checkpoint back whenever there are errors —
3958
+ * looks safer and is not: a single invoice that always fails (a corrupt PDF,
3959
+ * a supplier that never resolves) would freeze the whole enterprise's sync,
3960
+ * reprocessing an ever-growing window until the function times out.
3961
+ */
3962
+ pending?: PennylanePendingInvoice[];
3963
+ };
3964
+ /** An invoice awaiting retry, with its attempt count. */
3965
+ export type PennylanePendingInvoice = {
3966
+ /** Invoice id in PennyLane. */
3967
+ id: string;
3968
+ /** Attempts used. On reaching [[PENNYLANE_MAX_RETRIES]] it is abandoned. */
3969
+ attempts: number;
3970
+ /** Last error, so the reason is visible without opening the logs. */
3971
+ lastError: string;
3972
+ /** When it last failed. */
3973
+ lastAttemptAt: number;
3952
3974
  };
3953
3975
  export declare enum ImportedBillStatus {
3954
- /** Llego de PennyLane y no se ha podido resolver proyecto o devis. */
3976
+ /** Arrived from PennyLane; project or devis could not be resolved. */
3955
3977
  PENDING_ASSIGNMENT = "PENDING_ASSIGNMENT",
3956
- /** Proyecto y devis resueltos: falta que un administrador confirme. */
3978
+ /** Project and devis resolved: waiting for an administrator to confirm. */
3957
3979
  READY_TO_ASSIGN = "READY_TO_ASSIGN",
3958
- /** Ya tiene una factura creada dentro de un proyecto. */
3980
+ /** Already has a bill created inside a project. */
3959
3981
  ASSIGNED = "ASSIGNED",
3960
- /** Descartada a mano. */
3982
+ /** Discarded by hand. */
3961
3983
  IGNORED = "IGNORED",
3962
- /** Duplicado de otra factura importada. */
3984
+ /** Duplicate of another imported invoice. */
3963
3985
  DUPLICATE = "DUPLICATE"
3964
3986
  }
3965
3987
  export declare enum PennylaneSyncEventType {
@@ -3971,8 +3993,8 @@ export declare enum PennylaneSyncEventType {
3971
3993
  ERROR = "ERROR"
3972
3994
  }
3973
3995
  /**
3974
- * Un evento por cada cosa que le pasa a una factura importada. Sin esto, una
3975
- * factura que cambia sola de estado es indistinguible de un bug.
3996
+ * One event per thing that happens to an imported invoice. Without this, an
3997
+ * invoice that changes status on its own is indistinguishable from a bug.
3976
3998
  */
3977
3999
  export type PennylaneSyncEvent = {
3978
4000
  id: string;
@@ -3984,17 +4006,17 @@ export type PennylaneSyncEvent = {
3984
4006
  payload?: Record<string, unknown>;
3985
4007
  };
3986
4008
  /**
3987
- * Espejo de una factura de PennyLane dentro de Articho.
4009
+ * Mirror of a PennyLane invoice inside Articho.
3988
4010
  *
3989
- * Vive a nivel de empresa y no dentro de un proyecto a proposito: una factura
3990
- * que entra electronicamente no sabe a que proyecto pertenece. Es tambien la
3991
- * fuente del listado "Bills" del menu de administradores.
4011
+ * It deliberately lives at enterprise level and not inside a project: an
4012
+ * invoice arriving electronically does not know which project it belongs to.
4013
+ * It is also the source of the "Bills" listing in the administrator menu.
3992
4014
  */
3993
4015
  export type ImportedBill = {
3994
4016
  id: string;
3995
4017
  source: 'pennylane';
3996
4018
  direction: 'supplier' | 'customer';
3997
- /** Id en PennyLane. Clave de deduplicacion. */
4019
+ /** Id in PennyLane. The deduplication key. */
3998
4020
  externalId: string;
3999
4021
  enterpriseId: string;
4000
4022
  status: ImportedBillStatus;
@@ -4010,7 +4032,7 @@ export type ImportedBill = {
4010
4032
  isPaid: boolean;
4011
4033
  paidAt?: number | null;
4012
4034
  externalStatus?: string | null;
4013
- /** Origen de la importacion en PennyLane: Email, API, PA/PDP... */
4035
+ /** How it got into PennyLane: Email, API, PA/PDP… */
4014
4036
  externalSource?: string | null;
4015
4037
  fileUrl?: string | null;
4016
4038
  };
@@ -4019,7 +4041,7 @@ export type ImportedBill = {
4019
4041
  regNo?: string | null;
4020
4042
  pennylaneId?: string | null;
4021
4043
  };
4022
- /** Referencias tal y como venian en la factura, y de que campo salieron. */
4044
+ /** References exactly as they came on the invoice, and which field they came from. */
4023
4045
  references: {
4024
4046
  projectRef?: string | null;
4025
4047
  devisRef?: string | null;
@@ -4028,13 +4050,13 @@ export type ImportedBill = {
4028
4050
  devis?: string;
4029
4051
  };
4030
4052
  };
4031
- /** Resolucion automatica. Nunca crea la factura por si sola. */
4053
+ /** Automatic resolution. It never creates the bill on its own. */
4032
4054
  suggestion?: {
4033
4055
  projectId?: string | null;
4034
4056
  devisId?: string | null;
4035
4057
  reasons: string[];
4036
4058
  };
4037
- /** Asociacion confirmada por un administrador. */
4059
+ /** Association confirmed by an administrator. */
4038
4060
  assignment?: {
4039
4061
  projectId: string;
4040
4062
  devisId: string;
@@ -4049,18 +4071,18 @@ export type ImportedBill = {
4049
4071
  createdAt: number;
4050
4072
  };
4051
4073
  /**
4052
- * Direccion postal desglosada.
4074
+ * Postal address, broken down.
4053
4075
  *
4054
- * El campo `address` suelto que ya existe en varias entidades no sirve para
4055
- * facturar: PennyLane —y la facturacion electronica en general— exige calle,
4056
- * codigo postal, ciudad y pais como campos separados. Y `GeoLocation` solo
4057
- * guarda lat/lng, asi que no hay de donde derivarlos.
4076
+ * The loose `address` field several entities already carry is not usable for
4077
+ * invoicing: PennyLane — and e-invoicing in general — requires street, postal
4078
+ * code, city and country as separate fields. And `GeoLocation` only stores
4079
+ * lat/lng, so there is nothing to derive them from.
4058
4080
  */
4059
4081
  export type PostalAddress = {
4060
4082
  address: string;
4061
4083
  postalCode: string;
4062
4084
  city: string;
4063
- /** Codigo ISO de dos letras: FR, ES, BE... */
4085
+ /** Two-letter ISO code: FR, ES, BE… */
4064
4086
  countryAlpha2: string;
4065
4087
  };
4066
4088
  export declare enum BillingPaymentConditions {
@@ -4080,193 +4102,193 @@ export declare enum BillingLanguage {
4080
4102
  ES = "es_ES"
4081
4103
  }
4082
4104
  /**
4083
- * Datos necesarios para emitir una factura a esta entidad.
4105
+ * Everything needed to issue an invoice to this entity.
4084
4106
  *
4085
- * Es el mismo objeto para las cinco entidades facturables (Client, Pro,
4086
- * Seller, Provider, MaterialsProvider) a proposito: un solo tipo, un solo
4087
- * validador y un solo formulario, en lugar de cinco variantes que divergen.
4107
+ * It is deliberately the same object for the five billable entities (Client,
4108
+ * Pro, Seller, Provider, MaterialsProvider): one type, one validator and one
4109
+ * form, instead of five variants that drift apart.
4088
4110
  *
4089
- * Se rellena de forma incremental: el modal de envio a PennyLane pide lo que
4090
- * falte justo antes de facturar y lo guarda aqui, de modo que solo se completa
4091
- * para las entidades a las que de verdad se les factura.
4111
+ * It is filled in incrementally: the PennyLane sending modal asks for whatever
4112
+ * is missing right before invoicing and saves it here, so it only ever gets
4113
+ * completed for the entities that actually get invoiced.
4092
4114
  */
4093
4115
  /**
4094
- * Persona juridica o persona fisica.
4116
+ * Legal person or natural person.
4095
4117
  *
4096
- * No es un detalle de forma: decide que exige la ley y que endpoint de
4097
- * PennyLane se usa. Una factura a una empresa entra en la facturacion
4098
- * electronica —SIREN obligatorio, transmision por la red—; una a un particular
4099
- * queda fuera del ambito y solo genera e-reporting, sin identificar al cliente.
4118
+ * Not a cosmetic detail: it decides what the law requires and which PennyLane
4119
+ * endpoint is used. An invoice to a company falls under e-invoicing — SIREN
4120
+ * mandatory, transmitted over the network; one to a private individual is out
4121
+ * of scope and only produces e-reporting, with no client identity.
4100
4122
  *
4101
- * Un `undefined` significa "todavia no lo sabemos", que es distinto de las
4102
- * otras dos: el formulario tiene que preguntarlo, no suponerlo.
4123
+ * `undefined` means "we do not know yet", which is different from the other
4124
+ * two: the form has to ask, not assume.
4103
4125
  */
4104
4126
  export type BillingLegalType = 'company' | 'individual';
4105
4127
  export type BillingIdentity = {
4106
- /** Empresa o particular. Ver [[BillingLegalType]]. */
4128
+ /** Company or private individual. See [[BillingLegalType]]. */
4107
4129
  legalType?: BillingLegalType;
4108
4130
  /**
4109
- * Razon social. Obligatoria en empresas.
4131
+ * Legal name. Mandatory for companies.
4110
4132
  *
4111
- * En un particular no se pide: se compone de nombre y apellidos con
4112
- * [[billingDisplayName]], para no tener dos sitios donde vive el mismo dato
4113
- * y que acaben diciendo cosas distintas.
4133
+ * It is not asked of an individual: it is composed from first and last name
4134
+ * by [[billingDisplayName]], so the same fact does not live in two places
4135
+ * and end up saying different things.
4114
4136
  */
4115
4137
  legalName: string;
4116
- /** Nombre. Obligatorio en particulares; PennyLane lo pide separado. */
4138
+ /** First name. Mandatory for individuals; PennyLane wants it separate. */
4117
4139
  firstName?: string;
4118
- /** Apellidos. Obligatorio en particulares. */
4140
+ /** Last name. Mandatory for individuals. */
4119
4141
  lastName?: string;
4120
- /** Direccion de facturacion. Obligatoria. */
4142
+ /** Billing address. Mandatory. */
4121
4143
  address: PostalAddress;
4122
- /** Direccion de entrega, si difiere de la de facturacion. */
4144
+ /** Delivery address, when it differs from the billing one. */
4123
4145
  deliveryAddress?: PostalAddress;
4124
- /** SIREN (9 digitos) o SIRET (14). */
4146
+ /** SIREN (9 digits) or SIRET (14). */
4125
4147
  registrationNumber?: string;
4126
- /** Numero de TVA intracomunitario. No confundir con el tipo de IVA. */
4148
+ /** Intra-community VAT number. Not to be confused with the VAT rate. */
4127
4149
  vatNumber?: string;
4128
- /** Correos a los que enviar la factura. */
4150
+ /** Addresses the invoice is sent to. */
4129
4151
  emails?: string[];
4130
4152
  phone?: string;
4131
- /** Persona o servicio destinatario dentro de la empresa. */
4153
+ /** Recipient person or department inside the company. */
4132
4154
  recipient?: string;
4133
4155
  paymentConditions?: BillingPaymentConditions;
4134
4156
  language?: BillingLanguage;
4135
- /** Notas que acompanan a la ficha del tercero. */
4157
+ /** Notes attached to the third party's record. */
4136
4158
  notes?: string;
4137
4159
  /**
4138
- * Id del tercero en PennyLane, cacheado tras la primera factura. Evita
4139
- * volver a buscarlo y, sobre todo, evita duplicar la ficha.
4160
+ * The third party's id in PennyLane, cached after the first invoice. It
4161
+ * avoids looking it up again and, above all, avoids duplicating the record.
4140
4162
  */
4141
4163
  pennylaneCustomerId?: string;
4142
4164
  /**
4143
- * Lo que dice el registro publico de la empresa, tal y como se leyo la
4144
- * ultima vez. No va impreso en la factura: es la procedencia de lo que hay
4145
- * arriba. Ver [[BillingInseeData]].
4165
+ * What the public register says about the company, exactly as it was last
4166
+ * read. It is not printed on the invoice: it is the provenance of what is
4167
+ * above. See [[BillingInseeData]].
4146
4168
  */
4147
4169
  insee?: BillingInseeData;
4148
4170
  /**
4149
- * Que problemas se encontraron la ultima vez que se intento completar esta
4150
- * ficha desde los registros publicos. Pensado para pintarse como tooltip.
4151
- * Ver [[BillingEnrichment]].
4171
+ * What went wrong the last time this record was completed from the public
4172
+ * registers. Meant to be rendered as a tooltip. See [[BillingEnrichment]].
4152
4173
  */
4153
4174
  enrichment?: BillingEnrichment;
4154
4175
  updatedAt?: number;
4155
4176
  updatedBy?: string;
4156
4177
  };
4157
4178
  /**
4158
- * Lo que el registro publico dice de la empresa de un tercero.
4179
+ * What the public register says about a third party's company.
4159
4180
  *
4160
- * Lo escribe `scripts/enrich-billing-from-insee.js`. Cuelga de
4161
- * [[BillingIdentity]] junto al resto de lo que hace falta para facturar, pero
4162
- * en su propio bloque: los campos de arriba son lo que va impreso en la
4163
- * factura y los puede corregir una persona; esto es lo que dice el registro y
4164
- * se reescribe en cada pasada.
4181
+ * Written by `scripts/enrich-billing-from-insee.js`. It hangs off
4182
+ * [[BillingIdentity]] alongside the rest of what invoicing needs, but in its
4183
+ * own block: the fields above are what gets printed on the invoice and a human
4184
+ * may correct them; this is what the register says and it is rewritten on
4185
+ * every pass.
4165
4186
  */
4166
4187
  export interface BillingInseeData {
4167
- /** SIREN, 9 digitos. */
4188
+ /** SIREN, 9 digits. */
4168
4189
  siren?: string;
4169
- /** SIRET del establecimiento consultado, 14 digitos. */
4190
+ /** SIRET of the establishment queried, 14 digits. */
4170
4191
  siret?: string;
4171
- /** Si el establecimiento consultado es el domicilio social. */
4192
+ /** Whether the establishment queried is the registered office. */
4172
4193
  siege?: boolean;
4173
- /** Categoria juridica (`categorieJuridiqueUniteLegale`). */
4194
+ /** Legal form (`categorieJuridiqueUniteLegale`). */
4174
4195
  legalForm?: string | null;
4175
- /** Codigo APE/NAF (`activitePrincipaleUniteLegale`). */
4196
+ /** APE/NAF code (`activitePrincipaleUniteLegale`). */
4176
4197
  nafCode?: string | null;
4177
- /** Estado de la unidad legal: `A` activa, `C` cesada. */
4198
+ /** Legal unit state: `A` active, `C` ceased. */
4178
4199
  state?: string | null;
4179
- /** Estado del establecimiento: `A` activo, `F` cerrado. */
4200
+ /** Establishment state: `A` open, `F` closed. */
4180
4201
  establishmentState?: string | null;
4181
- /** Nombre comercial, si difiere de la razon social. */
4202
+ /** Trade name, when it differs from the legal name. */
4182
4203
  tradeName?: string | null;
4183
- /** Como se resolvio: `siret`, `siege` o `siege-fallback`. */
4204
+ /** How it was resolved: `siret`, `siege` or `siege-fallback`. */
4184
4205
  matchedBy?: string;
4185
4206
  /**
4186
- * Presente solo si el SIREN no venia en la ficha y se dedujo buscando por
4187
- * razon social. Sirve para no confundir un dato aportado con uno inferido.
4207
+ * Set only when the SIREN was absent from the record and was deduced by
4208
+ * searching on the legal name. It keeps a supplied fact distinguishable from
4209
+ * an inferred one.
4188
4210
  */
4189
4211
  sirenFoundBy?: string;
4190
- /** Resultado de validar el numero de TVA contra VIES. */
4212
+ /** Result of checking the VAT number against VIES. */
4191
4213
  vatCheck?: BillingVatCheck;
4192
- /** Cuando se consulto el registro por ultima vez. */
4214
+ /** When the register was last queried. */
4193
4215
  checkedAt?: number;
4194
4216
  }
4195
4217
  /**
4196
- * Validacion del numero de TVA intracomunitario contra el registro VIES.
4218
+ * Validation of the intra-community VAT number against the VIES register.
4197
4219
  *
4198
- * El numero no lo publica el INSEE: se calcula a partir del SIREN, y la
4199
- * formula siempre devuelve algo bien formado, tambien para quien esta en
4200
- * franquicia en base y no tiene numero real. `valid: false` significa que el
4201
- * numero no existe, no que este mal escrito.
4220
+ * INSEE does not publish the number: it is computed from the SIREN, and the
4221
+ * formula always returns something well-formed, including for someone under
4222
+ * franchise en base who has no real number. `valid: false` means the number
4223
+ * does not exist, not that it is malformed.
4202
4224
  */
4203
4225
  export interface BillingVatCheck {
4204
- /** El numero que se comprobo. */
4226
+ /** The number that was checked. */
4205
4227
  number: string;
4206
4228
  status: 'VALID' | 'INVALID' | 'UNAVAILABLE';
4207
- /** `null` cuando VIES no contesto: no se sabe, que no es lo mismo que no. */
4229
+ /** `null` when VIES did not answer: unknown, which is not the same as no. */
4208
4230
  valid: boolean | null;
4209
4231
  reason?: string | null;
4210
4232
  source: string;
4211
4233
  checkedAt: number;
4212
4234
  }
4213
4235
  /**
4214
- * Gravedad de una incidencia de enriquecimiento.
4236
+ * Severity of an enrichment issue.
4215
4237
  *
4216
- * - `ok` la ficha se completo sin nada que senalar.
4217
- * - `warning` se completo, pero hay algo que conviene mirar.
4218
- * - `error` no se pudo completar: falta el identificador, no esta en el
4219
- * registro, o la consulta fallo.
4238
+ * - `ok` the record was completed with nothing worth flagging.
4239
+ * - `warning` it was completed, but something is worth a look.
4240
+ * - `error` it could not be completed: the identifier is missing, it is not
4241
+ * in the register, or the lookup failed.
4220
4242
  */
4221
4243
  export type BillingEnrichmentLevel = 'ok' | 'warning' | 'error';
4222
4244
  /**
4223
- * Codigo de cada incidencia. Existe para poder filtrar y contar sin parsear
4224
- * el texto, que esta escrito para leerse y puede cambiar de redaccion.
4245
+ * Code for each issue. It exists so they can be filtered and counted without
4246
+ * parsing the text, which is written to be read and may be reworded.
4225
4247
  */
4226
4248
  export declare enum BillingEnrichmentCode {
4227
- /** La ficha no trae ni SIREN ni SIRET. */
4249
+ /** The record carries neither SIREN nor SIRET. */
4228
4250
  NO_IDENTIFIER = "NO_IDENTIFIER",
4229
- /** Hay varias empresas con esa razon social: hace falta elegir a mano. */
4251
+ /** Several companies share that legal name: a human must choose. */
4230
4252
  SIREN_AMBIGUOUS = "SIREN_AMBIGUOUS",
4231
- /** El identificador no aparece en el registro. */
4253
+ /** The identifier does not appear in the register. */
4232
4254
  NOT_FOUND = "NOT_FOUND",
4233
- /** La unidad legal figura cesada. */
4255
+ /** The legal unit is recorded as ceased. */
4234
4256
  COMPANY_CLOSED = "COMPANY_CLOSED",
4235
- /** El establecimiento figura cerrado; la empresa puede seguir viva. */
4257
+ /** The establishment is closed; the company may still be alive. */
4236
4258
  ESTABLISHMENT_CLOSED = "ESTABLISHMENT_CLOSED",
4237
- /** El numero de TVA no consta en VIES. Probable franquicia en base. */
4259
+ /** The VAT number is unknown to VIES. Likely franchise en base. */
4238
4260
  VAT_NOT_REGISTERED = "VAT_NOT_REGISTERED",
4239
- /** VIES no contesto: el numero se guardo sin verificar. */
4261
+ /** VIES did not answer: the number was stored unverified. */
4240
4262
  VAT_UNVERIFIED = "VAT_UNVERIFIED",
4241
- /** VIES devuelve una razon social distinta de la del INSEE. */
4263
+ /** VIES returns a legal name different from INSEE's. */
4242
4264
  VAT_NAME_MISMATCH = "VAT_NAME_MISMATCH",
4243
- /** Establecimiento fuera de Francia: falta informar el pais. */
4265
+ /** Establishment outside France: the country must be filled in by hand. */
4244
4266
  FOREIGN_ADDRESS = "FOREIGN_ADDRESS",
4245
4267
  MISSING_POSTAL_CODE = "MISSING_POSTAL_CODE",
4246
4268
  MISSING_STREET = "MISSING_STREET",
4247
- /** La consulta al registro fallo (red, cuota, credenciales). */
4269
+ /** The register lookup failed (network, quota, credentials). */
4248
4270
  LOOKUP_ERROR = "LOOKUP_ERROR"
4249
4271
  }
4250
4272
  /**
4251
- * Que paso la ultima vez que se intento completar los datos de facturacion de
4252
- * esta ficha desde los registros publicos.
4273
+ * What happened the last time this record's billing data was completed from
4274
+ * the public registers.
4253
4275
  *
4254
- * `text` es el campo que se pinta: texto plano, un mensaje por linea, listo
4255
- * para un `title` o un tooltip. `messages` y `codes` estan para quien prefiera
4256
- * pintarlos sueltos o filtrar por tipo de incidencia.
4276
+ * `text` is the field meant to be displayed: plain text, one message per line,
4277
+ * ready for a `title` or a tooltip. `messages` and `codes` are there for
4278
+ * whoever prefers to render them separately or filter by issue type.
4257
4279
  *
4258
- * El bloque se reescribe entero en cada pasada. Que este ausente significa que
4259
- * la ficha nunca se reviso; que `level` sea `ok` significa que se reviso y no
4260
- * habia nada que senalar.
4280
+ * The whole block is rewritten on every pass. Its absence means the record was
4281
+ * never reviewed; `level` being `ok` means it was reviewed and there was
4282
+ * nothing to flag.
4261
4283
  */
4262
4284
  export interface BillingEnrichment {
4263
- /** Un mensaje por linea, separados por `\n`. Vacio cuando `level` es `ok`. */
4285
+ /** One message per line, separated by `\n`. Empty when `level` is `ok`. */
4264
4286
  text: string;
4265
- /** Los mismos mensajes, sin unir. */
4287
+ /** The same messages, unjoined. */
4266
4288
  messages: string[];
4267
4289
  codes: BillingEnrichmentCode[];
4268
4290
  level: BillingEnrichmentLevel;
4269
- /** Quien lo escribio, p. ej. `insee-script`. */
4291
+ /** Who wrote it, e.g. `insee-script`. */
4270
4292
  source: string;
4271
4293
  checkedAt: number;
4272
4294
  }