@doctocar/tooling 0.3.1-21 → 0.3.1-27
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/types/professional/ProfessionalOrderIssueReportedConfirmationEmailData.type.d.ts +1 -1
- package/dist/emails/types/professional/ProfessionalServiceCompletedByProfessionalEmailData.type.d.ts +1 -1
- package/dist/errors/enums/cloudFunctions/entities/RedeemPromoCodeForEntityErrorCodes.enum.d.ts +18 -0
- package/dist/errors/enums/cloudFunctions/entities/RedeemPromoCodeForEntityErrorCodes.enum.js +22 -0
- package/dist/errors/enums/cloudFunctions/entities/index.d.ts +1 -0
- package/dist/errors/enums/cloudFunctions/entities/index.js +1 -0
- package/dist/errors/enums/cloudFunctions/orders/CancelConfirmedOrInProgressOrderErrorCodes.enum.d.ts +1 -1
- package/dist/errors/enums/cloudFunctions/orders/CancelConfirmedOrInProgressOrderErrorCodes.enum.js +1 -1
- package/dist/errors/enums/cloudFunctions/orders/ConfirmServiceCompletionByServiceProviderErrorCodes.enum.d.ts +7 -0
- package/dist/errors/enums/cloudFunctions/orders/ConfirmServiceCompletionByServiceProviderErrorCodes.enum.js +11 -0
- package/dist/errors/enums/cloudFunctions/orders/StartConfirmedOrderByServiceProviderErrorCodes.enum.d.ts +6 -0
- package/dist/errors/enums/cloudFunctions/orders/StartConfirmedOrderByServiceProviderErrorCodes.enum.js +10 -0
- package/dist/errors/enums/cloudFunctions/orders/index.d.ts +2 -2
- package/dist/errors/enums/cloudFunctions/orders/index.js +2 -2
- package/dist/errors/enums/cloudFunctions/serviceProviderUsers/DeleteServiceProviderUserServiceErrorCodes.enum.d.ts +1 -1
- package/dist/errors/enums/cloudFunctions/serviceProviderUsers/DeleteServiceProviderUserServiceErrorCodes.enum.js +1 -1
- package/dist/errors/enums/cloudFunctions/serviceProviderUsers/UpdateServiceProviderUserServiceErrorCodes.enum.d.ts +1 -1
- package/dist/errors/enums/cloudFunctions/serviceProviderUsers/UpdateServiceProviderUserServiceErrorCodes.enum.js +1 -1
- package/dist/firebase/cloudFunctions/enums/OnCallCloudFunctionsNames.enum.d.ts +3 -3
- package/dist/firebase/cloudFunctions/enums/OnCallCloudFunctionsNames.enum.js +3 -3
- package/dist/firebase/cloudFunctions/enums/TaskCloudFunctionsNames.enum.d.ts +1 -1
- package/dist/firebase/cloudFunctions/enums/TaskCloudFunctionsNames.enum.js +1 -1
- package/dist/firebase/cloudFunctions/maps/OnCallCloudFunctionsTypeMappings.map.d.ts +11 -11
- package/dist/firebase/cloudFunctions/types/entities/RedeemPromoCodeForEntityRequestData.type.d.ts +5 -0
- package/dist/firebase/cloudFunctions/types/entities/RedeemPromoCodeForEntityRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/RedeemPromoCodeForEntityResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/entities/RedeemPromoCodeForEntityResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/entities/index.d.ts +2 -0
- package/dist/firebase/cloudFunctions/types/entities/index.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/ConfirmServiceCompletionByServiceProviderRequestData.type.d.ts +4 -0
- package/dist/firebase/cloudFunctions/types/orders/ConfirmServiceCompletionByServiceProviderRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/ConfirmServiceCompletionByServiceProviderResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/orders/ConfirmServiceCompletionByServiceProviderResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeForEntityRequestData.type.d.ts +5 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeForEntityRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeForEntityResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeForEntityResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeRequestData.type.d.ts +5 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeResponseData.type.d.ts +9 -0
- package/dist/firebase/cloudFunctions/types/orders/RedeemPromoCodeResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/StartConfirmedOrderByServiceProviderRequestData.type.d.ts +4 -0
- package/dist/firebase/cloudFunctions/types/orders/StartConfirmedOrderByServiceProviderRequestData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/StartConfirmedOrderByServiceProviderResponseData.type.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/orders/StartConfirmedOrderByServiceProviderResponseData.type.js +2 -0
- package/dist/firebase/cloudFunctions/types/orders/index.d.ts +4 -6
- package/dist/firebase/cloudFunctions/types/orders/index.js +4 -6
- package/dist/firebase/cloudFunctions/types/users/serviceProviderUsers/UpdateServiceProviderUserServiceRequestData.type.d.ts +2 -2
- package/dist/firebase/firestore/constants/credits/firestoreCreditsSchemaVersion.enum.d.ts +1 -0
- package/dist/firebase/firestore/constants/credits/firestoreCreditsSchemaVersion.enum.js +4 -0
- package/dist/firebase/firestore/constants/credits/index.d.ts +1 -0
- package/dist/firebase/firestore/constants/credits/index.js +17 -0
- package/dist/firebase/firestore/constants/creditsLedgerEntry/firestoreCreditsLedgerEntrySchemaVersion.enum.d.ts +1 -0
- package/dist/firebase/firestore/constants/creditsLedgerEntry/firestoreCreditsLedgerEntrySchemaVersion.enum.js +4 -0
- package/dist/firebase/firestore/constants/creditsLedgerEntry/index.d.ts +1 -0
- package/dist/firebase/firestore/constants/creditsLedgerEntry/index.js +17 -0
- package/dist/firebase/firestore/constants/index.d.ts +6 -4
- package/dist/firebase/firestore/constants/index.js +6 -4
- package/dist/firebase/firestore/constants/providerLocationServiceMaxRadiusInKM.constant.d.ts +1 -0
- package/dist/firebase/firestore/constants/providerLocationServiceMaxRadiusInKM.constant.js +4 -0
- package/dist/firebase/firestore/constants/providerLocationServiceMinRadiusInKM.constant.d.ts +1 -0
- package/dist/firebase/firestore/constants/providerLocationServiceMinRadiusInKM.constant.js +4 -0
- package/dist/firebase/firestore/constants/providerServiceMinimumDurationIncrementInMinutes.constant.d.ts +1 -0
- package/dist/firebase/firestore/constants/providerServiceMinimumDurationIncrementInMinutes.constant.js +4 -0
- package/dist/firebase/firestore/constants/providerServiceMinimumPriceIncrementInCents.constant.d.ts +1 -0
- package/dist/firebase/firestore/constants/providerServiceMinimumPriceIncrementInCents.constant.js +4 -0
- package/dist/firebase/firestore/enums/FirestoreCollections.enum.d.ts +4 -1
- package/dist/firebase/firestore/enums/FirestoreCollections.enum.js +4 -1
- package/dist/firebase/firestore/enums/creditsLedgerEntry/CreditsLedgerEntryContextReferenceType.enum.d.ts +6 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/CreditsLedgerEntryContextReferenceType.enum.js +10 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/CreditsLedgerEntryReason.enum.d.ts +10 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/CreditsLedgerEntryReason.enum.js +14 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/CreditsLedgerEntryType.enum.d.ts +4 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/CreditsLedgerEntryType.enum.js +8 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/index.d.ts +3 -0
- package/dist/firebase/firestore/enums/creditsLedgerEntry/index.js +19 -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/orders/OrderCancellationByTypes.enum.d.ts +1 -1
- package/dist/firebase/firestore/enums/orders/OrderCancellationByTypes.enum.js +1 -1
- package/dist/firebase/firestore/enums/orders/OrderServiceProviderCancellationReason.enum.d.ts +7 -7
- package/dist/firebase/firestore/enums/orders/OrderServiceProviderCancellationReason.enum.js +7 -7
- package/dist/firebase/firestore/enums/orders/dispute/OrderDisputeOpenedBy.enum.d.ts +1 -1
- package/dist/firebase/firestore/enums/orders/dispute/OrderDisputeOpenedBy.enum.js +1 -1
- package/dist/firebase/firestore/enums/orders/index.d.ts +1 -1
- package/dist/firebase/firestore/enums/orders/index.js +1 -1
- package/dist/firebase/firestore/enums/ordersIssues/CustomerOrderIssueReason.enum.d.ts +2 -2
- package/dist/firebase/firestore/enums/ordersIssues/CustomerOrderIssueReason.enum.js +2 -2
- package/dist/firebase/firestore/enums/ordersIssues/ServiceProviderOrderIssueReason.enum.d.ts +10 -0
- package/dist/firebase/firestore/enums/ordersIssues/ServiceProviderOrderIssueReason.enum.js +14 -0
- package/dist/firebase/firestore/enums/ordersIssues/index.d.ts +1 -1
- package/dist/firebase/firestore/enums/ordersIssues/index.js +1 -1
- package/dist/firebase/firestore/enums/promoCode/PromoCodeDiscountType.enum.d.ts +0 -1
- package/dist/firebase/firestore/enums/promoCode/PromoCodeDiscountType.enum.js +1 -1
- package/dist/firebase/firestore/enums/users/professionals/ServiceProviderBadgesTypes.enum.d.ts +3 -0
- package/dist/firebase/firestore/enums/users/professionals/ServiceProviderBadgesTypes.enum.js +7 -0
- package/dist/firebase/firestore/enums/users/professionals/index.d.ts +1 -1
- package/dist/firebase/firestore/enums/users/professionals/index.js +1 -1
- package/dist/firebase/firestore/maps/FirestoreCollectionDocumentTypeMap.d.ts +5 -2
- package/dist/firebase/firestore/types/credits/CheckoutCreditsSummary.type.d.ts +6 -0
- package/dist/firebase/firestore/types/credits/CheckoutCreditsSummary.type.js +2 -0
- package/dist/firebase/firestore/types/credits/FirestoreCreditsDocument.type.d.ts +17 -0
- package/dist/firebase/firestore/types/credits/FirestoreCreditsDocument.type.js +2 -0
- package/dist/firebase/firestore/types/credits/index.d.ts +1 -0
- package/dist/firebase/firestore/types/credits/index.js +17 -0
- package/dist/firebase/firestore/types/creditsLedgerEntryDocument/FirestoreCreditsLedgerEntryDocument.type.d.ts +21 -0
- package/dist/firebase/firestore/types/creditsLedgerEntryDocument/FirestoreCreditsLedgerEntryDocument.type.js +2 -0
- package/dist/firebase/firestore/types/creditsLedgerEntryDocument/index.d.ts +1 -0
- package/dist/firebase/firestore/types/creditsLedgerEntryDocument/index.js +17 -0
- package/dist/firebase/firestore/types/entities/FirestoreEntityDocument.type.d.ts +3 -0
- package/dist/firebase/firestore/types/index.d.ts +4 -1
- package/dist/firebase/firestore/types/index.js +4 -1
- package/dist/firebase/firestore/types/order/FirestoreOrderCancellationReason.type.d.ts +2 -2
- package/dist/firebase/firestore/types/order/FirestoreOrderDocument.type.d.ts +3 -0
- package/dist/firebase/firestore/types/ordersIssues/OrderIssueReason.type.d.ts +2 -2
- package/dist/firebase/firestore/types/ordersReviews/FirestoreOrderReviewDocument.type.d.ts +1 -1
- package/dist/firebase/firestore/types/promoCode/FirestorePromoCodeDocument.type.d.ts +8 -14
- package/dist/firebase/firestore/types/promoCodeRedemptions/FirestorePromoCodeRedemptionDocument.type.d.ts +9 -0
- package/dist/firebase/firestore/types/promoCodeRedemptions/FirestorePromoCodeRedemptionDocument.type.js +2 -0
- package/dist/firebase/firestore/types/promoCodeRedemptions/index.d.ts +1 -0
- package/dist/firebase/firestore/types/promoCodeRedemptions/index.js +17 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/FirestoreServiceProviderUserPublicDocument.type.d.ts +49 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/FirestoreServiceProviderUserPublicDocument.type.js +2 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/FirestoreServiceProviderUserPublicDocumentReviewAggregates.type.d.ts +4 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/FirestoreServiceProviderUserPublicDocumentReviewAggregates.type.js +2 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/FirestoreServiceProviderUserPublicDocumentServicesLocation.type.d.ts +4 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/FirestoreServiceProviderUserPublicDocumentServicesLocation.type.js +2 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/index.d.ts +3 -0
- package/dist/firebase/firestore/types/serviceProviderUserPublicDocument/index.js +19 -0
- package/dist/firebase/firestore/types/services/ProviderService.type.d.ts +8 -0
- package/dist/firebase/firestore/types/services/ProviderService.type.js +2 -0
- package/dist/firebase/firestore/types/services/ServiceProviderService.type.d.ts +8 -0
- package/dist/firebase/firestore/types/services/ServiceProviderService.type.js +2 -0
- package/dist/firebase/firestore/types/services/index.d.ts +1 -1
- package/dist/firebase/firestore/types/services/index.js +1 -1
- package/dist/firebase/firestore/utils/dataValidators/services/__tests__/isValidProfessionalService.test.js +11 -11
- package/dist/firebase/firestore/utils/dataValidators/services/__tests__/isValidProviderService.test.d.ts +1 -0
- package/dist/firebase/firestore/utils/dataValidators/services/__tests__/isValidProviderService.test.js +172 -0
- package/dist/firebase/firestore/utils/dataValidators/services/__tests__/isValidServicePricingAndDurationForVehicle.test.js +9 -9
- package/dist/firebase/firestore/utils/dataValidators/services/index.d.ts +1 -1
- package/dist/firebase/firestore/utils/dataValidators/services/index.js +1 -1
- package/dist/firebase/firestore/utils/dataValidators/services/isValidProfessionalService.d.ts +1 -1
- package/dist/firebase/firestore/utils/dataValidators/services/isValidProfessionalService.js +13 -13
- package/dist/firebase/firestore/utils/dataValidators/services/isValidProviderService.d.ts +2 -0
- package/dist/firebase/firestore/utils/dataValidators/services/isValidProviderService.js +42 -0
- package/dist/firebase/firestore/utils/dataValidators/services/isValidServicePricingAndDurationForVehicle.js +2 -2
- package/dist/firebase/firestore/utils/dataValidators/services/types/IsValidProfessionalServiceParams.type.d.ts +2 -2
- package/dist/firebase/firestore/utils/dataValidators/services/types/IsValidProviderServiceParams.type.d.ts +6 -0
- package/dist/firebase/firestore/utils/dataValidators/services/types/IsValidProviderServiceParams.type.js +2 -0
- package/dist/firebase/firestore/utils/dataValidators/services/types/index.d.ts +1 -1
- package/dist/firebase/firestore/utils/dataValidators/services/types/index.js +1 -1
- package/dist/firebase/firestore/utils/order/__tests__/buildOrderServicePreTaxLinesAndServicesDetails.test.js +13 -13
- package/dist/firebase/firestore/utils/order/buildOrderServicePreTaxLinesAndServicesDetails.d.ts +1 -1
- package/dist/firebase/firestore/utils/order/buildOrderServicePreTaxLinesAndServicesDetails.js +2 -2
- package/dist/firebase/firestore/utils/order/types/BuildOrderServicePreTaxLinesAndServicesDetailsProps.type.d.ts +2 -2
- package/dist/firebase/firestore/utils/reviews/__tests__/getAverageRatingFromReviewAggregates.test.d.ts +1 -0
- package/dist/firebase/firestore/utils/reviews/__tests__/getAverageRatingFromReviewAggregates.test.js +97 -0
- package/dist/firebase/firestore/utils/reviews/getAverageRatingFromReviewAggregates.d.ts +2 -0
- package/dist/firebase/firestore/utils/reviews/getAverageRatingFromReviewAggregates.js +13 -0
- package/dist/firebase/firestore/utils/reviews/index.d.ts +1 -1
- package/dist/firebase/firestore/utils/reviews/index.js +1 -1
- package/dist/firebase/firestore/utils/services/__tests__/computeTotalServiceProviderServiceDurationInMinutesForVehicleType.test.d.ts +1 -0
- package/dist/firebase/firestore/utils/services/__tests__/computeTotalServiceProviderServiceDurationInMinutesForVehicleType.test.js +101 -0
- package/dist/firebase/firestore/utils/services/__tests__/createServiceVehicleComboKey.test.js +4 -4
- package/dist/firebase/firestore/utils/services/__tests__/getBookableServiceProviderServicesForVehicleType.test.js +49 -49
- package/dist/firebase/firestore/utils/services/__tests__/getServiceProviderActiveServicePricingAndDurationForVehicleOrThrow.test.js +32 -32
- package/dist/firebase/firestore/utils/services/computeTotalServiceProviderServiceDurationInMinutesForVehicleType.d.ts +2 -0
- package/dist/firebase/firestore/utils/services/computeTotalServiceProviderServiceDurationInMinutesForVehicleType.js +18 -0
- package/dist/firebase/firestore/utils/services/getBookableServiceProviderServicesForVehicleType.d.ts +3 -3
- package/dist/firebase/firestore/utils/services/getBookableServiceProviderServicesForVehicleType.js +11 -11
- package/dist/firebase/firestore/utils/services/getServiceProviderActiveServicePricingAndDurationForVehicleOrThrow.d.ts +1 -1
- package/dist/firebase/firestore/utils/services/getServiceProviderActiveServicePricingAndDurationForVehicleOrThrow.js +2 -2
- package/dist/firebase/firestore/utils/services/index.d.ts +1 -1
- package/dist/firebase/firestore/utils/services/index.js +1 -1
- package/dist/firebase/firestore/utils/services/types/ComputeTotalServiceProviderServiceDurationInMinutesForVehicleTypeArgs.type.d.ts +7 -0
- package/dist/firebase/firestore/utils/services/types/ComputeTotalServiceProviderServiceDurationInMinutesForVehicleTypeArgs.type.js +2 -0
- package/dist/firebase/firestore/utils/services/types/GetBookableServiceProviderServicesForVehicleTypeParams.type.d.ts +2 -2
- package/dist/firebase/firestore/utils/services/types/GetServiceProviderActiveServicePricingAndDurationForVehicleOrThrowParams.type.d.ts +2 -2
- package/dist/firebase/firestore/utils/services/types/index.d.ts +1 -1
- package/dist/firebase/firestore/utils/services/types/index.js +1 -1
- package/dist/firebase/firestore/utils/stubs/credits/firestoreCreditsDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/credits/firestoreCreditsDocumentStub.js +24 -0
- package/dist/firebase/firestore/utils/stubs/credits/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/credits/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/creditsLedgerEntry/firestoreCreditsLedgerEntryDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/creditsLedgerEntry/firestoreCreditsLedgerEntryDocumentStub.js +27 -0
- package/dist/firebase/firestore/utils/stubs/creditsLedgerEntry/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/creditsLedgerEntry/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/entities/firestoreEntityDocumentStub.js +3 -0
- package/dist/firebase/firestore/utils/stubs/index.d.ts +5 -1
- package/dist/firebase/firestore/utils/stubs/index.js +5 -1
- package/dist/firebase/firestore/utils/stubs/ordersReviews/firestoreOrderReviewDocumentStub.js +1 -1
- package/dist/firebase/firestore/utils/stubs/promoCode/firestorePromoCodeDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/promoCode/firestorePromoCodeDocumentStub.js +23 -0
- package/dist/firebase/firestore/utils/stubs/promoCode/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/promoCode/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/promoCodeRedemptions/firestorePromoCodeRedemptionDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/promoCodeRedemptions/firestorePromoCodeRedemptionDocumentStub.js +10 -0
- package/dist/firebase/firestore/utils/stubs/promoCodeRedemptions/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/promoCodeRedemptions/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/serviceProviderUserPublicDocument/firestoreServiceProviderUserPublicDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/serviceProviderUserPublicDocument/firestoreServiceProviderUserPublicDocumentStub.js +44 -0
- package/dist/firebase/firestore/utils/stubs/serviceProviderUserPublicDocument/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/serviceProviderUserPublicDocument/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/services/index.d.ts +1 -1
- package/dist/firebase/firestore/utils/stubs/services/index.js +1 -1
- package/dist/firebase/firestore/utils/stubs/services/pricingAndDurationForVehicleStub.js +2 -2
- package/dist/firebase/firestore/utils/stubs/services/providerServiceStub.d.ts +5 -0
- package/dist/firebase/firestore/utils/stubs/services/providerServiceStub.js +21 -0
- package/dist/firebase/firestore/utils/stubs/services/serviceProviderServiceStub.d.ts +5 -0
- package/dist/firebase/firestore/utils/stubs/services/serviceProviderServiceStub.js +21 -0
- package/dist/firebase/storage/enums/FirebaseStorageBasePaths.enum.js +1 -1
- package/dist/firebase/storage/utils/__tests__/buildStoragePeriodSlug.test.js +8 -6
- package/dist/gcp/cloudTask/enums/CloudTasksQueueName.enum.d.ts +1 -1
- package/dist/gcp/cloudTask/enums/CloudTasksQueueName.enum.js +1 -1
- package/dist/gcp/cloudTask/maps/CloudTaskEnvelopeMap.map.d.ts +2 -2
- package/dist/gcp/cloudTask/types/OnTaskRecomputeServiceProviderAvailabilityEnvelope.type.d.ts +1 -1
- package/dist/gcp/cloudTask/types/index.d.ts +1 -1
- package/dist/gcp/cloudTask/types/index.js +1 -1
- package/dist/gcp/cloudTask/utils/stubs/index.d.ts +1 -1
- package/dist/gcp/cloudTask/utils/stubs/index.js +1 -1
- package/dist/gcp/cloudTask/utils/stubs/onTaskRecomputeServiceProviderAvailabilityEnvelopeStub.js +1 -1
- package/dist/pricing/__tests__/calculateInvoiceTotalWithTax.util.test.js +3 -3
- package/dist/stripe/types/StripeCustomServiceProviderPayoutMetadata.type.d.ts +5 -0
- package/dist/stripe/types/StripeCustomServiceProviderPayoutMetadata.type.js +2 -0
- package/dist/stripe/types/index.d.ts +1 -1
- package/dist/stripe/types/index.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export * from "./userDocument";
|
|
2
2
|
export * from "./messages";
|
|
3
3
|
export * from "./services";
|
|
4
|
-
export * from "./
|
|
4
|
+
export * from "./serviceProviderUserPublicDocument";
|
|
5
5
|
export * from "./rateLimitDocument";
|
|
6
6
|
export * from "./FirestoreFile.type";
|
|
7
7
|
export * from "./location";
|
|
@@ -21,6 +21,7 @@ export * from "./metrics";
|
|
|
21
21
|
export * from "./onTaskExecutionState";
|
|
22
22
|
export * from "./WithDocumentId.type";
|
|
23
23
|
export * from "./promoCode";
|
|
24
|
+
export * from "./promoCodeRedemptions";
|
|
24
25
|
export * from "./counters";
|
|
25
26
|
export * from "./deviceTokens";
|
|
26
27
|
export * from "./image";
|
|
@@ -29,6 +30,8 @@ export * from "./notificationEvent";
|
|
|
29
30
|
export * from "./wallets";
|
|
30
31
|
export * from "./walletsLedgerEntryDocument";
|
|
31
32
|
export * from "./walletsWithdrawalIntents";
|
|
33
|
+
export * from "./credits";
|
|
34
|
+
export * from "./creditsLedgerEntryDocument";
|
|
32
35
|
export * from "./functionsDeploymentRuns";
|
|
33
36
|
export * from "./marketplaceFinancialReports";
|
|
34
37
|
export * from "./entities";
|
|
@@ -17,7 +17,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./userDocument"), exports);
|
|
18
18
|
__exportStar(require("./messages"), exports);
|
|
19
19
|
__exportStar(require("./services"), exports);
|
|
20
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./serviceProviderUserPublicDocument"), exports);
|
|
21
21
|
__exportStar(require("./rateLimitDocument"), exports);
|
|
22
22
|
__exportStar(require("./FirestoreFile.type"), exports);
|
|
23
23
|
__exportStar(require("./location"), exports);
|
|
@@ -37,6 +37,7 @@ __exportStar(require("./metrics"), exports);
|
|
|
37
37
|
__exportStar(require("./onTaskExecutionState"), exports);
|
|
38
38
|
__exportStar(require("./WithDocumentId.type"), exports);
|
|
39
39
|
__exportStar(require("./promoCode"), exports);
|
|
40
|
+
__exportStar(require("./promoCodeRedemptions"), exports);
|
|
40
41
|
__exportStar(require("./counters"), exports);
|
|
41
42
|
__exportStar(require("./deviceTokens"), exports);
|
|
42
43
|
__exportStar(require("./image"), exports);
|
|
@@ -45,6 +46,8 @@ __exportStar(require("./notificationEvent"), exports);
|
|
|
45
46
|
__exportStar(require("./wallets"), exports);
|
|
46
47
|
__exportStar(require("./walletsLedgerEntryDocument"), exports);
|
|
47
48
|
__exportStar(require("./walletsWithdrawalIntents"), exports);
|
|
49
|
+
__exportStar(require("./credits"), exports);
|
|
50
|
+
__exportStar(require("./creditsLedgerEntryDocument"), exports);
|
|
48
51
|
__exportStar(require("./functionsDeploymentRuns"), exports);
|
|
49
52
|
__exportStar(require("./marketplaceFinancialReports"), exports);
|
|
50
53
|
__exportStar(require("./entities"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { OrderCustomerCancellationReason, OrderPaymentCancellationReason,
|
|
2
|
-
export type FirestoreOrderCancellationReason = OrderSystemCancellationReason | OrderCustomerCancellationReason |
|
|
1
|
+
import type { OrderCustomerCancellationReason, OrderPaymentCancellationReason, OrderServiceProviderCancellationReason, OrderSystemCancellationReason } from "../../enums";
|
|
2
|
+
export type FirestoreOrderCancellationReason = OrderSystemCancellationReason | OrderCustomerCancellationReason | OrderServiceProviderCancellationReason | OrderPaymentCancellationReason;
|
|
@@ -142,6 +142,9 @@ export type FirestoreOrderDocument = {
|
|
|
142
142
|
status: PaymentStatusTypes;
|
|
143
143
|
amountInCents: number;
|
|
144
144
|
currency: SupportedIsoCurrency;
|
|
145
|
+
invoiceTotalAmountInCents?: number;
|
|
146
|
+
creditsUsedInCents?: number;
|
|
147
|
+
remainingAmountToChargeInCents?: number;
|
|
145
148
|
paidAt?: FirestoreTimestamp;
|
|
146
149
|
authorizedAt?: FirestoreTimestamp;
|
|
147
150
|
capturedAt?: FirestoreTimestamp;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { CustomerOrderIssueReason,
|
|
2
|
-
export type OrderIssueReason = CustomerOrderIssueReason |
|
|
1
|
+
import type { CustomerOrderIssueReason, ServiceProviderOrderIssueReason } from "../../enums";
|
|
2
|
+
export type OrderIssueReason = CustomerOrderIssueReason | ServiceProviderOrderIssueReason;
|
|
@@ -1,23 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type {
|
|
1
|
+
import type { SupportedIsoCurrency } from "../../../../enums";
|
|
2
|
+
import type { PromoCodeDiscountType } from "../../enums";
|
|
3
3
|
import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
4
4
|
export type FirestorePromoCodeDocument = {
|
|
5
5
|
code: string;
|
|
6
6
|
active: boolean;
|
|
7
7
|
type: PromoCodeDiscountType;
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
minOrderAmountInCents?: number;
|
|
14
|
-
maxRedemptions?: number;
|
|
8
|
+
amountInCents: number;
|
|
9
|
+
currency: SupportedIsoCurrency;
|
|
10
|
+
startsAt: FirestoreTimestamp;
|
|
11
|
+
endsAt: FirestoreTimestamp;
|
|
12
|
+
maxRedemptions: number;
|
|
15
13
|
redeemedCount: number;
|
|
16
|
-
|
|
17
|
-
firstOrderOnly?: boolean;
|
|
18
|
-
restrictedToServiceTypes?: ServicesTypes[];
|
|
19
|
-
restrictedToCountries?: SupportedCountryIsoCodes[];
|
|
20
|
-
stackable?: boolean;
|
|
14
|
+
firstOrderOnly: boolean;
|
|
21
15
|
createdAt: FirestoreTimestamp;
|
|
22
16
|
updatedAt: FirestoreTimestamp;
|
|
23
17
|
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
2
|
+
/**
|
|
3
|
+
* Per-entity promo redemption counter at
|
|
4
|
+
* `entities/{entityId}/promo_code_redemptions/{promoCodeId}`.
|
|
5
|
+
* Document id is the normalized (uppercase) promo code.
|
|
6
|
+
*/
|
|
7
|
+
export type FirestorePromoCodeRedemptionDocument = {
|
|
8
|
+
redeemedAt: FirestoreTimestamp;
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./FirestorePromoCodeRedemptionDocument.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("./FirestorePromoCodeRedemptionDocument.type"), exports);
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { SupportedCountryIsoCodes } from "../../../../enums";
|
|
2
|
+
import type { ServiceProviderBadgesTypes, ServicesTypes } from "../../enums";
|
|
3
|
+
import type { FirestoreTimestamp } from "../FirestoreTimestamp.type";
|
|
4
|
+
import type { FirestoreImageVariantSet } from "../image";
|
|
5
|
+
import type { ProviderService } from "../services/ProviderService.type";
|
|
6
|
+
import type { FirestoreServiceProviderUserPublicDocumentReviewAggregates } from "./FirestoreServiceProviderUserPublicDocumentReviewAggregates.type";
|
|
7
|
+
import type { FirestoreServiceProviderUserPublicDocumentServicesLocation } from "./FirestoreServiceProviderUserPublicDocumentServicesLocation.type";
|
|
8
|
+
export type FirestoreServiceProviderUserPublicDocument = {
|
|
9
|
+
createdAt: FirestoreTimestamp;
|
|
10
|
+
updatedAt: FirestoreTimestamp;
|
|
11
|
+
version: 1;
|
|
12
|
+
userId: string;
|
|
13
|
+
entityId: string;
|
|
14
|
+
entityDisplayName: string;
|
|
15
|
+
countryIsoCode: SupportedCountryIsoCodes;
|
|
16
|
+
isVatExempt: boolean;
|
|
17
|
+
profile?: {
|
|
18
|
+
photo?: {
|
|
19
|
+
storagePaths: FirestoreImageVariantSet;
|
|
20
|
+
updatedAt: FirestoreTimestamp;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
coverPicture?: {
|
|
24
|
+
storagePaths: FirestoreImageVariantSet;
|
|
25
|
+
updatedAt: FirestoreTimestamp;
|
|
26
|
+
};
|
|
27
|
+
publicDescription?: string;
|
|
28
|
+
activeServicesVehiclesCombos: string[];
|
|
29
|
+
services: Partial<{
|
|
30
|
+
[T in ServicesTypes]: ProviderService<T>;
|
|
31
|
+
}>;
|
|
32
|
+
reviewAggregates: FirestoreServiceProviderUserPublicDocumentReviewAggregates;
|
|
33
|
+
servicesLocation: FirestoreServiceProviderUserPublicDocumentServicesLocation;
|
|
34
|
+
availability: {
|
|
35
|
+
horizonStart: FirestoreTimestamp;
|
|
36
|
+
horizonDays: number;
|
|
37
|
+
granularityMinutes: number;
|
|
38
|
+
encodedOpenTimeline: string;
|
|
39
|
+
encodedBlockedTimeline: string;
|
|
40
|
+
updatedAt: FirestoreTimestamp;
|
|
41
|
+
};
|
|
42
|
+
isBookable: boolean;
|
|
43
|
+
badges?: Partial<Record<ServiceProviderBadgesTypes, {
|
|
44
|
+
grantedAt: FirestoreTimestamp;
|
|
45
|
+
expiredAt?: FirestoreTimestamp;
|
|
46
|
+
metadata?: Record<string, unknown>;
|
|
47
|
+
}>>;
|
|
48
|
+
isTest: boolean;
|
|
49
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
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("./FirestoreServiceProviderUserPublicDocument.type"), exports);
|
|
18
|
+
__exportStar(require("./FirestoreServiceProviderUserPublicDocumentServicesLocation.type"), exports);
|
|
19
|
+
__exportStar(require("./FirestoreServiceProviderUserPublicDocumentReviewAggregates.type"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServicesTypes, type VehicleTypes } from "../../enums";
|
|
2
|
+
import type { ServicePricingAndDurationForVehicle } from "./ServicePricingAndDurationForVehicle.type";
|
|
3
|
+
export type ProviderService<T extends ServicesTypes> = {
|
|
4
|
+
type: T;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
parentsServices?: ServicesTypes[];
|
|
7
|
+
pricingAndDurationByVehicleType: Partial<Record<VehicleTypes, ServicePricingAndDurationForVehicle>>;
|
|
8
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { ServicesTypes, type VehicleTypes } from "../../enums";
|
|
2
|
+
import type { ServicePricingAndDurationForVehicle } from "./ServicePricingAndDurationForVehicle.type";
|
|
3
|
+
export type ServiceProviderService<T extends ServicesTypes> = {
|
|
4
|
+
type: T;
|
|
5
|
+
isActive: boolean;
|
|
6
|
+
parentsServices?: ServicesTypes[];
|
|
7
|
+
pricingAndDurationByVehicleType: Partial<Record<VehicleTypes, ServicePricingAndDurationForVehicle>>;
|
|
8
|
+
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./ProviderService.type";
|
|
2
2
|
export * from "./ServicePricingAndDurationForVehicle.type";
|
|
@@ -14,5 +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("./
|
|
17
|
+
__exportStar(require("./ProviderService.type"), exports);
|
|
18
18
|
__exportStar(require("./ServicePricingAndDurationForVehicle.type"), exports);
|
|
@@ -14,7 +14,7 @@ describe("isValidProfessionalService", () => {
|
|
|
14
14
|
let isValidServicePricingAndDurationForVehicleReturnValue;
|
|
15
15
|
beforeEach(() => {
|
|
16
16
|
defaultProps = {
|
|
17
|
-
|
|
17
|
+
providerService: {
|
|
18
18
|
isActive: true,
|
|
19
19
|
type: enums_2.ServicesTypes.EXTERIOR_CLEANING,
|
|
20
20
|
pricingAndDurationByVehicleType: {
|
|
@@ -46,24 +46,24 @@ describe("isValidProfessionalService", () => {
|
|
|
46
46
|
});
|
|
47
47
|
describe("Active", () => {
|
|
48
48
|
it("should throw if the active field is not a boolean", async () => {
|
|
49
|
-
defaultProps.
|
|
49
|
+
defaultProps.providerService.isActive = "yes";
|
|
50
50
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).rejects.toThrow(new errors_1.DoctoCarError("Professional service is active is required and must be a boolean", errors_1.DoctoCarValidationErrorCodes.INVALID_SERVICE_IS_ACTIVE));
|
|
51
51
|
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
52
52
|
});
|
|
53
53
|
it("should throw if the active field is not provided", async () => {
|
|
54
|
-
defaultProps.
|
|
54
|
+
defaultProps.providerService.isActive = undefined;
|
|
55
55
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).rejects.toThrow(new errors_1.DoctoCarError("Professional service is active is required and must be a boolean", errors_1.DoctoCarValidationErrorCodes.INVALID_SERVICE_IS_ACTIVE));
|
|
56
56
|
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
57
57
|
});
|
|
58
58
|
});
|
|
59
59
|
describe("Service type", () => {
|
|
60
60
|
it("should throw if the service type is not a valid ServicesTypes", async () => {
|
|
61
|
-
defaultProps.
|
|
61
|
+
defaultProps.providerService.type = "INVALID_TYPE";
|
|
62
62
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).rejects.toThrow();
|
|
63
63
|
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
64
64
|
});
|
|
65
65
|
it("should throw if the type is not provided", async () => {
|
|
66
|
-
defaultProps.
|
|
66
|
+
defaultProps.providerService.type = undefined;
|
|
67
67
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).rejects.toThrow();
|
|
68
68
|
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
69
69
|
});
|
|
@@ -82,8 +82,8 @@ describe("isValidProfessionalService", () => {
|
|
|
82
82
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).resolves.not.toThrow();
|
|
83
83
|
expect(isValidServicePricingAndDurationForVehicleMock).toHaveBeenCalledTimes(1);
|
|
84
84
|
expect(isValidServicePricingAndDurationForVehicleMock).toHaveBeenCalledWith({
|
|
85
|
-
servicePublicConfig: defaultProps.countryServicePublicConfig[defaultProps.
|
|
86
|
-
servicePricingAndDurationForVehicle: defaultProps.
|
|
85
|
+
servicePublicConfig: defaultProps.countryServicePublicConfig[defaultProps.providerService.type],
|
|
86
|
+
servicePricingAndDurationForVehicle: defaultProps.providerService.pricingAndDurationByVehicleType[enums_2.VehicleTypes.SEDAN],
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
it("Should throw if isValidServicePricingAndDurationForVehicle return false", async () => {
|
|
@@ -94,7 +94,7 @@ describe("isValidProfessionalService", () => {
|
|
|
94
94
|
});
|
|
95
95
|
describe("parentsServices", () => {
|
|
96
96
|
it("Should throw if a service does not have the parents services indicated in the config", async () => {
|
|
97
|
-
defaultProps.
|
|
97
|
+
defaultProps.providerService = {
|
|
98
98
|
isActive: true,
|
|
99
99
|
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
100
100
|
parentsServices: [],
|
|
@@ -111,7 +111,7 @@ describe("isValidProfessionalService", () => {
|
|
|
111
111
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).rejects.toThrow();
|
|
112
112
|
});
|
|
113
113
|
it("Should not throw if a valid service have the parents services indicated in the config", async () => {
|
|
114
|
-
defaultProps.
|
|
114
|
+
defaultProps.providerService = {
|
|
115
115
|
isActive: true,
|
|
116
116
|
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
117
117
|
parentsServices: [
|
|
@@ -131,7 +131,7 @@ describe("isValidProfessionalService", () => {
|
|
|
131
131
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).resolves.not.toThrow();
|
|
132
132
|
});
|
|
133
133
|
it("Should throw if a valid service have the parents services indicated in the config but miss one", async () => {
|
|
134
|
-
defaultProps.
|
|
134
|
+
defaultProps.providerService = {
|
|
135
135
|
isActive: true,
|
|
136
136
|
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
137
137
|
parentsServices: [enums_2.ServicesTypes.INTERIOR_CLEANING],
|
|
@@ -148,7 +148,7 @@ describe("isValidProfessionalService", () => {
|
|
|
148
148
|
await expect((0, isValidProfessionalService_1.isValidProfessionalService)(defaultProps)).rejects.toThrow();
|
|
149
149
|
});
|
|
150
150
|
it("Should throw if a valid service have the parents services indicated in the config but have one more", async () => {
|
|
151
|
-
defaultProps.
|
|
151
|
+
defaultProps.providerService = {
|
|
152
152
|
isActive: true,
|
|
153
153
|
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
154
154
|
parentsServices: [
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
+
const enums_1 = require("../../../../../../enums");
|
|
5
|
+
const errors_1 = require("../../../../../../errors");
|
|
6
|
+
const enums_2 = require("../../../../enums");
|
|
7
|
+
const stubs_1 = require("../../../stubs");
|
|
8
|
+
const isValidProviderService_1 = require("../isValidProviderService");
|
|
9
|
+
const isValidServicePricingAndDurationForVehicle_1 = require("../isValidServicePricingAndDurationForVehicle");
|
|
10
|
+
jest.mock("../isValidServicePricingAndDurationForVehicle");
|
|
11
|
+
describe("isValidProviderService", () => {
|
|
12
|
+
let defaultProps;
|
|
13
|
+
let isValidServicePricingAndDurationForVehicleMock;
|
|
14
|
+
let isValidServicePricingAndDurationForVehicleReturnValue;
|
|
15
|
+
beforeEach(() => {
|
|
16
|
+
defaultProps = {
|
|
17
|
+
providerService: {
|
|
18
|
+
isActive: true,
|
|
19
|
+
type: enums_2.ServicesTypes.EXTERIOR_CLEANING,
|
|
20
|
+
pricingAndDurationByVehicleType: {
|
|
21
|
+
[enums_2.VehicleTypes.SEDAN]: {
|
|
22
|
+
isActive: true,
|
|
23
|
+
type: enums_2.VehicleTypes.SEDAN,
|
|
24
|
+
pricePreTaxInCents: 2000,
|
|
25
|
+
currency: enums_1.SupportedIsoCurrency.EUR,
|
|
26
|
+
durationInMinutes: 30,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
countryServicePublicConfig: (0, stubs_1.countryServicesPublicConfigStub)({
|
|
31
|
+
[enums_2.ServicesTypes.EXTERIOR_CLEANING]: (0, stubs_1.firestoreServicesPublicConfigStub)({}),
|
|
32
|
+
}),
|
|
33
|
+
};
|
|
34
|
+
isValidServicePricingAndDurationForVehicleMock =
|
|
35
|
+
isValidServicePricingAndDurationForVehicle_1.isValidServicePricingAndDurationForVehicle;
|
|
36
|
+
isValidServicePricingAndDurationForVehicleReturnValue = true;
|
|
37
|
+
isValidServicePricingAndDurationForVehicleMock.mockImplementation(() => {
|
|
38
|
+
return isValidServicePricingAndDurationForVehicleReturnValue;
|
|
39
|
+
});
|
|
40
|
+
});
|
|
41
|
+
afterEach(() => {
|
|
42
|
+
jest.clearAllMocks();
|
|
43
|
+
});
|
|
44
|
+
it("should not throw if is a valid service with empty pricing and empty subservice", async () => {
|
|
45
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).resolves.not.toThrow();
|
|
46
|
+
});
|
|
47
|
+
describe("Active", () => {
|
|
48
|
+
it("should throw if the active field is not a boolean", async () => {
|
|
49
|
+
defaultProps.providerService.isActive = "yes";
|
|
50
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow(new errors_1.DoctoCarError("Provider service isActive must be a boolean", errors_1.DoctoCarValidationErrorCodes.INVALID_SERVICE_IS_ACTIVE));
|
|
51
|
+
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
52
|
+
});
|
|
53
|
+
it("should throw if the active field is not provided", async () => {
|
|
54
|
+
defaultProps.providerService.isActive = undefined;
|
|
55
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow(new errors_1.DoctoCarError("Provider service isActive must be a boolean", errors_1.DoctoCarValidationErrorCodes.INVALID_SERVICE_IS_ACTIVE));
|
|
56
|
+
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
describe("Service type", () => {
|
|
60
|
+
it("should throw if the service type is not a valid ServicesTypes", async () => {
|
|
61
|
+
defaultProps.providerService.type = "INVALID_TYPE";
|
|
62
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow();
|
|
63
|
+
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
64
|
+
});
|
|
65
|
+
it("should throw if the type is not provided", async () => {
|
|
66
|
+
defaultProps.providerService.type = undefined;
|
|
67
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow();
|
|
68
|
+
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
describe("Country services public config", () => {
|
|
72
|
+
it("should throw if there is no public config entry for the provider service type", async () => {
|
|
73
|
+
defaultProps.countryServicePublicConfig = {};
|
|
74
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow(new errors_1.DoctoCarError("Country services public config has no entry for this provider service type", errors_1.DoctoCarValidationErrorCodes.INVALID_SERVICE_TYPE));
|
|
75
|
+
expect(isValidServicePricingAndDurationForVehicleMock).not.toHaveBeenCalled();
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
describe("Price and duration", () => {
|
|
79
|
+
it("should not throw if isValidServicePricingAndDurationForVehicle return true", async () => {
|
|
80
|
+
isValidServicePricingAndDurationForVehicleReturnValue = true;
|
|
81
|
+
isValidServicePricingAndDurationForVehicleMock.mockReturnValue(isValidServicePricingAndDurationForVehicleReturnValue);
|
|
82
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).resolves.not.toThrow();
|
|
83
|
+
expect(isValidServicePricingAndDurationForVehicleMock).toHaveBeenCalledTimes(1);
|
|
84
|
+
expect(isValidServicePricingAndDurationForVehicleMock).toHaveBeenCalledWith({
|
|
85
|
+
servicePublicConfig: defaultProps.countryServicePublicConfig[defaultProps.providerService.type],
|
|
86
|
+
servicePricingAndDurationForVehicle: defaultProps.providerService.pricingAndDurationByVehicleType[enums_2.VehicleTypes.SEDAN],
|
|
87
|
+
});
|
|
88
|
+
});
|
|
89
|
+
it("Should throw if isValidServicePricingAndDurationForVehicle return false", async () => {
|
|
90
|
+
isValidServicePricingAndDurationForVehicleReturnValue = false;
|
|
91
|
+
isValidServicePricingAndDurationForVehicleMock.mockReturnValue(isValidServicePricingAndDurationForVehicleReturnValue);
|
|
92
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow();
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
describe("parentsServices", () => {
|
|
96
|
+
it("Should throw if a service does not have the parents services indicated in the config", async () => {
|
|
97
|
+
defaultProps.providerService = {
|
|
98
|
+
isActive: true,
|
|
99
|
+
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
100
|
+
parentsServices: [],
|
|
101
|
+
pricingAndDurationByVehicleType: {},
|
|
102
|
+
};
|
|
103
|
+
defaultProps.countryServicePublicConfig = (0, stubs_1.countryServicesPublicConfigStub)({
|
|
104
|
+
[enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT]: (0, stubs_1.firestoreServicesPublicConfigStub)({
|
|
105
|
+
parentsServices: [
|
|
106
|
+
enums_2.ServicesTypes.INTERIOR_CLEANING,
|
|
107
|
+
enums_2.ServicesTypes.INTERIOR_AND_EXTERIOR_CLEANING,
|
|
108
|
+
],
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow();
|
|
112
|
+
});
|
|
113
|
+
it("Should not throw if a valid service have the parents services indicated in the config", async () => {
|
|
114
|
+
defaultProps.providerService = {
|
|
115
|
+
isActive: true,
|
|
116
|
+
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
117
|
+
parentsServices: [
|
|
118
|
+
enums_2.ServicesTypes.INTERIOR_CLEANING,
|
|
119
|
+
enums_2.ServicesTypes.INTERIOR_AND_EXTERIOR_CLEANING,
|
|
120
|
+
],
|
|
121
|
+
pricingAndDurationByVehicleType: {},
|
|
122
|
+
};
|
|
123
|
+
defaultProps.countryServicePublicConfig = (0, stubs_1.countryServicesPublicConfigStub)({
|
|
124
|
+
[enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT]: (0, stubs_1.firestoreServicesPublicConfigStub)({
|
|
125
|
+
parentsServices: [
|
|
126
|
+
enums_2.ServicesTypes.INTERIOR_CLEANING,
|
|
127
|
+
enums_2.ServicesTypes.INTERIOR_AND_EXTERIOR_CLEANING,
|
|
128
|
+
],
|
|
129
|
+
}),
|
|
130
|
+
});
|
|
131
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).resolves.not.toThrow();
|
|
132
|
+
});
|
|
133
|
+
it("Should throw if a valid service have the parents services indicated in the config but miss one", async () => {
|
|
134
|
+
defaultProps.providerService = {
|
|
135
|
+
isActive: true,
|
|
136
|
+
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
137
|
+
parentsServices: [enums_2.ServicesTypes.INTERIOR_CLEANING],
|
|
138
|
+
pricingAndDurationByVehicleType: {},
|
|
139
|
+
};
|
|
140
|
+
defaultProps.countryServicePublicConfig = (0, stubs_1.countryServicesPublicConfigStub)({
|
|
141
|
+
[enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT]: (0, stubs_1.firestoreServicesPublicConfigStub)({
|
|
142
|
+
parentsServices: [
|
|
143
|
+
enums_2.ServicesTypes.INTERIOR_CLEANING,
|
|
144
|
+
enums_2.ServicesTypes.INTERIOR_AND_EXTERIOR_CLEANING,
|
|
145
|
+
],
|
|
146
|
+
}),
|
|
147
|
+
});
|
|
148
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow();
|
|
149
|
+
});
|
|
150
|
+
it("Should throw if a valid service have the parents services indicated in the config but have one more", async () => {
|
|
151
|
+
defaultProps.providerService = {
|
|
152
|
+
isActive: true,
|
|
153
|
+
type: enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT,
|
|
154
|
+
parentsServices: [
|
|
155
|
+
enums_2.ServicesTypes.INTERIOR_CLEANING,
|
|
156
|
+
enums_2.ServicesTypes.INTERIOR_AND_EXTERIOR_CLEANING,
|
|
157
|
+
enums_2.ServicesTypes.EXTERIOR_CLEANING,
|
|
158
|
+
],
|
|
159
|
+
pricingAndDurationByVehicleType: {},
|
|
160
|
+
};
|
|
161
|
+
defaultProps.countryServicePublicConfig = (0, stubs_1.countryServicesPublicConfigStub)({
|
|
162
|
+
[enums_2.ServicesTypes.ANIMAL_HAIR_TREATMENT]: (0, stubs_1.firestoreServicesPublicConfigStub)({
|
|
163
|
+
parentsServices: [
|
|
164
|
+
enums_2.ServicesTypes.INTERIOR_CLEANING,
|
|
165
|
+
enums_2.ServicesTypes.INTERIOR_AND_EXTERIOR_CLEANING,
|
|
166
|
+
],
|
|
167
|
+
}),
|
|
168
|
+
});
|
|
169
|
+
await expect((0, isValidProviderService_1.isValidProviderService)(defaultProps)).rejects.toThrow();
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
});
|
|
@@ -12,11 +12,11 @@ describe("isValidServicePricingAndDurationForVehicle", () => {
|
|
|
12
12
|
let maximumPriceInCents;
|
|
13
13
|
let durationInMinutes;
|
|
14
14
|
beforeEach(() => {
|
|
15
|
-
minimumPriceInCents = constants_1.
|
|
15
|
+
minimumPriceInCents = constants_1.PROVIDER_SERVICE_MINIMUM_PRICE_INCREMENT_IN_CENTS;
|
|
16
16
|
maximumPriceInCents =
|
|
17
|
-
constants_1.
|
|
17
|
+
constants_1.PROVIDER_SERVICE_MINIMUM_PRICE_INCREMENT_IN_CENTS * 10;
|
|
18
18
|
durationInMinutes =
|
|
19
|
-
constants_1.
|
|
19
|
+
constants_1.PROVIDER_SERVICE_MINIMUM_DURATION_INCREMENT_IN_MINUTES;
|
|
20
20
|
defaultProps = {
|
|
21
21
|
servicePublicConfig: (0, stubs_1.firestoreServicesPublicConfigStub)({
|
|
22
22
|
byVehicleType: {
|
|
@@ -92,16 +92,16 @@ describe("isValidServicePricingAndDurationForVehicle", () => {
|
|
|
92
92
|
it("Should return false if pricePreTaxInCents is less than the service minimum", () => {
|
|
93
93
|
defaultProps.servicePricingAndDurationForVehicle.pricePreTaxInCents =
|
|
94
94
|
minimumPriceInCents -
|
|
95
|
-
constants_1.
|
|
95
|
+
constants_1.PROVIDER_SERVICE_MINIMUM_PRICE_INCREMENT_IN_CENTS;
|
|
96
96
|
expect((0, isValidServicePricingAndDurationForVehicle_1.isValidServicePricingAndDurationForVehicle)(defaultProps)).toBe(false);
|
|
97
97
|
});
|
|
98
|
-
it("Should return false if pricePreTaxInCents is more than
|
|
98
|
+
it("Should return false if pricePreTaxInCents is more than the configured maximum price", () => {
|
|
99
99
|
defaultProps.servicePricingAndDurationForVehicle.pricePreTaxInCents =
|
|
100
100
|
maximumPriceInCents +
|
|
101
|
-
constants_1.
|
|
101
|
+
constants_1.PROVIDER_SERVICE_MINIMUM_PRICE_INCREMENT_IN_CENTS;
|
|
102
102
|
expect((0, isValidServicePricingAndDurationForVehicle_1.isValidServicePricingAndDurationForVehicle)(defaultProps)).toBe(false);
|
|
103
103
|
});
|
|
104
|
-
it("Should return false if pricePreTaxInCents is not a multiple of
|
|
104
|
+
it("Should return false if pricePreTaxInCents is not a multiple of PROVIDER_SERVICE_MINIMUM_PRICE_INCREMENT_IN_CENTS", () => {
|
|
105
105
|
defaultProps.servicePricingAndDurationForVehicle.pricePreTaxInCents =
|
|
106
106
|
maximumPriceInCents - 1;
|
|
107
107
|
expect((0, isValidServicePricingAndDurationForVehicle_1.isValidServicePricingAndDurationForVehicle)(defaultProps)).toBe(false);
|
|
@@ -119,13 +119,13 @@ describe("isValidServicePricingAndDurationForVehicle", () => {
|
|
|
119
119
|
it("Should return false if durationInMinutes is less than the duration for the service", () => {
|
|
120
120
|
defaultProps.servicePricingAndDurationForVehicle.durationInMinutes =
|
|
121
121
|
durationInMinutes -
|
|
122
|
-
constants_1.
|
|
122
|
+
constants_1.PROVIDER_SERVICE_MINIMUM_DURATION_INCREMENT_IN_MINUTES;
|
|
123
123
|
expect((0, isValidServicePricingAndDurationForVehicle_1.isValidServicePricingAndDurationForVehicle)(defaultProps)).toBe(false);
|
|
124
124
|
});
|
|
125
125
|
it("Should return false if durationInMinutes is more than the duration for the service", () => {
|
|
126
126
|
defaultProps.servicePricingAndDurationForVehicle.durationInMinutes =
|
|
127
127
|
durationInMinutes +
|
|
128
|
-
constants_1.
|
|
128
|
+
constants_1.PROVIDER_SERVICE_MINIMUM_DURATION_INCREMENT_IN_MINUTES;
|
|
129
129
|
expect((0, isValidServicePricingAndDurationForVehicle_1.isValidServicePricingAndDurationForVehicle)(defaultProps)).toBe(false);
|
|
130
130
|
});
|
|
131
131
|
it("Should return false if the type is not a valid vehicle type", () => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from "./isValidServicePricingAndDurationForVehicle";
|
|
2
|
-
export * from "./
|
|
2
|
+
export * from "./isValidProviderService";
|
|
@@ -15,4 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./isValidServicePricingAndDurationForVehicle"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./isValidProviderService"), exports);
|
package/dist/firebase/firestore/utils/dataValidators/services/isValidProfessionalService.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { IsValidProfessionalServiceParams } from "./types";
|
|
2
|
-
export declare function isValidProfessionalService({
|
|
2
|
+
export declare function isValidProfessionalService({ providerService, countryServicePublicConfig, }: IsValidProfessionalServiceParams): Promise<void>;
|