From 511d4dbcee667ecb0216b0cf57a047b0246907f5 Mon Sep 17 00:00:00 2001 From: zman Date: Wed, 12 Feb 2025 21:04:53 -0500 Subject: [PATCH] price --- app/services/pricing.py | 12 ++++++++---- dns.txt | 6 ++++++ requests.md | 23 +++++++++-------------- 3 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 dns.txt diff --git a/app/services/pricing.py b/app/services/pricing.py index b0ad79b..b37dae7 100644 --- a/app/services/pricing.py +++ b/app/services/pricing.py @@ -117,6 +117,7 @@ class PricingService: """Default pricing algorithm with complex pricing rules""" tcg_low = row.get('tcg_low_price') tcg_low_shipping = row.get('tcg_low_price_with_shipping') + tcg_market_price = row.get('tcg_market_price') if pd.isna(tcg_low) or pd.isna(tcg_low_shipping): logger.warning(f"Missing pricing data for row: {row}") @@ -124,14 +125,17 @@ class PricingService: return row # Apply pricing rules - if tcg_low < 0.35: + if tcg_low < 0.35 and tcg_market_price < 1: new_price = 0.35 elif tcg_low < 5 or tcg_low_shipping < 5: - new_price = round(tcg_low * 1.25, 2) - elif tcg_low_shipping > 25: - new_price = round(tcg_low_shipping * 1.025, 2) + new_price = round(tcg_low_shipping * .85, 2) + elif tcg_low_shipping > 20: + new_price = round(tcg_low_shipping * 1.0125, 2) else: new_price = round(tcg_low_shipping * 1.10, 2) + # if new price is less than half of market price, set to 90% market + if new_price < (tcg_market_price / 2): + new_price = round(tcg_market_price * 0.85, 2) row['new_price'] = new_price return row diff --git a/dns.txt b/dns.txt new file mode 100644 index 0000000..2108d1a --- /dev/null +++ b/dns.txt @@ -0,0 +1,6 @@ +@ IN MX 1 aspmx.l.google.com. +@ IN MX 5 alt1.aspmx.l.google.com. +@ IN MX 5 alt2.aspmx.l.google.com. +@ IN MX 10 alt3.aspmx.l.google.com. +@ IN MX 10 alt4.aspmx.l.google.com. +@ IN TXT "v=spf1 include:_spf.google.com ~all" \ No newline at end of file diff --git a/requests.md b/requests.md index 715baee..1d78edf 100644 --- a/requests.md +++ b/requests.md @@ -2,21 +2,16 @@ curl -J http://192.168.1.41:8000/api/tcgplayer/inventory/update --remote-name curl -J -X POST http://192.168.1.41:8000/api/tcgplayer/inventory/add \ -H "Content-Type: application/json" \ - -d '{"open_box_ids": ["620fdeec-072d-4dd3-aef0-8a8a66de0c5f"]}' \ + -d '{"open_box_ids": ["4ccd2005-edd2-4764-9599-0d863be72034"]}' \ --remote-name curl -X POST http://192.168.1.41:8000/api/boxes \ --F "type=play" \ --F "set_code=FDN" \ --F "sku=195166261782" \ --F "num_cards_expected=540" +-F "type=draft" \ +-F "set_code=LCI" \ +-F "sku=195166229669" \ +-F "num_cards_expected=541" -curl -X POST "http://192.168.1.41:8000/api/boxes/588dddad-0661-4541-a16c-beba1c564b4f/open" \ - -F "product_id=588dddad-0661-4541-a16c-beba1c564b4f" \ - -F "file_ids=b06c8808-d024-4bb4-8b77-89d4f8b92938" \ - -F "file_ids=8349456c-d588-4c50-bfd4-f5895d3b4a43" \ - -F "file_ids=33fee9cf-790a-4f50-91b9-dfdf1adc75c7" \ - -F "file_ids=12f848c7-80b9-4ce2-8be8-1f36e714bd6f" \ - -F "file_ids=f5b6513c-97e3-423c-9f4d-73f058529e4f" \ - -F "file_ids=995249ac-97df-40be-a779-3acca32eb186" \ - -F "date_opened=2025-02-10" \ No newline at end of file +curl -X POST "http://192.168.1.41:8000/api/boxes/35ec0beb-1f59-448d-a6ea-1189b804607b/open" \ + -F "product_id=35ec0beb-1f59-448d-a6ea-1189b804607b" \ + -F "file_ids=2b71ce17-3c8d-4483-a4d9-e59dc76f3a23" \ + -F "date_opened=2025-02-12" \ No newline at end of file