From d71e045ca3bd848d1f931a301cc5e97e56c72cec Mon Sep 17 00:00:00 2001 From: Leo Wilkin Date: Fri, 3 Jan 2025 18:40:03 +0100 Subject: [PATCH] add boba drops! (ty @leowilkin!) --- app/shipment_types.rb | 64 ++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) diff --git a/app/shipment_types.rb b/app/shipment_types.rb index d140bca..bf9a90a 100644 --- a/app/shipment_types.rb +++ b/app/shipment_types.rb @@ -327,4 +327,66 @@ class HSRawPendingAGHShipment < HighSeasShipment end end -SHIPMENT_TYPES = [WarehouseShipment, HighSeasShipment].freeze \ No newline at end of file +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" + '' + when "Packed" + '' + when "Shipped" + '' + else + '' + 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 \ No newline at end of file