# YOKESEN Seminar API Deployment

Status: production endpoint deployed. Midtrans mode is currently `sandbox` for payment testing.

## Public Endpoint

- API domain: `https://api.yokesen.com`
- Health check: `https://api.yokesen.com/health`
- Midtrans notification URL: `https://api.yokesen.com/api/midtrans/notification`
- Midtrans finish URL: `https://yokesen.com/id/seminar/payment/finish`
- Midtrans pending URL: `https://yokesen.com/id/seminar/payment/pending`
- Midtrans error URL: `https://yokesen.com/id/seminar/payment/error`

## Server

- Host: `thegreatsky`
- Public IP: `94.237.65.236`
- Active app path: `/home/gatepayment/public_html/api_yokesen_com`
- Public document root: `/home/gatepayment/public_html/api_yokesen_com/public`
- Environment file: `/home/gatepayment/public_html/api_yokesen_com/.env`
- PHP runtime: cPanel EasyApache PHP 8.0 FPM
- Apache include: `/etc/apache2/conf.d/includes/pre_virtualhost_global.conf`
- SSL certificate path: `/etc/ssl/api.yokesen.com`

## Database

- MySQL database: `gatepayment_yokesenapi`
- MySQL user: `gatepayment_yapi`
- Tables:
  - `seminar_orders`
  - `seminar_attendees`
  - `seminar_payments`
  - `midtrans_notifications`

Do not document database passwords in Git. The password lives only in the remote `.env`.

## DNS

- Zone owner server: `yokedollar`
- Zone file: `/var/named/yokesen.com.db`
- Record: `api.yokesen.com A 94.237.65.236`
- Last known serial after setup: `2026070701`

## Midtrans

Sandbox mode is active for current testing:

```env
MIDTRANS_MODE=sandbox
```

Production keys are present but not active while `MIDTRANS_MODE=sandbox`.

For production go-live, switch the remote `.env` back to:

```env
MIDTRANS_MODE=production
```

Sandbox keys are used while testing:

```env
MIDTRANS_SANDBOX_CLIENT_KEY=...
MIDTRANS_SANDBOX_SERVER_KEY=...
```

## Legal Entity

- Seminar legal/invoice entity: `PT. YOKESEN MEDIA KAGUMI`
- Technology company context: `PT. YOKESEN TEKNOLOGI INDONESIA`

## Smoke Test Result

Verified on 2026-07-07:

- `GET /health` returns `200 OK`.
- `POST /api/seminar/register` creates a seminar order.
- `GET /api/seminar/order/{order_id}` returns order details.
- `POST /api/midtrans/create-transaction` returns `503` while production keys are still placeholders. This is expected and prevents accidental production calls without credentials.

The smoke-test order was removed from the production database after verification.

## Next Step

After Coach fills the Midtrans production keys:

1. Run a real Midtrans create-transaction smoke test.
2. Connect the YOKESEN website seminar form to `POST /api/seminar/register`.
3. Redirect the buyer to the returned Midtrans Snap URL.
4. Run one browser checkout test from `https://yokesen.com/id/seminar/checkout`.
