-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4499 from RoboJackets/kristaps/free-trips
Allow $0 trip fees
- Loading branch information
Showing
10 changed files
with
116 additions
and
86 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
This is the amount that will be collected from <strong>each</strong> traveler. The trip fee must be at least {{ (config('travelpolicy.minimum_trip_fee_cost_ratio') * 100) }}% of the per-person cost for this trip. Online payments incur a <a href="https://squareup.com/us/en/payments/our-fees">~4% processing fee</a> paid by RoboJackets. | ||
This is the amount that will be collected from <strong>each</strong> traveler. Online payments incur a <a href="https://squareup.com/us/en/payments/our-fees">~4% processing fee</a> paid by RoboJackets. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1019,6 +1019,62 @@ | |
Mailbook::to($user) | ||
->add(TravelAssignmentCreated::class) | ||
->label('Trip Assignment Created') | ||
->variant('Need Travel Information Form No Payment', static function (): TravelAssignmentCreated { | ||
$user = User::withoutEvents(static function (): User { | ||
$user = User::factory()->make([ | ||
'first_name' => 'George', | ||
'preferred_name' => null, | ||
'last_name' => 'Burdell', | ||
'gt_email' => '[email protected]', | ||
'primary_affiliation' => 'student', | ||
'emergency_contact_name' => 'asdf', | ||
'emergency_contact_phone' => 'asdf', | ||
]); | ||
$user->save(); | ||
|
||
return $user; | ||
}); | ||
|
||
$officer = User::withoutEvents(static function (): User { | ||
$officer = User::factory()->make([ | ||
'first_name' => 'Robo', | ||
'preferred_name' => null, | ||
'last_name' => 'Buzz', | ||
'gt_email' => '[email protected]', | ||
]); | ||
$officer->save(); | ||
|
||
return $officer; | ||
}); | ||
|
||
$travel = Travel::withoutEvents(static fn (): Travel => Travel::firstOrCreate([ | ||
'name' => 'Motorama 2022', | ||
], [ | ||
'destination' => 'mailbook', | ||
'departure_date' => '2022-02-18', | ||
'return_date' => '2022-02-21', | ||
'fee_amount' => 0, | ||
'forms' => [ | ||
Travel::TRAVEL_INFORMATION_FORM_KEY => true, | ||
], | ||
'primary_contact_user_id' => $officer->id, | ||
'included_with_fee' => 'mailbook', | ||
'is_international' => false, | ||
'status' => 'draft', | ||
])); | ||
|
||
$assignment = TravelAssignment::withoutEvents(static function () use ($user, $travel): TravelAssignment { | ||
$assignment = TravelAssignment::factory()->make([ | ||
'user_id' => $user->id, | ||
'travel_id' => $travel->id, | ||
]); | ||
$assignment->save(); | ||
|
||
return $assignment; | ||
}); | ||
|
||
return new TravelAssignmentCreated($assignment); | ||
}) | ||
->variant('Need Travel Information Form', static function (): TravelAssignmentCreated { | ||
$user = User::withoutEvents(static function (): User { | ||
$user = User::factory()->make([ | ||
|