UNPKG

@kenniy/godeye-event-contracts

Version:

Shared event schemas and stream definitions for 8Medical microservices architecture

113 lines 4.15 kB
import { BaseEvent, BusinessEntityIds, ContactInfo, Address, BusinessType, VerificationStatus } from "../../schemas/base-event"; export declare const RegistrationEvents: { readonly CUSTOMER_REGISTERED: "user.customer.registered"; readonly BUSINESS_REGISTERED: "user.business.registered"; readonly AGENT_INVITED: "user.agent.invited"; readonly AGENT_ACCEPTED: "user.agent.accepted"; readonly AGENT_REJECTED: "user.agent.rejected"; }; export interface CustomerRegistrationData extends BusinessEntityIds { customerId: string; email: string; firstName: string; lastName: string; dateOfBirth?: string; gender?: "male" | "female" | "other" | "prefer_not_to_say"; contactInfo: ContactInfo; address?: Address; registeredAt: string; registrationSource: "web" | "mobile" | "admin" | "agent"; verificationStatus: VerificationStatus; accountStatus: "active" | "inactive" | "suspended"; medicalInfo?: { bloodType?: string; allergies?: string[]; chronicConditions?: string[]; emergencyContact?: ContactInfo["emergencyContact"]; }; privacySettings?: { allowMarketing: boolean; allowDataSharing: boolean; communicationPreferences: ("email" | "sms" | "push")[]; }; } export interface BusinessRegistrationData extends BusinessEntityIds { businessId: string; businessName: string; businessType: BusinessType; email: string; registrationNumber?: string; licenseNumber?: string; hefamaaNumber?: string; taxId?: string; contactInfo: ContactInfo; address: Address; website?: string; businessDescription?: string; establishedYear?: number; employeeCount?: number; operationalHours?: Record<string, string>; servicesOffered?: string[]; ownerId: string; ownerEmail: string; ownerName: string; registeredAt: string; verificationStatus: VerificationStatus; onboardingStatus: "not_started" | "in_progress" | "completed"; specialtyAreas?: string[]; accreditations?: string[]; insuranceAccepted?: string[]; requiresHrmIntegration: boolean; requiresPaymentIntegration: boolean; socialMedia?: Record<string, string>; marketingConsent: boolean; } export interface AgentInvitationData extends BusinessEntityIds { invitationId: string; businessId: string; businessName: string; inviteeEmail: string; inviteeName?: string; roleTitle: string; permissions: string[]; invitedBy: string; invitedAt: string; expiresAt: string; invitationToken: string; roleDescription?: string; departmentAccess?: string[]; specialPermissions?: Record<string, boolean>; sendWelcomeEmail: boolean; customMessage?: string; } export interface AgentResponseData extends BusinessEntityIds { invitationId: string; businessId: string; agentId: string; agentEmail: string; agentName: string; response: "accepted" | "rejected"; respondedAt: string; responseMessage?: string; profileCompleted?: boolean; agreementsSigned?: string[]; onboardingStarted?: boolean; } export interface CustomerRegisteredEvent extends BaseEvent<CustomerRegistrationData> { eventType: typeof RegistrationEvents.CUSTOMER_REGISTERED; } export interface BusinessRegisteredEvent extends BaseEvent<BusinessRegistrationData> { eventType: typeof RegistrationEvents.BUSINESS_REGISTERED; } export interface AgentInvitedEvent extends BaseEvent<AgentInvitationData> { eventType: typeof RegistrationEvents.AGENT_INVITED; } export interface AgentAcceptedEvent extends BaseEvent<AgentResponseData> { eventType: typeof RegistrationEvents.AGENT_ACCEPTED; } export interface AgentRejectedEvent extends BaseEvent<AgentResponseData> { eventType: typeof RegistrationEvents.AGENT_REJECTED; } export type RegistrationEvent = CustomerRegisteredEvent | BusinessRegisteredEvent | AgentInvitedEvent | AgentAcceptedEvent | AgentRejectedEvent; export type RegistrationEventType = (typeof RegistrationEvents)[keyof typeof RegistrationEvents]; //# sourceMappingURL=registration.d.ts.map