@doctocar/tooling 0.3.1-2 → 0.3.1-4
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/AWSSESEmailSenders.enum.d.ts +1 -1
- package/dist/emails/enums/AWSSESEmailSenders.enum.js +1 -1
- package/dist/emails/enums/AWSSESEmailsTemplatesNames.enum.d.ts +2 -3
- package/dist/emails/enums/AWSSESEmailsTemplatesNames.enum.js +3 -4
- package/dist/emails/maps/EmailTemplateDataMap.map.d.ts +3 -4
- package/dist/emails/types/customer/index.d.ts +0 -1
- package/dist/emails/types/customer/index.js +0 -1
- package/dist/emails/types/{company/CompanyVatRejectedEmailData.type.d.ts → entity/EntityVatVerificationFailedEmailData.type.d.ts} +1 -1
- package/dist/emails/types/entity/EntityVatVerificationSucceededEmailData.type.d.ts +3 -0
- package/dist/emails/types/entity/index.d.ts +2 -0
- package/dist/{notifications/pushNotifications/types/company → emails/types/entity}/index.js +2 -2
- package/dist/emails/types/index.d.ts +1 -1
- package/dist/emails/types/index.js +1 -1
- package/dist/errors/enums/cloudFunctions/customers/index.d.ts +0 -1
- package/dist/errors/enums/cloudFunctions/customers/index.js +0 -1
- package/dist/errors/enums/cloudFunctions/entities/CreateNewEntityErrorCodes.enum.d.ts +26 -0
- package/dist/errors/enums/cloudFunctions/entities/CreateNewEntityErrorCodes.enum.js +30 -0
- package/dist/errors/enums/cloudFunctions/entities/index.d.ts +1 -0
- package/dist/{emails/types/company → errors/enums/cloudFunctions/entities}/index.js +1 -2
- package/dist/errors/enums/cloudFunctions/index.d.ts +1 -0
- package/dist/errors/enums/cloudFunctions/index.js +1 -0
- package/dist/firebase/cloudFunctions/enums/OnCallCloudFunctionsNames.enum.d.ts +1 -1
- package/dist/firebase/cloudFunctions/enums/OnCallCloudFunctionsNames.enum.js +2 -1
- package/dist/firebase/cloudFunctions/maps/OnCallCloudFunctionsTypeMappings.map.d.ts +5 -5
- package/dist/firebase/cloudFunctions/types/entities/CreateNewEntityPayload.type.d.ts +16 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateNewEntityRequestData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/CreateNewEntityResponseData.type.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/index.d.ts +3 -0
- package/dist/firebase/cloudFunctions/types/entities/index.js +19 -0
- package/dist/firebase/cloudFunctions/types/index.d.ts +1 -0
- package/dist/firebase/cloudFunctions/types/index.js +1 -0
- package/dist/firebase/cloudFunctions/types/users/customers/index.d.ts +0 -2
- package/dist/firebase/cloudFunctions/types/users/customers/index.js +0 -2
- package/dist/firebase/firestore/enums/FirestoreCollections.enum.d.ts +3 -1
- package/dist/firebase/firestore/enums/FirestoreCollections.enum.js +2 -0
- package/dist/firebase/firestore/enums/entities/EntityRegistrationIdentifierVerificationSource.enum.d.ts +3 -0
- package/dist/firebase/firestore/enums/entities/EntityRegistrationIdentifierVerificationSource.enum.js +7 -0
- package/dist/firebase/firestore/enums/entities/EntityRegistrationIdentifierVerificationStatus.enum.d.ts +6 -0
- package/dist/firebase/firestore/enums/entities/EntityRegistrationIdentifierVerificationStatus.enum.js +10 -0
- package/dist/firebase/firestore/enums/entities/index.d.ts +2 -0
- package/dist/firebase/firestore/enums/entities/index.js +2 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberRole.enum.d.ts +5 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberRole.enum.js +9 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberStatus.enum.d.ts +5 -0
- package/dist/firebase/firestore/enums/entityMembers/EntityMemberStatus.enum.js +9 -0
- package/dist/firebase/firestore/enums/entityMembers/index.d.ts +2 -0
- package/dist/firebase/firestore/enums/entityMembers/index.js +18 -0
- package/dist/firebase/firestore/enums/index.d.ts +1 -0
- package/dist/firebase/firestore/enums/index.js +1 -0
- package/dist/firebase/firestore/maps/FirestoreCollectionDocumentTypeMap.d.ts +3 -1
- package/dist/firebase/firestore/types/company/FrenchCompanyRegistration.type.d.ts +1 -1
- package/dist/firebase/firestore/types/entities/EntityLegalDetails.type.d.ts +8 -1
- package/dist/firebase/firestore/types/entities/EntityLegalRepresentative.type.d.ts +2 -2
- package/dist/firebase/firestore/types/entities/index.d.ts +1 -1
- package/dist/firebase/firestore/types/entities/index.js +1 -1
- package/dist/firebase/firestore/types/entityMembers/FirestoreEntityMemberDocument.type.d.ts +11 -0
- package/dist/firebase/firestore/types/entityMembers/index.d.ts +1 -0
- package/dist/firebase/firestore/types/entityMembers/index.js +17 -0
- package/dist/firebase/firestore/types/entityUniqueKeys/FirestoreEntityUniqueKeyDocument.type.d.ts +6 -0
- package/dist/firebase/firestore/types/entityUniqueKeys/index.d.ts +1 -0
- package/dist/firebase/firestore/types/entityUniqueKeys/index.js +17 -0
- package/dist/firebase/firestore/types/index.d.ts +2 -0
- package/dist/firebase/firestore/types/index.js +2 -0
- package/dist/firebase/firestore/types/paymentProviders/stripes/StripeConnectAccountSummary.type.d.ts +1 -0
- package/dist/firebase/firestore/types/userDocument/FirestoreUserDocumentCustomerInfos.type.d.ts +0 -7
- package/dist/firebase/firestore/utils/stubs/company/frenchCompanyRegistrationStub.js +2 -2
- package/dist/firebase/firestore/utils/stubs/configs/firestoreNotificationEventsPublicConfigDocumentStub.js +25 -32
- package/dist/firebase/firestore/utils/stubs/entityMembers/firestoreEntityMemberDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/entityMembers/firestoreEntityMemberDocumentStub.js +17 -0
- package/dist/firebase/firestore/utils/stubs/entityMembers/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/entityMembers/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/entityUniqueKeys/firestoreEntityUniqueKeyDocumentStub.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/entityUniqueKeys/firestoreEntityUniqueKeyDocumentStub.js +12 -0
- package/dist/firebase/firestore/utils/stubs/entityUniqueKeys/index.d.ts +1 -0
- package/dist/firebase/firestore/utils/stubs/entityUniqueKeys/index.js +17 -0
- package/dist/firebase/firestore/utils/stubs/index.d.ts +2 -0
- package/dist/firebase/firestore/utils/stubs/index.js +2 -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/entities/PubSubEntityVatNumberVerificationRequestedMessage.type.d.ts +3 -0
- package/dist/gcp/pubsub/types/entities/index.d.ts +1 -0
- package/dist/gcp/pubsub/types/entities/index.js +17 -0
- package/dist/gcp/pubsub/types/index.d.ts +1 -0
- package/dist/gcp/pubsub/types/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 +17 -0
- package/dist/gcp/pubsub/utils/stubs/entities/pubSubEntityVatNumberVerificationRequestedMessageStub.d.ts +2 -0
- package/dist/gcp/pubsub/utils/stubs/entities/pubSubEntityVatNumberVerificationRequestedMessageStub.js +9 -0
- package/dist/gcp/pubsub/utils/stubs/index.d.ts +1 -0
- package/dist/gcp/pubsub/utils/stubs/index.js +1 -0
- package/dist/notifications/enums/CustomerNotificationEventType.d.ts +1 -2
- package/dist/notifications/enums/CustomerNotificationEventType.js +0 -1
- package/dist/notifications/enums/EntityNotificationEventType.d.ts +4 -0
- package/dist/notifications/enums/EntityNotificationEventType.js +8 -0
- package/dist/notifications/enums/index.d.ts +1 -1
- package/dist/notifications/enums/index.js +1 -1
- package/dist/notifications/pushNotifications/enums/EntityPushNotificationType.d.ts +4 -0
- package/dist/notifications/pushNotifications/enums/EntityPushNotificationType.js +8 -0
- package/dist/notifications/pushNotifications/enums/index.d.ts +1 -1
- package/dist/notifications/pushNotifications/enums/index.js +1 -1
- package/dist/notifications/pushNotifications/maps/EntityPushNotificationDataMap.d.ts +9 -0
- package/dist/notifications/pushNotifications/maps/EntityPushNotificationDataMap.js +6 -0
- package/dist/notifications/pushNotifications/maps/index.d.ts +1 -0
- package/dist/notifications/pushNotifications/maps/index.js +1 -0
- package/dist/notifications/pushNotifications/types/PushNotificationDataMap.type.d.ts +2 -3
- package/dist/notifications/pushNotifications/types/entity/EntityVatVerificationFailedPushNotificationData.type.d.ts +4 -0
- package/dist/notifications/pushNotifications/types/entity/EntityVatVerificationSucceededPushNotificationData.type.d.ts +4 -0
- package/dist/notifications/pushNotifications/types/entity/EntityVatVerificationSucceededPushNotificationData.type.js +2 -0
- package/dist/notifications/pushNotifications/types/entity/index.d.ts +2 -0
- package/dist/notifications/pushNotifications/types/entity/index.js +18 -0
- package/dist/notifications/pushNotifications/types/index.d.ts +1 -1
- package/dist/notifications/pushNotifications/types/index.js +1 -1
- package/dist/notifications/types/NotificationEvent.type.d.ts +2 -2
- package/dist/utils/regex/__tests__/isValidCompanyLegalName.util.test.js +5 -0
- package/dist/utils/vat/__tests__/extractVatNumberAndCountryCode.test.js +39 -0
- package/dist/utils/vat/__tests__/{validateVATFormat.util.test.js → validateVatNumberFormat.test.js} +3 -3
- package/dist/utils/vat/extractVatNumberAndCountryCode.d.ts +4 -0
- package/dist/utils/vat/{extractVATNumber.util.js → extractVatNumberAndCountryCode.js} +2 -2
- package/dist/utils/vat/index.d.ts +2 -2
- package/dist/utils/vat/index.js +2 -2
- package/dist/utils/vat/types/{ValidateVATFormatArgs.type.d.ts → ValidateVatNumberFormatArgs.type.d.ts} +1 -1
- package/dist/utils/vat/types/ValidateVatNumberFormatArgs.type.js +2 -0
- package/dist/utils/vat/types/index.d.ts +1 -1
- package/dist/utils/vat/types/index.js +1 -1
- package/dist/utils/vat/validateVatNumberFormat.d.ts +2 -0
- package/dist/utils/vat/{validateVATFormat.util.js → validateVatNumberFormat.js} +2 -2
- package/package.json +1 -1
- package/dist/emails/types/company/CompanyVatVerifiedEmailData.type.d.ts +0 -3
- package/dist/emails/types/company/index.d.ts +0 -2
- package/dist/emails/types/customer/CustomerWelcomeEmailData.type.d.ts +0 -1
- package/dist/errors/enums/cloudFunctions/customers/ProcessCustomerUserOnboardingErrorCodes.enum.d.ts +0 -22
- package/dist/errors/enums/cloudFunctions/customers/ProcessCustomerUserOnboardingErrorCodes.enum.js +0 -26
- package/dist/firebase/cloudFunctions/types/users/customers/ProcessCustomerUserOnboardingRequestData.type.d.ts +0 -15
- package/dist/firebase/cloudFunctions/types/users/customers/ProcessCustomerUserOnboardingResponseData.type.d.ts +0 -1
- package/dist/notifications/enums/CompanyNotificationEventType.d.ts +0 -4
- package/dist/notifications/enums/CompanyNotificationEventType.js +0 -8
- package/dist/notifications/pushNotifications/enums/CompanyPushNotificationType.d.ts +0 -4
- package/dist/notifications/pushNotifications/enums/CompanyPushNotificationType.js +0 -8
- package/dist/notifications/pushNotifications/maps/CompanyPushNotificationDataMap.d.ts +0 -6
- package/dist/notifications/pushNotifications/types/company/CompanyVatVerificationFailedPushNotificationData.type.d.ts +0 -4
- package/dist/notifications/pushNotifications/types/company/CompanyVatVerificationSucceededPushNotificationData.type.d.ts +0 -4
- package/dist/notifications/pushNotifications/types/company/index.d.ts +0 -2
- package/dist/utils/vat/__tests__/extractVATNumber.util.test.js +0 -39
- package/dist/utils/vat/extractVATNumber.util.d.ts +0 -4
- package/dist/utils/vat/validateVATFormat.util.d.ts +0 -2
- /package/dist/emails/types/{company/CompanyVatRejectedEmailData.type.js → entity/EntityVatVerificationFailedEmailData.type.js} +0 -0
- /package/dist/emails/types/{company/CompanyVatVerifiedEmailData.type.js → entity/EntityVatVerificationSucceededEmailData.type.js} +0 -0
- /package/dist/{emails/types/customer/CustomerWelcomeEmailData.type.js → firebase/cloudFunctions/types/entities/CreateNewEntityPayload.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/ProcessCustomerUserOnboardingRequestData.type.js → entities/CreateNewEntityRequestData.type.js} +0 -0
- /package/dist/firebase/cloudFunctions/types/{users/customers/ProcessCustomerUserOnboardingResponseData.type.js → entities/CreateNewEntityResponseData.type.js} +0 -0
- /package/dist/firebase/firestore/types/entities/{EntityRegistration.enum.d.ts → EntityRegistration.type.d.ts} +0 -0
- /package/dist/firebase/firestore/types/entities/{EntityRegistration.enum.js → EntityRegistration.type.js} +0 -0
- /package/dist/{notifications/pushNotifications/maps/CompanyPushNotificationDataMap.js → firebase/firestore/types/entityMembers/FirestoreEntityMemberDocument.type.js} +0 -0
- /package/dist/{notifications/pushNotifications/types/company/CompanyVatVerificationFailedPushNotificationData.type.js → firebase/firestore/types/entityUniqueKeys/FirestoreEntityUniqueKeyDocument.type.js} +0 -0
- /package/dist/{notifications/pushNotifications/types/company/CompanyVatVerificationSucceededPushNotificationData.type.js → gcp/pubsub/types/entities/PubSubEntityVatNumberVerificationRequestedMessage.type.js} +0 -0
- /package/dist/{utils/vat/types/ValidateVATFormatArgs.type.js → notifications/pushNotifications/types/entity/EntityVatVerificationFailedPushNotificationData.type.js} +0 -0
- /package/dist/utils/vat/__tests__/{extractVATNumber.util.test.d.ts → extractVatNumberAndCountryCode.test.d.ts} +0 -0
- /package/dist/utils/vat/__tests__/{validateVATFormat.util.test.d.ts → validateVatNumberFormat.test.d.ts} +0 -0
|
@@ -16,3 +16,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./CustomerPushNotificationDataMap"), exports);
|
|
18
18
|
__exportStar(require("./ProfessionalPushNotificationDataMap"), exports);
|
|
19
|
+
__exportStar(require("./EntityPushNotificationDataMap"), exports);
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import type { CustomerPushNotificationDataMap, ProfessionalPushNotificationDataMap } from "../maps";
|
|
2
|
-
|
|
3
|
-
export type PushNotificationDataMap = CustomerPushNotificationDataMap & ProfessionalPushNotificationDataMap & CompanyPushNotificationDataMap;
|
|
1
|
+
import type { CustomerPushNotificationDataMap, EntityPushNotificationDataMap, ProfessionalPushNotificationDataMap } from "../maps";
|
|
2
|
+
export type PushNotificationDataMap = CustomerPushNotificationDataMap & ProfessionalPushNotificationDataMap & EntityPushNotificationDataMap;
|
|
@@ -0,0 +1,18 @@
|
|
|
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("./EntityVatVerificationFailedPushNotificationData.type"), exports);
|
|
18
|
+
__exportStar(require("./EntityVatVerificationSucceededPushNotificationData.type"), exports);
|
|
@@ -16,5 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./customer"), exports);
|
|
18
18
|
__exportStar(require("./professional"), exports);
|
|
19
|
+
__exportStar(require("./entity"), exports);
|
|
19
20
|
__exportStar(require("./PushNotificationDataMap.type"), exports);
|
|
20
|
-
__exportStar(require("./company"), exports);
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
export type NotificationEvent = CustomerNotificationEventType | ProfessionalNotificationEventType |
|
|
1
|
+
import { type CustomerNotificationEventType, type EntityNotificationEventType, type ProfessionalNotificationEventType } from "../enums";
|
|
2
|
+
export type NotificationEvent = CustomerNotificationEventType | ProfessionalNotificationEventType | EntityNotificationEventType;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const extractVatNumberAndCountryCode_1 = require("../extractVatNumberAndCountryCode");
|
|
4
|
+
describe("extractVatNumberAndCountryCode", () => {
|
|
5
|
+
test("should extract country code and VAT number correctly", () => {
|
|
6
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("FR123456789")).toEqual({
|
|
7
|
+
countryISOCode: "FR",
|
|
8
|
+
vatNumber: "123456789",
|
|
9
|
+
});
|
|
10
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("DE987654321")).toEqual({
|
|
11
|
+
countryISOCode: "DE",
|
|
12
|
+
vatNumber: "987654321",
|
|
13
|
+
});
|
|
14
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("IT12345678901")).toEqual({
|
|
15
|
+
countryISOCode: "IT",
|
|
16
|
+
vatNumber: "12345678901",
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
test("should return null for invalid VAT number formats", () => {
|
|
20
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("123456789")).toBeNull();
|
|
21
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("FR")).toBeNull();
|
|
22
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("fr123456789")).toBeNull();
|
|
23
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("F123456789")).toBeNull();
|
|
24
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("FR-123456789")).toBeNull();
|
|
25
|
+
});
|
|
26
|
+
test("should handle edge cases", () => {
|
|
27
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("GBGD123")).toEqual({
|
|
28
|
+
countryISOCode: "GB",
|
|
29
|
+
vatNumber: "GD123",
|
|
30
|
+
});
|
|
31
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("ESX1234567")).toEqual({
|
|
32
|
+
countryISOCode: "ES",
|
|
33
|
+
vatNumber: "X1234567",
|
|
34
|
+
});
|
|
35
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("")).toBeNull();
|
|
36
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)(" ")).toBeNull();
|
|
37
|
+
expect((0, extractVatNumberAndCountryCode_1.extractVatNumberAndCountryCode)("FR 123456789")).toBeNull();
|
|
38
|
+
});
|
|
39
|
+
});
|
package/dist/utils/vat/__tests__/{validateVATFormat.util.test.js → validateVatNumberFormat.test.js}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
4
|
-
const
|
|
4
|
+
const validateVatNumberFormat_1 = require("../validateVatNumberFormat");
|
|
5
5
|
const france = [
|
|
6
6
|
{
|
|
7
7
|
name: "🇫🇷 FR valid simple digits",
|
|
@@ -319,9 +319,9 @@ const allCases = [
|
|
|
319
319
|
...portugal,
|
|
320
320
|
...belgium,
|
|
321
321
|
];
|
|
322
|
-
describe("
|
|
322
|
+
describe("validateVatNumberFormat", () => {
|
|
323
323
|
test.each(allCases)("should match the result for $name", ({ countryCode, vatNumber, result }) => {
|
|
324
|
-
expect((0,
|
|
324
|
+
expect((0, validateVatNumberFormat_1.validateVatNumberFormat)({
|
|
325
325
|
vatNumber,
|
|
326
326
|
countryCode,
|
|
327
327
|
})).toBe(result);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.extractVatNumberAndCountryCode = extractVatNumberAndCountryCode;
|
|
4
|
+
function extractVatNumberAndCountryCode(vatNumber) {
|
|
5
5
|
const match = vatNumber.match(/^([A-Z]{2})([A-Z0-9]+)$/);
|
|
6
6
|
if (!match) {
|
|
7
7
|
return null;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./
|
|
2
|
-
export * from "./
|
|
1
|
+
export * from "./validateVatNumberFormat";
|
|
2
|
+
export * from "./extractVatNumberAndCountryCode";
|
package/dist/utils/vat/index.js
CHANGED
|
@@ -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("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./validateVatNumberFormat"), exports);
|
|
18
|
+
__exportStar(require("./extractVatNumberAndCountryCode"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./
|
|
1
|
+
export * from "./ValidateVatNumberFormatArgs.type";
|
|
@@ -14,4 +14,4 @@ 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("./ValidateVatNumberFormatArgs.type"), exports);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
function
|
|
3
|
+
exports.validateVatNumberFormat = validateVatNumberFormat;
|
|
4
|
+
function validateVatNumberFormat({ countryCode, vatNumber, }) {
|
|
5
5
|
const cleaned = vatNumber.replace(/\s+/g, "").toUpperCase();
|
|
6
6
|
switch (countryCode.toUpperCase()) {
|
|
7
7
|
case "FR":
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type CustomerOnboardingCompletedEmailData = Record<string, never>;
|
package/dist/errors/enums/cloudFunctions/customers/ProcessCustomerUserOnboardingErrorCodes.enum.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export declare enum ProcessCustomerUserOnboardingErrorCodes {
|
|
2
|
-
REQUEST_DATA_VALIDATION_FAILED = "REQUEST_DATA_VALIDATION_FAILED",
|
|
3
|
-
CONTEXT_VALIDATION_FAILED = "CONTEXT_VALIDATION_FAILED",
|
|
4
|
-
USER_DOCUMENT_MISSING_CONTACT_INFO = "processCustomerUserOnboardingErrorCodes/userDocumentMissingContactInfo",
|
|
5
|
-
INVALID_ENTITY_LEGAL_TYPE = "processCustomerUserOnboardingErrorCodes/invalidEntityLegalType",
|
|
6
|
-
USER_ALREADY_HAVE_AN_ENTITY = "processCustomerUserOnboardingErrorCodes/userAlreadyHaveAnEntity",
|
|
7
|
-
ONBOARDING_ALREADY_COMPLETED = "processCustomerUserOnboardingErrorCodes/onboardingAlreadyCompleted",
|
|
8
|
-
USER_DOCUMENT_MISSING_PHONE_NUMBER = "processCustomerUserOnboardingErrorCodes/userDocumentMissingPhoneNumber",
|
|
9
|
-
MISSING_COMPANY_DETAILS = "processCustomerUserOnboardingErrorCodes/missingCompanyDetails",
|
|
10
|
-
INVALID_LEGAL_REPRESENTATIVE_FIRST_NAME = "processCustomerUserOnboardingErrorCodes/invalidLegalRepresentativeFirstName",
|
|
11
|
-
INVALID_LEGAL_REPRESENTATIVE_LAST_NAME = "processCustomerUserOnboardingErrorCodes/invalidLegalRepresentativeLastName",
|
|
12
|
-
INVALID_BILLING_ADDRESS_PLACE_ID = "processCustomerUserOnboardingErrorCodes/invalidBillingAddressPlaceId",
|
|
13
|
-
INVALID_COMPANY_LEGAL_NAME = "processCustomerUserOnboardingErrorCodes/invalidCompanyLegalName",
|
|
14
|
-
VAT_NUMBER_IS_REQUIRED = "processCustomerUserOnboardingErrorCodes/vatNumberIsRequired",
|
|
15
|
-
INVALID_COMPANY_LEGAL_ADDRESS_PLACE_ID = "processCustomerUserOnboardingErrorCodes/invalidCompanyLegalAddressPlaceId",
|
|
16
|
-
INVALID_VAT_NUMBER = "processCustomerUserOnboardingErrorCodes/invalidVatNumber",
|
|
17
|
-
USER_EMAIL_NOT_SET = "processCustomerUserOnboardingErrorCodes/userEmailNotSet",
|
|
18
|
-
USER_EMAIL_NOT_VERIFIED = "processCustomerUserOnboardingErrorCodes/userEmailNotVerified",
|
|
19
|
-
USER_IS_ANONYMOUS = "processCustomerUserOnboardingErrorCodes/userIsAnonymous",
|
|
20
|
-
STRIPE_CUSTOMER_CREATION_FAILED = "processCustomerUserOnboardingErrorCodes/stripeCustomerCreationFailed",
|
|
21
|
-
USER_DOCUMENT_NOT_FOUND = "processCustomerUserOnboardingErrorCodes/userDocumentNotFound"
|
|
22
|
-
}
|
package/dist/errors/enums/cloudFunctions/customers/ProcessCustomerUserOnboardingErrorCodes.enum.js
DELETED
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProcessCustomerUserOnboardingErrorCodes = void 0;
|
|
4
|
-
var ProcessCustomerUserOnboardingErrorCodes;
|
|
5
|
-
(function (ProcessCustomerUserOnboardingErrorCodes) {
|
|
6
|
-
ProcessCustomerUserOnboardingErrorCodes["REQUEST_DATA_VALIDATION_FAILED"] = "REQUEST_DATA_VALIDATION_FAILED";
|
|
7
|
-
ProcessCustomerUserOnboardingErrorCodes["CONTEXT_VALIDATION_FAILED"] = "CONTEXT_VALIDATION_FAILED";
|
|
8
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_DOCUMENT_MISSING_CONTACT_INFO"] = "processCustomerUserOnboardingErrorCodes/userDocumentMissingContactInfo";
|
|
9
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_ENTITY_LEGAL_TYPE"] = "processCustomerUserOnboardingErrorCodes/invalidEntityLegalType";
|
|
10
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_ALREADY_HAVE_AN_ENTITY"] = "processCustomerUserOnboardingErrorCodes/userAlreadyHaveAnEntity";
|
|
11
|
-
ProcessCustomerUserOnboardingErrorCodes["ONBOARDING_ALREADY_COMPLETED"] = "processCustomerUserOnboardingErrorCodes/onboardingAlreadyCompleted";
|
|
12
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_DOCUMENT_MISSING_PHONE_NUMBER"] = "processCustomerUserOnboardingErrorCodes/userDocumentMissingPhoneNumber";
|
|
13
|
-
ProcessCustomerUserOnboardingErrorCodes["MISSING_COMPANY_DETAILS"] = "processCustomerUserOnboardingErrorCodes/missingCompanyDetails";
|
|
14
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_LEGAL_REPRESENTATIVE_FIRST_NAME"] = "processCustomerUserOnboardingErrorCodes/invalidLegalRepresentativeFirstName";
|
|
15
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_LEGAL_REPRESENTATIVE_LAST_NAME"] = "processCustomerUserOnboardingErrorCodes/invalidLegalRepresentativeLastName";
|
|
16
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_BILLING_ADDRESS_PLACE_ID"] = "processCustomerUserOnboardingErrorCodes/invalidBillingAddressPlaceId";
|
|
17
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_COMPANY_LEGAL_NAME"] = "processCustomerUserOnboardingErrorCodes/invalidCompanyLegalName";
|
|
18
|
-
ProcessCustomerUserOnboardingErrorCodes["VAT_NUMBER_IS_REQUIRED"] = "processCustomerUserOnboardingErrorCodes/vatNumberIsRequired";
|
|
19
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_COMPANY_LEGAL_ADDRESS_PLACE_ID"] = "processCustomerUserOnboardingErrorCodes/invalidCompanyLegalAddressPlaceId";
|
|
20
|
-
ProcessCustomerUserOnboardingErrorCodes["INVALID_VAT_NUMBER"] = "processCustomerUserOnboardingErrorCodes/invalidVatNumber";
|
|
21
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_EMAIL_NOT_SET"] = "processCustomerUserOnboardingErrorCodes/userEmailNotSet";
|
|
22
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_EMAIL_NOT_VERIFIED"] = "processCustomerUserOnboardingErrorCodes/userEmailNotVerified";
|
|
23
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_IS_ANONYMOUS"] = "processCustomerUserOnboardingErrorCodes/userIsAnonymous";
|
|
24
|
-
ProcessCustomerUserOnboardingErrorCodes["STRIPE_CUSTOMER_CREATION_FAILED"] = "processCustomerUserOnboardingErrorCodes/stripeCustomerCreationFailed";
|
|
25
|
-
ProcessCustomerUserOnboardingErrorCodes["USER_DOCUMENT_NOT_FOUND"] = "processCustomerUserOnboardingErrorCodes/userDocumentNotFound";
|
|
26
|
-
})(ProcessCustomerUserOnboardingErrorCodes || (exports.ProcessCustomerUserOnboardingErrorCodes = ProcessCustomerUserOnboardingErrorCodes = {}));
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { EntityLegalType } from "../../../../firestore";
|
|
2
|
-
import { BaseOnCallRequestData } from "../../BaseOncallRequestData";
|
|
3
|
-
export type ProcessCustomerUserOnboardingRequestData = BaseOnCallRequestData & ({
|
|
4
|
-
entityLegalType: EntityLegalType.INDIVIDUAL;
|
|
5
|
-
} | {
|
|
6
|
-
entityLegalType: EntityLegalType.COMPANY;
|
|
7
|
-
companyLegalName: string;
|
|
8
|
-
companyLegalAddressPlaceId: string;
|
|
9
|
-
legalRepresentativeFirstName: string;
|
|
10
|
-
legalRepresentativeLastName: string;
|
|
11
|
-
companyIsVATExempt: boolean;
|
|
12
|
-
companyVATNumber?: string;
|
|
13
|
-
billingAddressIsSameAsLegalAddress?: boolean;
|
|
14
|
-
billingAddressPlaceId?: string;
|
|
15
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type ProcessCustomerUserOnboardingResponseData = void;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompanyNotificationEventType = void 0;
|
|
4
|
-
var CompanyNotificationEventType;
|
|
5
|
-
(function (CompanyNotificationEventType) {
|
|
6
|
-
CompanyNotificationEventType["COMPANY_VAT_VERIFICATION_FAILED"] = "company/vatVerificationFailed";
|
|
7
|
-
CompanyNotificationEventType["COMPANY_VAT_VERIFICATION_SUCCEEDED"] = "company/vatVerificationSucceeded";
|
|
8
|
-
})(CompanyNotificationEventType || (exports.CompanyNotificationEventType = CompanyNotificationEventType = {}));
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.CompanyPushNotificationType = void 0;
|
|
4
|
-
var CompanyPushNotificationType;
|
|
5
|
-
(function (CompanyPushNotificationType) {
|
|
6
|
-
CompanyPushNotificationType["COMPANY_VAT_VERIFICATION_FAILED"] = "COMPANY_VAT_VERIFICATION_FAILED";
|
|
7
|
-
CompanyPushNotificationType["COMPANY_VAT_VERIFICATION_SUCCEEDED"] = "COMPANY_VAT_VERIFICATION_SUCCEEDED";
|
|
8
|
-
})(CompanyPushNotificationType || (exports.CompanyPushNotificationType = CompanyPushNotificationType = {}));
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { CompanyPushNotificationType } from "../enums";
|
|
2
|
-
import type { CompanyVatVerificationFailedPushNotificationData, CompanyVatVerificationSucceededPushNotificationData } from "../types";
|
|
3
|
-
export type CompanyPushNotificationDataMap = {
|
|
4
|
-
[CompanyPushNotificationType.COMPANY_VAT_VERIFICATION_FAILED]: CompanyVatVerificationFailedPushNotificationData;
|
|
5
|
-
[CompanyPushNotificationType.COMPANY_VAT_VERIFICATION_SUCCEEDED]: CompanyVatVerificationSucceededPushNotificationData;
|
|
6
|
-
};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const extractVATNumber_util_1 = require("../extractVATNumber.util");
|
|
4
|
-
describe("extractVATNumber", () => {
|
|
5
|
-
test("should extract country code and VAT number correctly", () => {
|
|
6
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("FR123456789")).toEqual({
|
|
7
|
-
countryISOCode: "FR",
|
|
8
|
-
vatNumber: "123456789",
|
|
9
|
-
});
|
|
10
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("DE987654321")).toEqual({
|
|
11
|
-
countryISOCode: "DE",
|
|
12
|
-
vatNumber: "987654321",
|
|
13
|
-
});
|
|
14
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("IT12345678901")).toEqual({
|
|
15
|
-
countryISOCode: "IT",
|
|
16
|
-
vatNumber: "12345678901",
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
test("should return null for invalid VAT number formats", () => {
|
|
20
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("123456789")).toBeNull();
|
|
21
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("FR")).toBeNull();
|
|
22
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("fr123456789")).toBeNull();
|
|
23
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("F123456789")).toBeNull();
|
|
24
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("FR-123456789")).toBeNull();
|
|
25
|
-
});
|
|
26
|
-
test("should handle edge cases", () => {
|
|
27
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("GBGD123")).toEqual({
|
|
28
|
-
countryISOCode: "GB",
|
|
29
|
-
vatNumber: "GD123",
|
|
30
|
-
});
|
|
31
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("ESX1234567")).toEqual({
|
|
32
|
-
countryISOCode: "ES",
|
|
33
|
-
vatNumber: "X1234567",
|
|
34
|
-
});
|
|
35
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("")).toBeNull();
|
|
36
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)(" ")).toBeNull();
|
|
37
|
-
expect((0, extractVATNumber_util_1.extractVATNumber)("FR 123456789")).toBeNull();
|
|
38
|
-
});
|
|
39
|
-
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|