ecotransac-shared-js 1.1.45 → 1.1.47
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 +13 -34
- package/dist/index.d.ts +13 -34
- package/dist/index.js +34 -10
- package/dist/index.mjs +32 -10
- package/package.json +1 -1
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';
|
|
@@ -724,11 +701,13 @@ declare const getFeesPercentage: (price: number, isForProfessionalUse: boolean)
|
|
|
724
701
|
type GetNetPriceMandate = Pick<Mandate, "isForProfessionalUse" | "isCommercialWallsSale" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "netOwnerPrice" | "leaseRightsPrice" | "businessAssetsPrice">;
|
|
725
702
|
declare const getNetPrice: (mandate: GetNetPriceMandate) => number;
|
|
726
703
|
declare const getAgencyFees: (mandate: GetNetPriceMandate & {
|
|
727
|
-
agencyFeePercentage
|
|
704
|
+
agencyFeePercentage?: number | null;
|
|
728
705
|
}) => number;
|
|
706
|
+
declare const getDisplayedPrice: (mandate: Mandate) => number;
|
|
707
|
+
declare const getIsLowPrice: (mandate: Mandate) => boolean;
|
|
729
708
|
|
|
730
|
-
type Field
|
|
731
|
-
name:
|
|
709
|
+
type Field = {
|
|
710
|
+
name: string;
|
|
732
711
|
fieldType: FieldType;
|
|
733
712
|
label: string;
|
|
734
713
|
condition?: Condition;
|
|
@@ -772,7 +751,7 @@ declare const formatPhone: (phone?: string | null) => string | null;
|
|
|
772
751
|
declare const formatMandateNumber: (number: number) => string;
|
|
773
752
|
declare const formatRegistrationNumber: (rawNumber?: string | null) => string | null;
|
|
774
753
|
declare const formatAgentLegalData: (profile?: Pick<Profile, "legalStatus" | "registrationNumber" | "registrationPlace"> | null) => string | null;
|
|
775
|
-
declare const getPropertyTitle: (property: Pick<Property, "propertyType" | "roomCount" | "
|
|
754
|
+
declare const getPropertyTitle: (property: Pick<Property, "propertyType" | "roomCount" | "carrezLawArea" | "isForProfessionalUse" | "floorLevel">) => string;
|
|
776
755
|
declare const formatNumber: (number?: number | null) => string;
|
|
777
756
|
|
|
778
757
|
declare const only: (condition: string | Condition) => Condition;
|
|
@@ -780,10 +759,10 @@ declare const not: (condition: string | Condition) => Condition;
|
|
|
780
759
|
declare const or: (...conditions: (string | Condition)[]) => Condition;
|
|
781
760
|
declare const and: (...conditions: (string | Condition)[]) => Condition;
|
|
782
761
|
|
|
783
|
-
declare const featuresFormFields: Field
|
|
784
|
-
declare const technicalFormFields: Field
|
|
785
|
-
declare const surfacesFormFields: Field
|
|
786
|
-
declare const propertyFields: Field
|
|
762
|
+
declare const featuresFormFields: Field[];
|
|
763
|
+
declare const technicalFormFields: Field[];
|
|
764
|
+
declare const surfacesFormFields: Field[];
|
|
765
|
+
declare const propertyFields: Field[];
|
|
787
766
|
|
|
788
767
|
declare const CONDITIONS: SelectOption<PropertyCondition>[];
|
|
789
768
|
declare const STANDINGS: SelectOption<PropertyStanding>[];
|
|
@@ -799,11 +778,11 @@ declare const HEATING_ENERGY: SelectOption<HeatingEnergy>[];
|
|
|
799
778
|
type StateType$1 = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
|
|
800
779
|
declare const getPropertyState: (property: StateType$1) => State;
|
|
801
780
|
|
|
802
|
-
declare const mandateFormFields: Field
|
|
781
|
+
declare const mandateFormFields: Field[];
|
|
803
782
|
|
|
804
783
|
declare const MANDATE_EXCLUSIVITY: SelectOption<MandateExclusivity>[];
|
|
805
784
|
|
|
806
|
-
declare const contactFormFields: Field
|
|
785
|
+
declare const contactFormFields: Field[];
|
|
807
786
|
|
|
808
787
|
declare const GENDER: SelectOption<Gender>[];
|
|
809
788
|
declare const IDENTIFICATION_DOCUMENTS: SelectOption<IdentificationDocument>[];
|
|
@@ -853,4 +832,4 @@ declare const COUNTRIES: SelectOption<string>[];
|
|
|
853
832
|
|
|
854
833
|
declare const LEGAL_STATUS: SelectOption<LegalStatus>[];
|
|
855
834
|
|
|
856
|
-
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 };
|
|
835
|
+
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, getDisplayedPrice, getFeesPercentage, getIsLowPrice, 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';
|
|
@@ -724,11 +701,13 @@ declare const getFeesPercentage: (price: number, isForProfessionalUse: boolean)
|
|
|
724
701
|
type GetNetPriceMandate = Pick<Mandate, "isForProfessionalUse" | "isCommercialWallsSale" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "netOwnerPrice" | "leaseRightsPrice" | "businessAssetsPrice">;
|
|
725
702
|
declare const getNetPrice: (mandate: GetNetPriceMandate) => number;
|
|
726
703
|
declare const getAgencyFees: (mandate: GetNetPriceMandate & {
|
|
727
|
-
agencyFeePercentage
|
|
704
|
+
agencyFeePercentage?: number | null;
|
|
728
705
|
}) => number;
|
|
706
|
+
declare const getDisplayedPrice: (mandate: Mandate) => number;
|
|
707
|
+
declare const getIsLowPrice: (mandate: Mandate) => boolean;
|
|
729
708
|
|
|
730
|
-
type Field
|
|
731
|
-
name:
|
|
709
|
+
type Field = {
|
|
710
|
+
name: string;
|
|
732
711
|
fieldType: FieldType;
|
|
733
712
|
label: string;
|
|
734
713
|
condition?: Condition;
|
|
@@ -772,7 +751,7 @@ declare const formatPhone: (phone?: string | null) => string | null;
|
|
|
772
751
|
declare const formatMandateNumber: (number: number) => string;
|
|
773
752
|
declare const formatRegistrationNumber: (rawNumber?: string | null) => string | null;
|
|
774
753
|
declare const formatAgentLegalData: (profile?: Pick<Profile, "legalStatus" | "registrationNumber" | "registrationPlace"> | null) => string | null;
|
|
775
|
-
declare const getPropertyTitle: (property: Pick<Property, "propertyType" | "roomCount" | "
|
|
754
|
+
declare const getPropertyTitle: (property: Pick<Property, "propertyType" | "roomCount" | "carrezLawArea" | "isForProfessionalUse" | "floorLevel">) => string;
|
|
776
755
|
declare const formatNumber: (number?: number | null) => string;
|
|
777
756
|
|
|
778
757
|
declare const only: (condition: string | Condition) => Condition;
|
|
@@ -780,10 +759,10 @@ declare const not: (condition: string | Condition) => Condition;
|
|
|
780
759
|
declare const or: (...conditions: (string | Condition)[]) => Condition;
|
|
781
760
|
declare const and: (...conditions: (string | Condition)[]) => Condition;
|
|
782
761
|
|
|
783
|
-
declare const featuresFormFields: Field
|
|
784
|
-
declare const technicalFormFields: Field
|
|
785
|
-
declare const surfacesFormFields: Field
|
|
786
|
-
declare const propertyFields: Field
|
|
762
|
+
declare const featuresFormFields: Field[];
|
|
763
|
+
declare const technicalFormFields: Field[];
|
|
764
|
+
declare const surfacesFormFields: Field[];
|
|
765
|
+
declare const propertyFields: Field[];
|
|
787
766
|
|
|
788
767
|
declare const CONDITIONS: SelectOption<PropertyCondition>[];
|
|
789
768
|
declare const STANDINGS: SelectOption<PropertyStanding>[];
|
|
@@ -799,11 +778,11 @@ declare const HEATING_ENERGY: SelectOption<HeatingEnergy>[];
|
|
|
799
778
|
type StateType$1 = Pick<Property, "isForProfessionalUse" | "propertyType" | "isOccupied" | "isCoOwnership" | "isHousingScheme" | "isBusinessAssetsTransfer" | "isLeaseRightsTransfer" | "isCommercialWallsSale" | "isDpeCompleted" | "isEnergyAuditCompleted" | "leaseEstablishedUnder" | "constructionYear">;
|
|
800
779
|
declare const getPropertyState: (property: StateType$1) => State;
|
|
801
780
|
|
|
802
|
-
declare const mandateFormFields: Field
|
|
781
|
+
declare const mandateFormFields: Field[];
|
|
803
782
|
|
|
804
783
|
declare const MANDATE_EXCLUSIVITY: SelectOption<MandateExclusivity>[];
|
|
805
784
|
|
|
806
|
-
declare const contactFormFields: Field
|
|
785
|
+
declare const contactFormFields: Field[];
|
|
807
786
|
|
|
808
787
|
declare const GENDER: SelectOption<Gender>[];
|
|
809
788
|
declare const IDENTIFICATION_DOCUMENTS: SelectOption<IdentificationDocument>[];
|
|
@@ -853,4 +832,4 @@ declare const COUNTRIES: SelectOption<string>[];
|
|
|
853
832
|
|
|
854
833
|
declare const LEGAL_STATUS: SelectOption<LegalStatus>[];
|
|
855
834
|
|
|
856
|
-
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 };
|
|
835
|
+
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, getDisplayedPrice, getFeesPercentage, getIsLowPrice, getLabel, getLowThreshold, getNetPrice, getPropertyState, getPropertyTitle, getValue, mandateFormFields, not, only, or, propertyFields, shouldRender, surfacesFormFields, technicalFormFields };
|
package/dist/index.js
CHANGED
|
@@ -64,7 +64,9 @@ __export(src_exports, {
|
|
|
64
64
|
formatSeconds: () => formatSeconds,
|
|
65
65
|
getAgencyFees: () => getAgencyFees,
|
|
66
66
|
getContactState: () => getContactState,
|
|
67
|
+
getDisplayedPrice: () => getDisplayedPrice,
|
|
67
68
|
getFeesPercentage: () => getFeesPercentage,
|
|
69
|
+
getIsLowPrice: () => getIsLowPrice,
|
|
68
70
|
getLabel: () => getLabel,
|
|
69
71
|
getLowThreshold: () => getLowThreshold,
|
|
70
72
|
getNetPrice: () => getNetPrice,
|
|
@@ -130,6 +132,16 @@ var getAgencyFees = (mandate) => {
|
|
|
130
132
|
if (netPrice < limit) return fees;
|
|
131
133
|
return (0, import_currency.default)(netPrice).multiply((agencyFeePercentage || 100) / 100).value;
|
|
132
134
|
};
|
|
135
|
+
var getDisplayedPrice = (mandate) => {
|
|
136
|
+
const netPrice = getNetPrice(mandate);
|
|
137
|
+
const agencyFees = getAgencyFees(mandate);
|
|
138
|
+
return (0, import_currency.default)(netPrice).add(agencyFees).value;
|
|
139
|
+
};
|
|
140
|
+
var getIsLowPrice = (mandate) => {
|
|
141
|
+
const netPrice = getNetPrice(mandate);
|
|
142
|
+
const { limit } = getLowThreshold(mandate.isForProfessionalUse);
|
|
143
|
+
return netPrice < limit;
|
|
144
|
+
};
|
|
133
145
|
|
|
134
146
|
// src/static/countries.ts
|
|
135
147
|
var COUNTRIES = [
|
|
@@ -450,7 +462,7 @@ var getPropertyTitle = (property) => {
|
|
|
450
462
|
const floorLabel = property.floorLevel === 1 ? "er" : "\xE8me";
|
|
451
463
|
infos.push(`${property.floorLevel}${floorLabel} \xE9tage`);
|
|
452
464
|
}
|
|
453
|
-
if (property.
|
|
465
|
+
if (property.carrezLawArea) infos.push(`${property.carrezLawArea} m\xB2`);
|
|
454
466
|
return infos.join(" - ");
|
|
455
467
|
};
|
|
456
468
|
var formatNumber = (number) => number ? number.toLocaleString("fr-FR") : "";
|
|
@@ -467,6 +479,7 @@ var getValue = (params) => {
|
|
|
467
479
|
return value.getFullYear().toString();
|
|
468
480
|
if (value instanceof Date) return formatDate(value);
|
|
469
481
|
if (typeof value === "boolean") return value ? "Oui" : "Non";
|
|
482
|
+
if (name == "phone" && value) return formatPhone(value);
|
|
470
483
|
if ((name == null ? void 0 : name.startsWith("country")) || name === "nationality")
|
|
471
484
|
return ((_a = COUNTRIES.find((language) => language.value === value)) == null ? void 0 : _a.label) || null;
|
|
472
485
|
if (isAddress(value))
|
|
@@ -668,7 +681,13 @@ var featuresFormFields = [
|
|
|
668
681
|
name: "propertyType",
|
|
669
682
|
fieldType: "propertyType",
|
|
670
683
|
label: "Nature du bien",
|
|
671
|
-
requiredFor: []
|
|
684
|
+
requiredFor: ["MANDATE_CREATION", "DIFFUSION"]
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
name: "address",
|
|
688
|
+
fieldType: "address",
|
|
689
|
+
label: "Adresse postale",
|
|
690
|
+
requiredFor: ["MANDATE_CREATION", "DIFFUSION"]
|
|
672
691
|
},
|
|
673
692
|
{
|
|
674
693
|
name: "estateCondition",
|
|
@@ -1206,6 +1225,7 @@ var surfacesFormFields = [
|
|
|
1206
1225
|
name: "propertyLotsCount",
|
|
1207
1226
|
fieldType: "number",
|
|
1208
1227
|
label: "Nombre de lot(s) vendu(s)",
|
|
1228
|
+
condition: or(only("isCoOwnership"), only("isHousingScheme")),
|
|
1209
1229
|
props: { suffix: "lot(s)" },
|
|
1210
1230
|
requiredFor: ["MANDATE_CREATION", "DIFFUSION"]
|
|
1211
1231
|
},
|
|
@@ -1213,6 +1233,7 @@ var surfacesFormFields = [
|
|
|
1213
1233
|
name: "propertyLotsIdentifiers",
|
|
1214
1234
|
fieldType: "text",
|
|
1215
1235
|
label: "Num\xE9ro des lot(s) vendu(s)",
|
|
1236
|
+
condition: or(only("isCoOwnership"), only("isHousingScheme")),
|
|
1216
1237
|
props: { placeholder: "Non renseign\xE9" },
|
|
1217
1238
|
requiredFor: ["MANDATE_CREATION"]
|
|
1218
1239
|
},
|
|
@@ -1223,7 +1244,8 @@ var surfacesFormFields = [
|
|
|
1223
1244
|
props: {
|
|
1224
1245
|
tooltip: "Retrouvez la/les r\xE9f\xE9rence(s) sur cadastre.gouv.fr",
|
|
1225
1246
|
placeholder: "Exemple : Section AB, Parcelle 1234"
|
|
1226
|
-
}
|
|
1247
|
+
},
|
|
1248
|
+
requiredFor: ["MANDATE_CREATION"]
|
|
1227
1249
|
}
|
|
1228
1250
|
];
|
|
1229
1251
|
var propertyFields = [
|
|
@@ -1392,6 +1414,7 @@ var mandateFormFields = [
|
|
|
1392
1414
|
condition: not("isForProfessionalUse"),
|
|
1393
1415
|
requiredFor: ["MANDATE_CREATION"]
|
|
1394
1416
|
},
|
|
1417
|
+
// TODO: move to property fields
|
|
1395
1418
|
{
|
|
1396
1419
|
fieldType: "text",
|
|
1397
1420
|
name: "notaryNameAndCity",
|
|
@@ -1584,7 +1607,7 @@ var contactFormFields = [
|
|
|
1584
1607
|
},
|
|
1585
1608
|
{
|
|
1586
1609
|
name: "prenupType",
|
|
1587
|
-
fieldType: "
|
|
1610
|
+
fieldType: "select",
|
|
1588
1611
|
label: "Type de contrat de mariage",
|
|
1589
1612
|
condition: only("isMarriedWithPrenup"),
|
|
1590
1613
|
props: { options: PRENUP_TYPES }
|
|
@@ -1605,12 +1628,11 @@ var contactFormFields = [
|
|
|
1605
1628
|
fieldType: "text",
|
|
1606
1629
|
label: "Adresse e-mail"
|
|
1607
1630
|
},
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
// },
|
|
1631
|
+
{
|
|
1632
|
+
name: "address",
|
|
1633
|
+
fieldType: "address",
|
|
1634
|
+
label: "Adresse postale"
|
|
1635
|
+
},
|
|
1614
1636
|
{
|
|
1615
1637
|
name: "kycDocumentType",
|
|
1616
1638
|
fieldType: "select",
|
|
@@ -1711,7 +1733,9 @@ var COMPANY_INFO = {
|
|
|
1711
1733
|
formatSeconds,
|
|
1712
1734
|
getAgencyFees,
|
|
1713
1735
|
getContactState,
|
|
1736
|
+
getDisplayedPrice,
|
|
1714
1737
|
getFeesPercentage,
|
|
1738
|
+
getIsLowPrice,
|
|
1715
1739
|
getLabel,
|
|
1716
1740
|
getLowThreshold,
|
|
1717
1741
|
getNetPrice,
|
package/dist/index.mjs
CHANGED
|
@@ -46,6 +46,16 @@ var getAgencyFees = (mandate) => {
|
|
|
46
46
|
if (netPrice < limit) return fees;
|
|
47
47
|
return currency(netPrice).multiply((agencyFeePercentage || 100) / 100).value;
|
|
48
48
|
};
|
|
49
|
+
var getDisplayedPrice = (mandate) => {
|
|
50
|
+
const netPrice = getNetPrice(mandate);
|
|
51
|
+
const agencyFees = getAgencyFees(mandate);
|
|
52
|
+
return currency(netPrice).add(agencyFees).value;
|
|
53
|
+
};
|
|
54
|
+
var getIsLowPrice = (mandate) => {
|
|
55
|
+
const netPrice = getNetPrice(mandate);
|
|
56
|
+
const { limit } = getLowThreshold(mandate.isForProfessionalUse);
|
|
57
|
+
return netPrice < limit;
|
|
58
|
+
};
|
|
49
59
|
|
|
50
60
|
// src/static/countries.ts
|
|
51
61
|
var COUNTRIES = [
|
|
@@ -366,7 +376,7 @@ var getPropertyTitle = (property) => {
|
|
|
366
376
|
const floorLabel = property.floorLevel === 1 ? "er" : "\xE8me";
|
|
367
377
|
infos.push(`${property.floorLevel}${floorLabel} \xE9tage`);
|
|
368
378
|
}
|
|
369
|
-
if (property.
|
|
379
|
+
if (property.carrezLawArea) infos.push(`${property.carrezLawArea} m\xB2`);
|
|
370
380
|
return infos.join(" - ");
|
|
371
381
|
};
|
|
372
382
|
var formatNumber = (number) => number ? number.toLocaleString("fr-FR") : "";
|
|
@@ -383,6 +393,7 @@ var getValue = (params) => {
|
|
|
383
393
|
return value.getFullYear().toString();
|
|
384
394
|
if (value instanceof Date) return formatDate(value);
|
|
385
395
|
if (typeof value === "boolean") return value ? "Oui" : "Non";
|
|
396
|
+
if (name == "phone" && value) return formatPhone(value);
|
|
386
397
|
if ((name == null ? void 0 : name.startsWith("country")) || name === "nationality")
|
|
387
398
|
return ((_a = COUNTRIES.find((language) => language.value === value)) == null ? void 0 : _a.label) || null;
|
|
388
399
|
if (isAddress(value))
|
|
@@ -584,7 +595,13 @@ var featuresFormFields = [
|
|
|
584
595
|
name: "propertyType",
|
|
585
596
|
fieldType: "propertyType",
|
|
586
597
|
label: "Nature du bien",
|
|
587
|
-
requiredFor: []
|
|
598
|
+
requiredFor: ["MANDATE_CREATION", "DIFFUSION"]
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
name: "address",
|
|
602
|
+
fieldType: "address",
|
|
603
|
+
label: "Adresse postale",
|
|
604
|
+
requiredFor: ["MANDATE_CREATION", "DIFFUSION"]
|
|
588
605
|
},
|
|
589
606
|
{
|
|
590
607
|
name: "estateCondition",
|
|
@@ -1122,6 +1139,7 @@ var surfacesFormFields = [
|
|
|
1122
1139
|
name: "propertyLotsCount",
|
|
1123
1140
|
fieldType: "number",
|
|
1124
1141
|
label: "Nombre de lot(s) vendu(s)",
|
|
1142
|
+
condition: or(only("isCoOwnership"), only("isHousingScheme")),
|
|
1125
1143
|
props: { suffix: "lot(s)" },
|
|
1126
1144
|
requiredFor: ["MANDATE_CREATION", "DIFFUSION"]
|
|
1127
1145
|
},
|
|
@@ -1129,6 +1147,7 @@ var surfacesFormFields = [
|
|
|
1129
1147
|
name: "propertyLotsIdentifiers",
|
|
1130
1148
|
fieldType: "text",
|
|
1131
1149
|
label: "Num\xE9ro des lot(s) vendu(s)",
|
|
1150
|
+
condition: or(only("isCoOwnership"), only("isHousingScheme")),
|
|
1132
1151
|
props: { placeholder: "Non renseign\xE9" },
|
|
1133
1152
|
requiredFor: ["MANDATE_CREATION"]
|
|
1134
1153
|
},
|
|
@@ -1139,7 +1158,8 @@ var surfacesFormFields = [
|
|
|
1139
1158
|
props: {
|
|
1140
1159
|
tooltip: "Retrouvez la/les r\xE9f\xE9rence(s) sur cadastre.gouv.fr",
|
|
1141
1160
|
placeholder: "Exemple : Section AB, Parcelle 1234"
|
|
1142
|
-
}
|
|
1161
|
+
},
|
|
1162
|
+
requiredFor: ["MANDATE_CREATION"]
|
|
1143
1163
|
}
|
|
1144
1164
|
];
|
|
1145
1165
|
var propertyFields = [
|
|
@@ -1308,6 +1328,7 @@ var mandateFormFields = [
|
|
|
1308
1328
|
condition: not("isForProfessionalUse"),
|
|
1309
1329
|
requiredFor: ["MANDATE_CREATION"]
|
|
1310
1330
|
},
|
|
1331
|
+
// TODO: move to property fields
|
|
1311
1332
|
{
|
|
1312
1333
|
fieldType: "text",
|
|
1313
1334
|
name: "notaryNameAndCity",
|
|
@@ -1500,7 +1521,7 @@ var contactFormFields = [
|
|
|
1500
1521
|
},
|
|
1501
1522
|
{
|
|
1502
1523
|
name: "prenupType",
|
|
1503
|
-
fieldType: "
|
|
1524
|
+
fieldType: "select",
|
|
1504
1525
|
label: "Type de contrat de mariage",
|
|
1505
1526
|
condition: only("isMarriedWithPrenup"),
|
|
1506
1527
|
props: { options: PRENUP_TYPES }
|
|
@@ -1521,12 +1542,11 @@ var contactFormFields = [
|
|
|
1521
1542
|
fieldType: "text",
|
|
1522
1543
|
label: "Adresse e-mail"
|
|
1523
1544
|
},
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
// },
|
|
1545
|
+
{
|
|
1546
|
+
name: "address",
|
|
1547
|
+
fieldType: "address",
|
|
1548
|
+
label: "Adresse postale"
|
|
1549
|
+
},
|
|
1530
1550
|
{
|
|
1531
1551
|
name: "kycDocumentType",
|
|
1532
1552
|
fieldType: "select",
|
|
@@ -1626,7 +1646,9 @@ export {
|
|
|
1626
1646
|
formatSeconds,
|
|
1627
1647
|
getAgencyFees,
|
|
1628
1648
|
getContactState,
|
|
1649
|
+
getDisplayedPrice,
|
|
1629
1650
|
getFeesPercentage,
|
|
1651
|
+
getIsLowPrice,
|
|
1630
1652
|
getLabel,
|
|
1631
1653
|
getLowThreshold,
|
|
1632
1654
|
getNetPrice,
|