All files / services index.ts

100% Statements 2/2
100% Branches 0/0
100% Functions 1/1
100% Lines 2/2

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128                                                                                                                                                                                                      4x   4x                                                    
// Services - Central Export
import type { Dal } from "../dal";
import { ProService } from "./pro.service";
import { ProjectService } from "./project.service";
import { InquiryService } from "./inquiry.service";
import { RoomService } from "./room.service";
import { MediaService } from "./media.service";
import { CompanyProfileService } from "./company-profile";
import { BlogImagesService } from "./blog-images.service";
import { PipelineStagesService } from "./crm/pipeline-stages.service";
import { LeadSourcesService } from "./crm/lead-sources.service";
import { LeadsService } from "./crm/leads.service";
import { NotesService } from "./crm/notes.service";
import { DocumentsService } from "./crm/documents.service";
import { RemindersService } from "./crm/reminders.service";
import { CrmAnalyticsService } from "./crm/analytics.service";
import { CrmSettingsService } from "./crm/settings.service";
import { ConversationService } from "./whatsapp/conversation.service";
import { TemplateService } from "./whatsapp/template.service";
import { CampaignService } from "./whatsapp/campaign.service";
import { NotificationPreferencesService } from "./notification";
import { NotificationService } from "./notification/notification.service";
import { UploadService } from "./upload.service";
 
export { ProService } from "./pro.service";
export { ProjectService } from "./project.service";
export { InquiryService } from "./inquiry.service";
export { RoomService } from "./room.service";
export { MediaService } from "./media.service";
export { CompanyProfileService } from "./company-profile";
export { BlogImagesService } from "./blog-images.service";
export { PipelineStagesService } from "./crm/pipeline-stages.service";
export { LeadSourcesService } from "./crm/lead-sources.service";
export { LeadsService } from "./crm/leads.service";
export { NotesService } from "./crm/notes.service";
export { DocumentsService } from "./crm/documents.service";
export { RemindersService } from "./crm/reminders.service";
export { CrmAnalyticsService } from "./crm/analytics.service";
export { CrmSettingsService } from "./crm/settings.service";
export {
	ConversationService,
	TemplateService,
	CampaignService,
} from "./whatsapp";
export {
	NotificationPreferencesService,
	type EffectivePreference,
} from "./notification";
export { NotificationService } from "./notification";
export { UploadService } from "./upload.service";
export { EntityCreator } from "./entity-creator";
export type {
	CreateLeadInput,
	CreateFromInquiryInput,
} from "./crm/leads.service";
 
export type {
	CreateProInput,
	UpdateProInput,
} from "./pro.service";
export type {
	CreateProjectInput,
	UpdateProjectInput,
} from "./project.service";
export type { CreateInquiryInput } from "./inquiry.service";
export type {
	CreateRoomInput,
	UpdateRoomInput,
} from "./room.service";
export type {
	CreateMediaInput,
	UpdateMediaInput,
} from "./media.service";
export type {
	UpdateProfileInput,
	AddLeadershipInput,
	UpdateLeadershipInput,
	AddCertificationInput,
	UpdateCertificationInput,
	AddTestimonialInput,
	UpdateTestimonialInput,
} from "./company-profile";
export type {
	RequestUploadInput,
	RequestUploadResult,
	UploadContext,
} from "./upload.service";
export type {
	UploadBlogImageInput,
	AddPexelsImageInput,
	AddProjectImageInput,
	PexelsPhoto,
	PexelsSearchResult,
} from "./blog-images.service";
 
/**
 * Factory function to create all service instances
 */
export function createServices(dal: Dal, env: CloudflareBindings) {
	const notification = new NotificationService(dal, env);
 
	return {
		pro: new ProService(dal),
		project: new ProjectService(dal),
		inquiry: new InquiryService(dal),
		room: new RoomService(dal),
		media: new MediaService(dal),
		companyProfile: new CompanyProfileService(dal),
		blogImages: new BlogImagesService(dal, env),
		pipelineStages: new PipelineStagesService(dal),
		leadSources: new LeadSourcesService(dal),
		leads: new LeadsService(dal),
		notes: new NotesService(dal),
		documents: new DocumentsService(dal),
		reminders: new RemindersService(dal),
		crmAnalytics: new CrmAnalyticsService(dal),
		crmSettings: new CrmSettingsService(dal),
		waConversation: new ConversationService(dal),
		waTemplate: new TemplateService(dal),
		waCampaign: new CampaignService(dal),
		notifPreferences: new NotificationPreferencesService(dal),
		notification,
		upload: new UploadService(dal, env),
	};
}
 
export type Services = ReturnType<typeof createServices>;