ecotransac-shared-js 1.1.44 → 1.1.46

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/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
1
  type Maybe<T> = T | null;
2
- type InputMaybe<T> = Maybe<T>;
3
2
  /** All built-in and custom scalars, mapped to their actual values */
4
3
  type Scalars = {
5
4
  ID: {
@@ -370,28 +369,6 @@ type Mandate = {
370
369
  updatedAt: Scalars['DateTime']['output'];
371
370
  };
372
371
  type MandateExclusivity = 'EXCLUSIVE' | 'SEMI_EXCLUSIVE' | 'SIMPLE';
373
- type MandateInput = {
374
- /** % d'honoraires agence */
375
- agencyFeePercentage?: InputMaybe<Scalars['Float']['input']>;
376
- /** Prix de cession du fonds de commerce */
377
- businessAssetsPrice?: InputMaybe<Scalars['Float']['input']>;
378
- escrowReceiver?: InputMaybe<Scalars['String']['input']>;
379
- exclusivity: MandateExclusivity;
380
- isFreeOfOccupationAndManagement?: InputMaybe<Scalars['Boolean']['input']>;
381
- isFreeOfPledge?: InputMaybe<Scalars['Boolean']['input']>;
382
- isFreeOfPrivilege?: InputMaybe<Scalars['Boolean']['input']>;
383
- isStockIncluded?: InputMaybe<Scalars['Boolean']['input']>;
384
- isVatApplicable?: InputMaybe<Scalars['Boolean']['input']>;
385
- /** Prix de cession du bail */
386
- leaseRightsPrice?: InputMaybe<Scalars['Float']['input']>;
387
- /** Prix de vente vendeur */
388
- netOwnerPrice?: InputMaybe<Scalars['Float']['input']>;
389
- netOwnerRent?: InputMaybe<Scalars['Float']['input']>;
390
- notaryNameAndCity: Scalars['String']['input'];
391
- rentCharges?: InputMaybe<Scalars['Float']['input']>;
392
- securityDeposit?: InputMaybe<Scalars['Float']['input']>;
393
- specialConditions?: InputMaybe<Scalars['String']['input']>;
394
- };
395
372
  type MandateStatus = 'AWAITING_SIGNATURES' | 'AWAITING_VALIDATION' | 'EXPIRED' | 'PROCESSING' | 'REJECTED' | 'WITHDRAWN';
396
373
  type MaritalStatus = 'CIVIL_PARTNERSHIP' | 'DIVORCED' | 'MARRIED_WITHOUT_PRENUP' | 'MARRIED_WITH_PRENUP' | 'SINGLE' | 'WIDOWED';
397
374
  type MultimediaUsage = 'INTENSE' | 'LOW' | 'MODERATE';
@@ -569,7 +546,7 @@ type Property = {
569
546
  propertyTaxPrice?: Maybe<Scalars['Float']['output']>;
570
547
  propertyType: Scalars['String']['output'];
571
548
  recommendedWorkCost?: Maybe<Scalars['Float']['output']>;
572
- reference: Scalars['String']['output'];
549
+ reference: Scalars['Int']['output'];
573
550
  renovationYear?: Maybe<Scalars['DateTime']['output']>;
574
551
  roomCount?: Maybe<Scalars['Int']['output']>;
575
552
  securityServices?: Maybe<Scalars['String']['output']>;
@@ -727,8 +704,8 @@ declare const getAgencyFees: (mandate: GetNetPriceMandate & {
727
704
  agencyFeePercentage: number;
728
705
  }) => number;
729
706
 
730
- type Field<T> = {
731
- name: keyof T;
707
+ type Field = {
708
+ name: string;
732
709
  fieldType: FieldType;
733
710
  label: string;
734
711
  condition?: Condition;
@@ -765,6 +742,7 @@ declare const getLabel: <T>(list: {
765
742
  }[], value: T) => string | null;
766
743
  declare const formatAddress: (address: Pick<Address, "address" | "postalCode" | "locality">) => string;
767
744
  declare const formatSeconds: (seconds: number) => string;
745
+ declare const formatReference: (reference: number) => string;
768
746
  declare const formatDate: (date?: Date | null, withTime?: boolean) => string | null;
769
747
  declare const formatPrice: (price: number) => string;
770
748
  declare const formatPhone: (phone?: string | null) => string | null;
@@ -779,10 +757,10 @@ declare const not: (condition: string | Condition) => Condition;
779
757
  declare const or: (...conditions: (string | Condition)[]) => Condition;
780
758
  declare const and: (...conditions: (string | Condition)[]) => Condition;
781
759
 
782
- declare const featuresFormFields: Field<Partial<Property>>[];
783
- declare const technicalFormFields: Field<Partial<Property>>[];
784
- declare const surfacesFormFields: Field<Partial<Property>>[];
785
- declare const propertyFields: Field<Partial<Property>>[];
760
+ declare const featuresFormFields: Field[];
761
+ declare const technicalFormFields: Field[];
762
+ declare const surfacesFormFields: Field[];
763
+ declare const propertyFields: Field[];
786
764
 
787
765
  declare const CONDITIONS: SelectOption<PropertyCondition>[];
788
766
  declare const STANDINGS: SelectOption<PropertyStanding>[];
@@ -798,11 +776,11 @@ declare const HEATING_ENERGY: SelectOption<HeatingEnergy>[];
798
776
  type StateType$1 = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
799
777
  declare const getPropertyState: (property: StateType$1) => State;
800
778
 
801
- declare const mandateFormFields: Field<MandateInput>[];
779
+ declare const mandateFormFields: Field[];
802
780
 
803
781
  declare const MANDATE_EXCLUSIVITY: SelectOption<MandateExclusivity>[];
804
782
 
805
- declare const contactFormFields: Field<Contact>[];
783
+ declare const contactFormFields: Field[];
806
784
 
807
785
  declare const GENDER: SelectOption<Gender>[];
808
786
  declare const IDENTIFICATION_DOCUMENTS: SelectOption<IdentificationDocument>[];
@@ -852,4 +830,4 @@ declare const COUNTRIES: SelectOption<string>[];
852
830
 
853
831
  declare const LEGAL_STATUS: SelectOption<LegalStatus>[];
854
832
 
855
- export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, LEGAL_STATUS, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, contactFormFields, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatRegistrationNumber, formatSeconds, getAgencyFees, getContactState, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
833
+ export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, LEGAL_STATUS, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, contactFormFields, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatReference, formatRegistrationNumber, formatSeconds, getAgencyFees, getContactState, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,4 @@
1
1
  type Maybe<T> = T | null;
2
- type InputMaybe<T> = Maybe<T>;
3
2
  /** All built-in and custom scalars, mapped to their actual values */
4
3
  type Scalars = {
5
4
  ID: {
@@ -370,28 +369,6 @@ type Mandate = {
370
369
  updatedAt: Scalars['DateTime']['output'];
371
370
  };
372
371
  type MandateExclusivity = 'EXCLUSIVE' | 'SEMI_EXCLUSIVE' | 'SIMPLE';
373
- type MandateInput = {
374
- /** % d'honoraires agence */
375
- agencyFeePercentage?: InputMaybe<Scalars['Float']['input']>;
376
- /** Prix de cession du fonds de commerce */
377
- businessAssetsPrice?: InputMaybe<Scalars['Float']['input']>;
378
- escrowReceiver?: InputMaybe<Scalars['String']['input']>;
379
- exclusivity: MandateExclusivity;
380
- isFreeOfOccupationAndManagement?: InputMaybe<Scalars['Boolean']['input']>;
381
- isFreeOfPledge?: InputMaybe<Scalars['Boolean']['input']>;
382
- isFreeOfPrivilege?: InputMaybe<Scalars['Boolean']['input']>;
383
- isStockIncluded?: InputMaybe<Scalars['Boolean']['input']>;
384
- isVatApplicable?: InputMaybe<Scalars['Boolean']['input']>;
385
- /** Prix de cession du bail */
386
- leaseRightsPrice?: InputMaybe<Scalars['Float']['input']>;
387
- /** Prix de vente vendeur */
388
- netOwnerPrice?: InputMaybe<Scalars['Float']['input']>;
389
- netOwnerRent?: InputMaybe<Scalars['Float']['input']>;
390
- notaryNameAndCity: Scalars['String']['input'];
391
- rentCharges?: InputMaybe<Scalars['Float']['input']>;
392
- securityDeposit?: InputMaybe<Scalars['Float']['input']>;
393
- specialConditions?: InputMaybe<Scalars['String']['input']>;
394
- };
395
372
  type MandateStatus = 'AWAITING_SIGNATURES' | 'AWAITING_VALIDATION' | 'EXPIRED' | 'PROCESSING' | 'REJECTED' | 'WITHDRAWN';
396
373
  type MaritalStatus = 'CIVIL_PARTNERSHIP' | 'DIVORCED' | 'MARRIED_WITHOUT_PRENUP' | 'MARRIED_WITH_PRENUP' | 'SINGLE' | 'WIDOWED';
397
374
  type MultimediaUsage = 'INTENSE' | 'LOW' | 'MODERATE';
@@ -569,7 +546,7 @@ type Property = {
569
546
  propertyTaxPrice?: Maybe<Scalars['Float']['output']>;
570
547
  propertyType: Scalars['String']['output'];
571
548
  recommendedWorkCost?: Maybe<Scalars['Float']['output']>;
572
- reference: Scalars['String']['output'];
549
+ reference: Scalars['Int']['output'];
573
550
  renovationYear?: Maybe<Scalars['DateTime']['output']>;
574
551
  roomCount?: Maybe<Scalars['Int']['output']>;
575
552
  securityServices?: Maybe<Scalars['String']['output']>;
@@ -727,8 +704,8 @@ declare const getAgencyFees: (mandate: GetNetPriceMandate & {
727
704
  agencyFeePercentage: number;
728
705
  }) => number;
729
706
 
730
- type Field<T> = {
731
- name: keyof T;
707
+ type Field = {
708
+ name: string;
732
709
  fieldType: FieldType;
733
710
  label: string;
734
711
  condition?: Condition;
@@ -765,6 +742,7 @@ declare const getLabel: <T>(list: {
765
742
  }[], value: T) => string | null;
766
743
  declare const formatAddress: (address: Pick<Address, "address" | "postalCode" | "locality">) => string;
767
744
  declare const formatSeconds: (seconds: number) => string;
745
+ declare const formatReference: (reference: number) => string;
768
746
  declare const formatDate: (date?: Date | null, withTime?: boolean) => string | null;
769
747
  declare const formatPrice: (price: number) => string;
770
748
  declare const formatPhone: (phone?: string | null) => string | null;
@@ -779,10 +757,10 @@ declare const not: (condition: string | Condition) => Condition;
779
757
  declare const or: (...conditions: (string | Condition)[]) => Condition;
780
758
  declare const and: (...conditions: (string | Condition)[]) => Condition;
781
759
 
782
- declare const featuresFormFields: Field<Partial<Property>>[];
783
- declare const technicalFormFields: Field<Partial<Property>>[];
784
- declare const surfacesFormFields: Field<Partial<Property>>[];
785
- declare const propertyFields: Field<Partial<Property>>[];
760
+ declare const featuresFormFields: Field[];
761
+ declare const technicalFormFields: Field[];
762
+ declare const surfacesFormFields: Field[];
763
+ declare const propertyFields: Field[];
786
764
 
787
765
  declare const CONDITIONS: SelectOption<PropertyCondition>[];
788
766
  declare const STANDINGS: SelectOption<PropertyStanding>[];
@@ -798,11 +776,11 @@ declare const HEATING_ENERGY: SelectOption<HeatingEnergy>[];
798
776
  type StateType$1 = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
799
777
  declare const getPropertyState: (property: StateType$1) => State;
800
778
 
801
- declare const mandateFormFields: Field<MandateInput>[];
779
+ declare const mandateFormFields: Field[];
802
780
 
803
781
  declare const MANDATE_EXCLUSIVITY: SelectOption<MandateExclusivity>[];
804
782
 
805
- declare const contactFormFields: Field<Contact>[];
783
+ declare const contactFormFields: Field[];
806
784
 
807
785
  declare const GENDER: SelectOption<Gender>[];
808
786
  declare const IDENTIFICATION_DOCUMENTS: SelectOption<IdentificationDocument>[];
@@ -852,4 +830,4 @@ declare const COUNTRIES: SelectOption<string>[];
852
830
 
853
831
  declare const LEGAL_STATUS: SelectOption<LegalStatus>[];
854
832
 
855
- export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, LEGAL_STATUS, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, contactFormFields, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatRegistrationNumber, formatSeconds, getAgencyFees, getContactState, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
833
+ export { COMPANY_INFO, CONDITIONS, COUNTRIES, type Condition, ESTATE_CONDITION, EXPOSURES, type Field, GENDER, HEATING_ENERGY, IDENTIFICATION_DOCUMENTS, KITCHEN_TYPE, LEASE_ESTABLISHMENT, LEASE_TRANSFERT_PERMISSIONS, LEGAL_NATURE, LEGAL_STATUS, MANDATE_EXCLUSIVITY, MARITAL_STATUS, PRENUP_TYPES, SHARING_CONFIGURATION, STANDINGS, type SelectOption, type State, VIEWS, and, contactFormFields, featuresFormFields, formatAddress, formatAgentLegalData, formatDate, formatMandateNumber, formatNumber, formatPhone, formatPrice, formatReference, formatRegistrationNumber, formatSeconds, getAgencyFees, getContactState, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
package/dist/index.js CHANGED
@@ -59,6 +59,7 @@ __export(src_exports, {
59
59
  formatNumber: () => formatNumber,
60
60
  formatPhone: () => formatPhone,
61
61
  formatPrice: () => formatPrice,
62
+ formatReference: () => formatReference,
62
63
  formatRegistrationNumber: () => formatRegistrationNumber,
63
64
  formatSeconds: () => formatSeconds,
64
65
  getAgencyFees: () => getAgencyFees,
@@ -405,6 +406,7 @@ var formatSeconds = (seconds) => {
405
406
  if (hours === 0) return `${minutes} minute${minutes > 1 ? "s" : ""}`;
406
407
  return `${hours} heure${hours > 1 ? "s" : ""} et ${minutes} minute${minutes > 1 ? "s" : ""}`;
407
408
  };
409
+ var formatReference = (reference) => `R\xE9f. ${reference.toString().padStart(5, "0")}`;
408
410
  var formatDate = (date, withTime = false) => {
409
411
  if (!date) return null;
410
412
  return withTime ? (0, import_date_fns.format)(date || /* @__PURE__ */ new Date(), "dd/MM/yyyy \xE0 HH:mm") : (0, import_date_fns.format)(date || /* @__PURE__ */ new Date(), "dd/MM/yyyy");
@@ -1603,12 +1605,11 @@ var contactFormFields = [
1603
1605
  fieldType: "text",
1604
1606
  label: "Adresse e-mail"
1605
1607
  },
1606
- // FIXME: add address field
1607
- // {
1608
- // name: "address",
1609
- // fieldType: "address",
1610
- // label: "Adresse postale",
1611
- // },
1608
+ {
1609
+ name: "address",
1610
+ fieldType: "address",
1611
+ label: "Adresse postale"
1612
+ },
1612
1613
  {
1613
1614
  name: "kycDocumentType",
1614
1615
  fieldType: "select",
@@ -1704,6 +1705,7 @@ var COMPANY_INFO = {
1704
1705
  formatNumber,
1705
1706
  formatPhone,
1706
1707
  formatPrice,
1708
+ formatReference,
1707
1709
  formatRegistrationNumber,
1708
1710
  formatSeconds,
1709
1711
  getAgencyFees,
package/dist/index.mjs CHANGED
@@ -322,6 +322,7 @@ var formatSeconds = (seconds) => {
322
322
  if (hours === 0) return `${minutes} minute${minutes > 1 ? "s" : ""}`;
323
323
  return `${hours} heure${hours > 1 ? "s" : ""} et ${minutes} minute${minutes > 1 ? "s" : ""}`;
324
324
  };
325
+ var formatReference = (reference) => `R\xE9f. ${reference.toString().padStart(5, "0")}`;
325
326
  var formatDate = (date, withTime = false) => {
326
327
  if (!date) return null;
327
328
  return withTime ? format(date || /* @__PURE__ */ new Date(), "dd/MM/yyyy \xE0 HH:mm") : format(date || /* @__PURE__ */ new Date(), "dd/MM/yyyy");
@@ -1520,12 +1521,11 @@ var contactFormFields = [
1520
1521
  fieldType: "text",
1521
1522
  label: "Adresse e-mail"
1522
1523
  },
1523
- // FIXME: add address field
1524
- // {
1525
- // name: "address",
1526
- // fieldType: "address",
1527
- // label: "Adresse postale",
1528
- // },
1524
+ {
1525
+ name: "address",
1526
+ fieldType: "address",
1527
+ label: "Adresse postale"
1528
+ },
1529
1529
  {
1530
1530
  name: "kycDocumentType",
1531
1531
  fieldType: "select",
@@ -1620,6 +1620,7 @@ export {
1620
1620
  formatNumber,
1621
1621
  formatPhone,
1622
1622
  formatPrice,
1623
+ formatReference,
1623
1624
  formatRegistrationNumber,
1624
1625
  formatSeconds,
1625
1626
  getAgencyFees,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecotransac-shared-js",
3
- "version": "1.1.44",
3
+ "version": "1.1.46",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "modules": "dist/index.mjs",