use of model.banking.Account in project amos-ss17-alexa by c-i-ber.
the class BlockCardService method onIntent.
@Override
public SpeechletResponse onIntent(SpeechletRequestEnvelope<IntentRequest> requestEnvelope) {
IntentRequest request = requestEnvelope.getRequest();
Session session = requestEnvelope.getSession();
// TODO: Use account later to actually block a card
Account account = AccountAPI.getAccount(ACCOUNT_ID);
if (request.getIntent().getName().equals(YES_INTENT)) {
String cardNumberObj = (String) session.getAttribute("BlockCardService.CardNumber");
if (cardNumberObj != null) {
long cardNumber = Long.parseLong(cardNumberObj);
return getResponse(BLOCK_CARD, "Karte " + cardNumberObj + " wurde gesperrt.");
}
return null;
} else if (request.getIntent().getName().equals(NO_INTENT)) {
session.setAttribute("BlockCardService.CardNumber", null);
return getResponse(BLOCK_CARD, "Okay, tschüss.");
} else if (request.getIntent().getName().equals(BLOCK_CARD_INTENT)) {
String bankCardNumber = request.getIntent().getSlot("BankCardNumber").getValue();
if (bankCardNumber == null) {
return getAskResponse(BLOCK_CARD, "Wie lautet die Nummber der Karte?");
} else {
session.setAttribute("BlockCardService.CardNumber", bankCardNumber);
return getAskResponse(BLOCK_CARD, "Möchten Sie die Karte " + bankCardNumber + " wirklich sperren?");
}
}
return null;
}
use of model.banking.Account in project amos-ss17-alexa by c-i-ber.
the class AccountFactory method createSavingsAccount.
private Account createSavingsAccount() {
String accountNumber = getRandomAccountNumber();
Account newDemoSavingsAccount = null;
if (!existAccount(accountNumber)) {
newDemoSavingsAccount = AccountAPI.createAccount(accountNumber, ACCOUNT_BALANCE_DEMO, ACCOUNT_OPENING_DATE_DEMO);
}
return newDemoSavingsAccount;
}
use of model.banking.Account in project amos-ss17-alexa by c-i-ber.
the class AccountFactory method saveContactAccounts.
private void saveContactAccounts(List<Account> contactAccounts) {
String[] names = { "bob", "sandra", "lucas" };
int i = 0;
for (Account contactAccount : contactAccounts) {
Contact c = new Contact();
c.setAccountNumber(contactAccount.getNumber());
c.setName(names[i]);
c.setIban(contactAccount.getIban());
dynamoDbMapper.save(c);
i++;
}
}
use of model.banking.Account in project amos-ss17-alexa by c-i-ber.
the class AccountFactory method createContactsAccount.
private List<Account> createContactsAccount() {
List<Account> contactAccounts = new ArrayList<>();
for (int i = 0; i < 3; i++) {
String accountNumber = getRandomAccountNumber();
Account contactAccount = AccountAPI.createAccount(accountNumber, ACCOUNT_BALANCE_DEMO, ACCOUNT_OPENING_DATE_DEMO);
contactAccounts.add(contactAccount);
}
return contactAccounts;
}
use of model.banking.Account in project amos-ss17-alexa by c-i-ber.
the class AccountFactory method createDemoAccount.
private Account createDemoAccount() {
String accountNumber = getRandomAccountNumber();
Account newDemoAccount = null;
if (!existAccount(accountNumber)) {
newDemoAccount = AccountAPI.createAccount(accountNumber, ACCOUNT_BALANCE_DEMO, ACCOUNT_OPENING_DATE_DEMO);
}
return newDemoAccount;
}
Aggregations