add boba drops! (ty @leowilkin!)

This commit is contained in:
Leo Wilkin 2025-01-03 18:40:03 +01:00 committed by GitHub
parent 888a1ddb8e
commit d71e045ca3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -327,4 +327,66 @@ class HSRawPendingAGHShipment < HighSeasShipment
end
end
SHIPMENT_TYPES = [WarehouseShipment, HighSeasShipment].freeze
class BobaDropsShipment < Shipment
self.table_name = ENV["BOBA_TABLE"]
self.email_column = "Email"
def title_text
"Boba Drops!"
end
def type_text
"Boba Drops Shipment"
end
def date
self["[Shipment Viewer] Approved/pending at"] || 'error!'
end
def status_text
case fields["Physical Status"]
when "Pending"
"pending!"
when "Packed"
"labelled!"
when "Shipped"
"shipped!"
else
"please contact leow@hackclub.com, something went wrong!"
end
end
def status_icon
case fields["Physical Status"]
when "Pending"
'<i class="fa-solid fa-clock"></i>'
when "Packed"
'<i class="fa-solid fa-dolly"></i>'
when "Shipped"
'<i class="fa-solid fa-truck-fast"></i>'
else
'<i class="fa-solid fa-circle-exclamation"></i>'
end
end
def tracking_link
fields["[INTL] Tracking Link"]
end
def tracking_number
fields["[INTL] Tracking ID"]
end
def icon
"🧋"
end
def shipped?
fields["Physical Status"] == 'Shipped'
end
def description
"shipment from boba drops <3"
end
end
SHIPMENT_TYPES = [WarehouseShipment, HighSeasShipment, BobaDropsShipment].freeze