Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: notion of groups #595

Merged
merged 61 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
1d70e75
feat: notion of groups
djaiss Mar 3, 2021
5bc5239
wip
djaiss Mar 4, 2021
c78d1b0
Update 2021_03_03_031835_create_groups_table.php
djaiss Mar 5, 2021
5bf570c
Update 2021_03_03_031835_create_groups_table.php
djaiss Mar 5, 2021
29ab0b8
fixes
djaiss Mar 5, 2021
a53cd60
wip
djaiss Mar 6, 2021
b6b1e18
wip
djaiss Mar 6, 2021
e865455
new services
djaiss Mar 6, 2021
946da0d
wip
djaiss Mar 7, 2021
3756672
Merge branch 'main' into 2021-03-02-groups
djaiss Mar 12, 2021
7a8c98e
wip
djaiss Mar 12, 2021
f6ff8c5
Optimised images with calibre/image-actions
github-actions[bot] Mar 12, 2021
6debfd3
merge main
djaiss Mar 23, 2021
2c746ff
wip
djaiss Mar 23, 2021
1012d4b
wip
djaiss Mar 23, 2021
2d6fb54
wip
djaiss Mar 23, 2021
da10e40
Merge branch 'main' into 2021-03-02-groups
djaiss Mar 25, 2021
90cd131
wip
djaiss Mar 25, 2021
15dba2c
wip
djaiss Mar 25, 2021
d92b451
wip
djaiss Mar 25, 2021
f9aa5ba
wip
djaiss Mar 25, 2021
551090c
wip
djaiss Mar 26, 2021
658b74e
merge main
djaiss Mar 27, 2021
e4b80b6
wip
djaiss Mar 30, 2021
c0054ee
fixes
djaiss Mar 30, 2021
1939e2d
wip
djaiss Mar 30, 2021
96f1c0e
Merge branch 'main' into 2021-03-02-groups
djaiss Mar 31, 2021
a91fda7
wip
djaiss Apr 1, 2021
3823585
Optimised images with calibre/image-actions
github-actions[bot] Apr 1, 2021
eefaca0
meeting deletion
djaiss Apr 1, 2021
b08db0f
wip
djaiss Apr 3, 2021
e2ca5d4
Merge branch '2021-03-02-groups' of github.com:officelifehq/officelif…
djaiss Apr 3, 2021
5154b64
Update Group.php
djaiss Apr 3, 2021
e0755b0
Update EmployeeEditController.php
djaiss Apr 3, 2021
366ac11
Merge branch 'main' into 2021-03-02-groups
djaiss Apr 3, 2021
3ba8e8b
Merge branch 'main' into 2021-03-02-groups
djaiss Apr 3, 2021
b376265
Merge branch 'main' into 2021-03-02-groups
djaiss Apr 10, 2021
ac5152a
merge
djaiss Apr 11, 2021
c05a2fd
merge main
djaiss Apr 15, 2021
0e6d6b2
fix
djaiss Apr 15, 2021
08472c4
Merge branch 'main' into 2021-03-02-groups
djaiss Apr 19, 2021
aee8ad5
wip
djaiss Apr 20, 2021
2fabf8f
wip
djaiss Apr 20, 2021
1518d14
wip
djaiss Apr 21, 2021
e4b219c
wip
djaiss May 2, 2021
ed26393
wip
djaiss May 2, 2021
63b0afa
Update Agenda.vue
djaiss May 2, 2021
f891aa5
wip
djaiss May 2, 2021
6bce7e4
wip
djaiss May 2, 2021
38b96f4
wip
djaiss May 2, 2021
d82088d
wip
djaiss May 2, 2021
50f30c2
wip
djaiss May 4, 2021
f708f4d
Update GroupController.php
djaiss May 4, 2021
e1fa58e
Merge branch 'main' into 2021-03-02-groups
djaiss May 4, 2021
feb2c8e
wip
djaiss May 4, 2021
96cd301
Merge branch '2021-03-02-groups' of github.com:officelifehq/officelif…
djaiss May 4, 2021
b1de797
wip
djaiss May 4, 2021
5cd68db
wip
djaiss May 4, 2021
a9fc089
wip
djaiss May 5, 2021
1f2b912
wip
djaiss May 6, 2021
c0bedb9
wip
djaiss May 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
102 changes: 102 additions & 0 deletions app/Console/Commands/Tests/SetupDummyAccount.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,31 @@
use App\Models\Company\Employee;
use App\Models\Company\Position;
use App\Models\Company\Question;
use Illuminate\Support\Facades\DB;
use App\Models\Company\ECoffeeMatch;
use App\Services\User\CreateAccount;
use App\Models\Company\ProjectStatus;
use App\Models\Company\EmployeeStatus;
use App\Models\Company\ExpenseCategory;
use App\Services\Company\Team\SetTeamLead;
use App\Services\Company\Group\CreateGroup;
use Illuminate\Database\Eloquent\Collection;
use App\Models\Company\RateYourManagerAnswer;
use App\Models\Company\RateYourManagerSurvey;
use App\Services\Company\Group\CreateMeeting;
use App\Services\Company\Project\StartProject;
use App\Services\Company\Team\Ship\CreateShip;
use App\Models\Company\EmployeePositionHistory;
use App\Services\Company\Project\CreateProject;
use App\Services\Company\Group\CreateAgendaItem;
use App\Services\Company\Group\UpdateMeetingDate;
use Symfony\Component\Console\Helper\ProgressBar;
use App\Services\Company\Adminland\Team\CreateTeam;
use App\Services\Company\Employee\Morale\LogMorale;
use App\Services\Company\Project\CreateProjectLink;
use App\Services\Company\Project\CreateProjectTask;
use App\Services\Company\Employee\Worklog\LogWorklog;
use App\Services\Company\Group\CreateMeetingDecision;
use App\Services\Company\Project\CreateProjectStatus;
use App\Services\Company\Employee\Answer\CreateAnswer;
use App\Services\Company\Project\AddEmployeeToProject;
Expand Down Expand Up @@ -209,8 +215,10 @@ public function handle(): void
$this->createTimeTrackingEntries();
$this->setContractRenewalDates();
$this->setECoffeeProcess();
$this->addGroups();
$this->addPreviousPositionsHistory();
$this->addSecondaryBlankAccount();
$this->validateUserAccounts();
$this->stop();
}

