Skip to content

Commit bc7a13d

Browse files
authored
Merge pull request #474 from HiEventsDev/develop
main <- develop
2 parents bded7ef + b8c5cfa commit bc7a13d

File tree

5 files changed

+145
-15
lines changed

5 files changed

+145
-15
lines changed

backend/app/Http/Actions/Orders/EditOrderAction.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ public function __invoke(EditOrderRequest $request, int $eventId, int $orderId):
2424

2525
$order = $this->handler->handle(new EditOrderDTO(
2626
id: $orderId,
27-
first_name: $request->validated('first_name'),
28-
last_name: $request->validated('last_name'),
27+
eventId: $eventId,
28+
firstName: $request->validated('first_name'),
29+
lastName: $request->validated('last_name'),
2930
email: $request->validated('email'),
3031
notes: $request->validated('notes'),
3132
));

backend/app/Services/Application/Handlers/Order/DTO/EditOrderDTO.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
class EditOrderDTO extends BaseDTO
88
{
99
public function __construct(
10-
public int $id,
11-
public string $first_name,
12-
public string $last_name,
13-
public string $email,
10+
public int $id,
11+
public int $eventId,
12+
public string $firstName,
13+
public string $lastName,
14+
public string $email,
1415
public ?string $notes,
1516
)
1617
{

backend/app/Services/Application/Handlers/Order/EditOrderHandler.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ public function handle(EditOrderDTO $dto): OrderDomainObject
2828

2929
return $this->editOrderService->editOrder(
3030
id: $dto->id,
31-
first_name: $dto->first_name,
32-
last_name: $dto->last_name,
31+
eventId: $dto->eventId,
32+
firstName: $dto->firstName,
33+
lastName: $dto->lastName,
3334
email: $dto->email,
3435
notes: $dto->notes
3536
);

backend/app/Services/Domain/Order/EditOrderService.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,24 @@ public function __construct(
2525
*/
2626
public function editOrder(
2727
int $id,
28-
?string $first_name,
29-
?string $last_name,
28+
int $eventId,
29+
?string $firstName,
30+
?string $lastName,
3031
?string $email,
3132
?string $notes
3233
): OrderDomainObject
3334
{
34-
return $this->databaseManager->transaction(function () use ($id, $first_name, $last_name, $email, $notes) {
35+
return $this->databaseManager->transaction(function () use ($id, $firstName, $lastName, $email, $notes, $eventId) {
3536
$this->orderRepository->updateWhere(
3637
attributes: array_filter([
37-
'first_name' => $first_name,
38-
'last_name' => $last_name,
38+
'first_name' => $firstName,
39+
'last_name' => $lastName,
3940
'email' => $email,
4041
'notes' => $notes,
4142
]),
4243
where: [
43-
'id' => $id
44+
'id' => $id,
45+
'event_id' => $eventId,
4446
]
4547
);
4648

@@ -51,7 +53,10 @@ public function editOrder(
5153
),
5254
);
5355

54-
return $this->orderRepository->findById($id);
56+
return $this->orderRepository->findFirstWhere([
57+
'id' => $id,
58+
'event_id' => $eventId,
59+
]);
5560
});
5661
}
5762
}

docker/development/README.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# Hi.Events local development with Docker
2+
3+
This guide walks you through setting up Hi.Events using Docker, including requirements, setup steps, configuration,
4+
and environment variables.
5+
6+
## Requirements
7+
8+
1. **Docker** – Required for containerized development. [Install Docker](https://docs.docker.com/get-docker/)
9+
2. **Git** – Needed to clone the repository. [Install Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
10+
11+
> **Note:** This guide assumes a macOS or Linux environment by default. See the **Windows setup instructions** below if you're on Windows.
12+
13+
---
14+
15+
## Setup instructions (macOS / Linux)
16+
17+
### 1. Clone the repository
18+
19+
```bash
20+
git clone [email protected]:HiEventsDev/Hi.Events.git
21+
```
22+
23+
### 2. Start the development environment
24+
25+
Navigate to the Docker development directory and run the startup script:
26+
27+
```bash
28+
cd Hi.Events/docker/development
29+
./start-dev.sh
30+
```
31+
32+
Once running, access the app at:
33+
34+
- **Frontend**: [https://localhost:8443](https://localhost:8443)
35+
36+
---
37+
38+
## Setup instructions (Windows)
39+
40+
Windows users should follow the steps below to manually run the setup commands instead of using the `start-dev.sh` script.
41+
42+
### 1. Clone the repository
43+
44+
Using Git Bash or Windows Terminal:
45+
46+
```bash
47+
git clone [email protected]:HiEventsDev/Hi.Events.git
48+
cd Hi.Events/docker/development
49+
```
50+
51+
### 2. Generate SSL certificates
52+
53+
You can use `openssl` to generate self-signed certificates:
54+
55+
```bash
56+
mkdir -p certs
57+
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout certs/localhost.pem.key -out certs/localhost.pem -subj "/CN=localhost"
58+
```
59+
60+
Then, update your `docker/development/nginx/nginx.conf` to use `.pem` files:
61+
62+
```nginx
63+
ssl_certificate /etc/nginx/certs/localhost.pem;
64+
ssl_certificate_key /etc/nginx/certs/localhost.pem.key;
65+
```
66+
67+
> If you're using `.crt`/`.key`, update accordingly.
68+
69+
### 3. Start Docker services
70+
71+
```bash
72+
docker-compose -f docker-compose.dev.yml up -d
73+
```
74+
75+
### 4. Install backend dependencies
76+
77+
```bash
78+
docker-compose -f docker-compose.dev.yml exec -T backend composer install --ignore-platform-reqs --no-interaction --optimize-autoloader --prefer-dist
79+
```
80+
81+
### 5. Wait for the database
82+
83+
Keep checking logs until you see "ready to accept connections":
84+
85+
```bash
86+
docker-compose -f docker-compose.dev.yml logs pgsql
87+
```
88+
89+
### 6. Create environment files (if missing)
90+
91+
```bash
92+
docker-compose -f docker-compose.dev.yml exec backend cp .env.example .env
93+
docker-compose -f docker-compose.dev.yml exec frontend cp .env.example .env
94+
```
95+
96+
### 7. Laravel setup
97+
98+
```bash
99+
docker-compose -f docker-compose.dev.yml exec backend php artisan key:generate
100+
docker-compose -f docker-compose.dev.yml exec backend php artisan migrate
101+
docker-compose -f docker-compose.dev.yml exec backend chmod -R 775 /var/www/html/vendor/ezyang/htmlpurifier/library/HTMLPurifier/DefinitionCache/Serializer
102+
docker-compose -f docker-compose.dev.yml exec backend php artisan storage:link
103+
```
104+
105+
### 8. Open the app
106+
107+
```bash
108+
start https://localhost:8443/auth/register
109+
```
110+
111+
---
112+
113+
## Additional configuration
114+
115+
Hi.Events uses environment variables for configuration. You’ll find `.env` files in:
116+
117+
- `frontend/.env`
118+
- `backend/.env`
119+
120+
You can modify these to customize your setup.
121+
122+
For a full list of environment variables, see the [Environment Variables Documentation](https://hi.events/docs/getting-started/deploying#environment-variables).

0 commit comments

Comments
 (0)