Subversion Repositories SmartDukaan

Rev

Rev 36789 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 36789 Rev 36792
Line 923... Line 923...
923
        LeadDetail leadDetail = leadDetailRepository.selectByLeadId(createLeadActivityRequest.getId());
923
        LeadDetail leadDetail = leadDetailRepository.selectByLeadId(createLeadActivityRequest.getId());
924
 
924
 
925
        // Geo gate: required for follow-up / finalized (anything that schedules
925
        // Geo gate: required for follow-up / finalized (anything that schedules
926
        // a visit or beat slot). For notInterested (close-out) no geo / no beat
926
        // a visit or beat slot). For notInterested (close-out) no geo / no beat
927
        // is needed — only the activity (status + reason + remark) is saved.
927
        // is needed — only the activity (status + reason + remark) is saved.
-
 
928
        // Non-sales assignees (BGC / other internal hand-offs) also bypass the
-
 
929
        // gate — those are just routing the lead to another department's queue
-
 
930
        // and don't carry a beat-day attachment.
-
 
931
        int assignToId = createLeadActivityRequest.getAssignTo();
-
 
932
        boolean assigneeIsSales = assignToId > 0
-
 
933
                && positionRepository.hasCategory(assignToId, ProfitMandiConstants.TICKET_CATEGORY_SALES);
928
        if (createLeadActivityRequest.getStatus() != LeadStatus.notInterested) {
934
        if (createLeadActivityRequest.getStatus() != LeadStatus.notInterested && assigneeIsSales) {
929
            LeadLiveLocation approvedGeo = leadLiveLocationRepository.selectApprovedByLeadId(createLeadActivityRequest.getId());
935
            LeadLiveLocation approvedGeo = leadLiveLocationRepository.selectApprovedByLeadId(createLeadActivityRequest.getId());
930
            if (approvedGeo == null) {
936
            if (approvedGeo == null) {
931
                throw new ProfitMandiBusinessException("Lead", "", "Live geo-location for this lead has not been approved yet. Please approve the geo-location before editing.");
937
                throw new ProfitMandiBusinessException("Lead", "", "Live geo-location for this lead has not been approved yet. Please approve the geo-location before editing.");
932
            }
938
            }
933
        }
939
        }