Subversion Repositories SmartDukaan

Rev

Rev 37783 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37783 Rev 37991
Line 1389... Line 1389...
1389
        lead.setColor(Boolean.TRUE.equals(body.conversionHigh) ? "Green" : "Yellow");
1389
        lead.setColor(Boolean.TRUE.equals(body.conversionHigh) ? "Green" : "Yellow");
1390
        lead.setSource(latin1Safe(body.source == null || body.source.trim().isEmpty()
1390
        lead.setSource(latin1Safe(body.source == null || body.source.trim().isEmpty()
1391
                ? "LMS Dashboard" : body.source.trim()));
1391
                ? "LMS Dashboard" : body.source.trim()));
1392
        lead.setCreatedTimestamp(LocalDateTime.now());
1392
        lead.setCreatedTimestamp(LocalDateTime.now());
1393
        lead.setUpdatedTimestamp(LocalDateTime.now());
1393
        lead.setUpdatedTimestamp(LocalDateTime.now());
1394
        lead.setCreatedBy(me.getFirstName() + " " + me.getLastName());
1394
        lead.setCreatedBy(me.getFullName());
1395
        lead.setAuthId(me.getId());
1395
        lead.setAuthId(me.getId());
1396
        // The record screen reads the business name off user.lead.outlet_name. Until now it was only
1396
        // The record screen reads the business name off user.lead.outlet_name. Until now it was only
1397
        // written to lead_detail below — a call that throws for every lead created here, because the
1397
        // written to lead_detail below — a call that throws for every lead created here, because the
1398
        // legacy detail path demands store photos this form deliberately does not collect — so the
1398
        // legacy detail path demands store photos this form deliberately does not collect — so the
1399
        // name the agent typed was silently dropped and the Business row rendered blank.
1399
        // name the agent typed was silently dropped and the Business row rendered blank.
Line 1493... Line 1493...
1493
        out.put("ok", true);
1493
        out.put("ok", true);
1494
        out.put("leadId", lead.getId());
1494
        out.put("leadId", lead.getId());
1495
        out.put("lmsCode", lead.getLmsCode());
1495
        out.put("lmsCode", lead.getLmsCode());
1496
        out.put("assignmentStatus", lead.getAssignmentStatus());
1496
        out.put("assignmentStatus", lead.getAssignmentStatus());
1497
        out.put("ownerName", assignment != null && assignment.bm != null
1497
        out.put("ownerName", assignment != null && assignment.bm != null
1498
                ? assignment.bm.getFirstName() + " " + assignment.bm.getLastName() : null);
1498
                ? assignment.bm.getFullName() : null);
1499
        out.put("geoLink", geoLink);
1499
        out.put("geoLink", geoLink);
1500
        LOGGER.info("LMS lead {} created ({}) by auth {} — region {} status {}",
1500
        LOGGER.info("LMS lead {} created ({}) by auth {} — region {} status {}",
1501
                lead.getId(), lead.getLmsCode(), me.getId(), lead.getRegionCode(), lead.getAssignmentStatus());
1501
                lead.getId(), lead.getLmsCode(), me.getId(), lead.getRegionCode(), lead.getAssignmentStatus());
1502
        return responseSender.ok(out);
1502
        return responseSender.ok(out);
1503
    }
1503
    }