Skip to content

Commit

Permalink
Merge pull request #140 from pycontw/feature/2024-ticket
Browse files Browse the repository at this point in the history
fix(app): update 2024 ticket name and price
  • Loading branch information
henry410213028 authored Jun 23, 2024
2 parents 02a112b + 5200aaf commit 6e2ae23
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 19 deletions.
33 changes: 14 additions & 19 deletions dags/app/team_registration_bot/udf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from app import discord
from google.cloud import bigquery

YEAR = datetime.now().year

TABLE = f"{os.getenv('BIGQUERY_PROJECT', 'pycontw-225217')}.ods.ods_kktix_attendeeId_datetime"

CLIENT = bigquery.Client(project=os.getenv("BIGQUERY_PROJECT"))
Expand Down Expand Up @@ -33,7 +35,7 @@ def _get_statistics_from_bigquery() -> Dict:
FROM
`{TABLE}`
WHERE
((REFUNDED IS NULL) OR (REFUNDED = FALSE)) AND (NAME LIKE "PyCon TW 2023 Registration%")
((REFUNDED IS NULL) OR (REFUNDED = FALSE)) AND (NAME LIKE "PyCon TW {YEAR} Registration%")
)
SELECT
Expand All @@ -50,26 +52,19 @@ def _get_statistics_from_bigquery() -> Dict:


ticket_price = {
"企業票 - 早鳥階段 (含紀念衣服) / Corporate - Early Stage (with T-Shirt)": 5500,
# please update the price for target year
"企業票 - 一般階段 / Corporate - Regular Stage": 5800,
"企業票 - 晚鳥階段 / Corporate - Final Stage": 6500,
"社群優惠票 (含紀念衣服) / Community Discount (with T-Shirt)": 2790,
"OSCVPass (含紀念衣服) / OSCVPass Discount (with T-Shirt)": 2790,
"超級 Py 粉票 (含紀念衣服) / PyCon TW Stans (with T-Shirt)": 1990,
"講者票 (含紀念衣服) / Speaker (with T-Shirt)": 1290,
"投稿者票 / Submitter": 1990,
"貢獻者票 (含紀念衣服) / Contributor (with T-Shirt)": 1290,
"大會贊助票 (歡迎申請) / Sponsorship from PyCon TW (Free to Apply)": 2490,
"邀請票 (含紀念衣服) / Invited (with T-Shirt)": 0,
"獎品預留票 (含紀念衣服) / Prize Reserved (with T-Shirt)": 1895,
"企業獎品預留票 (含紀念衣服) / Corporate Prize Reserved (with T-Shirt)": 2900,
"個人尊榮票 (含紀念衣服) / Premium (with T-Shirt)": 5500,
"團體票 (歡迎申請) / Group-Buy Individual (Free to Apply)": 0,
"個人票 - 早鳥階段 (含紀念衣服) / Individual - Early Stage (with T-Shirt)": 2990,
"個人票 - 一般階段 / Individual - Regular Stage": 3790,
"企業團體票 (歡迎申請) / Group-Buy Corporate (Free to Apply)": 5220,
"優惠票 (含紀念衣服) / Reserved - Community (with T-Shirt)": 2590,
"貢獻者票 (含紀念衣服) / Reserved - Contributor (with T-Shirt)": 1290,
"財務補助票 / Reserved - Financial Aid": 0,
"邀請票 (含紀念衣服) / Reserved - Invited (with T-Shirt)": 0,
"個人贊助票 (含紀念衣服) / Individual - Sponsor (with T-Shirt)": 5500,
"個人票 - 早鳥 (含紀念衣服) / Individual - Early Stage (with T-Shirt)": 2790,
"個人票 - 一般 (含紀念衣服)/ Individual - Regular Stage (with T-Shirt)": 3790,
"個人票 - 晚鳥階段 / Individual - Final Stage": 4290,
"社群票 / Community": 3390,
"愛心優待票 / Concession": 1895,
"愛心優待票 (含紀念衣服)/ Individual - Concession": 1895,
}


Expand All @@ -82,6 +77,6 @@ def _compose_discord_msg(payload) -> Text:
total += counts
total_income += ticket_price.get(ticket_name, 0) * counts
total_income = "{:,}".format(total_income)
msg += "dashboard: https://metabase.pycon.tw/question/142\n"
msg += f"dashboard: https://metabase.pycon.tw/question/142?year={YEAR}\n"
msg += f"總共賣出 {total} 張喔~ (總收入 TWD${total_income})"
return msg
13 changes: 13 additions & 0 deletions dags/ods/kktix_ticket_orders/udfs/kktix_bq_dwd_etl.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@
"How did you know PyCon TW 2023? / 如何得知 PyCon TW 2023?": "how_did_you_know_pycon_tw",
"(初次參與) How did you know PyCon TW 2023? / (Attend first time) 如何得知 PyCon TW 2023?": "how_did_you_know_pycon_tw",
'(投稿者) 你是怎麼得知 PyCon Taiwan 投稿資訊?/ (For Submitter) How did you know the CfP information of PyCon Taiwan? (If you are NOT submitter, fill in "non-submitter"/ 如果您沒有投稿,請填寫「非投稿者」)': "how_did_you_know_cfp_of_pycon_tw",
# form 2024 reformatted column names
"來自國家、地區或縣市": "country_or_region",
"(Attend first time) How did you know PyCon TW 2024? / (初次參與) 如何得知 PyCon TW?": "how_did_you_know_pycon_tw",
"Dietary Preference / 飲食偏好": "dietary_habit",
}

UNWANTED_DATA_TO_UPLOAD = (
Expand Down Expand Up @@ -242,6 +246,15 @@
# "Size of T-shirt / 衣服尺寸 (For tickets with t-shirt should fill in this field / 票種有含紀念衣服需填寫)",
"""I'm willing to comply with the PyCon TW 2023 CoC / 我願意遵守 PyCon TW 2023 行為準則""",
# "Have you ever been a PyCon TW volunteer? / 是否曾擔任過 PyCon TW 志工?",
# For 2024, just for notes
"地址",
"聯絡人 地址",
"注意事項",
"I would like to donate invoice to Open Culture Foundation / 我願意捐贈發票給開放文化基金會 (Ref: https://reurl.cc/ZQ6VY6)",
"I’ve already read and I accept the Privacy Policy of PyCon TW 2024 / 我已閱讀並同意 PyCon TW 2024 個人資料保護聲明",
"I'm willing to comply with the PyCon TW 2024 CoC / 我願意遵守 PyCon TW 2024 行為準則",
"我願意收到未來 PyCon TW 贊助機會相關信件",
"願意收到未來 PyCon TW 活動訊息",
)


Expand Down

0 comments on commit 6e2ae23

Please sign in to comment.