Skip to content

Commit

Permalink
Updates: LATAM offer ended; accuracy updates for various historical o…
Browse files Browse the repository at this point in the history
…ffers
  • Loading branch information
andenacitelli committed Feb 1, 2025
1 parent 97b4bd0 commit 809ad15
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 149 deletions.
8 changes: 3 additions & 5 deletions exports/data.csv
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ Blue Business Cash,AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,true,0,false,2,,https:/
Blue Business Cash,AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,true,0,false,2,,https://www.americanexpress.com/en-us/business/credit-cards/blue-business-cash/,https://offeroptimist.com/images/amex/blue-business-cash.webp,,,300,6000,,90,false
Blue Business Cash,AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,true,0,false,2,,https://www.americanexpress.com/en-us/business/credit-cards/blue-business-cash/,https://offeroptimist.com/images/amex/blue-business-cash.webp,,,500,8000,,90,false
Blue Business Plus,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,true,0,false,2,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-blue-business-plus-credit-card-amex/,https://offeroptimist.com/images/amex/blue-business-plus.webp,,,15000,3000,,90,false
Blue Cash Everyday,AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,false,0,false,2,,https://www.americanexpress.com/us/credit-cards/card/blue-cash-everyday/,https://offeroptimist.com/images/amex/blue-cash-everyday.webp,,,200,2000,https://resy.com/amex-offers?date=2022-10-01&seats=2,180,true
Blue Cash Everyday,AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,false,0,false,2,,https://www.americanexpress.com/us/credit-cards/card/blue-cash-everyday/,https://offeroptimist.com/images/amex/blue-cash-everyday.webp,,,200,2000,https://resy.com/amex-offers,180,true
Blue Cash Preferred,AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,false,95,true,2,84 $7/mo Disney Bundle Credit,https://www.americanexpress.com/us/credit-cards/card/blue-cash-preferred/,https://offeroptimist.com/images/amex/blue-cash-preferred.webp,,,250,3000,https://www.americanexpress.com/us/credit-cards/card/blue-cash-preferred/,180,true
Blue Cash Preferred (Morgan Stanley),AMERICAN_EXPRESS,AMERICAN_EXPRESS,USD,false,95,true,2,84 $7/mo Disney Bundle Credit,https://apply.americanexpress.com/amex-morgan-stanley-credit-cards/,https://offeroptimist.com/images/amex/blue-cash-preferred-morgan-stanley.png,,,250,3000,,180,true
Business Gold,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,true,375,false,1,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-gold-card-amex/,https://offeroptimist.com/images/amex/business-gold.webp,,,70000,10000,,90,false
Business Gold,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,true,375,false,1,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-gold-card-amex/,https://offeroptimist.com/images/amex/business-gold.webp,,,200000,15000,https://www.uscreditcardguide.com/amex-business-gold-rewards-card/,90,false
Business Gold,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,true,375,false,1,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-gold-card-amex/,https://offeroptimist.com/images/amex/business-gold.webp,,,100000,10000,,90,false
Business Green,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,true,95,false,1,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-green-card-amex/,https://offeroptimist.com/images/amex/business-green.webp,,,25000,3000,,90,false
Business Green,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,true,95,false,1,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/american-express-business-green-card-amex/,https://offeroptimist.com/images/amex/business-green.webp,,,15000,3000,,90,false
Expand All @@ -30,9 +30,8 @@ Hilton Honors Business,AMERICAN_EXPRESS,AMERICAN_EXPRESS,HILTON,true,175,false,5
Hilton Honors Surpass,AMERICAN_EXPRESS,AMERICAN_EXPRESS,HILTON,false,95,false,1,,https://www.hilton.com/en/hilton-honors/credit-cards/,https://offeroptimist.com/images/amex/hilton-honors-surpass.jpg,,,130000,3000,,180,true
Marriott Bonvoy Brilliant,AMERICAN_EXPRESS,AMERICAN_EXPRESS,MARRIOTT,false,650,false,1,300 $25/mo Dining Credit,https://www.americanexpress.com/us/credit-cards/card/marriott-bonvoy-brilliant/,https://offeroptimist.com/images/amex/marriott-bonvoy-brilliant.webp,,,95000,6000,,180,true
Marriott Bonvoy Business,AMERICAN_EXPRESS,AMERICAN_EXPRESS,MARRIOTT,true,125,false,1,,https://www.americanexpress.com/us/credit-cards/business/business-credit-cards/amex-marriott-bonvoy-business-credit-card/,https://offeroptimist.com/images/amex/marriott-bonvoy-business.webp,,,0,8000,,90,false
Platinum,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,false,695,false,1,200 Hotel Credit; 100 Bi-yearly $50 Saks Credit; 200 $20/mo Digital Entertainment Credit; 200 $15/mo Uber Cash; 200 Airline Fee Credit; 155 Walmart+ Credit; 189 CLEAR Credit,https://www.americanexpress.com/us/credit-cards/card/platinum/,https://offeroptimist.com/images/amex/platinum.webp,,,80000,8000,,180,true
Platinum,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,false,695,false,1,200 Hotel Credit; 100 Bi-yearly $50 Saks Credit; 200 $20/mo Digital Entertainment Credit; 200 $15/mo Uber Cash; 200 Airline Fee Credit; 155 Walmart+ Credit; 189 CLEAR Credit,https://www.americanexpress.com/us/credit-cards/card/platinum/,https://offeroptimist.com/images/amex/platinum.webp,,,100000,8000,https://resy.com/amex-offers?date=2022-07-16&seats=2,180,true
Platinum,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,false,695,false,1,200 Hotel Credit; 100 Bi-yearly $50 Saks Credit; 200 $20/mo Digital Entertainment Credit; 200 $15/mo Uber Cash; 200 Airline Fee Credit; 155 Walmart+ Credit; 189 CLEAR Credit,https://www.americanexpress.com/us/credit-cards/card/platinum/,https://offeroptimist.com/images/amex/platinum.webp,,,80000,8000,,180,true
Platinum,AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,false,695,false,1,200 Hotel Credit; 100 Bi-yearly $50 Saks Credit; 200 $20/mo Digital Entertainment Credit; 200 $15/mo Uber Cash; 200 Airline Fee Credit; 155 Walmart+ Credit; 189 CLEAR Credit,https://www.americanexpress.com/us/credit-cards/card/platinum/,https://offeroptimist.com/images/amex/platinum.webp,,,50000,8000,,180,true
Platinum (Schwab),AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,false,695,false,1,200 Hotel Credit; 200 $20/mo Digital Entertainment Credit; 200 $15/mo Uber Cash; 200 Airline Fee Credit; 155 Walmart+ Credit; 189 CLEAR Credit,https://www.schwab.com/credit-cards#panel--50-media-right-117911,https://offeroptimist.com/images/amex/platinum-schwab.webp,,,80000,6000,,180,true
Platinum (Morgan Stanley),AMERICAN_EXPRESS,AMERICAN_EXPRESS,AMERICAN_EXPRESS,false,695,false,1,200 Hotel Credit; 200 $20/mo Digital Entertainment Credit; 200 $15/mo Uber Cash; 200 Airline Fee Credit; 155 Walmart+ Credit; 189 CLEAR Credit,https://apply.americanexpress.com/amex-morgan-stanley-credit-cards/,https://offeroptimist.com/images/amex/platinum-morgan-stanley.webp,,,80000,8000,,180,true
Marriott Bonvoy Bevy,AMERICAN_EXPRESS,AMERICAN_EXPRESS,MARRIOTT,false,250,false,1,,https://www.americanexpress.com/us/credit-cards/card/marriott-bonvoy-bevy/,https://offeroptimist.com/images/amex/marriott-bonvoy-bevy.png,,,85000,5000,,180,true
Expand Down Expand Up @@ -134,7 +133,6 @@ Rewards+,CITI,MASTERCARD,CITI,false,0,false,2,,https://www.citi.com/credit-cards
AT&T Points Plus,CITI,MASTERCARD,USD,false,0,false,1,,https://www.att.com/deals/att-points-plus-citi/,https://offeroptimist.com/images/citi/att-points-plus.jpg,,,200,1000,,90,true
Discover It,DISCOVER,DISCOVER,USD,false,0,false,1,,https://www.discover.com/credit-cards/,https://offeroptimist.com/images/discover/it.webp,,,0,0.01,,90,true
LATAM Airlines,FIRST,MASTERCARD,LATAM,false,0,false,1,,https://latampass.latam.com/en_us/earn-miles/latam-airlines-credit-cards,https://offeroptimist.com/images/first/latam-airlines.svg,,,15000,1000,,90,true
LATAM Airlines World Elite,FIRST,MASTERCARD,LATAM,false,99,false,1,,https://latampass.latam.com/en_us/earn-miles/latam-airlines-credit-cards,https://offeroptimist.com/images/first/latam-airlines-world-elite.webp,,,70000,2500,,90,true
LATAM Airlines World Elite,FIRST,MASTERCARD,LATAM,false,99,false,1,,https://latampass.latam.com/en_us/earn-miles/latam-airlines-credit-cards,https://offeroptimist.com/images/first/latam-airlines-world-elite.webp,,,40000,2500,,90,true
Cardless Qatar Signature,FIRST,VISA,AVIOS,false,99,false,1,,https://qatarairways.cardless.com/compare,https://offeroptimist.com/images/first/cardless-qatar-signature.jpg,,,60000,3000,,90,true
Cardless Qatar Infinite,FIRST,VISA,AVIOS,false,499,false,1,,https://qatarairways.cardless.com/compare,https://offeroptimist.com/images/first/cardless-qatar-infinite.jpg,,,80000,5000,,90,true
Expand Down
2 changes: 1 addition & 1 deletion exports/data.json

