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 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 | import { Module } from '@nestjs/common'; import { MongooseModule } from '@nestjs/mongoose'; import { BullModule } from '@nestjs/bullmq'; // Schemas import { CrmConfiguration, CrmConfigurationSchema, CrmConfigurationVersion, CrmConfigurationVersionSchema, CrmNumberingRule, CrmNumberingRuleSchema, CrmNumberSequence, CrmNumberSequenceSchema, } from './schemas/crm-config.schema'; import { Lead, LeadSchema, LeadSource, LeadSourceSchema, LeadSourceCampaign, LeadSourceCampaignSchema, LeadQualificationFramework, LeadQualificationFrameworkSchema, LeadQualificationResponse, LeadQualificationResponseSchema, LeadScoringModel, LeadScoringModelSchema, LeadScoreHistory, LeadScoreHistorySchema, LeadAssignmentRule, LeadAssignmentRuleSchema, LeadAssignmentExecution, LeadAssignmentExecutionSchema, RoundRobinPool, RoundRobinPoolSchema, RoundRobinMember, RoundRobinMemberSchema, DuplicateDetectionRule, DuplicateDetectionRuleSchema, DuplicateCandidate, DuplicateCandidateSchema, DuplicateMergeHistory, DuplicateMergeHistorySchema, } from './schemas/lead.schema'; import { Account, AccountSchema, Contact, ContactSchema, ContactRelationship, ContactRelationshipSchema, AccountRelationship, AccountRelationshipSchema, SalesTerritory, SalesTerritorySchema, TerritoryMember, TerritoryMemberSchema, SalesTeam, SalesTeamSchema, SalesTeamMember, SalesTeamMemberSchema, } from './schemas/account-contact.schema'; import { SalesPipeline, SalesPipelineSchema, SalesPipelineVersion, SalesPipelineVersionSchema, SalesStage, SalesStageSchema, SalesStageTransition, SalesStageTransitionSchema, } from './schemas/pipeline.schema'; import { Opportunity, OpportunitySchema, OpportunityStageHistory, OpportunityStageHistorySchema, SalesForecast, SalesForecastSchema, ForecastSnapshot, ForecastSnapshotSchema, ForecastAdjustment, ForecastAdjustmentSchema, } from './schemas/opportunity.schema'; import { CrmActivity, CrmActivitySchema, ActivityReminder, ActivityReminderSchema, CrmNote, CrmNoteSchema, CrmEmailMessage, CrmEmailMessageSchema, CrmConversation, CrmConversationSchema, CrmMessage, CrmMessageSchema, } from './schemas/activity.schema'; import { CrmProduct, CrmProductSchema, CrmProductCategory, CrmProductCategorySchema, PriceBook, PriceBookSchema, PriceBookEntry, PriceBookEntrySchema, VolumeTier, VolumeTierSchema, DiscountSchedule, DiscountScheduleSchema, LossReason, LossReasonSchema, } from './schemas/product-pricing.schema'; import { Quotation, QuotationSchema, QuotationLineItem, QuotationLineItemSchema, QuotationSection, QuotationSectionSchema, Proposal, ProposalSchema, ProposalSection, ProposalSectionSchema, ProposalTemplate, ProposalTemplateSchema, } from './schemas/quotation-proposal.schema'; import { Contract, ContractSchema, ContractLineItem, ContractLineItemSchema, ContractMilestone, ContractMilestoneSchema, ContractAmendment, ContractAmendmentSchema, ContractSlaTerm, ContractSlaTermSchema, CustomerOnboarding, CustomerOnboardingSchema, CrmOnboardingChecklistItem, CrmOnboardingChecklistItemSchema, OnboardingTemplate, OnboardingTemplateSchema, CustomerHealthScore, CustomerHealthScoreSchema, } from './schemas/contract-onboarding.schema'; import { WebToLeadForm, WebToLeadFormSchema, WebToLeadSubmission, WebToLeadSubmissionSchema, CrmAutomationRule, CrmAutomationRuleSchema, CrmAutomationLog, CrmAutomationLogSchema, SalesTarget, SalesTargetSchema, CommissionPlan, CommissionPlanSchema, CommissionLog, CommissionLogSchema, CrmImport, CrmImportSchema, CrmExport, CrmExportSchema, } from './schemas/automation-import.schema'; // Services import { CrmConfigService } from './services/crm-config.service'; import { LeadService } from './services/lead.service'; import { AccountContactService } from './services/account-contact.service'; import { OpportunityService } from './services/opportunity.service'; import { ActivityService } from './services/activity.service'; import { ProductPricingService } from './services/product-pricing.service'; import { QuotationContractService } from './services/quotation-contract.service'; import { OnboardingService } from './services/onboarding.service'; import { CrmAutomationService } from './services/crm-automation.service'; import { LeadCaptureService } from './services/lead-capture.service'; import { SalesTargetService } from './services/sales-target.service'; import { CrmDashboardService } from './services/crm-dashboard.service'; import { CrmImportExportService } from './services/crm-import-export.service'; // Controllers import { CrmConfigController } from './controllers/crm-config.controller'; import { LeadController } from './controllers/lead.controller'; import { AccountContactController } from './controllers/account-contact.controller'; import { OpportunityController } from './controllers/opportunity.controller'; import { ActivityController } from './controllers/activity.controller'; import { ProductPricingController } from './controllers/product-pricing.controller'; import { QuotationContractController } from './controllers/quotation-contract.controller'; import { LeadCaptureController } from './controllers/lead-capture.controller'; import { SalesTargetController } from './controllers/sales-target.controller'; import { CrmDashboardController } from './controllers/crm-dashboard.controller'; import { CrmImportExportController } from './controllers/crm-import-export.controller'; // Mobile/Web/Public Portal Controllers import { CrmClientController } from '../../interfaces/web-api/client/crm-client.controller'; import { CrmSalesMobileController } from '../../interfaces/mobile-api/sales/crm-sales-mobile.controller'; import { CrmManagerMobileController } from '../../interfaces/mobile-api/manager/crm-manager-mobile.controller'; import { CrmPublicController } from '../../interfaces/public-api/crm-public.controller'; // Processors import { CrmProcessor } from './processors/crm.processor'; // Core dependencies import { PermissionModule } from '../../platform/permissions/permission.module'; import { FeatureFlagModule } from '../../platform/feature-flags/feature-flag.module'; @Module({ imports: [ MongooseModule.forFeature([ // Config { name: CrmConfiguration.name, schema: CrmConfigurationSchema }, { name: CrmConfigurationVersion.name, schema: CrmConfigurationVersionSchema, }, { name: CrmNumberingRule.name, schema: CrmNumberingRuleSchema }, { name: CrmNumberSequence.name, schema: CrmNumberSequenceSchema }, // Lead { name: Lead.name, schema: LeadSchema }, { name: LeadSource.name, schema: LeadSourceSchema }, { name: LeadSourceCampaign.name, schema: LeadSourceCampaignSchema }, { name: LeadQualificationFramework.name, schema: LeadQualificationFrameworkSchema, }, { name: LeadQualificationResponse.name, schema: LeadQualificationResponseSchema, }, { name: LeadScoringModel.name, schema: LeadScoringModelSchema }, { name: LeadScoreHistory.name, schema: LeadScoreHistorySchema }, { name: LeadAssignmentRule.name, schema: LeadAssignmentRuleSchema }, { name: LeadAssignmentExecution.name, schema: LeadAssignmentExecutionSchema, }, { name: RoundRobinPool.name, schema: RoundRobinPoolSchema }, { name: RoundRobinMember.name, schema: RoundRobinMemberSchema }, { name: DuplicateDetectionRule.name, schema: DuplicateDetectionRuleSchema, }, { name: DuplicateCandidate.name, schema: DuplicateCandidateSchema }, { name: DuplicateMergeHistory.name, schema: DuplicateMergeHistorySchema }, // Account / Contact { name: Account.name, schema: AccountSchema }, { name: Contact.name, schema: ContactSchema }, { name: ContactRelationship.name, schema: ContactRelationshipSchema }, { name: AccountRelationship.name, schema: AccountRelationshipSchema }, { name: SalesTerritory.name, schema: SalesTerritorySchema }, { name: TerritoryMember.name, schema: TerritoryMemberSchema }, { name: SalesTeam.name, schema: SalesTeamSchema }, { name: SalesTeamMember.name, schema: SalesTeamMemberSchema }, // Pipelines { name: SalesPipeline.name, schema: SalesPipelineSchema }, { name: SalesPipelineVersion.name, schema: SalesPipelineVersionSchema }, { name: SalesStage.name, schema: SalesStageSchema }, { name: SalesStageTransition.name, schema: SalesStageTransitionSchema }, // Opportunity { name: Opportunity.name, schema: OpportunitySchema }, { name: OpportunityStageHistory.name, schema: OpportunityStageHistorySchema, }, { name: SalesForecast.name, schema: SalesForecastSchema }, { name: ForecastSnapshot.name, schema: ForecastSnapshotSchema }, { name: ForecastAdjustment.name, schema: ForecastAdjustmentSchema }, // Activities { name: CrmActivity.name, schema: CrmActivitySchema }, { name: ActivityReminder.name, schema: ActivityReminderSchema }, { name: CrmNote.name, schema: CrmNoteSchema }, { name: CrmEmailMessage.name, schema: CrmEmailMessageSchema }, { name: CrmConversation.name, schema: CrmConversationSchema }, { name: CrmMessage.name, schema: CrmMessageSchema }, // Products { name: CrmProduct.name, schema: CrmProductSchema }, { name: CrmProductCategory.name, schema: CrmProductCategorySchema }, { name: PriceBook.name, schema: PriceBookSchema }, { name: PriceBookEntry.name, schema: PriceBookEntrySchema }, { name: VolumeTier.name, schema: VolumeTierSchema }, { name: DiscountSchedule.name, schema: DiscountScheduleSchema }, { name: LossReason.name, schema: LossReasonSchema }, // Quotes & Proposals { name: Quotation.name, schema: QuotationSchema }, { name: QuotationLineItem.name, schema: QuotationLineItemSchema }, { name: QuotationSection.name, schema: QuotationSectionSchema }, { name: Proposal.name, schema: ProposalSchema }, { name: ProposalSection.name, schema: ProposalSectionSchema }, { name: ProposalTemplate.name, schema: ProposalTemplateSchema }, // Contracts & Onboarding { name: Contract.name, schema: ContractSchema }, { name: ContractLineItem.name, schema: ContractLineItemSchema }, { name: ContractMilestone.name, schema: ContractMilestoneSchema }, { name: ContractAmendment.name, schema: ContractAmendmentSchema }, { name: ContractSlaTerm.name, schema: ContractSlaTermSchema }, { name: CustomerOnboarding.name, schema: CustomerOnboardingSchema }, { name: CrmOnboardingChecklistItem.name, schema: CrmOnboardingChecklistItemSchema, }, { name: OnboardingTemplate.name, schema: OnboardingTemplateSchema }, { name: CustomerHealthScore.name, schema: CustomerHealthScoreSchema }, // Automations, Targets, Imports/Exports { name: WebToLeadForm.name, schema: WebToLeadFormSchema }, { name: WebToLeadSubmission.name, schema: WebToLeadSubmissionSchema }, { name: CrmAutomationRule.name, schema: CrmAutomationRuleSchema }, { name: CrmAutomationLog.name, schema: CrmAutomationLogSchema }, { name: SalesTarget.name, schema: SalesTargetSchema }, { name: CommissionPlan.name, schema: CommissionPlanSchema }, { name: CommissionLog.name, schema: CommissionLogSchema }, { name: CrmImport.name, schema: CrmImportSchema }, { name: CrmExport.name, schema: CrmExportSchema }, ]), BullModule.registerQueue({ name: 'crm-processing', }), PermissionModule, FeatureFlagModule, ], controllers: [ CrmConfigController, LeadController, AccountContactController, OpportunityController, ActivityController, ProductPricingController, QuotationContractController, LeadCaptureController, SalesTargetController, CrmDashboardController, CrmImportExportController, CrmClientController, CrmSalesMobileController, CrmManagerMobileController, CrmPublicController, ], providers: [ CrmConfigService, LeadService, AccountContactService, OpportunityService, ActivityService, ProductPricingService, QuotationContractService, OnboardingService, CrmAutomationService, LeadCaptureService, SalesTargetService, CrmDashboardService, CrmImportExportService, CrmProcessor, ], exports: [ CrmConfigService, LeadService, AccountContactService, OpportunityService, ActivityService, ProductPricingService, QuotationContractService, OnboardingService, CrmAutomationService, LeadCaptureService, SalesTargetService, CrmDashboardService, CrmImportExportService, ], }) export class CrmModule {} |