Subversion Repositories SmartDukaan

Rev

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

Rev 37794 Rev 37799
Line 452... Line 452...
452
        return botPenguin.send(WhatsappFlow.ADLD, mobile, Collections.singletonList(invoiceNumber),
452
        return botPenguin.send(WhatsappFlow.ADLD, mobile, Collections.singletonList(invoiceNumber),
453
                mediaUrl, fileName, WhatsappMessageType.DOCUMENT);
453
                mediaUrl, fileName, WhatsappMessageType.DOCUMENT);
454
    }
454
    }
455
 
455
 
456
    @Override
456
    @Override
457
    public boolean sendOfferRadar(String mobile, String regionSummary, int offersAdded,
457
    public boolean sendOfferRadar(String mobile, String regionSummary, int programsAdded,
458
                                  int schemesAdded, int revisions, int endingSoon) throws Exception {
458
                                  int revisions, int endingSoon) throws Exception {
459
        // No isProd guard here. Recipient scoping for this digest is handled
459
        // No isProd guard here. Recipient scoping for this digest is handled
460
        // upstream by OfferRadarNotificationController — the file holds the
460
        // upstream by OfferRadarNotificationController — the file holds the
461
        // roster inline (a hardcoded test mobile during smoke-testing, or the
461
        // roster inline (a hardcoded test mobile during smoke-testing, or the
462
        // full HO user list after the toggle is flipped for prod). That
462
        // full HO user list after the toggle is flipped for prod). That
463
        // upstream toggle is the single audience gate; adding another
463
        // upstream toggle is the single audience gate; adding another
464
        // env-scoped guard here would just make staging sends silently disappear.
464
        // env-scoped guard here would just make staging sends silently disappear.
465
        // Meta rejects empty parameters, so an empty region string is normalised
465
        // Meta rejects empty parameters, so an empty region string is normalised
466
        // to "-" before it reaches the gateway. Counts render as decimal strings.
466
        // to "-" before it reaches the gateway. Counts render as decimal strings.
-
 
467
        // Offers and schemes are combined into a single programsAdded number
-
 
468
        // upstream, matching the Utility-category template body — see the
-
 
469
        // template rewrite rationale on NotificationService#sendOfferRadar.
467
        String safeRegion = (regionSummary == null || regionSummary.isEmpty()) ? "-" : regionSummary;
470
        String safeRegion = (regionSummary == null || regionSummary.isEmpty()) ? "-" : regionSummary;
468
        return botPenguin.send(WhatsappFlow.OFFER_RADAR, mobile,
471
        return botPenguin.send(WhatsappFlow.OFFER_RADAR, mobile,
469
                Arrays.asList(
472
                Arrays.asList(
470
                        safeRegion,
473
                        safeRegion,
471
                        Integer.toString(offersAdded),
474
                        Integer.toString(programsAdded),
472
                        Integer.toString(schemesAdded),
-
 
473
                        Integer.toString(revisions),
475
                        Integer.toString(revisions),
474
                        Integer.toString(endingSoon)),
476
                        Integer.toString(endingSoon)),
475
                null, null, null);
477
                null, null, null);
476
    }
478
    }
477
 
479