Proof of concept
This commit is contained in:
84
proof_of_concept/credit_cards.py
Normal file
84
proof_of_concept/credit_cards.py
Normal file
@@ -0,0 +1,84 @@
|
||||
from dataclasses import dataclass
|
||||
from typing import NamedTuple, Tuple
|
||||
|
||||
from collections.abc import Sequence
|
||||
|
||||
from enum import Enum, auto
|
||||
|
||||
class CardIssuer(Enum):
|
||||
AmericanExpress="American Express"
|
||||
|
||||
class SignUpBonus(NamedTuple):
|
||||
points: int
|
||||
time_months: int
|
||||
spend: int
|
||||
|
||||
class PointsCategory(Enum):
|
||||
Hotel=auto
|
||||
Travel=auto
|
||||
Delta=auto
|
||||
Gas=auto
|
||||
Restaurant=auto
|
||||
SuperMarket=auto
|
||||
|
||||
class PointsType(Enum):
|
||||
CashBack=auto
|
||||
DeltaSkyMiles="Delta SkyMiles®"
|
||||
|
||||
|
||||
@dataclass
|
||||
class CreditCard:
|
||||
issuer: CardIssuer
|
||||
card_name: str
|
||||
annual_fee: int
|
||||
signup_bonus: SignUpBonus
|
||||
points_type: PointsType
|
||||
default_multiplier: float
|
||||
category_multipliers: Sequence[Tuple[PointsCategory, float]]
|
||||
other: Sequence[str]
|
||||
|
||||
|
||||
credit_cards = [
|
||||
CreditCard(
|
||||
CardIssuer.AmericanExpress,
|
||||
"Delta SkyMiles® Reserve American Express Card",
|
||||
650,
|
||||
SignUpBonus(70000, 6, 5000),
|
||||
PointsType.DeltaSkyMiles,
|
||||
1,
|
||||
[
|
||||
(PointsCategory.Delta, 3)
|
||||
],
|
||||
[
|
||||
"15 Visits per Medallion® Year to the Delta Sky Club® when flying Delta",
|
||||
"$2,500 Medallion® Qualification Dollars with MQD Headstart each Medallion Qualification Year and earn $1 MQD for each $10 in purchases",
|
||||
"$240 Resy Credit",
|
||||
"$120 Rideshare Credit",
|
||||
"15% off when using miles to book Award Travel",
|
||||
]
|
||||
),
|
||||
CreditCard(
|
||||
CardIssuer.AmericanExpress,
|
||||
"Delta SkyMiles® Gold American Express Card",
|
||||
150,
|
||||
SignUpBonus(50000, 6, 2000),
|
||||
PointsType.DeltaSkyMiles,
|
||||
1,
|
||||
[
|
||||
(PointsCategory.Delta, 3)
|
||||
(PointsCategory.Restaurant, 2),
|
||||
(PointsCategory.SuperMarket, 2),
|
||||
],
|
||||
[
|
||||
"15% off when using miles to book Award Travel",
|
||||
"$200 Delta Flight Credit: After you spend $10,000 in purchases on your Card in a calendar year, you can receive a $200 Delta Flight Credit to use toward future travel.",
|
||||
"$100 Delta Stays Credit: Get up to $100 back per year as a statement credit after using your Delta SkyMiles® Gold American Express Card to book prepaid hotels or vacation rentals through Delta Stays on delta.com.",
|
||||
]
|
||||
)
|
||||
]
|
||||
|
||||
|
||||
card_names_by_issuer = {issuer: [] for issuer in CardIssuer}
|
||||
|
||||
for card in credit_cards:
|
||||
card_names_by_issuer[card.issuer].append(card.card_name)
|
||||
Reference in New Issue
Block a user