{"version":3,"file":"useSalesVisitData-910b4fac.js","sources":["../../src/components/pages/outlet/crm/subcomponents/ActivityLogEntryCard.vue","../../src/components/pages/outlet/crm/subcomponents/ActivityLogCard.vue","../../src/components/pages/orders/salesvisits/components/CompleteVisitDialog.vue","../../src/components/pages/orders/salesvisits/useSalesVisitData.ts"],"sourcesContent":["\n \n \n \n {{ activityLogEntry.timestampString }}\n \n \n \n {{ activityLogEntry.entityType }}\n \n \n \n \n \n \n \n \n \n \n {{ heading.name }}:\n \n {{ heading.value }}\n \n \n {{ $m.tasks_associated_with }}\n \n {{ activityLogEntry.association.name }}\n \n \n \n \n\n\n\n","\n \n \n \n item.association.icon\"\n @load-next-items=\"chunkCount++\"\n >\n \n \n \n \n \n \n\n\n\n","\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n {{ messages.create }}\n \n \n\n","import api from \"@/app/api\";\nimport apiCache from \"@/app/caching/apiCache\";\nimport CreditTermsCache from \"@/app/caching/caches/creditTermsCache\";\nimport DeliveryAreasCache from \"@/app/caching/caches/deliveryAreasCache\";\nimport GroupsCache from \"@/app/caching/caches/groupsCache\";\nimport LeadsCache from \"@/app/caching/caches/leadsCache\";\nimport OutletRatingsCache from \"@/app/caching/caches/outletRatingsCache\";\nimport OutletSummariesCache from \"@/app/caching/caches/outletSummariesCache\";\nimport SalesAreasCache from \"@/app/caching/caches/salesAreasCache\";\nimport SalesCodesCache from \"@/app/caching/caches/salesCodeCache\";\nimport { BrewManCannotFindEntityError, BrewManError } from \"@/app/errors\";\nimport { EnumDocumentContextType } from \"@/app/services/generated/enums/enumDocumentContextType.generated\";\nimport { EnumSalesVisitAssociatedEntityType } from \"@/app/services/generated/enums/enumSalesVisitAssociatedEntityType.generated\";\nimport type { Group } from \"@/app/services/generated/groupService\";\nimport type { Lead } from \"@/app/services/generated/leadService\";\nimport {\n OrderFilter,\n orderService,\n} from \"@/app/services/generated/orderService\";\nimport type {\n Outlet,\n OutletSummary,\n} from \"@/app/services/generated/outletService\";\nimport { outletService } from \"@/app/services/generated/outletService\";\nimport type { PlannedSalesVisit } from \"@/app/services/generated/salesvisitService\";\nimport {\n PlannedSalesVisitFilter,\n SalesVisitAssociatedEntityFilter,\n SalesVisitLog,\n SalesVisitLogFilter,\n salesVisitService,\n} from \"@/app/services/generated/salesvisitService\";\nimport Guid from \"@/app/types/common/guid\";\nimport { withLoading } from \"@/components/composables/componentTools\";\nimport { makeDeepRef } from \"@/components/composables/reactivityTypes\";\nimport type { LocalDate } from \"@js-joda/core\";\nimport type { Ref } from \"vue\";\nimport { watch, computed } from \"vue\";\nimport messages, {\n appendOrdinalSuffix,\n translate,\n translateWithParams,\n} from \"@/plugins/i18n\";\nimport { EnumBmEntityType } from \"@/app/services/generated/enums/enumBmEntityType.generated\";\nimport { ActivityLogType } from \"@/components/pages/outlet/crm/subcomponents/ActivityLogCard.vue\";\nimport { contactsMenu } from \"@/app/ui/navigation/contactsMenu\";\nimport { salesMenu } from \"@/app/ui/navigation/salesMenu\";\nimport { EnumTaskRepeatBasis } from \"@/app/services/generated/enums/enumTaskRepeatBasis.generated\";\nimport { EnumDayOfWeek } from \"@/app/services/generated/enums/enumDayOfWeek.generated\";\nimport { showConfirmationDialog } from \"@/components/composables/promptDialogs\";\nimport { EnumDialogType } from \"@/components/dialogs/DialogTypes\";\nimport { customColoursLight } from \"@/plugins/vuetify\";\nimport type { Location } from \"vue-router\";\nimport { showModalDialog } from \"@/components/platform/common/showModalDialog\";\nimport CompleteVisitDialog from \"@/components/pages/orders/salesvisits/components/CompleteVisitDialog.vue\";\nimport { openMapView } from \"@da/components/mixins/BmExternalLinks\";\nimport Key from \"@/app/types/common/key\";\n\nexport type SalesVisitWithEntity = {\n salesVisit: PlannedSalesVisit;\n entity: AssociatedEntityDetails;\n sequence?: number;\n};\n\nexport interface AssociatedEntityDetails {\n id: Guid;\n name: string;\n code: string | null;\n addressLine1: string;\n addressLine2: string;\n addressLine3: string;\n addressLine4: string;\n addressLine5: string;\n addressLine6: string;\n addressPostcode: string;\n telephoneNumber: string;\n emailAddress: string;\n salesAreaId: Guid | null;\n salesCodeId: Guid | null;\n entityType: EnumSalesVisitAssociatedEntityType;\n latitude: number | null;\n longitude: number | null;\n}\n\nexport function getRepeatBasisText(\n plannedSalesVisit: PlannedSalesVisit,\n basis?: EnumTaskRepeatBasis\n) {\n const currentBasis = basis ?? plannedSalesVisit.repeatBasis;\n const dayOfWeekValue = plannedSalesVisit.date?.dayOfWeek().value();\n\n const dayOfWeekTranslated = dayOfWeekValue\n ? EnumDayOfWeek.getByKey(dayOfWeekValue).translation\n : \"\";\n\n return translate(Key.fromString(currentBasis.translationKey), {\n day: dayOfWeekTranslated,\n repeatParameter: plannedSalesVisit.repeatParameter,\n ordinalNumber: appendOrdinalSuffix(plannedSalesVisit.repeatParameter),\n }).toString();\n}\n\nexport function getDetailsFromOutlet(entity: Readonly) {\n return {\n id: entity.id,\n name: entity.displayName,\n code: entity.code,\n addressLine1: entity.mainAddressLine1,\n addressLine2: entity.mainAddressLine2,\n addressLine3: entity.mainAddressLine3,\n addressLine4: entity.mainAddressLine4,\n addressLine5: entity.mainAddressLine5,\n addressLine6: entity.mainAddressLine6,\n addressPostcode: entity.mainAddressPostcode,\n telephoneNumber: entity.telephoneNumber,\n emailAddress: entity.emailAddress,\n salesAreaId: entity.salesAreaId,\n salesCodeId: entity.salesCodeId,\n entityType: EnumSalesVisitAssociatedEntityType.outlet,\n latitude: entity.mainLatitude,\n longitude: entity.mainLongitude,\n };\n}\n\nexport function getDetailsFromGroup(entity: Readonly) {\n return {\n id: entity.id,\n name: entity.name,\n code: entity.readOnly.code,\n addressLine1: entity.mainAddressLine1,\n addressLine2: entity.mainAddressLine2,\n addressLine3: entity.mainAddressLine3,\n addressLine4: entity.mainAddressLine4,\n addressLine5: entity.mainAddressLine5,\n addressLine6: entity.mainAddressLine6,\n addressPostcode: entity.mainAddressPostcode,\n telephoneNumber: entity.telephoneNumber,\n emailAddress: entity.emailAddress,\n salesAreaId: null,\n salesCodeId: entity.salesCodeId,\n entityType: EnumSalesVisitAssociatedEntityType.group,\n latitude: entity.readOnly.mainLatitude,\n longitude: entity.readOnly.mainLongitude,\n };\n}\n\nexport function getDetailsFromLead(entity: Readonly) {\n return {\n id: entity.id,\n name: entity.businessName,\n code: null,\n addressLine1: entity.addressLine1,\n addressLine2: entity.addressLine2,\n addressLine3: entity.addressLine3,\n addressLine4: entity.addressLine4,\n addressLine5: entity.addressLine5,\n addressLine6: entity.addressLine6,\n addressPostcode: entity.addressPostcode,\n telephoneNumber: entity.telephoneNumber,\n emailAddress: entity.emailAddress,\n salesAreaId: entity.salesAreaId,\n salesCodeId: entity.salesCodeId,\n entityType: EnumSalesVisitAssociatedEntityType.lead,\n latitude: entity.readOnly.latitude,\n longitude: entity.readOnly.longitude,\n };\n}\n\nexport function getSalesVisitEntityColour(\n entityType: EnumSalesVisitAssociatedEntityType\n) {\n switch (entityType) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n return customColoursLight.mediumBlue;\n case EnumSalesVisitAssociatedEntityType.group:\n return customColoursLight.darkBlue;\n case EnumSalesVisitAssociatedEntityType.lead:\n return customColoursLight.lightBlue;\n default:\n return null;\n }\n}\n\nexport function getSalesVisitEntityLocation(\n entityType: EnumSalesVisitAssociatedEntityType,\n entityId: Guid\n): Location | undefined {\n switch (entityType) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n return contactsMenu.viewOutlet(entityId);\n case EnumSalesVisitAssociatedEntityType.group:\n return contactsMenu.viewOutletGroup(entityId);\n case EnumSalesVisitAssociatedEntityType.lead:\n return salesMenu.leads.viewLead(entityId);\n }\n}\n\nexport function joinPlannedVisitWithAssociatedEntity(\n visit: PlannedSalesVisit,\n outlets: OutletSummariesCache,\n groups: GroupsCache,\n leads: LeadsCache,\n sequence?: number\n): SalesVisitWithEntity {\n switch (visit.associatedEntityType) {\n case EnumSalesVisitAssociatedEntityType.outlet: {\n const outlet = outlets.getById(visit.associatedEntityId);\n\n if (!outlet) {\n throw new BrewManCannotFindEntityError(\n EnumBmEntityType.outlet,\n visit.associatedEntityId\n );\n }\n\n return {\n salesVisit: visit,\n entity: getDetailsFromOutlet(outlet),\n sequence: visit.readOnly.doesFitInRoute ? sequence : undefined,\n };\n }\n case EnumSalesVisitAssociatedEntityType.group: {\n const group = groups.getById(visit.associatedEntityId);\n\n if (!group) {\n throw new BrewManCannotFindEntityError(\n EnumBmEntityType.outletGroup,\n visit.associatedEntityId\n );\n }\n\n return {\n salesVisit: visit,\n entity: getDetailsFromGroup(group),\n sequence: visit.readOnly.doesFitInRoute ? sequence : undefined,\n };\n }\n case EnumSalesVisitAssociatedEntityType.lead: {\n const lead = leads.getById(visit.associatedEntityId);\n\n if (!lead) {\n throw new BrewManCannotFindEntityError(\n EnumBmEntityType.lead,\n visit.associatedEntityId\n );\n }\n\n return {\n salesVisit: visit,\n entity: getDetailsFromLead(lead),\n sequence: visit.readOnly.doesFitInRoute ? sequence : undefined,\n };\n }\n default:\n throw new BrewManError(\n translateWithParams(\"sales_visit_unknown_entity_type\", {\n entity: visit.associatedEntityType.value,\n id: visit.associatedEntityId.toString(),\n }).toString()\n );\n }\n}\n\nexport async function deleteVisit(id: Guid) {\n const shouldDeleteVisit = await showConfirmationDialog(\n messages.prompt_confirm_title,\n messages.sales_visit_delete_visit_prompt,\n {\n type: EnumDialogType.error,\n }\n );\n\n if (shouldDeleteVisit) {\n await salesVisitService.deletePlannedSalesVisit(api.tenantId, id);\n }\n\n return shouldDeleteVisit;\n}\n\nexport async function createVisitLogFromVisit(visit: PlannedSalesVisit) {\n const newVisitLog = new SalesVisitLog();\n newVisitLog.header.id = Guid.create();\n newVisitLog.header.date = visit.date;\n newVisitLog.header.associatedEntityType = visit.associatedEntityType;\n newVisitLog.header.associatedEntityId = visit.associatedEntityId;\n newVisitLog.header.userId = visit.userId;\n\n await salesVisitService.saveSalesVisitLog(api.tenantId, newVisitLog);\n\n return await salesVisitService.getSalesVisitLog(\n api.tenantId,\n newVisitLog.header.id\n );\n}\n\nexport async function completeSalesVisitLog(\n plannedSalesVisit: PlannedSalesVisit | null\n) {\n if (plannedSalesVisit === null) {\n throw new BrewManError(messages.sales_visit_planned_sales_visit_not_found);\n }\n\n if (plannedSalesVisit?.repeatBasis === EnumTaskRepeatBasis.none) {\n if (\n await showConfirmationDialog(\n messages.prompt_confirm_title,\n messages.sales_visit_complete_confirm\n )\n ) {\n await salesVisitService.deletePlannedSalesVisit(\n api.tenantId,\n plannedSalesVisit.id\n );\n }\n } else {\n await showModalDialog(\n CompleteVisitDialog,\n {\n props: {\n plannedSalesVisitId: plannedSalesVisit!.id,\n },\n }\n );\n }\n}\n\nexport function openVisitNavigation(\n salesVisitWithEntity: SalesVisitWithEntity\n) {\n if (\n salesVisitWithEntity.entity.latitude === null ||\n salesVisitWithEntity.entity.longitude == null\n ) {\n openMapView(\n salesVisitWithEntity.entity.addressLine2,\n salesVisitWithEntity.entity.addressLine3,\n salesVisitWithEntity.entity.addressPostcode\n );\n return;\n }\n openMapView(\n salesVisitWithEntity.entity.latitude.toString(),\n salesVisitWithEntity.entity.longitude.toString()\n );\n}\n\nexport async function getPlannedVisitFromVisitLog(\n salesVisitLog: SalesVisitLog\n) {\n const filter = new PlannedSalesVisitFilter();\n filter.fromDate = salesVisitLog.header.date;\n filter.toDate = salesVisitLog.header.date;\n\n const entityFilter = new SalesVisitAssociatedEntityFilter();\n entityFilter.entityId = salesVisitLog.header.associatedEntityId;\n entityFilter.entityType = salesVisitLog.header.associatedEntityType;\n\n filter.limitAssociatedEntities = [entityFilter];\n filter.limitUserIds = [salesVisitLog.header.userId];\n\n const result = await salesVisitService.getPlannedSalesVisitsByFilter(\n api.tenantId,\n filter\n );\n\n return result.matchingCount === 1 ? result.plannedSalesVisits[0] : null;\n}\n\nexport async function getPlannedVisitByDateAndUser(\n fromDate: LocalDate,\n toDate: LocalDate,\n userIds: Guid[]\n) {\n const filter = new PlannedSalesVisitFilter();\n filter.fromDate = fromDate;\n filter.toDate = toDate;\n filter.limitUserIds = userIds;\n\n return await salesVisitService.getPlannedSalesVisitsByFilter(\n api.tenantId,\n filter\n );\n}\n\nexport function getRoutingLocation(\n associatedEntityType: EnumSalesVisitAssociatedEntityType,\n associatedEntityId: Guid\n) {\n switch (associatedEntityType) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n return contactsMenu.viewOutlet(associatedEntityId);\n case EnumSalesVisitAssociatedEntityType.group:\n return contactsMenu.viewOutletGroup(associatedEntityId);\n case EnumSalesVisitAssociatedEntityType.lead:\n return salesMenu.leads.viewLead(associatedEntityId);\n default: {\n throw new BrewManError(\n translateWithParams(\"sales_visit_unknown_entity_type\", {\n entity: associatedEntityType.value,\n id: associatedEntityId.toString(),\n }).toString()\n );\n }\n }\n}\n\nexport default function useSalesVisitData(\n associatedEntityType: Ref>,\n associatedEntityId: Ref>,\n userId: Ref>,\n date: Ref>\n) {\n const lastOrderDate = makeDeepRef(null);\n const lastVisitDate = makeDeepRef(null);\n\n const associatedOutlet = makeDeepRef(null);\n const associatedGroup = makeDeepRef(null);\n const associatedLead = makeDeepRef(null);\n\n const loadLastOrder = async () => {\n if (\n associatedEntityType.value === EnumSalesVisitAssociatedEntityType.lead\n ) {\n lastOrderDate.value = null;\n return;\n }\n\n const filter = new OrderFilter();\n\n if (\n associatedEntityType.value === EnumSalesVisitAssociatedEntityType.outlet\n ) {\n filter.singleOutletId = associatedEntityId.value;\n } else if (\n associatedEntityType.value === EnumSalesVisitAssociatedEntityType.group\n ) {\n filter.singleGroupId = associatedEntityId.value;\n }\n\n filter.maximumResults = 1;\n\n const result = await orderService.getOrdersByFilter(\n api.tenantId,\n filter,\n false\n );\n\n lastOrderDate.value =\n result.matchingCount === 0 ? null : result.orders[0].header.despatchDate;\n };\n\n const associatedEntityFilter = computed(() => {\n const entityFilter = new SalesVisitAssociatedEntityFilter();\n entityFilter.entityId = associatedEntityId.value!;\n\n switch (associatedEntityType.value) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n entityFilter.entityType = EnumSalesVisitAssociatedEntityType.outlet;\n\n break;\n case EnumSalesVisitAssociatedEntityType.group:\n entityFilter.entityType = EnumSalesVisitAssociatedEntityType.group;\n\n break;\n case EnumSalesVisitAssociatedEntityType.lead:\n entityFilter.entityType = EnumSalesVisitAssociatedEntityType.lead;\n break;\n default: {\n throw new BrewManError(\n `Unrecognized entity type: '${associatedEntityType.value}'`\n );\n }\n }\n\n return entityFilter;\n });\n\n const loadLatestVisitLog = async () => {\n const filter = new SalesVisitLogFilter();\n filter.limitAssociatedEntities = [associatedEntityFilter.value];\n filter.limitUserIds = [userId.value];\n filter.toDate = date.value.minusDays(1);\n filter.maximumResults = 1;\n\n const result = await salesVisitService.getSalesVisitLogsByFilter(\n api.tenantId,\n filter\n );\n\n lastVisitDate.value =\n result.matchingCount === 0 ? null : result.salesVisitLogs[0].header.date;\n };\n\n const cache = apiCache.buildCacheSet({\n outlets: OutletSummariesCache,\n groups: GroupsCache,\n leads: LeadsCache,\n salesCodes: SalesCodesCache,\n salesAreas: SalesAreasCache,\n deliveryAreas: DeliveryAreasCache,\n creditTerms: CreditTermsCache,\n outletRatings: OutletRatingsCache,\n });\n\n const documentStoreContext = computed(() => {\n switch (associatedEntityType.value) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n return EnumDocumentContextType.outlet;\n case EnumSalesVisitAssociatedEntityType.group:\n return EnumDocumentContextType.outletGroup;\n case EnumSalesVisitAssociatedEntityType.lead:\n return EnumDocumentContextType.lead;\n default: {\n throw new BrewManError(\n translateWithParams(\"sales_visit_unknown_entity_type\", {\n entity: associatedEntityType.value.value,\n id: associatedEntityId.toString(),\n }).toString()\n );\n }\n }\n });\n\n const logCommunicationType = computed(() => {\n switch (associatedEntityType.value) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n return EnumBmEntityType.outlet;\n case EnumSalesVisitAssociatedEntityType.group:\n return EnumBmEntityType.outletGroup;\n case EnumSalesVisitAssociatedEntityType.lead:\n return EnumBmEntityType.lead;\n default: {\n throw new BrewManError(\n translateWithParams(\"sales_visit_unknown_entity_type\", {\n entity: associatedEntityType.value.value,\n id: associatedEntityId.toString(),\n }).toString()\n );\n }\n }\n });\n\n const activityLogType = computed(() => {\n switch (associatedEntityType.value) {\n case EnumSalesVisitAssociatedEntityType.outlet:\n return ActivityLogType.outlet;\n case EnumSalesVisitAssociatedEntityType.group:\n return null;\n case EnumSalesVisitAssociatedEntityType.lead:\n return ActivityLogType.lead;\n default: {\n throw new BrewManError(\n translateWithParams(\"sales_visit_unknown_entity_type\", {\n entity: associatedEntityType.value.value,\n id: associatedEntityId.toString(),\n }).toString()\n );\n }\n }\n });\n\n const refresh = withLoading(async () => {\n if (\n associatedEntityId.value === null ||\n associatedEntityId.value.isEmpty()\n ) {\n return;\n }\n\n await Promise.all([cache.update(), loadLastOrder(), loadLatestVisitLog()]);\n\n associatedOutlet.value =\n associatedEntityType.value === EnumSalesVisitAssociatedEntityType.outlet\n ? await outletService.getOutlet(api.tenantId, associatedEntityId.value)\n : null;\n\n associatedGroup.value =\n associatedEntityType.value === EnumSalesVisitAssociatedEntityType.group\n ? (cache.groups.getById(associatedEntityId.value) as Group)\n : null;\n\n associatedLead.value =\n associatedEntityType.value === EnumSalesVisitAssociatedEntityType.lead\n ? (cache.leads.getById(associatedEntityId.value) as Lead)\n : null;\n });\n\n watch([associatedEntityId, userId], async () => await refresh(), {\n immediate: true,\n });\n\n return {\n lastOrderDate,\n lastVisitDate,\n associatedOutlet,\n associatedGroup,\n associatedLead,\n documentStoreContext,\n cache,\n logCommunicationType,\n activityLogType,\n refresh,\n };\n}\n"],"names":["ActivityLogType","ref"],"mappings":"shDA0DA,MAAA,YAAA,gBAAA,CACA,KAAA,uBACA,WAAA,CAAA,MAAA,EACA,MAAA,CACA,iBAAA,CACA,KAAA,OACA,SAAA,EACA,CACA,EACA,OAAA,CACA,MAAA,CAAA,UAAA,SACA,CACA,CAAA,olDCvBA,IAAA,iBAAAA,mBACAA,iBAAA,iBAAA,OAAA,CAAA,EAAA,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