ecotransac-shared-js 1.1.21 → 1.1.23

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
@@ -1008,8 +1008,8 @@ declare const LEASE_TRANSFERT_PERMISSIONS: SelectOption[];
1008
1008
  declare const KITCHEN_TYPE: SelectOption[];
1009
1009
  declare const HEATING_ENERGY: SelectOption[];
1010
1010
 
1011
- type StateType = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
1012
- declare const getPropertyState: (property: StateType) => State;
1011
+ type StateType$1 = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
1012
+ declare const getPropertyState: (property: StateType$1) => State;
1013
1013
 
1014
1014
  declare const mandateFormFields: Field<MandateInput>[];
1015
1015
 
@@ -1026,6 +1026,9 @@ declare const LEGAL_NATURE: SelectOption[];
1026
1026
  declare const MARITAL_STATUS: SelectOption[];
1027
1027
  declare const PRENUP_TYPES: SelectOption[];
1028
1028
 
1029
+ type StateType = Pick<Contact, "maritalStatus" | "isLegalEntity">;
1030
+ declare const getContactState: (contact: StateType) => State;
1031
+
1029
1032
  declare const COMPANY_INFO: {
1030
1033
  name: string;
1031
1034
  contactEmail: string;
@@ -1065,4 +1068,4 @@ declare const COUNTRIES: SelectOption[];
1065
1068
 
1066
1069
  declare const LEGAL_STATUS: SelectOption[];
1067
1070
 
1068
- 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, formatSeconds, getAgencyFees, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
1071
+ 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, formatSeconds, getAgencyFees, getContactState, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
package/dist/index.d.ts CHANGED
@@ -1008,8 +1008,8 @@ declare const LEASE_TRANSFERT_PERMISSIONS: SelectOption[];
1008
1008
  declare const KITCHEN_TYPE: SelectOption[];
1009
1009
  declare const HEATING_ENERGY: SelectOption[];
1010
1010
 
1011
- type StateType = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
1012
- declare const getPropertyState: (property: StateType) => State;
1011
+ type StateType$1 = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
1012
+ declare const getPropertyState: (property: StateType$1) => State;
1013
1013
 
1014
1014
  declare const mandateFormFields: Field<MandateInput>[];
1015
1015
 
@@ -1026,6 +1026,9 @@ declare const LEGAL_NATURE: SelectOption[];
1026
1026
  declare const MARITAL_STATUS: SelectOption[];
1027
1027
  declare const PRENUP_TYPES: SelectOption[];
1028
1028
 
1029
+ type StateType = Pick<Contact, "maritalStatus" | "isLegalEntity">;
1030
+ declare const getContactState: (contact: StateType) => State;
1031
+
1029
1032
  declare const COMPANY_INFO: {
1030
1033
  name: string;
1031
1034
  contactEmail: string;
@@ -1065,4 +1068,4 @@ declare const COUNTRIES: SelectOption[];
1065
1068
 
1066
1069
  declare const LEGAL_STATUS: SelectOption[];
1067
1070
 
1068
- 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, formatSeconds, getAgencyFees, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
1071
+ 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, formatSeconds, getAgencyFees, getContactState, getFeesPercentage, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
package/dist/index.js CHANGED
@@ -61,6 +61,7 @@ __export(src_exports, {
61
61
  formatPrice: () => formatPrice,
62
62
  formatSeconds: () => formatSeconds,
63
63
  getAgencyFees: () => getAgencyFees,
64
+ getContactState: () => getContactState,
64
65
  getFeesPercentage: () => getFeesPercentage,
65
66
  getLabel: () => getLabel,
66
67
  getLowThreshold: () => getLowThreshold,
@@ -1545,131 +1546,147 @@ var PRENUP_TYPES = [
1545
1546
  // src/static/contact/fields.ts
1546
1547
  var contactFormFields = [
1547
1548
  {
1548
- fieldType: "switch",
1549
1549
  name: "isLegalEntity",
1550
+ fieldType: "switch",
1550
1551
  label: "Le contact est une personne morale"
1551
1552
  },
1552
1553
  {
1553
- fieldType: "text",
1554
1554
  name: "companyName",
1555
+ fieldType: "text",
1555
1556
  label: "D\xE9nomination sociale",
1556
1557
  condition: only("isLegalEntity")
1557
1558
  },
1558
1559
  {
1559
- fieldType: "text",
1560
1560
  name: "companyLegalStatus",
1561
+ fieldType: "text",
1561
1562
  label: "Forme juridique",
1562
1563
  condition: only("isLegalEntity"),
1563
1564
  props: { options: LEGAL_STATUS }
1564
1565
  },
1565
1566
  {
1566
- fieldType: "text",
1567
1567
  name: "companyRegistrationNumber",
1568
+ fieldType: "text",
1568
1569
  label: "Num\xE9ro d'immatriculation (SIREN)",
1569
1570
  condition: only("isLegalEntity")
1570
1571
  },
1571
1572
  {
1572
- fieldType: "number",
1573
1573
  name: "companyCapitalStock",
1574
+ fieldType: "number",
1574
1575
  label: "Capital social",
1575
1576
  condition: only("isLegalEntity"),
1576
1577
  props: { suffix: "\u20AC" }
1577
1578
  },
1578
1579
  {
1579
- fieldType: "date",
1580
1580
  name: "authorizationRepresentationDate",
1581
+ fieldType: "date",
1581
1582
  label: "Date d'habilitation \xE0 repr\xE9senter l'entit\xE9",
1582
1583
  condition: only("isLegalEntity")
1583
1584
  },
1584
1585
  {
1585
- fieldType: "radio",
1586
1586
  name: "gender",
1587
+ fieldType: "radio",
1587
1588
  label: "Civilit\xE9",
1588
1589
  props: { options: GENDER }
1589
1590
  },
1590
1591
  {
1591
- fieldType: "text",
1592
1592
  name: "firstName",
1593
+ fieldType: "text",
1593
1594
  label: "Pr\xE9nom"
1594
1595
  },
1595
1596
  {
1596
- fieldType: "text",
1597
1597
  name: "lastName",
1598
+ fieldType: "text",
1598
1599
  label: "Nom de famille"
1599
1600
  },
1600
1601
  {
1601
- fieldType: "text",
1602
1602
  name: "profession",
1603
+ fieldType: "text",
1603
1604
  label: "Fonction dans l'entit\xE9",
1604
1605
  condition: only("isLegalEntity")
1605
1606
  },
1606
1607
  {
1607
- fieldType: "country",
1608
1608
  name: "nationality",
1609
+ fieldType: "country",
1609
1610
  label: "Nationalit\xE9"
1610
1611
  },
1611
1612
  {
1612
- fieldType: "date",
1613
1613
  name: "dateOfBirth",
1614
+ fieldType: "date",
1614
1615
  label: "Date de naissance"
1615
1616
  },
1616
1617
  {
1617
- fieldType: "text",
1618
1618
  name: "placeOfBirth",
1619
+ fieldType: "text",
1619
1620
  label: "Ville de naissance"
1620
1621
  },
1621
1622
  {
1622
- fieldType: "country",
1623
1623
  name: "countryOfBirth",
1624
+ fieldType: "country",
1624
1625
  label: "Pays de naissance"
1625
1626
  },
1626
1627
  {
1627
- fieldType: "text",
1628
1628
  name: "maritalStatus",
1629
+ fieldType: "text",
1629
1630
  label: "Situation matrimoniale",
1630
1631
  props: { options: MARITAL_STATUS }
1631
1632
  },
1632
1633
  {
1633
- fieldType: "text",
1634
1634
  name: "prenupType",
1635
+ fieldType: "text",
1635
1636
  label: "Type de contrat de mariage",
1636
1637
  condition: only("isMarriedWithPrenup"),
1637
1638
  props: { options: PRENUP_TYPES }
1638
1639
  },
1639
1640
  {
1640
- fieldType: "text",
1641
1641
  name: "profession",
1642
+ fieldType: "text",
1642
1643
  label: "Profession",
1643
1644
  condition: not("isLegalEntity")
1644
1645
  },
1645
1646
  {
1646
- fieldType: "phone",
1647
1647
  name: "phone",
1648
+ fieldType: "phone",
1648
1649
  label: "Num\xE9ro de t\xE9l\xE9phone"
1649
1650
  },
1650
1651
  {
1651
- fieldType: "text",
1652
1652
  name: "email",
1653
+ fieldType: "text",
1653
1654
  label: "Adresse e-mail"
1654
1655
  },
1655
1656
  {
1656
- fieldType: "address",
1657
1657
  name: "address",
1658
+ fieldType: "address",
1658
1659
  label: "Adresse postale"
1659
1660
  },
1660
1661
  {
1661
- fieldType: "text",
1662
1662
  name: "kycDocumentType",
1663
+ fieldType: "text",
1663
1664
  label: "Type de document d'identit\xE9",
1664
1665
  props: { options: IDENTIFICATION_DOCUMENTS }
1665
1666
  },
1666
1667
  {
1667
- fieldType: "date",
1668
+ name: "kycDocumentNumber",
1669
+ fieldType: "text",
1670
+ label: "Num\xE9ro du document"
1671
+ },
1672
+ {
1673
+ name: "kycIssuedBy",
1674
+ fieldType: "text",
1675
+ label: "D\xE9livr\xE9 par"
1676
+ },
1677
+ {
1668
1678
  name: "kycExpiresAt",
1679
+ fieldType: "date",
1669
1680
  label: "Date d'expiration"
1670
1681
  }
1671
1682
  ];
1672
1683
 
1684
+ // src/static/contact/state.ts
1685
+ var getContactState = (contact) => ({
1686
+ isLegalEntity: Boolean(contact.isLegalEntity),
1687
+ isMarriedWithPrenup: contact.maritalStatus === "MARRIED_WITH_PRENUP" /* MarriedWithPrenup */
1688
+ });
1689
+
1673
1690
  // src/static/company-details.ts
1674
1691
  var COMPANY_INFO = {
1675
1692
  name: "Ecotransac",
@@ -1738,6 +1755,7 @@ var COMPANY_INFO = {
1738
1755
  formatPrice,
1739
1756
  formatSeconds,
1740
1757
  getAgencyFees,
1758
+ getContactState,
1741
1759
  getFeesPercentage,
1742
1760
  getLabel,
1743
1761
  getLowThreshold,
package/dist/index.mjs CHANGED
@@ -1464,131 +1464,147 @@ var PRENUP_TYPES = [
1464
1464
  // src/static/contact/fields.ts
1465
1465
  var contactFormFields = [
1466
1466
  {
1467
- fieldType: "switch",
1468
1467
  name: "isLegalEntity",
1468
+ fieldType: "switch",
1469
1469
  label: "Le contact est une personne morale"
1470
1470
  },
1471
1471
  {
1472
- fieldType: "text",
1473
1472
  name: "companyName",
1473
+ fieldType: "text",
1474
1474
  label: "D\xE9nomination sociale",
1475
1475
  condition: only("isLegalEntity")
1476
1476
  },
1477
1477
  {
1478
- fieldType: "text",
1479
1478
  name: "companyLegalStatus",
1479
+ fieldType: "text",
1480
1480
  label: "Forme juridique",
1481
1481
  condition: only("isLegalEntity"),
1482
1482
  props: { options: LEGAL_STATUS }
1483
1483
  },
1484
1484
  {
1485
- fieldType: "text",
1486
1485
  name: "companyRegistrationNumber",
1486
+ fieldType: "text",
1487
1487
  label: "Num\xE9ro d'immatriculation (SIREN)",
1488
1488
  condition: only("isLegalEntity")
1489
1489
  },
1490
1490
  {
1491
- fieldType: "number",
1492
1491
  name: "companyCapitalStock",
1492
+ fieldType: "number",
1493
1493
  label: "Capital social",
1494
1494
  condition: only("isLegalEntity"),
1495
1495
  props: { suffix: "\u20AC" }
1496
1496
  },
1497
1497
  {
1498
- fieldType: "date",
1499
1498
  name: "authorizationRepresentationDate",
1499
+ fieldType: "date",
1500
1500
  label: "Date d'habilitation \xE0 repr\xE9senter l'entit\xE9",
1501
1501
  condition: only("isLegalEntity")
1502
1502
  },
1503
1503
  {
1504
- fieldType: "radio",
1505
1504
  name: "gender",
1505
+ fieldType: "radio",
1506
1506
  label: "Civilit\xE9",
1507
1507
  props: { options: GENDER }
1508
1508
  },
1509
1509
  {
1510
- fieldType: "text",
1511
1510
  name: "firstName",
1511
+ fieldType: "text",
1512
1512
  label: "Pr\xE9nom"
1513
1513
  },
1514
1514
  {
1515
- fieldType: "text",
1516
1515
  name: "lastName",
1516
+ fieldType: "text",
1517
1517
  label: "Nom de famille"
1518
1518
  },
1519
1519
  {
1520
- fieldType: "text",
1521
1520
  name: "profession",
1521
+ fieldType: "text",
1522
1522
  label: "Fonction dans l'entit\xE9",
1523
1523
  condition: only("isLegalEntity")
1524
1524
  },
1525
1525
  {
1526
- fieldType: "country",
1527
1526
  name: "nationality",
1527
+ fieldType: "country",
1528
1528
  label: "Nationalit\xE9"
1529
1529
  },
1530
1530
  {
1531
- fieldType: "date",
1532
1531
  name: "dateOfBirth",
1532
+ fieldType: "date",
1533
1533
  label: "Date de naissance"
1534
1534
  },
1535
1535
  {
1536
- fieldType: "text",
1537
1536
  name: "placeOfBirth",
1537
+ fieldType: "text",
1538
1538
  label: "Ville de naissance"
1539
1539
  },
1540
1540
  {
1541
- fieldType: "country",
1542
1541
  name: "countryOfBirth",
1542
+ fieldType: "country",
1543
1543
  label: "Pays de naissance"
1544
1544
  },
1545
1545
  {
1546
- fieldType: "text",
1547
1546
  name: "maritalStatus",
1547
+ fieldType: "text",
1548
1548
  label: "Situation matrimoniale",
1549
1549
  props: { options: MARITAL_STATUS }
1550
1550
  },
1551
1551
  {
1552
- fieldType: "text",
1553
1552
  name: "prenupType",
1553
+ fieldType: "text",
1554
1554
  label: "Type de contrat de mariage",
1555
1555
  condition: only("isMarriedWithPrenup"),
1556
1556
  props: { options: PRENUP_TYPES }
1557
1557
  },
1558
1558
  {
1559
- fieldType: "text",
1560
1559
  name: "profession",
1560
+ fieldType: "text",
1561
1561
  label: "Profession",
1562
1562
  condition: not("isLegalEntity")
1563
1563
  },
1564
1564
  {
1565
- fieldType: "phone",
1566
1565
  name: "phone",
1566
+ fieldType: "phone",
1567
1567
  label: "Num\xE9ro de t\xE9l\xE9phone"
1568
1568
  },
1569
1569
  {
1570
- fieldType: "text",
1571
1570
  name: "email",
1571
+ fieldType: "text",
1572
1572
  label: "Adresse e-mail"
1573
1573
  },
1574
1574
  {
1575
- fieldType: "address",
1576
1575
  name: "address",
1576
+ fieldType: "address",
1577
1577
  label: "Adresse postale"
1578
1578
  },
1579
1579
  {
1580
- fieldType: "text",
1581
1580
  name: "kycDocumentType",
1581
+ fieldType: "text",
1582
1582
  label: "Type de document d'identit\xE9",
1583
1583
  props: { options: IDENTIFICATION_DOCUMENTS }
1584
1584
  },
1585
1585
  {
1586
- fieldType: "date",
1586
+ name: "kycDocumentNumber",
1587
+ fieldType: "text",
1588
+ label: "Num\xE9ro du document"
1589
+ },
1590
+ {
1591
+ name: "kycIssuedBy",
1592
+ fieldType: "text",
1593
+ label: "D\xE9livr\xE9 par"
1594
+ },
1595
+ {
1587
1596
  name: "kycExpiresAt",
1597
+ fieldType: "date",
1588
1598
  label: "Date d'expiration"
1589
1599
  }
1590
1600
  ];
1591
1601
 
1602
+ // src/static/contact/state.ts
1603
+ var getContactState = (contact) => ({
1604
+ isLegalEntity: Boolean(contact.isLegalEntity),
1605
+ isMarriedWithPrenup: contact.maritalStatus === "MARRIED_WITH_PRENUP" /* MarriedWithPrenup */
1606
+ });
1607
+
1592
1608
  // src/static/company-details.ts
1593
1609
  var COMPANY_INFO = {
1594
1610
  name: "Ecotransac",
@@ -1656,6 +1672,7 @@ export {
1656
1672
  formatPrice,
1657
1673
  formatSeconds,
1658
1674
  getAgencyFees,
1675
+ getContactState,
1659
1676
  getFeesPercentage,
1660
1677
  getLabel,
1661
1678
  getLowThreshold,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecotransac-shared-js",
3
- "version": "1.1.21",
3
+ "version": "1.1.23",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "modules": "dist/index.mjs",