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 identification

  • published: Optional ActiveEnum value (YES/NO)

  • username: Optional unique identifier

  • facilities: Optional array of FacilityEnum values

  • All 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

  1. DTO Validation: Always validate DTOs using class-validator decorators

  2. Type Safety: Use TypeScript interfaces to ensure type safety across layers

  3. Nested Validation: Validate nested objects using their respective validation rules

  4. Media Handling: Use proper interfaces for file upload and management

  5. Settings Management: Separate concerns for different settings types

  6. Cache Management: Use enum-defined cache keys for consistency

  7. Error Handling: Implement domain-specific exceptions for business rules

  8. Context Propagation: Always pass TenantActorContext for proper authorization

Interface Evolution

When modifying interfaces:

  1. Consider backward compatibility for existing clients

  2. Use optional properties for new fields

  3. Update validation rules accordingly

  4. Document breaking changes

  5. Version the API if necessary

  6. Update corresponding DTOs and mappers

  7. Consider impact on cache invalidation

  8. Update media handling if related to file operations

Last updated

Was this helpful?