Interface Documentation
Overview
This document describes the interfaces, types, and contracts used in the Business Profile Management module. These interfaces define the structure of business data objects, repository contracts, service interfaces, and configuration objects used throughout the system.
Core Interfaces
IBusinessProfile
The main interface for business profile entities, extending the base entity interface.
interface IBusinessProfile extends IBase {
published: ActiveEnum; // Publication status
name: string; // Business name
username?: string; // Unique business username
facilities?: FacilityEnum[]; // Available facilities
socialNetworkLinks?: ISocialNetworkLink[]; // Social media links
bookingSettings: IBookingSettings; // Booking configuration
businessSettings: IBusinessSettings; // Business configuration
notificationSettings?: INotificationSettings; // Notification preferences
paymentSettings?: IPaymentSettings; // Payment configuration
panelSettings?: IPanelSettings; // Panel UI settings
publicPageSettings?: IPublicPageSettings; // Public page settings
addresses?: IBusinessAddress[]; // Business addresses
schedules?: ISchedule[]; // Operating schedules
specialSchedules?: ISpecialSchedule[]; // Special schedules
contacts?: IContact[]; // Contact information
gallery?: IMedia[]; // Gallery images
logo?: IMedia; // Business logo
banners?: IMedia[]; // Banner images
description?: string; // Business description
feature?: string; // Featured information
}IBusinessProfileRepository
Repository interface defining data access operations for business profiles.
Data Transfer Objects (DTOs)
BusinessProfileDto
Main DTO for business profile data transfer between layers.
Validation Rules:
name: Optional string for business identificationpublished: Optional ActiveEnum value (YES/NO)username: Optional unique identifierfacilities: Optional array of FacilityEnum valuesAll nested objects have their own validation requirements
Business Settings DTOs
BusinessSettingsDto
BookingSettingsClientDto
PaymentSettingsDto
Location and Contact DTOs
AddressDto
ContactDto
SocialNetworkLinkDto
Schedule DTOs
ScheduleDto
SpecialScheduleDto
Enumerations
ActiveEnum
FacilityEnum
ContactTypeEnum
SocialPlatformEnum
Use Case Interfaces
GetBusinessProfileParams
UpdateBusinessProfileParams
UpdateBusinessPaymentSettingsParams
Media Management Use Case Interfaces
UpdateClientLogoParams
DeleteClientLogoParams
UpdateClientBannerParams
UpdateClientGalleryParams
Value Objects Interfaces
IBookingSettings
IBusinessSettings
IPaymentSettings
IPanelSettings
INotificationSettings
Command and Query Interfaces
Commands
CreateBusinessProfileCommand
UpdateBusinessProfileCommand
UpdateBusinessPaymentSettingsCommand
Media Management Commands
UpsertClientLogoCommand
DeleteClientLogoCommand
Queries
GetBusinessProfileQuery
GetBusinessProfileByIdentifierQuery
GetBusinessSettingsQuery
GetBusinessBookingSettingsQuery
Cache Interfaces
BusinessCacheKeys
Media Management Interfaces
IMedia
MediaDto
Validation Interfaces
ValidationResult
Business Rule Validation Interfaces
IBusinessAddressValidation
IContactValidation
ISocialNetworkLinkValidation
Context Interfaces
TenantActorContext
Service Integration Interfaces
IMediaService
INotificationService
IPaymentGatewayService
Error Interfaces
BusinessProfileException
BusinessProfileErrorCodes
Module Configuration Interfaces
BusinessProfileModuleConfig
Usage Guidelines
DTO Validation: Always validate DTOs using class-validator decorators
Type Safety: Use TypeScript interfaces to ensure type safety across layers
Nested Validation: Validate nested objects using their respective validation rules
Media Handling: Use proper interfaces for file upload and management
Settings Management: Separate concerns for different settings types
Cache Management: Use enum-defined cache keys for consistency
Error Handling: Implement domain-specific exceptions for business rules
Context Propagation: Always pass TenantActorContext for proper authorization
Interface Evolution
When modifying interfaces:
Consider backward compatibility for existing clients
Use optional properties for new fields
Update validation rules accordingly
Document breaking changes
Version the API if necessary
Update corresponding DTOs and mappers
Consider impact on cache invalidation
Update media handling if related to file operations
Last updated
Was this helpful?