Large diffs are not rendered by default.

98 changes: 34 additions & 64 deletions exports/data.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,7 @@
spend: 3000
days: 90
credits: []
expiration: 2022-11-01
- amount:
- amount: 250
spend: 5000
days: 90
credits: []
expiration: 2023-10-01
- amount:
- amount: 500
spend: 15000
Expand Down Expand Up @@ -93,21 +88,17 @@
- value: 150
description: Dining Credit
weight: 0.8
url: https://resy.com/amex-offers?date=2022-10-01&seats=2
url: https://resy.com/amex-offers
historicalOffers:
- amount:
- amount: 350
spend: 3000
days: 180
credits: []
expiration: 2021-10-01
- amount:
- amount: 250
- amount: 200
spend: 2000
days: 180
credits: []
url: https://www.americanexpress.com/us/credit-cards/card/blue-cash-everyday/
details: Requires incognito or a VPN.
credits:
- value: 150
description: Dining Credit
weight: 0.8
url: https://resy.com/amex-offers
- name: Blue Cash Preferred
issuer: AMERICAN_EXPRESS
network: AMERICAN_EXPRESS
Expand All @@ -131,11 +122,11 @@
url: https://www.americanexpress.com/us/credit-cards/card/blue-cash-preferred/
historicalOffers:
- amount:
- amount: 400
- amount: 300
spend: 3000
days: 180
credits: []
expiration: 2022-06-01
expiration: 2024-06-01
- name: Blue Cash Preferred (Morgan Stanley)
issuer: AMERICAN_EXPRESS
network: AMERICAN_EXPRESS
Expand Down Expand Up @@ -177,23 +168,23 @@
credits: []
offers:
- amount:
- amount: 70000
spend: 10000
- amount: 200000
spend: 15000
days: 90
credits: []
url: https://www.uscreditcardguide.com/amex-business-gold-rewards-card/
details: Via referral; see link.
- amount:
- amount: 100000
spend: 10000
days: 90
credits: []
details: Inconsistent, YMMV.
historicalOffers:
- amount:
- amount: 130000
- amount: 200000
spend: 10000
days: 90
credits: []
expiration: 2022-09-01
- name: Business Green
issuer: AMERICAN_EXPRESS
network: AMERICAN_EXPRESS
Expand Down Expand Up @@ -259,19 +250,19 @@
days: 90
credits: []
url: https://www.uscreditcardguide.com/amex-business-platinum-card/
details: Available only via referral, see link.
details: Via referral; see link.
- amount:
- amount: 150000
spend: 20000
days: 90
credits: []
historicalOffers:
- amount:
- amount: 260000
- amount: 250000
spend: 30000
days: 90
credits: []
expiration: 2022-10-01
expiration: 2024-03-01
- amount:
- amount: 180000
spend: 15000
Expand Down Expand Up @@ -469,7 +460,7 @@
spend: 5000
days: 90
credits: []
expiration: 2021-12-01
expiration: 2023-05-01
- name: Delta SkyMiles Reserve Business
issuer: AMERICAN_EXPRESS
network: AMERICAN_EXPRESS
Expand Down Expand Up @@ -558,7 +549,7 @@
spend: 6000
days: 180
credits: []
details: Inconsistent. Try incognito mode.
details: Inconsistent (try incognito).
- amount:
- amount: 60000
spend: 6000
Expand Down Expand Up @@ -620,11 +611,11 @@
credits: []
historicalOffers:
- amount:
- amount: 150000
- amount: 100000
spend: 5000
days: 180
credits: []
expiration: 2021-12-01
expiration: 2025-01-01
- name: Hilton Honors Aspire
issuer: AMERICAN_EXPRESS
network: AMERICAN_EXPRESS
Expand Down Expand Up @@ -698,11 +689,11 @@
credits: []
historicalOffers:
- amount:
- amount: 200000
- amount: 170000
spend: 2000
days: 180
credits: []
details: 2021-12-01
details: 2024-02-01
- name: Marriott Bonvoy Brilliant
issuer: AMERICAN_EXPRESS
network: AMERICAN_EXPRESS
Expand Down Expand Up @@ -805,20 +796,14 @@
description: CLEAR Credit
weight: 0.4
offers:
- amount:
- amount: 80000
spend: 8000
days: 180
credits: []
details: Inconsistent, may require incognito.
- amount:
- amount: 100000
spend: 8000
days: 180
credits: []
url: https://resy.com/amex-offers?date=2022-07-16&seats=2
- amount:
- amount: 80000
- amount: 50000
spend: 8000
days: 180
credits: []
Expand Down Expand Up @@ -1606,11 +1591,11 @@
credits: []
historicalOffers:
- amount:
- amount: 100000
- amount: 70000
spend: 2000
days: 90
credits: []
expiration: 2021-04-01
expiration: 2023-05-01
- name: JetBlue Plus
issuer: BARCLAYS
network: MASTERCARD
Expand Down Expand Up @@ -2111,11 +2096,10 @@
url: https://www.referyourchasecard.com/18J/BDWS964YDG
historicalOffers:
- amount:
- amount: 25000
- amount: 20000
credits: []
spend: 500
days: 90
expiration: 2022-02-01
- name: Freedom Unlimited
issuer: CHASE
network: VISA
Expand Down Expand Up @@ -2276,7 +2260,7 @@
spend: 6000
days: 90
credits: []
referralUrl: https://www.referyourchasecard.com/21s/63VP5J3DX1
referralUrl: https://www.referyourchasecard.com/21s/6I9J2FNU9T
historicalOffers:
- amount:
- amount: 90000
Expand All @@ -2301,7 +2285,7 @@
spend: 8000
days: 90
credits: []
referralUrl: https://www.referyourchasecard.com/21s/63VP5J3DX1
referralUrl: https://www.referyourchasecard.com/21s/6I9J2FNU9T
historicalOffers:
- amount:
- amount: 120000
Expand All @@ -2325,7 +2309,7 @@
spend: 6000
days: 90
credits: []
referralUrl: https://www.referyourchasecard.com/21s/63VP5J3DX1
referralUrl: https://www.referyourchasecard.com/21s/6I9J2FNU9T
historicalOffers:
- amount:
- amount: 90000
Expand All @@ -2352,7 +2336,7 @@
spend: 10000
days: 90
credits: []
referralUrl: https://www.referyourchasecard.com/21s/63VP5J3DX1
referralUrl: https://www.referyourchasecard.com/21s/6I9J2FNU9T
details: "NOTE: Points are nontransferable. Only cashback redemption."
historicalOffers:
- amount:
Expand Down Expand Up @@ -2451,19 +2435,11 @@
referralUrl: https://www.referyourchasecard.com/19Q/QN3N8HQ4KX
historicalOffers:
- amount:
- amount: 70000
- amount: 300
currency: USD
spend: 4000
days: 90
credits: []
expiration: 2024-11-16
- amount:
- amount: 100000
- amount: 90000
spend: 4000
days: 90
credits: []
expiration: 2022-02-01
expiration: 2023-06-01
- name: Sapphire Reserve
issuer: CHASE
network: VISA
Expand Down Expand Up @@ -3458,12 +3434,6 @@
imageUrl: /images/first/latam-airlines-world-elite.webp
credits: []
offers:
- amount:
- amount: 70000
spend: 2500
days: 90
credits: []
expiration: 2025-01-17
- amount:
- amount: 40000
spend: 2500
Expand Down
10 changes: 6 additions & 4 deletions src/api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ components:
- description
- value
- weight
Expiration:
type: string
format: date # YYYY-MM-DD
description: The last day that the offer is valid, in YYYY-MM-DD format.
example: 2024-06-01
Offer:
type: object
properties:
Expand All @@ -92,10 +97,7 @@ components:
minimum: 30
example: 90
expiration:
type: string
format: date # YYYY-MM-DD
description: The last day that the offer is valid, in YYYY-MM-DD format. The offer becomes invalid at 11:59pm this day.
example: 2021-12-31
$ref: "#/components/schemas/Expiration"
isPublic:
type: boolean
description: Whether the offer is publicly available. A value of `true` indicates it's public. A value of `false` indicates it's a targeted offer.
Expand Down
48 changes: 36 additions & 12 deletions src/app.test.ts
Original file line number Diff line number Diff line change
@@ -1,31 +1,55 @@
import { describe, expect, test } from "vitest";
import { getDataInCsvFormat, getDataInJsonFormat } from "./conversion.js";
import {
getDataInCsvFormat,
getDataInJsonFormat,
getDataInYamlFormat,
} from "./conversion.js";
import { CREDIT_CARDS } from "./data/data.js";
import { isBefore } from "date-fns";
import { isBefore, differenceInYears } from "date-fns";

