Subversion Repositories SmartDukaan

Rev

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

Rev 37388 Rev 37409
Line 1... Line 1...
1
package com.spice.profitmandi.service.whatsapp;
1
package com.spice.profitmandi.service.whatsapp;
2
 
2
 
3
/**
3
/**
4
 * The business event behind a WhatsApp send, named by the caller so each provider can decide how to
4
 * The business event behind a WhatsApp send.
5
 * render it.
-
 
6
 *
5
 *
7
 * <p>Gupshup and cpass ignore this — they send free-form text either way. BotPenguin uses it to pick a
6
 * <p>Every send goes out as a Meta-approved template, and each flow names exactly one template via
-
 
7
 * {@code BotPenguinWhatsappService.FLOW_TEMPLATES}. The indirection is kept rather than having call
8
 * Meta-approved template, because a template-first gateway cannot send the raw string the legacy
8
 * sites name a template directly so that swapping the template behind a business event — a new
9
 * providers accept. Without this argument the provider would have no way to tell an invoice from a
9
 * approved version, a language variant — is a one-line change in the map instead of an edit at every
-
 
10
 * call site.</p>
-
 
11
 *
-
 
12
 * <p>{@link #GENERIC} is the ad-hoc single-variable fallback. Nothing routine should use it: a message
-
 
13
 * worth sending regularly is worth its own template, because a template's variable layout is what
10
 * payment link, and every call site would have to change when the provider switched.</p>
14
 * makes the parameter count checkable before dispatch.</p>
11
 */
15
 */
12
public enum WhatsappFlow {
16
public enum WhatsappFlow {
13
    INVOICE,
17
    INVOICE,
14
    PAYMENT_LINK,
18
    PAYMENT_LINK,
15
    ADLD,
19
    ADLD,
-
 
20
    OFFER,
-
 
21
    BIDDING_LIVE,
-
 
22
    LOAN_ALERT,
-
 
23
    ORDER_DELIVERED,
16
    GENERIC
24
    GENERIC
17
}
25
}