addPromitionToDatabase method

  1. @override
Future<void> addPromitionToDatabase (
  1. PromotionAdditionRequest req
)
override

Implementation

@override
Future<void> addPromitionToDatabase(PromotionAdditionRequest req) async {
  await Future.delayed(Duration(milliseconds: 200));
  if (cardDatabase.containsKey(req.targetCardId)) {
    cardDatabase[req.targetCardId].promotions.add(req.promotionData);
  } else {
    throw Exception('The credit card is not found');
  }
}