pub async fn create_shipment_to_home_address(&self, db: &Database) {
        // First let's check if the user even has an address.
        // If not we can return early.
        if self.home_address_formatted.is_empty() {
            println!("cannot create shipping label for user {} since we don't know their home address", self.username);
            return;
        }

        // Let's create the shipment.
        let new_shipment = NewOutboundShipment::from(self.clone());
        // Let's add it to our database.
        let mut shipment = new_shipment.upsert(db).await;
        // Create the shipment in shippo.
        shipment.create_or_get_shippo_shipment(db).await;
        // Update airtable and the database again.
        shipment.update(db).await;
    }
/// Create an internal swag shipment to an employee's home address.
/// This will:
/// - Check if the user has a home address.
/// - Create a record in outgoing shipments.
/// - Generate the shippo label.
/// - Print said shippo label.
Create an internal swag shipment to an employee's home address.
This will:
Check if the user has a home address.
Create a record in outgoing shipments.
Generate the shippo label.
Print said shippo label.
Create an internal swag shipment to an employee ' s home address . This will : Check if the user has a home address . Create a record in outgoing shipments . Generate the shippo label . Print said shippo label .
pub async fn create_shipment_to_home_address(&self, db: &Database) {
        // First let's check if the user even has an address.
        // If not we can return early.
        if self.home_address_formatted.is_empty() {
            println!("cannot create shipping label for user {} since we don't know their home address", self.username);
            return;
        }
        // Let's create the shipment.
        let new_shipment = NewOutboundShipment::from(self.clone());
        // Let's add it to our database.
        let mut shipment = new_shipment.upsert(db).await;
        // Create the shipment in shippo.
        shipment.create_or_get_shippo_shipment(db).await;
        // Update airtable and the database again.
        shipment.update(db).await;
    }
pub async fn create_shipment_to_home_address ( & self , db : & Database ) { // First let's check if the user even has an address. // If not we can return early. if self . home_address_formatted . is_empty ( ) { println ! ( " " self username ) ; return ; } // Let's create the shipment. let new_shipment = NewOutboundShipment :: from ( self . clone ( ) ) ; // Let's add it to our database. let mut shipment = new_shipment . upsert ( db ) . await ; // Create the shipment in shippo. shipment . create_or_get_shippo_shipment ( db ) . await ; // Update airtable and the database again. shipment . update ( db ) . await ; }
Create an internal swag shipment to an employee's home address.
Create an internal swag shipment to an employee ' s home address .
&self
db
&Database
&self
db
&Database