describe("Export JSON", () => {
test("Returns array of nonzero length", async () => {
describe("Export", () => {
test("JSON", () => {
const result = getDataInJsonFormat();
expect(result.length).toBeGreaterThan(0);
});
});
describe("Export CSV", () => {
test("Returns string of nonzero length", () => {
test("CSV", () => {
const result = getDataInCsvFormat();
expect(result).toContain("issuer"); // Checking header row exists
expect(result).not.toContain("[object Object]");
});
test("YAML", () => {
const result = getDataInYamlFormat();
expect(result.length).toBeGreaterThan(0);
});
});

describe("Data Validity Checks", () => {
const inputs = CREDIT_CARDS.map((card) => ({ card, name: card.name }));
describe("Expiration", () => {
test.each(inputs)("$name", ({ card }) => {
for (const offer of card.offers) {
if (offer.expiration) {
expect(isBefore(new Date(), new Date(offer.expiration))).toBeTruthy();
describe("Current Offers", () => {
// Verify current offers have not expired
test.each(inputs)("$name", ({ card }) => {
for (const offer of card.offers) {
if (offer.expiration) {
expect(
isBefore(new Date(), new Date(offer.expiration))
).toBeTruthy();
}
}
});
});
describe("Historical Offers", () => {
// Verify historical offer expiration dates are always present and always within ~2yr; any older, they kind of fail the "recent" part of "recent best"
test.each(inputs)("$name", ({ card }) => {
for (const offer of card.historicalOffers) {
if (offer.expiration) {
// cannot mandate expiration b/c it's possible (and not uncommon) for a card to actively be at its all-time high
expect(
differenceInYears(new Date(), new Date(offer.expiration))
).toBeLessThanOrEqual(2);
}
}
}
});
});
});
describe("Trimmed Strings", () => {
Expand Down
Loading

0 comments on commit 809ad15

Please sign in to comment.