LocalRequestsRepository.php 2.15 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<?php


namespace Source\Gateways\Requests;

use Carbon\Carbon;
use Source\Entities\Request;
use Source\Gateways\Users\LocalUsersRepository;

class LocalRequestsRepository extends InMemoryRequestsRepository
{
    /**
     * @throws \Source\Exceptions\EntityExistsException
     * @throws \Exception
     */
    public function __construct()
    {
        $now = Carbon::now();
        $this->create(new Request(
            1,
            'gif access pls',
            LocalUsersRepository::getComputerScienceStudent()->getId(),
            'Please give 24 hour access to CSP315',
            'No, you may not have 24 hour access, but you have working hour access',
            true,
            $now,
            $now
        ));

        $this->create(new Request(
            2,
            'Remove my access',
            LocalUsersRepository::getComputerScienceStudent()->getId(),
            'I don\'t want access to anything',
            'No, you must have accesss.',
            false,
            $now,
            $now
        ));

        $this->create(new Request(
            3,
            'Pending request',
            LocalUsersRepository::getEngineeringLabAccessStudent()->getId(),
            'unpend my request you wench',
            null,
            null,
            $now,
            $now
        ));

        $this->create(new Request(
            4,
            'Admins Pending request',
            LocalUsersRepository::getAdminUser()->getId(),
            'this is a pending request from the admin user',
            null,
            null,
            $now,
            $now
        ));

        $this->create(new Request(
            5,
            'Admins granted request',
            LocalUsersRepository::getAdminUser()->getId(),
            'this is a granted request',
            null,
            true,
            $now,
            $now
        ));

        $this->create(new Request(
            6,
            'Admins rejected request',
            LocalUsersRepository::getAdminUser()->getId(),
            'this is a rejected request',
            'https://i.imgur.com/abNQApV.png',
            false,
            $now,
            $now
        ));
    }
}