@doctocar/tooling 0.3.1-4 → 0.3.1-6
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/emails/enums/AWSSESEmailsTemplatesNames.enum.d.ts +1 -0
- package/dist/emails/enums/AWSSESEmailsTemplatesNames.enum.js +1 -0
- package/dist/emails/maps/EmailTemplateDataMap.map.d.ts +2 -1
- package/dist/emails/types/entity/EntityMemberInviteEmailData.type.d.ts +8 -0
- package/dist/emails/types/entity/EntityVatVerificationFailedEmailData.type.d.ts +0 -1
- package/dist/emails/types/entity/index.d.ts +1 -0
- package/dist/emails/types/entity/index.js +1 -0
- package/dist/errors/enums/cloudFunctions/entities/CreateEntityMemberInviteErrorCodes.enum.d.ts +16 -0
- package/dist/errors/enums/cloudFunctions/entities/CreateEntityMemberInviteErrorCodes.enum.js +20 -0
- package/dist/errors/enums/cloudFunctions/{customers/CreateCustomerVehicleErrorCodes.enum.d.ts → entities/CreateEntityVehicleErrorCodes.enum.d.ts} +4 -1
- package/dist/errors/enums/cloudFunctions/entities/CreateEntityVehicleErrorCodes.enum.js +21 -0
- package/dist/errors/enums/cloudFunctions/entities/CreateNewEntityErrorCodes.enum.d.ts +7 -1
- package/dist/errors/enums/cloudFunctions/entities/CreateNewEntityErrorCodes.enum.js +6 -0
- package/dist/errors/enums/cloudFunctions/entities/DeleteEntityVehicleErrorCodes.enum.d.ts +10 -0
- package/dist/errors/enums/cloudFunctions/entities/DeleteEntityVehicleErrorCodes.enum.js +14 -0
- package/dist/errors/enums/cloudFunctions/entities/JoinEntityErrorCodes.enum.d.ts +13 -0
- package/dist/errors/enums/cloudFunctions/entities/JoinEntityErrorCodes.enum.js +17 -0
- package/dist/errors/enums/cloudFunctions/entities/RevokeEntityMemberErrorCodes.enum.d.ts +11 -0
- package/dist/errors/enums/cloudFunctions/entities/RevokeEntityMemberErrorCodes.enum.js +15 -0
- package/dist/errors/enums/cloudFunctions/entities/RevokeEntityMemberInviteErrorCodes.enum.d.ts +13 -0
- package/dist/errors/enums/cloudFunctions/entities/RevokeEntityMemberInviteErrorCodes.enum.js +17 -0
- package/dist/errors/enums/cloudFunctions/entities/TransferEntityOwnershipErrorCodes.enum.d.ts +11 -0
- package/dist/errors/enums/cloudFunctions/entities/TransferEntityOwnershipErrorCodes.enum.js +15 -0
- package/dist/errors/enums/cloudFunctions/entities/UpdateEntityMemberErrorCodes.enum.d.ts +13 -0
- package/dist/errors/enums/cloudFunctions/entities/UpdateEntityMemberErrorCodes.enum.js +17 -0
- package/dist/errors/enums/cloudFunctions/{customers/UpdateCustomerVehicleErrorCodes.enum.d.ts → entities/UpdateEntityVehicleErrorCodes.enum.d.ts} +5 -2
- package/dist/errors/enums/cloudFunctions/entities/UpdateEntityVehicleErrorCodes.enum.js +21 -0
- package/dist/errors/enums/cloudFunctions/entities/index.d.ts +9 -0
- package/dist/errors/enums/cloudFunctions/entities/index.js +9 -0
- package/dist/errors/enums/cloudFunctions/index.d.ts +0 -1
- package/dist/errors/enums/cloudFunctions/index.js +0 -1
- package/dist/errors/enums/cloudFunctions/users/UpdateUserIdentityErrorCodes.enum.d.ts +6 -1
- package/dist/errors/enums/cloudFunctions/users/UpdateUserIdentityErrorCodes.enum.js +5 -0
- package/dist/firebase/cloudFunctions/enums/OnCallCloudFunctionsNames.enum.d.ts +9 -3
- package/dist/firebase/cloudFunctions/enums/OnCallCloudFunctionsNames.enum.js +9 -4
- package/dist/firebase/cloudFunctions/maps/OnCallCloudFunctionsTypeMappings.map.d.ts +41 -17
- package/dist/firebase/cloudFunctions/types/entities/CreateEntityMemberInviteRequestData.type.d.ts +7 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateEntityMemberInviteResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateEntityVehiclePayload.type.d.ts +11 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateEntityVehicleRequestData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateEntityVehicleResponseData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateNewEntityPayload.type.d.ts +4 -0
- package/dist/firebase/cloudFunctions/types/entities/DeleteEntityVehiclePayload.type.d.ts +4 -0
- package/dist/firebase/cloudFunctions/types/entities/DeleteEntityVehiclePayload.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/DeleteEntityVehicleRequestData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/DeleteEntityVehicleRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/DeleteEntityVehicleResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/DeleteEntityVehicleResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/JoinEntityRequestData.type.d.ts +4 -0
- package/dist/firebase/cloudFunctions/types/entities/JoinEntityRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/JoinEntityResponseData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/JoinEntityResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberInviteRequestData.type.d.ts +5 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberInviteRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberInviteResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberInviteResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberRequestData.type.d.ts +5 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/RevokeEntityMemberResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/TransferEntityOwnershipRequestData.type.d.ts +5 -0
- package/dist/firebase/cloudFunctions/types/entities/TransferEntityOwnershipRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/TransferEntityOwnershipResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/TransferEntityOwnershipResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityMemberPayload.type.d.ts +6 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityMemberPayload.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityMemberRequestData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityMemberRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityMemberResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityMemberResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityVehiclePayload.type.d.ts +12 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityVehiclePayload.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityVehicleRequestData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityVehicleRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityVehicleResponseData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/UpdateEntityVehicleResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/index.d.ts +22 -0
- package/dist/firebase/cloudFunctions/types/entities/index.js +22 -0
- package/dist/firebase/cloudFunctions/types/users/UpdateUserIdentityRequestData.type.d.ts +2 -0
- package/dist/firebase/cloudFunctions/types/users/index.d.ts +0 -1
- package/dist/firebase/cloudFunctions/types/users/index.js +0 -1
- package/dist/firebase/firestore/constants/index.d.ts +2 -2
- package/dist/firebase/firestore/constants/index.js +2 -2
- package/dist/firebase/firestore/constants/maximumEntityMembers.constant.d.ts +1 -0
- package/dist/firebase/firestore/constants/maximumEntityMembers.constant.js +4 -0
- package/dist/firebase/firestore/constants/maximumEntityVehicles.constant.d.ts +1 -0
- package/dist/firebase/firestore/constants/maximumEntityVehicles.constant.js +4 -0
- package/dist/firebase/firestore/enums/FirestoreCollections.enum.d.ts +1 -0
- package/dist/firebase/firestore/enums/FirestoreCollections.enum.js +1 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberInviteStatus.enum.d.ts +6 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberInviteStatus.enum.js +10 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberStatus.enum.d.ts +1 -2
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberStatus.enum.js +1 -2
- package/dist/firebase/firestore/enums/entityMembers/index.d.ts +1 -0
- package/dist/firebase/firestore/enums/entityMembers/index.js +1 -0
- package/dist/firebase/firestore/enums/index.d.ts +1 -0
- package/dist/firebase/firestore/enums/index.js +1 -0
- package/dist/firebase/firestore/enums/notificationEvent/NotificationEventDeliveryStateStatus.enum.d.ts +5 -0
- package/dist/firebase/firestore/enums/notificationEvent/NotificationEventDeliveryStateStatus.enum.js +9 -0
- package/dist/firebase/firestore/enums/notificationEvent/index.d.ts +1 -0
- package/dist/{errors/enums/cloudFunctions/customers → firebase/firestore/enums/notificationEvent}/index.js +1 -3
- package/dist/firebase/firestore/maps/FirestoreCollectionDocumentTypeMap.d.ts +2 -1
- package/dist/firebase/firestore/types/agreements/FirestoreUserAgreements.type.d.ts +1 -3
- package/dist/firebase/firestore/types/configs/FirestorePlatformPublicConfigDocument.type.d.ts +4 -4
- package/dist/firebase/firestore/types/entities/EntityAgreements.type.d.ts +10 -0
- package/dist/firebase/firestore/types/entities/EntityAgreements.type.js +2 -0
- package/dist/firebase/firestore/types/entities/FirestoreEntityDocument.type.d.ts +5 -10
- package/dist/firebase/firestore/types/entities/index.d.ts +1 -0
- package/dist/firebase/firestore/types/entities/index.js +1 -0
- package/dist/firebase/firestore/types/entityMemberInvites/EntityMemberInviteRole.type.d.ts +2 -0
- package/dist/firebase/firestore/types/entityMemberInvites/EntityMemberInviteRole.type.js +2 -0
- package/dist/firebase/firestore/types/entityMemberInvites/FirestoreEntityMemberInviteDocument.type.d.ts +22 -0
- package/dist/firebase/firestore/types/entityMemberInvites/FirestoreEntityMemberInviteDocument.type.js +2 -0
- package/dist/firebase/firestore/types/entityMemberInvites/index.d.ts +2 -0
- package/dist/firebase/{cloudFunctions/types/users/customers → firestore/types/entityMemberInvites}/index.js +2 -6
- package/dist/firebase/firestore/types/entityMembers/FirestoreEntityMemberDocument.type.d.ts +10 -0
- package/dist/firebase/firestore/types/index.d.ts +1 -0
- package/dist/firebase/firestore/types/index.js +1 -0
- package/dist/firebase/firestore/types/notificationEvent/FirestoreNotificationEventDeliveryStateDocument.type.d.ts +2 -1
- package/dist/firebase/firestore/types/userPublicDocument/FirestoreProfessionalUserPublicDocument.type.d.ts +4 -1
- package/dist/firebase/firestore/types/vehicles/FirestoreVehicleDocument.type.d.ts +3 -3
- package/dist/firebase/firestore/utils/entities/__tests__/isEntityMemberAuthorized.test.d.ts +1 -0
- package/dist/firebase/firestore/utils/entities/__tests__/isEntityMemberAuthorized.test.js +83 -0
- package/dist/firebase/firestore/utils/entities/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/entities/index.js +17 -0
- package/dist/firebase/firestore/utils/entities/isEntityMemberAuthorized.d.ts +2 -0
- package/dist/firebase/firestore/utils/entities/isEntityMemberAuthorized.js +9 -0
- package/dist/firebase/firestore/utils/entities/types/IsEntityMemberAuthorizedParams.type.d.ts +7 -0
- package/dist/firebase/firestore/utils/entities/types/IsEntityMemberAuthorizedParams.type.js +2 -0
- package/dist/firebase/firestore/utils/entities/types/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/entities/types/index.js +17 -0
- package/dist/firebase/firestore/utils/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/index.js +1 -0
- package/dist/firebase/firestore/utils/stubs/configs/firestorePlatformPublicConfigDocumentStub.js +4 -4
- package/dist/firebase/firestore/utils/stubs/entities/firestoreEntityDocumentStub.js +3 -0
- package/dist/firebase/firestore/utils/stubs/entityMemberInvites/firestoreEntityMemberInviteDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/entityMemberInvites/firestoreEntityMemberInviteDocumentStub.js +22 -0
- package/dist/firebase/firestore/utils/stubs/entityMemberInvites/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/entityMemberInvites/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/index.js +1 -0
- package/dist/firebase/firestore/utils/stubs/notificationEvent/firestoreNotificationEventDeliveryStateDocumentStub.js +2 -1
- package/dist/firebase/firestore/utils/stubs/userPublicDocument/firestoreProfessionalUserPublicDocumentStub.js +0 -2
- package/dist/firebase/firestore/utils/users/__tests__/assertCustomerUserCanBookServices.test.js +7 -7
- package/dist/firebase/firestore/utils/users/__tests__/assertProfessionalUserIsBookable.util.test.js +7 -7
- package/dist/firebase/firestore/utils/users/assertCustomerUserCanBookServices.js +2 -2
- package/dist/firebase/firestore/utils/users/assertProfessionalUserIsBookable.util.js +2 -2
- package/dist/firebase/storage/utils/__tests__/buildStoragePeriodSlug.test.js +7 -0
- package/dist/gcp/pubsub/enums/PubSubTopics.enum.d.ts +2 -1
- package/dist/gcp/pubsub/enums/PubSubTopics.enum.js +1 -0
- package/dist/gcp/pubsub/maps/PubSubTopicMessageMap.map.d.ts +2 -1
- package/dist/gcp/pubsub/types/PubSubNotificationEventMessage.type.d.ts +1 -1
- package/dist/gcp/pubsub/types/entities/PubSubEntityMemberProjectionResyncRequestedMessage.type.d.ts +4 -0
- package/dist/gcp/pubsub/types/entities/PubSubEntityMemberProjectionResyncRequestedMessage.type.js +2 -0
- package/dist/gcp/pubsub/types/entities/index.d.ts +1 -0
- package/dist/gcp/pubsub/types/entities/index.js +1 -0
- package/dist/gcp/pubsub/utils/stubs/entities/index.d.ts +1 -0
- package/dist/gcp/pubsub/utils/stubs/entities/index.js +1 -0
- package/dist/gcp/pubsub/utils/stubs/entities/pubSubEntityMemberProjectionResyncRequestedMessageStub.d.ts +2 -0
- package/dist/gcp/pubsub/utils/stubs/entities/pubSubEntityMemberProjectionResyncRequestedMessageStub.js +10 -0
- package/package.json +1 -1
- package/dist/errors/enums/cloudFunctions/customers/CreateCustomerVehicleErrorCodes.enum.js +0 -18
- package/dist/errors/enums/cloudFunctions/customers/DeleteCustomerVehicleErrorCodes.enum.d.ts +0 -7
- package/dist/errors/enums/cloudFunctions/customers/DeleteCustomerVehicleErrorCodes.enum.js +0 -11
- package/dist/errors/enums/cloudFunctions/customers/UpdateCustomerVehicleErrorCodes.enum.js +0 -18
- package/dist/errors/enums/cloudFunctions/customers/index.d.ts +0 -3
- package/dist/firebase/cloudFunctions/types/users/customers/CreateCustomerVehicleRequestData.type.d.ts +0 -11
- package/dist/firebase/cloudFunctions/types/users/customers/CreateCustomerVehicleResponseData.type.d.ts +0 -3
- package/dist/firebase/cloudFunctions/types/users/customers/DeleteCustomerVehicleRequestData.type.d.ts +0 -4
- package/dist/firebase/cloudFunctions/types/users/customers/DeleteCustomerVehicleResponseData.type.d.ts +0 -1
- package/dist/firebase/cloudFunctions/types/users/customers/UpdateCustomerVehicleRequestData.type.d.ts +0 -12
- package/dist/firebase/cloudFunctions/types/users/customers/UpdateCustomerVehicleResponseData.type.d.ts +0 -3
- package/dist/firebase/cloudFunctions/types/users/customers/index.d.ts +0 -6
- package/dist/firebase/firestore/constants/maximumCustomerVehicles.constant.d.ts +0 -1
- package/dist/firebase/firestore/constants/maximumCustomerVehicles.constant.js +0 -4
- package/dist/firebase/firestore/constants/minimumCustomerVehicles.constant.d.ts +0 -1
- package/dist/firebase/firestore/constants/minimumCustomerVehicles.constant.js +0 -4
- /package/dist/{firebase/cloudFunctions/types/users/customers/CreateCustomerVehicleRequestData.type.js → emails/types/entity/EntityMemberInviteEmailData.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/CreateCustomerVehicleResponseData.type.js → entities/CreateEntityMemberInviteRequestData.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/DeleteCustomerVehicleRequestData.type.js → entities/CreateEntityMemberInviteResponseData.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/DeleteCustomerVehicleResponseData.type.js → entities/CreateEntityVehiclePayload.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/UpdateCustomerVehicleRequestData.type.js → entities/CreateEntityVehicleRequestData.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/UpdateCustomerVehicleResponseData.type.js → entities/CreateEntityVehicleResponseData.type.js} +0 -0
package/dist/firebase/firestore/types/configs/FirestorePlatformPublicConfigDocument.type.d.ts
CHANGED
|
@@ -5,19 +5,19 @@ export type FirestorePlatformPublicConfigDocument = {
|
|
|
5
5
|
metadata: FirestoreConfigMetadata;
|
|
6
6
|
data: {
|
|
7
7
|
legal: {
|
|
8
|
-
|
|
8
|
+
privacyPolicyPro: {
|
|
9
9
|
version: string;
|
|
10
10
|
documentUrl: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
selfBillingAgreement: {
|
|
13
13
|
version: string;
|
|
14
14
|
documentUrl: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
16
|
+
marketplaceTermsPro: {
|
|
17
17
|
version: string;
|
|
18
18
|
documentUrl: string;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
marketplaceTerms: {
|
|
21
21
|
version: string;
|
|
22
22
|
documentUrl: string;
|
|
23
23
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { EntityInsuranceType, EntityLegalType, EntityMarketplaceRole, EntityServiceProviderComplianceStatus, EntityServiceProviderNonBookableReason } from "../../enums";
|
|
2
2
|
import type { LegalAddress } from "../company";
|
|
3
3
|
import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
4
|
-
import type { TermsAndPolicy } from "../legal";
|
|
5
4
|
import type { StripeConnectAccountSummary, StripeCustomerSummary } from "../paymentProviders";
|
|
5
|
+
import type { EntityAgreements } from "./EntityAgreements.type";
|
|
6
6
|
import type { EntityInsuranceFile } from "./EntityInsuranceFile.type";
|
|
7
7
|
import type { EntityLegalDetails } from "./EntityLegalDetails.type";
|
|
8
8
|
import type { EntityLegalRepresentative } from "./EntityLegalRepresentative.type";
|
|
@@ -19,18 +19,13 @@ export type FirestoreEntityDocument = {
|
|
|
19
19
|
billingAddress: LegalAddress;
|
|
20
20
|
sameAsLegalAddress?: boolean;
|
|
21
21
|
};
|
|
22
|
-
agreements?:
|
|
23
|
-
customerAgreement?: {
|
|
24
|
-
termsOfUse?: TermsAndPolicy;
|
|
25
|
-
};
|
|
26
|
-
serviceProviderAgreement?: {
|
|
27
|
-
termsOfService?: TermsAndPolicy;
|
|
28
|
-
selfBillingAgreement?: TermsAndPolicy;
|
|
29
|
-
};
|
|
30
|
-
};
|
|
22
|
+
agreements?: EntityAgreements;
|
|
31
23
|
documents?: {
|
|
32
24
|
insurances?: Partial<Record<EntityInsuranceType, EntityInsuranceFile>>;
|
|
33
25
|
};
|
|
26
|
+
capabilities: {
|
|
27
|
+
supportsMultipleMembers: boolean;
|
|
28
|
+
};
|
|
34
29
|
compliance?: {
|
|
35
30
|
serviceProvider?: {
|
|
36
31
|
isBookable: boolean;
|
|
@@ -19,3 +19,4 @@ __exportStar(require("./EntityLegalDetails.type"), exports);
|
|
|
19
19
|
__exportStar(require("./EntityLegalRepresentative.type"), exports);
|
|
20
20
|
__exportStar(require("./EntityVatDetails.type"), exports);
|
|
21
21
|
__exportStar(require("./EntityRegistration.type"), exports);
|
|
22
|
+
__exportStar(require("./EntityAgreements.type"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { AppsNames } from "../../../../enums";
|
|
2
|
+
import type { EntityMemberInviteStatus } from "../../enums";
|
|
3
|
+
import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
4
|
+
import type { EntityMemberInviteRole } from "./EntityMemberInviteRole.type";
|
|
5
|
+
export type FirestoreEntityMemberInviteDocument = {
|
|
6
|
+
createdAt: FirestoreTimestamp;
|
|
7
|
+
updatedAt: FirestoreTimestamp;
|
|
8
|
+
version: 1;
|
|
9
|
+
entityId: string;
|
|
10
|
+
appName: AppsNames;
|
|
11
|
+
inviteeEmail: string;
|
|
12
|
+
role: EntityMemberInviteRole;
|
|
13
|
+
status: EntityMemberInviteStatus;
|
|
14
|
+
createdByUserId: string;
|
|
15
|
+
expiresAt: FirestoreTimestamp;
|
|
16
|
+
ttlExpiration?: FirestoreTimestamp;
|
|
17
|
+
inviteCodeHash: string;
|
|
18
|
+
revokedAt?: FirestoreTimestamp;
|
|
19
|
+
revokedByUserId?: string;
|
|
20
|
+
acceptedAt?: FirestoreTimestamp;
|
|
21
|
+
acceptedByUserId?: string;
|
|
22
|
+
};
|
|
@@ -14,9 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
18
|
-
__exportStar(require("./
|
|
19
|
-
__exportStar(require("./UpdateCustomerVehicleRequestData.type"), exports);
|
|
20
|
-
__exportStar(require("./UpdateCustomerVehicleResponseData.type"), exports);
|
|
21
|
-
__exportStar(require("./DeleteCustomerVehicleRequestData.type"), exports);
|
|
22
|
-
__exportStar(require("./DeleteCustomerVehicleResponseData.type"), exports);
|
|
17
|
+
__exportStar(require("./EntityMemberInviteRole.type"), exports);
|
|
18
|
+
__exportStar(require("./FirestoreEntityMemberInviteDocument.type"), exports);
|
|
@@ -8,4 +8,14 @@ export type FirestoreEntityMemberDocument = {
|
|
|
8
8
|
entityId: string;
|
|
9
9
|
role: EntityMemberRole;
|
|
10
10
|
status: EntityMemberStatus;
|
|
11
|
+
userProjection?: {
|
|
12
|
+
contact?: {
|
|
13
|
+
firstName?: string;
|
|
14
|
+
lastName?: string;
|
|
15
|
+
email?: string;
|
|
16
|
+
};
|
|
17
|
+
syncedAt?: FirestoreTimestamp;
|
|
18
|
+
};
|
|
19
|
+
revokedAt?: FirestoreTimestamp;
|
|
20
|
+
revokedByUserId?: string;
|
|
11
21
|
};
|
|
@@ -52,4 +52,5 @@ __exportStar(require("./entities"), exports);
|
|
|
52
52
|
__exportStar(require("./paymentProviders"), exports);
|
|
53
53
|
__exportStar(require("./agreements"), exports);
|
|
54
54
|
__exportStar(require("./entityMembers"), exports);
|
|
55
|
+
__exportStar(require("./entityMemberInvites"), exports);
|
|
55
56
|
__exportStar(require("./entityUniqueKeys"), exports);
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
+
import type { NotificationEventDeliveryStateStatus } from "../../enums";
|
|
1
2
|
import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
2
3
|
export type FirestoreNotificationEventDeliveryStateDocument = {
|
|
3
4
|
createdAt: FirestoreTimestamp;
|
|
4
5
|
updatedAt: FirestoreTimestamp;
|
|
5
6
|
lastSentAt?: FirestoreTimestamp;
|
|
6
7
|
sentCount?: number;
|
|
7
|
-
status:
|
|
8
|
+
status: NotificationEventDeliveryStateStatus;
|
|
8
9
|
ttlExpiration?: FirestoreTimestamp;
|
|
9
10
|
};
|
|
@@ -17,7 +17,10 @@ export type FirestoreProfessionalUserPublicDocument = {
|
|
|
17
17
|
updatedAt: FirestoreTimestamp;
|
|
18
18
|
};
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
coverPicture?: {
|
|
21
|
+
storagePaths: FirestoreImageVariantSet;
|
|
22
|
+
updatedAt: FirestoreTimestamp;
|
|
23
|
+
};
|
|
21
24
|
publicDescription?: string;
|
|
22
25
|
activeServicesVehiclesCombos: string[];
|
|
23
26
|
professionalServices: Partial<{
|
|
@@ -3,10 +3,10 @@ import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
|
3
3
|
import type { DoctoCarLocation } from "../location";
|
|
4
4
|
export type FirestoreVehicleDocument = {
|
|
5
5
|
type: VehicleTypes;
|
|
6
|
-
color: VehicleColorsTypes;
|
|
6
|
+
color: VehicleColorsTypes | null;
|
|
7
7
|
location: DoctoCarLocation;
|
|
8
|
-
brand: VehicleBrands;
|
|
9
|
-
model: string;
|
|
8
|
+
brand: VehicleBrands | null;
|
|
9
|
+
model: string | null;
|
|
10
10
|
licensePlate: string;
|
|
11
11
|
personalLabel: string | null;
|
|
12
12
|
createdAt: FirestoreTimestamp;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const enums_1 = require("../../../enums");
|
|
4
|
+
const stubs_1 = require("../../stubs");
|
|
5
|
+
const isEntityMemberAuthorized_1 = require("../isEntityMemberAuthorized");
|
|
6
|
+
describe("isEntityMemberAuthorized", () => {
|
|
7
|
+
describe("when entityMemberDocument is null", () => {
|
|
8
|
+
it("should return false", () => {
|
|
9
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
10
|
+
entityMemberDocument: null,
|
|
11
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER],
|
|
12
|
+
})).toBe(false);
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
describe("role check", () => {
|
|
16
|
+
it("should return true when member role is in allowedRoles", () => {
|
|
17
|
+
const member = (0, stubs_1.firestoreEntityMemberDocumentStub)({
|
|
18
|
+
role: enums_1.EntityMemberRole.OWNER,
|
|
19
|
+
status: enums_1.EntityMemberStatus.ACTIVE,
|
|
20
|
+
});
|
|
21
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
22
|
+
entityMemberDocument: member,
|
|
23
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER, enums_1.EntityMemberRole.ADMIN],
|
|
24
|
+
})).toBe(true);
|
|
25
|
+
});
|
|
26
|
+
it("should return false when member role is not in allowedRoles", () => {
|
|
27
|
+
const member = (0, stubs_1.firestoreEntityMemberDocumentStub)({
|
|
28
|
+
role: enums_1.EntityMemberRole.MEMBER,
|
|
29
|
+
status: enums_1.EntityMemberStatus.ACTIVE,
|
|
30
|
+
});
|
|
31
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
32
|
+
entityMemberDocument: member,
|
|
33
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER, enums_1.EntityMemberRole.ADMIN],
|
|
34
|
+
})).toBe(false);
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
describe("status check (default allowedStatuses)", () => {
|
|
38
|
+
it("should return true when member status is ACTIVE (default)", () => {
|
|
39
|
+
const member = (0, stubs_1.firestoreEntityMemberDocumentStub)({
|
|
40
|
+
role: enums_1.EntityMemberRole.OWNER,
|
|
41
|
+
status: enums_1.EntityMemberStatus.ACTIVE,
|
|
42
|
+
});
|
|
43
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
44
|
+
entityMemberDocument: member,
|
|
45
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER],
|
|
46
|
+
})).toBe(true);
|
|
47
|
+
});
|
|
48
|
+
it("should return false when member status is REVOKED", () => {
|
|
49
|
+
const member = (0, stubs_1.firestoreEntityMemberDocumentStub)({
|
|
50
|
+
role: enums_1.EntityMemberRole.OWNER,
|
|
51
|
+
status: enums_1.EntityMemberStatus.REVOKED,
|
|
52
|
+
});
|
|
53
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
54
|
+
entityMemberDocument: member,
|
|
55
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER],
|
|
56
|
+
})).toBe(false);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe("custom allowedStatuses", () => {
|
|
60
|
+
it("should return true when member status is in custom allowedStatuses", () => {
|
|
61
|
+
const member = (0, stubs_1.firestoreEntityMemberDocumentStub)({
|
|
62
|
+
role: enums_1.EntityMemberRole.OWNER,
|
|
63
|
+
status: enums_1.EntityMemberStatus.REVOKED,
|
|
64
|
+
});
|
|
65
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
66
|
+
entityMemberDocument: member,
|
|
67
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER],
|
|
68
|
+
allowedStatuses: [enums_1.EntityMemberStatus.REVOKED],
|
|
69
|
+
})).toBe(true);
|
|
70
|
+
});
|
|
71
|
+
it("should return false when member status is not in custom allowedStatuses", () => {
|
|
72
|
+
const member = (0, stubs_1.firestoreEntityMemberDocumentStub)({
|
|
73
|
+
role: enums_1.EntityMemberRole.OWNER,
|
|
74
|
+
status: enums_1.EntityMemberStatus.ACTIVE,
|
|
75
|
+
});
|
|
76
|
+
expect((0, isEntityMemberAuthorized_1.isEntityMemberAuthorized)({
|
|
77
|
+
entityMemberDocument: member,
|
|
78
|
+
allowedRoles: [enums_1.EntityMemberRole.OWNER],
|
|
79
|
+
allowedStatuses: [enums_1.EntityMemberStatus.REVOKED],
|
|
80
|
+
})).toBe(false);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./isEntityMemberAuthorized";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./isEntityMemberAuthorized"), exports);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isEntityMemberAuthorized = isEntityMemberAuthorized;
|
|
4
|
+
const enums_1 = require("../../enums");
|
|
5
|
+
function isEntityMemberAuthorized({ entityMemberDocument, allowedRoles, allowedStatuses = [enums_1.EntityMemberStatus.ACTIVE], }) {
|
|
6
|
+
return (!!entityMemberDocument &&
|
|
7
|
+
allowedStatuses.includes(entityMemberDocument.status) &&
|
|
8
|
+
allowedRoles.includes(entityMemberDocument.role));
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { EntityMemberRole, EntityMemberStatus } from "../../../enums";
|
|
2
|
+
import type { FirestoreEntityMemberDocument } from "../../../types";
|
|
3
|
+
export type IsEntityMemberAuthorizedParams = {
|
|
4
|
+
entityMemberDocument: FirestoreEntityMemberDocument | null;
|
|
5
|
+
allowedRoles: EntityMemberRole[];
|
|
6
|
+
allowedStatuses?: EntityMemberStatus[];
|
|
7
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./IsEntityMemberAuthorizedParams.type";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./IsEntityMemberAuthorizedParams.type"), exports);
|
package/dist/firebase/firestore/utils/stubs/configs/firestorePlatformPublicConfigDocumentStub.js
CHANGED
|
@@ -21,17 +21,17 @@ function firestorePlatformPublicConfigDocumentStub(overwrite = {}) {
|
|
|
21
21
|
version: "1.0.0",
|
|
22
22
|
documentUrl: "https://example.com/privacy-policy-pro",
|
|
23
23
|
},
|
|
24
|
-
|
|
24
|
+
marketplaceTermsPro: {
|
|
25
25
|
version: "1.0.0",
|
|
26
|
-
documentUrl: "https://example.com/terms-
|
|
26
|
+
documentUrl: "https://example.com/marketplace-terms-pro",
|
|
27
27
|
},
|
|
28
28
|
selfBillingAgreement: {
|
|
29
29
|
version: "1.0.0",
|
|
30
30
|
documentUrl: "https://example.com/self-billing-agreement",
|
|
31
31
|
},
|
|
32
|
-
|
|
32
|
+
marketplaceTerms: {
|
|
33
33
|
version: "1.0.0",
|
|
34
|
-
documentUrl: "https://example.com/terms
|
|
34
|
+
documentUrl: "https://example.com/marketplace-terms",
|
|
35
35
|
},
|
|
36
36
|
},
|
|
37
37
|
appVersions: {
|
|
@@ -18,6 +18,9 @@ function firestoreEntityDocumentStub(overwrite = {}) {
|
|
|
18
18
|
},
|
|
19
19
|
legalRepresentative: (0, entityLegalRepresentativeStub_1.entityLegalRepresentativeStub)(),
|
|
20
20
|
legalDetails: (0, entityLegalDetailsStub_1.entityLegalDetailsStub)(),
|
|
21
|
+
capabilities: {
|
|
22
|
+
supportsMultipleMembers: false,
|
|
23
|
+
},
|
|
21
24
|
metrics: {
|
|
22
25
|
members: {
|
|
23
26
|
activeCount: 1,
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firestoreEntityMemberInviteDocumentStub = firestoreEntityMemberInviteDocumentStub;
|
|
4
|
+
const enums_1 = require("../../../../../enums");
|
|
5
|
+
const enums_2 = require("../../../enums");
|
|
6
|
+
const firestoreTimestampStub_1 = require("../firestoreTimestampStub");
|
|
7
|
+
function firestoreEntityMemberInviteDocumentStub(overwrite = {}) {
|
|
8
|
+
return {
|
|
9
|
+
createdAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
10
|
+
updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
11
|
+
version: 1,
|
|
12
|
+
entityId: "some-entity-id",
|
|
13
|
+
appName: enums_1.AppsNames.DOCTOCAR_CUSTOMER_APP,
|
|
14
|
+
inviteeEmail: "invitee@example.com",
|
|
15
|
+
role: enums_2.EntityMemberRole.MEMBER,
|
|
16
|
+
status: enums_2.EntityMemberInviteStatus.PENDING,
|
|
17
|
+
createdByUserId: "some-user-id",
|
|
18
|
+
expiresAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
19
|
+
inviteCodeHash: "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
|
|
20
|
+
...overwrite,
|
|
21
|
+
};
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./firestoreEntityMemberInviteDocumentStub";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./firestoreEntityMemberInviteDocumentStub"), exports);
|
|
@@ -42,4 +42,5 @@ __exportStar(require("./functionsDeploymentRuns"), exports);
|
|
|
42
42
|
__exportStar(require("./marketplaceFinancialReports"), exports);
|
|
43
43
|
__exportStar(require("./entities"), exports);
|
|
44
44
|
__exportStar(require("./entityMembers"), exports);
|
|
45
|
+
__exportStar(require("./entityMemberInvites"), exports);
|
|
45
46
|
__exportStar(require("./entityUniqueKeys"), exports);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.firestoreNotificationEventDeliveryStateDocumentStub = firestoreNotificationEventDeliveryStateDocumentStub;
|
|
4
|
+
const enums_1 = require("../../../enums");
|
|
4
5
|
const firestoreTimestampStub_1 = require("../firestoreTimestampStub");
|
|
5
6
|
function firestoreNotificationEventDeliveryStateDocumentStub(overwrite = {}) {
|
|
6
7
|
return {
|
|
@@ -8,7 +9,7 @@ function firestoreNotificationEventDeliveryStateDocumentStub(overwrite = {}) {
|
|
|
8
9
|
updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
9
10
|
lastSentAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
10
11
|
sentCount: 0,
|
|
11
|
-
status:
|
|
12
|
+
status: enums_1.NotificationEventDeliveryStateStatus.PENDING,
|
|
12
13
|
...overwrite,
|
|
13
14
|
};
|
|
14
15
|
}
|
|
@@ -4,7 +4,6 @@ exports.firestoreProfessionalUserPublicDocumentStub = firestoreProfessionalUserP
|
|
|
4
4
|
const enums_1 = require("../../../../../enums");
|
|
5
5
|
const utils_1 = require("../../../../../utils");
|
|
6
6
|
const firestoreTimestampStub_1 = require("../firestoreTimestampStub");
|
|
7
|
-
const image_1 = require("../image");
|
|
8
7
|
function firestoreProfessionalUserPublicDocumentStub(overwrite = {}) {
|
|
9
8
|
const { openTimeline, blockedTimeline } = (0, utils_1.buildEmptyAvailabilityTimelines)({
|
|
10
9
|
horizonDays: 14,
|
|
@@ -14,7 +13,6 @@ function firestoreProfessionalUserPublicDocumentStub(overwrite = {}) {
|
|
|
14
13
|
createdAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
15
14
|
updatedAt: (0, firestoreTimestampStub_1.firestoreTimestampStub)(),
|
|
16
15
|
companyNickname: "DoctoCar",
|
|
17
|
-
coverPictureStoragePaths: (0, image_1.firestoreImageVariantSetStub)(),
|
|
18
16
|
professionalServices: {},
|
|
19
17
|
reviewAggregates: {
|
|
20
18
|
reviewCount: 0,
|
package/dist/firebase/firestore/utils/users/__tests__/assertCustomerUserCanBookServices.test.js
CHANGED
|
@@ -58,17 +58,17 @@ const platformPublicConfigDocument = (0, stubs_1.firestorePlatformPublicConfigDo
|
|
|
58
58
|
version: "1.0.0",
|
|
59
59
|
documentUrl: "https://example.com/privacy-policy-pro",
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
marketplaceTerms: {
|
|
62
62
|
version: "1.0.0",
|
|
63
|
-
documentUrl: "https://example.com/terms
|
|
63
|
+
documentUrl: "https://example.com/marketplace-terms",
|
|
64
64
|
},
|
|
65
65
|
selfBillingAgreement: {
|
|
66
66
|
version: "1.0.0",
|
|
67
67
|
documentUrl: "https://example.com/self-billing-agreement",
|
|
68
68
|
},
|
|
69
|
-
|
|
69
|
+
marketplaceTermsPro: {
|
|
70
70
|
version: "1.0.0",
|
|
71
|
-
documentUrl: "https://example.com/terms-
|
|
71
|
+
documentUrl: "https://example.com/marketplace-terms-pro",
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
},
|
|
@@ -144,7 +144,7 @@ const errorCases = [
|
|
|
144
144
|
platformPublicConfigDocument,
|
|
145
145
|
isCompanyVatValidReturnValue: true,
|
|
146
146
|
isLegalAddressValidReturnValue: true,
|
|
147
|
-
expectedError: new errors_1.DoctoCarError("Customer user has not accepted the latest terms
|
|
147
|
+
expectedError: new errors_1.DoctoCarError("Customer user has not accepted the latest marketplace terms", errors_2.AssertCustomerUserCanBookServicesErrorCodes.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE),
|
|
148
148
|
},
|
|
149
149
|
{
|
|
150
150
|
only: false,
|
|
@@ -162,7 +162,7 @@ const errorCases = [
|
|
|
162
162
|
platformPublicConfigDocument,
|
|
163
163
|
isCompanyVatValidReturnValue: true,
|
|
164
164
|
isLegalAddressValidReturnValue: true,
|
|
165
|
-
expectedError: new errors_1.DoctoCarError("Customer user has not accepted the latest terms
|
|
165
|
+
expectedError: new errors_1.DoctoCarError("Customer user has not accepted the latest marketplace terms", errors_2.AssertCustomerUserCanBookServicesErrorCodes.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE),
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
only: false,
|
|
@@ -198,7 +198,7 @@ const errorCases = [
|
|
|
198
198
|
platformPublicConfigDocument,
|
|
199
199
|
isCompanyVatValidReturnValue: true,
|
|
200
200
|
isLegalAddressValidReturnValue: true,
|
|
201
|
-
expectedError: new errors_1.DoctoCarError("Customer user has not accepted the latest terms
|
|
201
|
+
expectedError: new errors_1.DoctoCarError("Customer user has not accepted the latest marketplace terms", errors_2.AssertCustomerUserCanBookServicesErrorCodes.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE),
|
|
202
202
|
},
|
|
203
203
|
{
|
|
204
204
|
only: false,
|
package/dist/firebase/firestore/utils/users/__tests__/assertProfessionalUserIsBookable.util.test.js
CHANGED
|
@@ -50,17 +50,17 @@ const platformPublicConfigDocument = (0, stubs_1.firestorePlatformPublicConfigDo
|
|
|
50
50
|
version: "1.0.0",
|
|
51
51
|
documentUrl: "https://example.com/privacy-policy-pro",
|
|
52
52
|
},
|
|
53
|
-
|
|
53
|
+
marketplaceTermsPro: {
|
|
54
54
|
version: "1.0.0",
|
|
55
|
-
documentUrl: "https://example.com/terms-
|
|
55
|
+
documentUrl: "https://example.com/marketplace-terms-pro",
|
|
56
56
|
},
|
|
57
57
|
selfBillingAgreement: {
|
|
58
58
|
version: "1.0.0",
|
|
59
59
|
documentUrl: "https://example.com/self-billing-agreement",
|
|
60
60
|
},
|
|
61
|
-
|
|
61
|
+
marketplaceTerms: {
|
|
62
62
|
version: "1.0.0",
|
|
63
|
-
documentUrl: "https://example.com/terms
|
|
63
|
+
documentUrl: "https://example.com/marketplace-terms",
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
},
|
|
@@ -170,7 +170,7 @@ const errorCases = [
|
|
|
170
170
|
isCompanyVatValidReturnValue: true,
|
|
171
171
|
isLegalAddressValidReturnValue: true,
|
|
172
172
|
isFrenchCompanyRegistrationValidReturnValue: true,
|
|
173
|
-
expectedError: new errors_1.DoctoCarError("Professional user has not accepted the latest terms
|
|
173
|
+
expectedError: new errors_1.DoctoCarError("Professional user has not accepted the latest marketplace terms", enums_2.ProfessionalNonBookableReason.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE),
|
|
174
174
|
},
|
|
175
175
|
{
|
|
176
176
|
name: "missing terms of service acceptance",
|
|
@@ -187,7 +187,7 @@ const errorCases = [
|
|
|
187
187
|
isCompanyVatValidReturnValue: true,
|
|
188
188
|
isLegalAddressValidReturnValue: true,
|
|
189
189
|
isFrenchCompanyRegistrationValidReturnValue: true,
|
|
190
|
-
expectedError: new errors_1.DoctoCarError("Professional user has not accepted the latest terms
|
|
190
|
+
expectedError: new errors_1.DoctoCarError("Professional user has not accepted the latest marketplace terms", enums_2.ProfessionalNonBookableReason.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE),
|
|
191
191
|
},
|
|
192
192
|
{
|
|
193
193
|
name: "Invalid terms of service acceptance",
|
|
@@ -207,7 +207,7 @@ const errorCases = [
|
|
|
207
207
|
isCompanyVatValidReturnValue: true,
|
|
208
208
|
isLegalAddressValidReturnValue: true,
|
|
209
209
|
isFrenchCompanyRegistrationValidReturnValue: true,
|
|
210
|
-
expectedError: new errors_1.DoctoCarError("Professional user has not accepted the latest terms
|
|
210
|
+
expectedError: new errors_1.DoctoCarError("Professional user has not accepted the latest marketplace terms", enums_2.ProfessionalNonBookableReason.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE),
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
name: "invalid company VAT details",
|
|
@@ -18,8 +18,8 @@ function assertCustomerUserCanBookServices(customerUserDocument, platformConfigD
|
|
|
18
18
|
}
|
|
19
19
|
if (customerUserDocument.customerInfos?.termsOfUse?.acceptedAt === undefined ||
|
|
20
20
|
customerUserDocument.customerInfos?.termsOfUse.version === undefined ||
|
|
21
|
-
!semver_1.default.eq(customerUserDocument.customerInfos?.termsOfUse.version, platformConfigDocument.data.legal.
|
|
22
|
-
throw new errors_1.DoctoCarError("Customer user has not accepted the latest terms
|
|
21
|
+
!semver_1.default.eq(customerUserDocument.customerInfos?.termsOfUse.version, platformConfigDocument.data.legal.marketplaceTerms.version)) {
|
|
22
|
+
throw new errors_1.DoctoCarError("Customer user has not accepted the latest marketplace terms", errors_2.AssertCustomerUserCanBookServicesErrorCodes.USER_HAS_NOT_ACCEPTED_LATEST_TERMS_OF_USE);
|
|
23
23
|
}
|
|
24
24
|
if ((0, dataValidators_1.isLegalAddressValid)(customerUserDocument.customerInfos.billingAddress) ===
|
|
25
25
|
false) {
|