Expand Down Expand Up @@ -2022,6 +2030,8 @@ private function setContractRenewalDates(): void

private function setECoffeeProcess(): void
{
$this->info('☐ Set e Coffee Process');

$this->company->e_coffee_enabled = true;
$this->company->save();

Expand All @@ -2043,6 +2053,92 @@ private function setECoffeeProcess(): void
});
}

private function addGroups(): void
{
$this->info('☐ Add groups');

$groupNames = collect([
'Party planning committee',
'Basketball lovers',
'Monetisation executive meeting',
'Front end developers guild',
]);

$meetingAgendaItems = collect([
'What should we do about the negociations with Home Depot?',
'Discussion about strategic learnings',
'Sales update: previous quarter’s results',
'Team structure presentation',
'Impact on shareholders',
'iPhone 42 launch',
]);

$decisionItems = collect([
'Schedule meeting with supplier',
'Angela to take responsability and pubicly apologize to Dwight',
'Prepare forecasts for Q4',
'Prepare UX for the future feature',
]);

foreach ($groupNames as $name) {
$randomEmployees = $this->employees->shuffle()->take(rand(4, 9))->pluck('id')->toArray();

// create group with random employees
$group = (new CreateGroup)->execute([
'company_id' => $this->company->id,
'author_id' => $this->michael->id,
'name' => $name,
'employees' => $randomEmployees,
]);

$group->mission = 'This group was created to discuss all decisions we have to take together.';
$group->save();

// create meetings
$date = Carbon::now()->subMonths(10);
for ($i = 0; $i < rand(4, 9); $i++) {
$meeting = (new CreateMeeting)->execute([
'company_id' => $this->company->id,
'author_id' => $this->michael->id,
'group_id' => $group->id,
]);

(new UpdateMeetingDate)->execute([
'company_id' => $this->company->id,
'author_id' => $this->michael->id,
'group_id' => $group->id,
'meeting_id' => $meeting->id,
'date' => $date->addDays(rand(10, 57))->format('Y-m-d'),
]);

// add agenda items
foreach ($meetingAgendaItems as $item) {
$agendaItem = (new CreateAgendaItem)->execute([
'company_id' => $this->company->id,
'author_id' => $this->michael->id,
'group_id' => $group->id,
'meeting_id' => $meeting->id,
'summary' => $item,
'description' => null,
'presented_by_id' => $this->employees->shuffle()->first()->id,
]);

$decisionItems = $decisionItems->shuffle()->take(rand(1, 3));
foreach ($decisionItems as $item) {
(new CreateMeetingDecision)->execute([
'company_id' => $this->company->id,
'author_id' => $this->michael->id,
'group_id' => $group->id,
'meeting_id' => $meeting->id,
'agenda_item_id' => $agendaItem->id,
'description' => $item,
]);
}
}
}
}
}

private function addPreviousPositionsHistory(): void
{
foreach ($this->employees as $employee) {
Expand Down Expand Up @@ -2088,6 +2184,12 @@ private function addSecondaryBlankAccount(): void
]);
}

private function validateUserAccounts(): void
{
DB::table('users')
->update(['email_verified_at' => Carbon::now()]);
}

private function artisan(string $message, string $command, array $arguments = []): void
{
$this->info($message);
Expand Down
Loading