{
    "openapi": "3.0.3",
    "info": {
        "title": "API Kasir Toko (POS) — Belajar API UNAMA",
        "version": "1.0.0",
        "description": "REST API SaaS kasir toko multi-tenant. Dokumentasi: http://localhost/kasir/docs\nSemua response berbentuk {success, message, data, meta}."
    },
    "servers": [
        {
            "url": "http://localhost/api/kasir"
        }
    ],
    "tags": [
        {
            "name": "Info API",
            "description": "Endpoint publik berisi info API, spesifikasi OpenAPI 3, dan koleksi Postman."
        },
        {
            "name": "Autentikasi",
            "description": "Registrasi toko, login, dan akun. Login mengembalikan `data.token.access_token` (berlaku 30 hari). Kirim di setiap request sebagai header `Authorization: Bearer {token}`. Endpoint register/login/lupa password dibatasi 10 request/menit."
        },
        {
            "name": "Toko & Staff",
            "description": "Pengaturan toko (pajak %, footer & lebar struk, poin) dan manajemen staff kasir oleh owner."
        },
        {
            "name": "Master Data",
            "description": "Kategori, satuan, dan supplier milik toko. Kasir hanya bisa membaca; owner bisa menambah/mengubah/menghapus."
        },
        {
            "name": "Produk",
            "description": "Produk dengan SKU/barcode, harga beli (HPP), harga jual, stok & stok minimum. Stok tidak diubah lewat endpoint produk, tetapi lewat Stok Masuk atau Penyesuaian agar tercatat di riwayat mutasi."
        },
        {
            "name": "Stok",
            "description": "Stok masuk (pembelian dari supplier), penyesuaian/stock opname, riwayat mutasi, dan peringatan stok menipis. Khusus owner."
        },
        {
            "name": "Pelanggan",
            "description": "Data pelanggan per toko beserta poin. Kasir dapat menambah & mengubah; menghapus khusus owner."
        },
        {
            "name": "Transaksi (POS)",
            "description": "Penjualan kasir. Disimpan dalam satu DB transaction dengan baris produk dikunci (`SELECT ... FOR UPDATE`) sehingga stok tidak bisa minus walau dua kasir menjual bersamaan. Nomor nota otomatis per toko: `INV-yymmdd-0001`. Kasir hanya melihat transaksinya sendiri."
        },
        {
            "name": "Shift Kasir",
            "description": "Opsional: buka kas dengan saldo awal, lalu tutup kas dengan saldo akhir. Sistem menghitung kas seharusnya (saldo awal + penjualan tunai pada shift) dan selisihnya."
        },
        {
            "name": "Laporan",
            "description": "Laporan khusus owner. Hanya transaksi berstatus `paid`. Laba kotor = penjualan bersih (setelah diskon, sebelum pajak) − HPP (harga beli saat transaksi). Tambahkan `format=csv` untuk mengunduh CSV (pemisah `;`, siap dibuka Excel)."
        },
        {
            "name": "Portal Pelanggan",
            "description": "Pelanggan mendaftar sendiri di toko tertentu (berdasarkan slug) lalu melihat riwayat belanja & poin. Token pelanggan hanya berlaku untuk toko tersebut. Jika email & nomor HP sama dengan data yang sudah dicatat kasir, akun dihubungkan ke data itu."
        },
        {
            "name": "Superadmin Platform",
            "description": "Khusus superadmin: statistik seluruh platform, daftar toko, dan aktif/nonaktifkan toko. Toko nonaktif tidak bisa login (web & API) dan halaman tokonya ditutup."
        }
    ],
    "paths": {
        "/": {
            "get": {
                "tags": [
                    "Info API"
                ],
                "summary": "Info & daftar grup endpoint",
                "description": "",
                "operationId": "get_",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Selamat datang di API Kasir Toko",
                                    "data": {
                                        "name": "API Kasir Toko (POS) UNAMA",
                                        "version": "1.0.0",
                                        "base_url": "http://localhost/api/kasir",
                                        "docs": "http://localhost/kasir/docs",
                                        "openapi": "http://localhost/api/kasir/openapi",
                                        "openapi_static": "http://localhost/kasir/openapi.json",
                                        "postman": "http://localhost/api/kasir/postman",
                                        "endpoints": 80,
                                        "groups": [
                                            {
                                                "id": "meta",
                                                "title": "Info API",
                                                "endpoints": 3
                                            },
                                            {
                                                "id": "auth",
                                                "title": "Autentikasi",
                                                "endpoints": 8
                                            }
                                        ]
                                    },
                                    "meta": null
                                }
                            }
                        }
                    }
                }
            }
        },
        "/openapi.json": {
            "get": {
                "tags": [
                    "Info API"
                ],
                "summary": "Spesifikasi OpenAPI 3",
                "description": "",
                "operationId": "get_openapi_json",
                "responses": {
                    "200": {
                        "description": "Berhasil"
                    }
                }
            }
        },
        "/postman.json": {
            "get": {
                "tags": [
                    "Info API"
                ],
                "summary": "Unduh koleksi Postman",
                "description": "",
                "operationId": "get_postman_json",
                "responses": {
                    "200": {
                        "description": "Berhasil"
                    }
                }
            }
        },
        "/auth/register": {
            "post": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Registrasi toko baru (owner + toko)",
                "description": "Membuat toko beserta akun pemiliknya sekaligus. Slug toko dibuat otomatis dari nama toko. Kategori (Umum, Makanan, Minuman) dan satuan (pcs, box, kg, liter, pack) awal ikut dibuat. Langsung mengembalikan token.",
                "operationId": "post_auth_register",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Registrasi toko berhasil",
                                    "data": {
                                        "user": {
                                            "id": 26,
                                            "name": "Ahmad Fauzi",
                                            "email": "ahmad@example.com",
                                            "phone": "081234567890",
                                            "role": "owner",
                                            "is_active": true,
                                            "tenant_id": 12,
                                            "last_login_at": "2026-11-13T07:18:33+07:00",
                                            "created_at": "2026-11-13T07:18:33+07:00"
                                        },
                                        "store": {
                                            "id": 12,
                                            "name": "Warung Maju",
                                            "slug": "warung-maju",
                                            "status": "active",
                                            "store_url": "http://localhost/kasir/t/warung-maju"
                                        },
                                        "token": {
                                            "access_token": "50|OzhxpPTZAD6L6AInu651srNIkXeAh7NuZChCbJYhpZyWS8I1",
                                            "token_type": "Bearer",
                                            "expires_at": "2026-12-13T07:18:34+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "store_name": {
                                        "type": "string",
                                        "description": "Nama toko (3-120)",
                                        "example": "Warung Maju"
                                    },
                                    "name": {
                                        "type": "string",
                                        "description": "Nama pemilik",
                                        "example": "Ahmad Fauzi"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email login (unik)",
                                        "example": "ahmad@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Minimal 6 karakter",
                                        "example": "rahasia123"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "description": "Ulangi password",
                                        "example": "rahasia123"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Nomor HP/telepon toko",
                                        "example": "081234567890"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Alamat toko",
                                        "example": "Jl. Merdeka No. 1, Jambi"
                                    }
                                },
                                "required": [
                                    "store_name",
                                    "name",
                                    "email",
                                    "password",
                                    "password_confirmation"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/auth/login": {
            "post": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Login (superadmin, owner, kasir)",
                "description": "Tukar email & password dengan token. Akun demo: `owner@berkah.demo` / `password`.",
                "operationId": "post_auth_login",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Login berhasil",
                                    "data": {
                                        "user": {
                                            "id": 15,
                                            "name": "Budi Santoso",
                                            "email": "owner@berkah.demo",
                                            "phone": "081234567890",
                                            "role": "owner",
                                            "is_active": true,
                                            "tenant_id": 7,
                                            "last_login_at": "2026-11-13T07:18:34+07:00",
                                            "created_at": "2026-11-13T06:12:12+07:00"
                                        },
                                        "store": {
                                            "id": 7,
                                            "name": "Toko Berkah Jaya",
                                            "slug": "toko-berkah-jaya",
                                            "status": "active",
                                            "store_url": "http://localhost/kasir/t/toko-berkah-jaya"
                                        },
                                        "token": {
                                            "access_token": "51|heOSenGhSJwowEZJjaFy6UrFbcsY4ieVlOiQ7QAYgeymteLQ",
                                            "token_type": "Bearer",
                                            "expires_at": "2026-12-13T07:18:34+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Email",
                                        "example": "owner@berkah.demo"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password",
                                        "example": "password"
                                    },
                                    "device_name": {
                                        "type": "string",
                                        "description": "Nama perangkat",
                                        "example": "postman"
                                    }
                                },
                                "required": [
                                    "email",
                                    "password"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/auth/forgot-password": {
            "post": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Lupa password",
                "description": "Mengirim email berisi tautan reset (web) dan token reset (API). Respons selalu sama walau email tidak terdaftar.",
                "operationId": "post_auth_forgot_password",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Jika email terdaftar, tautan & token reset password telah dikirim ke email tersebut (berlaku 60 menit).",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Email akun",
                                        "example": "owner@berkah.demo"
                                    }
                                },
                                "required": [
                                    "email"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/auth/reset-password": {
            "post": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Reset password dengan token",
                "description": "Token dari email berlaku 60 menit. Semua token API user dicabut setelah berhasil.",
                "operationId": "post_auth_reset_password",
                "responses": {
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Email akun",
                                        "example": "owner@berkah.demo"
                                    },
                                    "token": {
                                        "type": "string",
                                        "description": "Token dari email",
                                        "example": "xxxxxxxx"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password baru",
                                        "example": "passwordbaru"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "description": "Ulangi password baru",
                                        "example": "passwordbaru"
                                    }
                                },
                                "required": [
                                    "email",
                                    "token",
                                    "password",
                                    "password_confirmation"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/auth/me": {
            "get": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Profil user yang login",
                "description": "Peran: superadmin,owner,kasir",
                "operationId": "get_auth_me",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "user": {
                                            "id": 1,
                                            "name": "Admin Platform",
                                            "email": "superadmin@kasir.demo",
                                            "phone": null,
                                            "role": "superadmin",
                                            "is_active": true,
                                            "tenant_id": null,
                                            "last_login_at": "2026-11-13T07:18:33+07:00",
                                            "created_at": "2026-11-13T05:46:59+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Ubah profil",
                "description": "Peran: superadmin,owner,kasir",
                "operationId": "put_auth_me",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Profil diperbarui",
                                    "data": {
                                        "user": {
                                            "id": 1,
                                            "name": "Budi Santoso",
                                            "email": "superadmin@kasir.demo",
                                            "phone": "081299998888",
                                            "role": "superadmin",
                                            "is_active": true,
                                            "tenant_id": null,
                                            "last_login_at": "2026-11-13T07:18:33+07:00",
                                            "created_at": "2026-11-13T05:46:59+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama",
                                        "example": "Budi Santoso"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email (unik)"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Nomor HP",
                                        "example": "081299998888"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/auth/password": {
            "put": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Ganti password",
                "description": "Token lain milik user dicabut, token yang sedang dipakai tetap berlaku.\n\nPeran: superadmin,owner,kasir",
                "operationId": "put_auth_password",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Password berhasil diganti. Token di perangkat lain telah dicabut.",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "current_password": {
                                        "type": "string",
                                        "description": "Password saat ini",
                                        "example": "password"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password baru (min 6)",
                                        "example": "passwordbaru"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "description": "Ulangi password baru",
                                        "example": "passwordbaru"
                                    }
                                },
                                "required": [
                                    "current_password",
                                    "password",
                                    "password_confirmation"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/auth/logout": {
            "post": {
                "tags": [
                    "Autentikasi"
                ],
                "summary": "Logout (cabut token ini)",
                "description": "Peran: superadmin,owner,kasir",
                "operationId": "post_auth_logout",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Logout berhasil",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/store": {
            "get": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Data toko",
                "description": "Peran: owner,kasir",
                "operationId": "get_store",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 7,
                                        "name": "Toko Berkah Jaya",
                                        "slug": "toko-berkah-jaya",
                                        "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                        "phone": "0741-123456",
                                        "email": "owner@berkah.demo",
                                        "logo": "demo/toko-berkah-jaya/logo.png",
                                        "tax_percent": 0,
                                        "point_rate": 10000,
                                        "receipt_footer": "Terima kasih telah berbelanja di Toko Berkah Jaya!",
                                        "receipt_width": 58,
                                        "status": "active",
                                        "created_at": "2026-09-29T06:12:12+07:00",
                                        "updated_at": "2026-11-13T06:12:12+07:00",
                                        "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                        "store_url": "http://localhost/kasir/t/toko-berkah-jaya"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Ubah pengaturan toko",
                "description": "Peran: owner",
                "operationId": "put_store",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Pengaturan toko disimpan",
                                    "data": {
                                        "id": 7,
                                        "name": "Toko Berkah Jaya",
                                        "slug": "toko-berkah-jaya",
                                        "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                        "phone": "0741-123456",
                                        "email": "owner@berkah.demo",
                                        "logo": "demo/toko-berkah-jaya/logo.png",
                                        "tax_percent": 0,
                                        "point_rate": 10000,
                                        "receipt_footer": "Terima kasih!",
                                        "receipt_width": 58,
                                        "status": "active",
                                        "created_at": "2026-09-29T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                        "store_url": "http://localhost/kasir/t/toko-berkah-jaya"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama toko",
                                        "example": "Toko Berkah Jaya"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Alamat",
                                        "example": "Jl. Kapten Pattimura No. 10, Jambi"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telepon",
                                        "example": "0741-123456"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email toko"
                                    },
                                    "tax_percent": {
                                        "type": "number",
                                        "description": "Pajak (%) yang otomatis ditambahkan ke setiap nota",
                                        "example": 0
                                    },
                                    "point_rate": {
                                        "type": "integer",
                                        "description": "1 poin pelanggan per kelipatan Rp ini (0 = poin nonaktif)",
                                        "example": 10000
                                    },
                                    "receipt_footer": {
                                        "type": "string",
                                        "description": "Teks di bawah struk",
                                        "example": "Terima kasih!"
                                    },
                                    "receipt_width": {
                                        "type": "integer",
                                        "description": "Lebar kertas struk: 58 atau 80 (mm)",
                                        "example": 58
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/store/logo": {
            "post": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Upload logo toko",
                "description": "Peran: owner",
                "operationId": "post_store_logo",
                "responses": {
                    "200": {
                        "description": "Berhasil"
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "logo": {
                                        "type": "string",
                                        "description": "Gambar jpg/png/webp maks 2MB",
                                        "format": "binary"
                                    }
                                },
                                "required": [
                                    "logo"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/users": {
            "get": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Daftar user toko",
                "description": "Peran: owner",
                "operationId": "get_users",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nama/email",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "role",
                        "in": "query",
                        "required": false,
                        "description": "`owner` atau `kasir`",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 17,
                                            "name": "Rudi Hartono",
                                            "email": "kasir2@berkah.demo",
                                            "phone": null,
                                            "role": "kasir",
                                            "is_active": true,
                                            "tenant_id": 7,
                                            "last_login_at": null,
                                            "created_at": "2026-11-13T06:12:12+07:00"
                                        },
                                        {
                                            "id": 16,
                                            "name": "Siti Aminah",
                                            "email": "kasir@berkah.demo",
                                            "phone": null,
                                            "role": "kasir",
                                            "is_active": true,
                                            "tenant_id": 7,
                                            "last_login_at": null,
                                            "created_at": "2026-11-13T06:12:12+07:00"
                                        },
                                        {
                                            "id": 15,
                                            "name": "Budi Santoso",
                                            "email": "owner@berkah.demo",
                                            "phone": "081234567890",
                                            "role": "owner",
                                            "is_active": true,
                                            "tenant_id": 7,
                                            "last_login_at": "2026-11-13T07:18:34+07:00",
                                            "created_at": "2026-11-13T06:12:12+07:00"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 3,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Tambah staff kasir",
                "description": "Peran: owner",
                "operationId": "post_users",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Kasir berhasil ditambahkan",
                                    "data": {
                                        "id": 27,
                                        "name": "Kasir Baru",
                                        "email": "kasir.baru@example.com",
                                        "phone": null,
                                        "role": "kasir",
                                        "is_active": true,
                                        "tenant_id": 7,
                                        "last_login_at": null,
                                        "created_at": "2026-11-13T07:18:34+07:00"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama",
                                        "example": "Kasir Baru"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email login (unik)",
                                        "example": "kasir.baru@example.com"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password (min 6)",
                                        "example": "rahasia123"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Nomor HP"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Aktif?",
                                        "example": true
                                    }
                                },
                                "required": [
                                    "name",
                                    "email",
                                    "password"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/users/{id}": {
            "get": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Detail user",
                "description": "Peran: owner",
                "operationId": "get_users_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID user",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 17
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 17,
                                        "name": "Rudi Hartono",
                                        "email": "kasir2@berkah.demo",
                                        "phone": null,
                                        "role": "kasir",
                                        "is_active": true,
                                        "tenant_id": 7,
                                        "last_login_at": null,
                                        "created_at": "2026-11-13T06:12:12+07:00"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Ubah user / reset password / nonaktifkan",
                "description": "Kirim field yang ingin diubah saja. `password` kosong = tidak diubah. Menonaktifkan atau mengganti password mencabut token user tersebut.\n\nPeran: owner",
                "operationId": "put_users_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID user",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 17
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "User diperbarui",
                                    "data": {
                                        "id": 17,
                                        "name": "Rudi Hartono",
                                        "email": "kasir2@berkah.demo",
                                        "phone": null,
                                        "role": "kasir",
                                        "is_active": true,
                                        "tenant_id": 7,
                                        "last_login_at": null,
                                        "created_at": "2026-11-13T06:12:12+07:00"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password baru"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Aktif?",
                                        "example": true
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Toko & Staff"
                ],
                "summary": "Hapus staff",
                "description": "Peran: owner",
                "operationId": "delete_users_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID user",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 17
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "User dihapus",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/categories": {
            "get": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Daftar kategori",
                "description": "Peran: owner,kasir",
                "operationId": "get_categories",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Kata kunci pencarian",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 28,
                                            "name": "Kebutuhan Rumah",
                                            "description": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "products_count": 5
                                        },
                                        {
                                            "id": 27,
                                            "name": "Makanan Ringan",
                                            "description": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "products_count": 4
                                        },
                                        {
                                            "id": 29,
                                            "name": "Mi Instan",
                                            "description": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "products_count": 3
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 5,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Tambah kategori",
                "description": "Peran: owner",
                "operationId": "post_categories",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Kategori berhasil ditambahkan",
                                    "data": {
                                        "name": "Frozen Food",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "created_at": "2026-11-13T07:18:34+07:00",
                                        "id": 48
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama kategori (unik per toko)",
                                        "example": "Frozen Food"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Keterangan"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/categories/{id}": {
            "get": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Detail kategori",
                "description": "Peran: owner,kasir",
                "operationId": "get_categories_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID kategori",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 25,
                                        "name": "Sembako",
                                        "description": null,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T06:12:12+07:00",
                                        "products_count": 6
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Ubah kategori",
                "description": "Peran: owner",
                "operationId": "put_categories_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID kategori",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Kategori diperbarui",
                                    "data": {
                                        "id": 25,
                                        "name": "Frozen Food (ubah)",
                                        "description": null,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama kategori (unik per toko)",
                                        "example": "Frozen Food (ubah)"
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Keterangan"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Hapus kategori",
                "description": "Peran: owner",
                "operationId": "delete_categories_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID kategori",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Kategori dihapus",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/units": {
            "get": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Daftar satuan",
                "description": "Peran: owner,kasir",
                "operationId": "get_units",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Kata kunci pencarian",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 35,
                                            "name": "box",
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "products_count": 1
                                        },
                                        {
                                            "id": 34,
                                            "name": "kg",
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "products_count": 3
                                        },
                                        {
                                            "id": 32,
                                            "name": "pack",
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "products_count": 1
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 4,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Tambah satuan",
                "description": "Peran: owner",
                "operationId": "post_units",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Satuan berhasil ditambahkan",
                                    "data": {
                                        "name": "lusin",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "created_at": "2026-11-13T07:18:34+07:00",
                                        "id": 62
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama satuan (unik per toko)",
                                        "example": "lusin"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/units/{id}": {
            "get": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Detail satuan",
                "description": "Peran: owner,kasir",
                "operationId": "get_units_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID satuan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 32
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 32,
                                        "name": "pack",
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T06:12:12+07:00",
                                        "products_count": 1
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Ubah satuan",
                "description": "Peran: owner",
                "operationId": "put_units_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID satuan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 32
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Satuan diperbarui",
                                    "data": {
                                        "id": 32,
                                        "name": "lusin (ubah)",
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama satuan (unik per toko)",
                                        "example": "lusin (ubah)"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Hapus satuan",
                "description": "Peran: owner",
                "operationId": "delete_units_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID satuan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 32
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Satuan dihapus",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/suppliers": {
            "get": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Daftar supplier",
                "description": "Peran: owner,kasir",
                "operationId": "get_suppliers",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Kata kunci pencarian",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 11,
                                            "name": "CV Indo Grosir",
                                            "phone": "0741-550001",
                                            "email": null,
                                            "address": "Jambi",
                                            "notes": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "purchases_count": 0
                                        },
                                        {
                                            "id": 12,
                                            "name": "Distributor Sinar Jambi",
                                            "phone": "0741-550002",
                                            "email": null,
                                            "address": "Jambi",
                                            "notes": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "purchases_count": 1
                                        },
                                        {
                                            "id": 10,
                                            "name": "PT Sumber Makmur",
                                            "phone": "0741-550000",
                                            "email": null,
                                            "address": "Jambi",
                                            "notes": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:12+07:00",
                                            "purchases_count": 3
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 3,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Tambah supplier",
                "description": "Peran: owner",
                "operationId": "post_suppliers",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Supplier berhasil ditambahkan",
                                    "data": {
                                        "name": "UD Sejahtera",
                                        "phone": "0741-222333",
                                        "address": "Jambi",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "created_at": "2026-11-13T07:18:34+07:00",
                                        "id": 18
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama supplier",
                                        "example": "UD Sejahtera"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telepon",
                                        "example": "0741-222333"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Alamat",
                                        "example": "Jambi"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Catatan"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/suppliers/{id}": {
            "get": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Detail supplier",
                "description": "Peran: owner,kasir",
                "operationId": "get_suppliers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID supplier",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 10
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 10,
                                        "name": "PT Sumber Makmur",
                                        "phone": "0741-550000",
                                        "email": null,
                                        "address": "Jambi",
                                        "notes": null,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T06:12:12+07:00",
                                        "purchases_count": 3
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Ubah supplier",
                "description": "Peran: owner",
                "operationId": "put_suppliers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID supplier",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 10
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Supplier diperbarui",
                                    "data": {
                                        "id": 10,
                                        "name": "UD Sejahtera (ubah)",
                                        "phone": "0741-222333",
                                        "email": null,
                                        "address": "Jambi",
                                        "notes": null,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama supplier",
                                        "example": "UD Sejahtera (ubah)"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Telepon",
                                        "example": "0741-222333"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Alamat",
                                        "example": "Jambi"
                                    },
                                    "notes": {
                                        "type": "string",
                                        "description": "Catatan"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Master Data"
                ],
                "summary": "Hapus supplier",
                "description": "Peran: owner",
                "operationId": "delete_suppliers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID supplier",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 10
                    }
                ],
                "responses": {
                    "422": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "message": "Supplier sudah dipakai di data stok masuk, tidak dapat dihapus",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/products": {
            "get": {
                "tags": [
                    "Produk"
                ],
                "summary": "Daftar & cari produk",
                "description": "Peran: owner,kasir",
                "operationId": "get_products",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nama / SKU / barcode",
                        "schema": {
                            "type": "string"
                        },
                        "example": "mi"
                    },
                    {
                        "name": "category_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter kategori",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "active",
                        "in": "query",
                        "required": false,
                        "description": "true / false",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "low_stock",
                        "in": "query",
                        "required": false,
                        "description": "true = hanya stok menipis",
                        "schema": {
                            "type": "boolean"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`name`, `-name`, `price`, `-price`, `stock`, `-stock`, `-created_at`",
                        "schema": {
                            "type": "string"
                        },
                        "example": "name"
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 51,
                                            "category_id": 26,
                                            "unit_id": 33,
                                            "sku": "TOK0007",
                                            "barcode": "8990000007007",
                                            "name": "Air Mineral 600ml",
                                            "description": null,
                                            "cost_price": 2500,
                                            "price": 4000,
                                            "stock": 119,
                                            "min_stock": 9,
                                            "image": "demo/toko-berkah-jaya/TOK0007.jpg",
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T03:40:20+07:00",
                                            "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0007.jpg",
                                            "is_low_stock": false,
                                            "category": {
                                                "id": 26,
                                                "name": "Minuman"
                                            },
                                            "unit": {
                                                "id": 33,
                                                "name": "pcs"
                                            }
                                        },
                                        {
                                            "id": 45,
                                            "category_id": 25,
                                            "unit_id": 32,
                                            "sku": "TOK0001",
                                            "barcode": "8990000007001",
                                            "name": "Beras Premium 5kg",
                                            "description": null,
                                            "cost_price": 62000,
                                            "price": 72000,
                                            "stock": 110,
                                            "min_stock": 15,
                                            "image": "demo/toko-berkah-jaya/TOK0001.jpg",
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T01:28:18+07:00",
                                            "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0001.jpg",
                                            "is_low_stock": false,
                                            "category": {
                                                "id": 25,
                                                "name": "Frozen Food (ubah)"
                                            },
                                            "unit": {
                                                "id": 32,
                                                "name": "lusin (ubah)"
                                            }
                                        },
                                        {
                                            "id": 67,
                                            "category_id": 29,
                                            "unit_id": 33,
                                            "sku": "TOK0023",
                                            "barcode": "8990000007023",
                                            "name": "Mi Cup",
                                            "description": null,
                                            "cost_price": 4500,
                                            "price": 6000,
                                            "stock": 265,
                                            "min_stock": 8,
                                            "image": "demo/toko-berkah-jaya/TOK0023.jpg",
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T01:28:18+07:00",
                                            "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0023.jpg",
                                            "is_low_stock": false,
                                            "category": {
                                                "id": 29,
                                                "name": "Mi Instan"
                                            },
                                            "unit": {
                                                "id": 33,
                                                "name": "pcs"
                                            }
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 7,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Produk"
                ],
                "summary": "Tambah produk",
                "description": "Bisa JSON atau multipart (bila menyertakan `image`). SKU kosong = dibuat otomatis (PRD00001). `stock` = stok awal (tercatat sebagai mutasi \"Stok awal\").\n\nPeran: owner",
                "operationId": "post_products",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Produk berhasil ditambahkan",
                                    "data": {
                                        "id": 87,
                                        "category_id": null,
                                        "unit_id": null,
                                        "sku": "KOPI200",
                                        "barcode": "8991234567890",
                                        "name": "Kopi Bubuk 200g",
                                        "description": null,
                                        "cost_price": 18000,
                                        "price": 24000,
                                        "stock": 20,
                                        "min_stock": 5,
                                        "image": null,
                                        "is_active": true,
                                        "created_at": "2026-11-13T07:18:34+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "image_url": null,
                                        "is_low_stock": false,
                                        "category": null,
                                        "unit": null
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama produk",
                                        "example": "Kopi Bubuk 200g"
                                    },
                                    "sku": {
                                        "type": "string",
                                        "description": "Kode unik per toko (huruf/angka/-/_)",
                                        "example": "KOPI200"
                                    },
                                    "barcode": {
                                        "type": "string",
                                        "description": "Barcode (unik per toko)",
                                        "example": "8991234567890"
                                    },
                                    "category_id": {
                                        "type": "integer",
                                        "description": "ID kategori"
                                    },
                                    "unit_id": {
                                        "type": "integer",
                                        "description": "ID satuan"
                                    },
                                    "cost_price": {
                                        "type": "number",
                                        "description": "Harga beli / HPP",
                                        "example": 18000
                                    },
                                    "price": {
                                        "type": "number",
                                        "description": "Harga jual",
                                        "example": 24000
                                    },
                                    "stock": {
                                        "type": "integer",
                                        "description": "Stok awal",
                                        "example": 20
                                    },
                                    "min_stock": {
                                        "type": "integer",
                                        "description": "Batas stok menipis",
                                        "example": 5
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Dijual di POS?",
                                        "example": true
                                    },
                                    "description": {
                                        "type": "string",
                                        "description": "Deskripsi"
                                    },
                                    "image": {
                                        "type": "string",
                                        "description": "Gambar jpg/png/webp maks 2MB (multipart)",
                                        "format": "binary"
                                    }
                                },
                                "required": [
                                    "name",
                                    "cost_price",
                                    "price"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/products/barcode/{code}": {
            "get": {
                "tags": [
                    "Produk"
                ],
                "summary": "Cari produk dari barcode / SKU (scan)",
                "description": "Peran: owner,kasir",
                "operationId": "get_products_barcode_code",
                "parameters": [
                    {
                        "name": "code",
                        "in": "path",
                        "required": true,
                        "description": "Barcode atau SKU",
                        "schema": {
                            "type": "string"
                        },
                        "example": "8990000007001"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 45,
                                        "category_id": 25,
                                        "unit_id": 32,
                                        "sku": "TOK0001",
                                        "barcode": "8990000007001",
                                        "name": "Beras Premium 5kg",
                                        "description": null,
                                        "cost_price": 62000,
                                        "price": 72000,
                                        "stock": 110,
                                        "min_stock": 15,
                                        "image": "demo/toko-berkah-jaya/TOK0001.jpg",
                                        "is_active": true,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T01:28:18+07:00",
                                        "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0001.jpg",
                                        "is_low_stock": false,
                                        "category": {
                                            "id": 25,
                                            "name": "Frozen Food (ubah)"
                                        },
                                        "unit": {
                                            "id": 32,
                                            "name": "lusin (ubah)"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/products/{id}": {
            "get": {
                "tags": [
                    "Produk"
                ],
                "summary": "Detail produk",
                "description": "Peran: owner,kasir",
                "operationId": "get_products_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID produk",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 45
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 45,
                                        "category_id": 25,
                                        "unit_id": 32,
                                        "sku": "TOK0001",
                                        "barcode": "8990000007001",
                                        "name": "Beras Premium 5kg",
                                        "description": null,
                                        "cost_price": 62000,
                                        "price": 72000,
                                        "stock": 110,
                                        "min_stock": 15,
                                        "image": "demo/toko-berkah-jaya/TOK0001.jpg",
                                        "is_active": true,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T01:28:18+07:00",
                                        "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0001.jpg",
                                        "is_low_stock": false,
                                        "category": {
                                            "id": 25,
                                            "name": "Frozen Food (ubah)"
                                        },
                                        "unit": {
                                            "id": 32,
                                            "name": "lusin (ubah)"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Produk"
                ],
                "summary": "Ubah produk",
                "description": "Kirim field yang ingin diubah saja. Field `stock` ditolak (422) — gunakan penyesuaian stok.\n\nPeran: owner",
                "operationId": "put_products_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID produk",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 45
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Produk diperbarui",
                                    "data": {
                                        "id": 45,
                                        "category_id": 25,
                                        "unit_id": 32,
                                        "sku": "TOK0001",
                                        "barcode": "8990000007001",
                                        "name": "Beras Premium 5kg",
                                        "description": null,
                                        "cost_price": 62000,
                                        "price": 73000,
                                        "stock": 110,
                                        "min_stock": 15,
                                        "image": "demo/toko-berkah-jaya/TOK0001.jpg",
                                        "is_active": true,
                                        "created_at": "2026-11-13T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0001.jpg",
                                        "is_low_stock": false,
                                        "category": {
                                            "id": 25,
                                            "name": "Frozen Food (ubah)"
                                        },
                                        "unit": {
                                            "id": 32,
                                            "name": "lusin (ubah)"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama"
                                    },
                                    "price": {
                                        "type": "number",
                                        "description": "Harga jual",
                                        "example": 73000
                                    },
                                    "cost_price": {
                                        "type": "number",
                                        "description": "Harga beli"
                                    },
                                    "min_stock": {
                                        "type": "integer",
                                        "description": "Stok minimum"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Aktif?"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Produk"
                ],
                "summary": "Hapus produk",
                "description": "Produk yang sudah pernah terjual tidak dapat dihapus (422); nonaktifkan dengan `is_active: false`.\n\nPeran: owner",
                "operationId": "delete_products_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID produk",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 45
                    }
                ],
                "responses": {
                    "422": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "message": "Produk sudah pernah terjual sehingga tidak dapat dihapus. Nonaktifkan saja (is_active = false).",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/products/{id}/image": {
            "post": {
                "tags": [
                    "Produk"
                ],
                "summary": "Upload gambar produk",
                "description": "Peran: owner",
                "operationId": "post_products_id_image",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID produk",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 45
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil"
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "multipart/form-data": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "image": {
                                        "type": "string",
                                        "description": "Gambar jpg/png/webp maks 2MB",
                                        "format": "binary"
                                    }
                                },
                                "required": [
                                    "image"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/stock/purchases": {
            "get": {
                "tags": [
                    "Stok"
                ],
                "summary": "Daftar stok masuk",
                "description": "Peran: owner",
                "operationId": "get_stock_purchases",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nomor",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "supplier_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter supplier",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Dari tanggal",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Sampai tanggal",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 16,
                                            "number": "PB-261108-0001",
                                            "supplier_id": 12,
                                            "user_id": 15,
                                            "date": "2026-11-08",
                                            "total": 1626600,
                                            "note": "Restock mingguan",
                                            "created_at": "2026-11-08T07:30:00+07:00",
                                            "updated_at": "2026-11-08T07:30:00+07:00",
                                            "items_count": 6,
                                            "supplier": {
                                                "id": 12,
                                                "name": "Distributor Sinar Jambi"
                                            },
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        },
                                        {
                                            "id": 15,
                                            "number": "PB-261029-0001",
                                            "supplier_id": 10,
                                            "user_id": 15,
                                            "date": "2026-10-29",
                                            "total": 2986000,
                                            "note": "Restock mingguan",
                                            "created_at": "2026-10-29T07:30:00+07:00",
                                            "updated_at": "2026-10-29T07:30:00+07:00",
                                            "items_count": 6,
                                            "supplier": {
                                                "id": 10,
                                                "name": "UD Sejahtera (ubah)"
                                            },
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        },
                                        {
                                            "id": 14,
                                            "number": "PB-261019-0001",
                                            "supplier_id": 10,
                                            "user_id": 15,
                                            "date": "2026-10-19",
                                            "total": 4929500,
                                            "note": "Restock mingguan",
                                            "created_at": "2026-10-19T07:30:00+07:00",
                                            "updated_at": "2026-10-19T07:30:00+07:00",
                                            "items_count": 6,
                                            "supplier": {
                                                "id": 10,
                                                "name": "UD Sejahtera (ubah)"
                                            },
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 4,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Stok"
                ],
                "summary": "Catat stok masuk",
                "description": "Menambah stok semua item dalam satu transaksi DB. `update_cost` (default true) memperbarui harga beli produk ke `cost_price` terbaru. Nomor otomatis `PB-yymmdd-0001`.\n\nPeran: owner",
                "operationId": "post_stock_purchases",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Stok masuk berhasil dicatat",
                                    "data": {
                                        "number": "PB-261113-0001",
                                        "supplier_id": null,
                                        "user_id": 15,
                                        "date": "2026-11-13",
                                        "note": "Faktur #123",
                                        "total": 620000,
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "created_at": "2026-11-13T07:18:34+07:00",
                                        "id": 24,
                                        "items": [
                                            {
                                                "id": 159,
                                                "purchase_id": 24,
                                                "product_id": 45,
                                                "qty": 10,
                                                "cost_price": 62000,
                                                "subtotal": 620000,
                                                "product": {
                                                    "id": 45,
                                                    "category_id": 25,
                                                    "unit_id": 32,
                                                    "sku": "TOK0001",
                                                    "barcode": "8990000007001",
                                                    "name": "Beras Premium 5kg",
                                                    "description": null,
                                                    "cost_price": 62000,
                                                    "price": 73000,
                                                    "stock": 120,
                                                    "min_stock": 15,
                                                    "image": "demo/toko-berkah-jaya/TOK0001.jpg",
                                                    "is_active": true,
                                                    "created_at": "2026-11-13T06:12:12+07:00",
                                                    "updated_at": "2026-11-13T07:18:34+07:00",
                                                    "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0001.jpg",
                                                    "is_low_stock": false
                                                }
                                            }
                                        ],
                                        "supplier": null
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "supplier_id": {
                                        "type": "integer",
                                        "description": "ID supplier"
                                    },
                                    "date": {
                                        "type": "string",
                                        "description": "Tanggal (default hari ini)"
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Catatan / no faktur supplier",
                                        "example": "Faktur #123"
                                    },
                                    "update_cost": {
                                        "type": "boolean",
                                        "description": "Perbarui harga beli produk",
                                        "example": true
                                    },
                                    "items": {
                                        "type": "array",
                                        "description": "Daftar item: `[{product_id, qty, cost_price?}]`",
                                        "items": {
                                            "type": "object"
                                        },
                                        "example": [
                                            {
                                                "product_id": 45,
                                                "qty": 10,
                                                "cost_price": 62000
                                            }
                                        ]
                                    }
                                },
                                "required": [
                                    "items"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/stock/purchases/{id}": {
            "get": {
                "tags": [
                    "Stok"
                ],
                "summary": "Detail stok masuk",
                "description": "Peran: owner",
                "operationId": "get_stock_purchases_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID stok masuk",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 13
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 13,
                                        "number": "PB-261013-0001",
                                        "supplier_id": 10,
                                        "user_id": 15,
                                        "date": "2026-10-13",
                                        "total": 58633200,
                                        "note": "Stok awal toko",
                                        "created_at": "2026-10-13T08:00:00+07:00",
                                        "updated_at": "2026-10-13T08:00:00+07:00",
                                        "items": [
                                            {
                                                "id": 81,
                                                "purchase_id": 13,
                                                "product_id": 45,
                                                "qty": 249,
                                                "cost_price": 62000,
                                                "subtotal": 15438000,
                                                "product": {
                                                    "id": 45,
                                                    "name": "Beras Premium 5kg",
                                                    "sku": "TOK0001",
                                                    "image_url": null,
                                                    "is_low_stock": true
                                                }
                                            },
                                            {
                                                "id": 82,
                                                "purchase_id": 13,
                                                "product_id": 46,
                                                "qty": 297,
                                                "cost_price": 31000,
                                                "subtotal": 9207000,
                                                "product": {
                                                    "id": 46,
                                                    "name": "Minyak Goreng 2L",
                                                    "sku": "TOK0002",
                                                    "image_url": null,
                                                    "is_low_stock": true
                                                }
                                            }
                                        ],
                                        "supplier": {
                                            "id": 10,
                                            "name": "UD Sejahtera (ubah)",
                                            "phone": "0741-222333",
                                            "email": null,
                                            "address": "Jambi",
                                            "notes": null,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T07:18:34+07:00"
                                        },
                                        "user": {
                                            "id": 15,
                                            "name": "Budi Santoso"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/stock/adjustments": {
            "post": {
                "tags": [
                    "Stok"
                ],
                "summary": "Penyesuaian stok (stock opname)",
                "description": "`mode: set` = jadikan stok sama dengan `qty` (hasil hitung fisik). `mode: add` = tambah/kurangi `qty` (boleh negatif, mis. barang rusak). Stok tidak boleh minus.\n\nPeran: owner",
                "operationId": "post_stock_adjustments",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Stok berhasil disesuaikan",
                                    "data": {
                                        "product_id": 45,
                                        "type": "adjustment",
                                        "qty": -1,
                                        "stock_before": 120,
                                        "stock_after": 119,
                                        "reference": "ADJ",
                                        "note": "Barang rusak",
                                        "user_id": 15,
                                        "created_at": "2026-11-13T07:18:34+07:00",
                                        "id": 6515,
                                        "product": {
                                            "id": 45,
                                            "name": "Beras Premium 5kg",
                                            "sku": "TOK0001",
                                            "image_url": null,
                                            "is_low_stock": true
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "product_id": {
                                        "type": "integer",
                                        "description": "ID produk",
                                        "example": 45
                                    },
                                    "mode": {
                                        "type": "string",
                                        "description": "`set` atau `add`",
                                        "example": "add"
                                    },
                                    "qty": {
                                        "type": "integer",
                                        "description": "Jumlah",
                                        "example": -1
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Alasan",
                                        "example": "Barang rusak"
                                    }
                                },
                                "required": [
                                    "product_id",
                                    "mode",
                                    "qty",
                                    "note"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/stock/movements": {
            "get": {
                "tags": [
                    "Stok"
                ],
                "summary": "Riwayat mutasi stok",
                "description": "Peran: owner",
                "operationId": "get_stock_movements",
                "parameters": [
                    {
                        "name": "product_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter produk",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "type",
                        "in": "query",
                        "required": false,
                        "description": "`initial`, `purchase`, `sale`, `adjustment`, `void`",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Dari tanggal",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Sampai tanggal",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 6515,
                                            "product_id": 45,
                                            "type": "adjustment",
                                            "qty": -1,
                                            "stock_before": 120,
                                            "stock_after": 119,
                                            "reference": "ADJ",
                                            "note": "Barang rusak",
                                            "user_id": 15,
                                            "created_at": "2026-11-13T07:18:34+07:00",
                                            "product": {
                                                "id": 45,
                                                "name": "Beras Premium 5kg",
                                                "sku": "TOK0001",
                                                "image_url": null,
                                                "is_low_stock": true
                                            },
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        },
                                        {
                                            "id": 6514,
                                            "product_id": 45,
                                            "type": "purchase",
                                            "qty": 10,
                                            "stock_before": 110,
                                            "stock_after": 120,
                                            "reference": "PB-261113-0001",
                                            "note": "Faktur #123",
                                            "user_id": 15,
                                            "created_at": "2026-11-13T07:18:34+07:00",
                                            "product": {
                                                "id": 45,
                                                "name": "Beras Premium 5kg",
                                                "sku": "TOK0001",
                                                "image_url": null,
                                                "is_low_stock": true
                                            },
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        },
                                        {
                                            "id": 6513,
                                            "product_id": 87,
                                            "type": "initial",
                                            "qty": 20,
                                            "stock_before": 0,
                                            "stock_after": 20,
                                            "reference": "AWAL",
                                            "note": "Stok awal produk",
                                            "user_id": 15,
                                            "created_at": "2026-11-13T07:18:34+07:00",
                                            "product": {
                                                "id": 87,
                                                "name": "Kopi Bubuk 200g",
                                                "sku": "KOPI200",
                                                "image_url": null,
                                                "is_low_stock": true
                                            },
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 1499,
                                        "last_page": 100
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/stock/low": {
            "get": {
                "tags": [
                    "Stok"
                ],
                "summary": "Produk stok menipis",
                "description": "Produk aktif dengan `stock <= min_stock`, diurutkan dari stok terkecil.\n\nPeran: owner",
                "operationId": "get_stock_low",
                "parameters": [
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Produk dengan stok di bawah atau sama dengan stok minimum",
                                    "data": [
                                        {
                                            "id": 62,
                                            "category_id": 28,
                                            "unit_id": 33,
                                            "sku": "TOK0018",
                                            "barcode": "8990000007018",
                                            "name": "Deterjen 800g",
                                            "description": null,
                                            "cost_price": 17000,
                                            "price": 21000,
                                            "stock": 3,
                                            "min_stock": 11,
                                            "image": "demo/toko-berkah-jaya/TOK0018.jpg",
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:31+07:00",
                                            "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0018.jpg",
                                            "is_low_stock": true,
                                            "unit": {
                                                "id": 33,
                                                "name": "pcs"
                                            }
                                        },
                                        {
                                            "id": 58,
                                            "category_id": 27,
                                            "unit_id": 33,
                                            "sku": "TOK0014",
                                            "barcode": "8990000007014",
                                            "name": "Wafer Coklat",
                                            "description": null,
                                            "cost_price": 4000,
                                            "price": 6000,
                                            "stock": 4,
                                            "min_stock": 11,
                                            "image": "demo/toko-berkah-jaya/TOK0014.jpg",
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:31+07:00",
                                            "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0014.jpg",
                                            "is_low_stock": true,
                                            "unit": {
                                                "id": 33,
                                                "name": "pcs"
                                            }
                                        },
                                        {
                                            "id": 60,
                                            "category_id": 28,
                                            "unit_id": 33,
                                            "sku": "TOK0016",
                                            "barcode": "8990000007016",
                                            "name": "Sabun Mandi",
                                            "description": null,
                                            "cost_price": 3000,
                                            "price": 4500,
                                            "stock": 10,
                                            "min_stock": 12,
                                            "image": "demo/toko-berkah-jaya/TOK0016.jpg",
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T06:12:31+07:00",
                                            "image_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/TOK0016.jpg",
                                            "is_low_stock": true,
                                            "unit": {
                                                "id": 33,
                                                "name": "pcs"
                                            }
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 3,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/customers": {
            "get": {
                "tags": [
                    "Pelanggan"
                ],
                "summary": "Daftar & cari pelanggan",
                "description": "Peran: owner,kasir",
                "operationId": "get_customers",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nama/kode/HP/email",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`name` atau `-points`",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 25,
                                            "code": "PLG00001",
                                            "name": "Andi Pratama",
                                            "phone": "081200000001",
                                            "email": "pelanggan@berkah.demo",
                                            "address": "Jambi",
                                            "points": 172,
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:13+07:00",
                                            "updated_at": "2026-11-13T03:13:07+07:00",
                                            "sales_count": 30,
                                            "has_account": true
                                        },
                                        {
                                            "id": 26,
                                            "code": "PLG00026",
                                            "name": "Bambang Wijaya",
                                            "phone": "081300000700",
                                            "email": null,
                                            "address": null,
                                            "points": 172,
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:13+07:00",
                                            "updated_at": "2026-11-12T19:02:42+07:00",
                                            "sales_count": 26,
                                            "has_account": false
                                        },
                                        {
                                            "id": 27,
                                            "code": "PLG00027",
                                            "name": "Citra Kirana",
                                            "phone": "081300000701",
                                            "email": null,
                                            "address": null,
                                            "points": 219,
                                            "is_active": true,
                                            "created_at": "2026-11-13T06:12:13+07:00",
                                            "updated_at": "2026-11-12T12:16:36+07:00",
                                            "sales_count": 28,
                                            "has_account": false
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 9,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "post": {
                "tags": [
                    "Pelanggan"
                ],
                "summary": "Tambah pelanggan",
                "description": "Kode pelanggan dibuat otomatis (PLG00001).\n\nPeran: owner,kasir",
                "operationId": "post_customers",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Pelanggan berhasil ditambahkan",
                                    "data": {
                                        "id": 48,
                                        "code": "PLG00034",
                                        "name": "Pelanggan Baru",
                                        "phone": "081311112222",
                                        "email": null,
                                        "address": null,
                                        "points": 0,
                                        "is_active": true,
                                        "created_at": "2026-11-13T07:18:35+07:00",
                                        "updated_at": "2026-11-13T07:18:35+07:00",
                                        "has_account": false
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama",
                                        "example": "Pelanggan Baru"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Nomor HP",
                                        "example": "081311112222"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email (unik per toko)"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Alamat"
                                    }
                                },
                                "required": [
                                    "name"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/customers/{id}": {
            "get": {
                "tags": [
                    "Pelanggan"
                ],
                "summary": "Detail pelanggan (+ total belanja)",
                "description": "Peran: owner,kasir",
                "operationId": "get_customers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID pelanggan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 25,
                                        "code": "PLG00001",
                                        "name": "Andi Pratama",
                                        "phone": "081200000001",
                                        "email": "pelanggan@berkah.demo",
                                        "address": "Jambi",
                                        "points": 172,
                                        "is_active": true,
                                        "created_at": "2026-11-13T06:12:13+07:00",
                                        "updated_at": "2026-11-13T03:13:07+07:00",
                                        "sales_count": 30,
                                        "total_spent": 1878000,
                                        "has_account": true
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "put": {
                "tags": [
                    "Pelanggan"
                ],
                "summary": "Ubah pelanggan",
                "description": "Peran: owner,kasir",
                "operationId": "put_customers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID pelanggan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Pelanggan diperbarui",
                                    "data": {
                                        "id": 25,
                                        "code": "PLG00001",
                                        "name": "Andi Pratama",
                                        "phone": "081200000001",
                                        "email": "pelanggan@berkah.demo",
                                        "address": "Jl. Baru",
                                        "points": 172,
                                        "is_active": true,
                                        "created_at": "2026-11-13T06:12:13+07:00",
                                        "updated_at": "2026-11-13T07:18:35+07:00",
                                        "has_account": true
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "HP"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email"
                                    },
                                    "address": {
                                        "type": "string",
                                        "description": "Alamat",
                                        "example": "Jl. Baru"
                                    },
                                    "is_active": {
                                        "type": "boolean",
                                        "description": "Aktif?"
                                    }
                                }
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "delete": {
                "tags": [
                    "Pelanggan"
                ],
                "summary": "Hapus pelanggan",
                "description": "Pelanggan yang sudah punya transaksi tidak dapat dihapus (422).\n\nPeran: owner",
                "operationId": "delete_customers_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID pelanggan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    }
                ],
                "responses": {
                    "422": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": false,
                                    "message": "Pelanggan sudah memiliki transaksi, tidak dapat dihapus. Nonaktifkan saja.",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/customers/{id}/sales": {
            "get": {
                "tags": [
                    "Pelanggan"
                ],
                "summary": "Riwayat belanja pelanggan",
                "description": "Peran: owner,kasir",
                "operationId": "get_customers_id_sales",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID pelanggan",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 25
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 1867,
                                            "number": "INV-261113-0008",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T04:35:45+07:00",
                                            "cashier": {
                                                "id": 17,
                                                "name": "Rudi Hartono"
                                            },
                                            "customer": null,
                                            "subtotal": 3500,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 3500,
                                            "paid": 5000,
                                            "change": 1500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 0,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        },
                                        {
                                            "id": 1865,
                                            "number": "INV-261113-0006",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T03:13:07+07:00",
                                            "cashier": {
                                                "id": 17,
                                                "name": "Rudi Hartono"
                                            },
                                            "customer": null,
                                            "subtotal": 80500,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 80500,
                                            "paid": 85000,
                                            "change": 4500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 8,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        },
                                        {
                                            "id": 1854,
                                            "number": "INV-261112-0016",
                                            "status": "paid",
                                            "sold_at": "2026-11-12T18:39:04+07:00",
                                            "cashier": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            },
                                            "customer": null,
                                            "subtotal": 37500,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 37500,
                                            "paid": 37500,
                                            "change": 0,
                                            "payment_method": "transfer",
                                            "payment_ref": "TRANSFER-190411",
                                            "points_earned": 3,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 30,
                                        "last_page": 2
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/sales": {
            "post": {
                "tags": [
                    "Transaksi (POS)"
                ],
                "summary": "Simpan transaksi",
                "description": "Perhitungan: `subtotal` = Σ harga×qty; dikurangi diskon item & `discount` nota; lalu `tax` = pajak toko (%); `total` = setelah pajak. Tunai wajib `paid` ≥ total (kembalian dihitung). Non-tunai: `paid` boleh kosong (= total). Pelanggan mendapat poin `floor(total / point_rate)`. Transaksi otomatis masuk ke shift kasir yang sedang terbuka.\n\nPeran: owner,kasir",
                "operationId": "post_sales",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Transaksi berhasil disimpan",
                                    "data": {
                                        "id": 2610,
                                        "number": "INV-261113-0011",
                                        "status": "paid",
                                        "sold_at": "2026-11-13T07:18:35+07:00",
                                        "cashier": {
                                            "id": 15,
                                            "name": "Budi Santoso"
                                        },
                                        "customer": {
                                            "id": 25,
                                            "code": "PLG00001",
                                            "name": "Andi Pratama"
                                        },
                                        "subtotal": 146000,
                                        "item_discount": 500,
                                        "discount": 0,
                                        "tax_percent": 0,
                                        "tax": 0,
                                        "total": 145500,
                                        "paid": 200000,
                                        "change": 54500,
                                        "payment_method": "cash",
                                        "payment_ref": null,
                                        "points_earned": 14,
                                        "note": null,
                                        "void_reason": null,
                                        "voided_at": null,
                                        "items": [
                                            {
                                                "product_id": 45,
                                                "sku": "TOK0001",
                                                "name": "Beras Premium 5kg",
                                                "qty": 1,
                                                "price": 73000,
                                                "discount": 0,
                                                "subtotal": 73000
                                            },
                                            {
                                                "product_id": 46,
                                                "sku": "TOK0002",
                                                "name": "Minyak Goreng 2L",
                                                "qty": 2,
                                                "price": 36500,
                                                "discount": 500,
                                                "subtotal": 72500
                                            }
                                        ],
                                        "receipt_url": "http://localhost/kasir/penjualan/2610/struk"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "items": {
                                        "type": "array",
                                        "description": "Item: `[{product_id, qty, discount?}]` — `discount` = potongan nominal per baris",
                                        "items": {
                                            "type": "object"
                                        },
                                        "example": [
                                            {
                                                "product_id": 45,
                                                "qty": 1
                                            },
                                            {
                                                "product_id": 46,
                                                "qty": 2,
                                                "discount": 500
                                            }
                                        ]
                                    },
                                    "payment_method": {
                                        "type": "string",
                                        "description": "`cash`, `transfer`, `qris`, `ewallet`",
                                        "example": "cash"
                                    },
                                    "paid": {
                                        "type": "number",
                                        "description": "Uang dibayar (wajib untuk tunai)",
                                        "example": 200000
                                    },
                                    "discount": {
                                        "type": "number",
                                        "description": "Diskon nota (nominal)",
                                        "example": 0
                                    },
                                    "customer_id": {
                                        "type": "integer",
                                        "description": "ID pelanggan (dapat poin)",
                                        "example": 25
                                    },
                                    "payment_ref": {
                                        "type": "string",
                                        "description": "No. referensi transfer/QRIS"
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Catatan"
                                    }
                                },
                                "required": [
                                    "items",
                                    "payment_method"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            },
            "get": {
                "tags": [
                    "Transaksi (POS)"
                ],
                "summary": "Daftar transaksi",
                "description": "Peran: owner,kasir",
                "operationId": "get_sales",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nomor nota",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "`paid` atau `void`",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "payment_method",
                        "in": "query",
                        "required": false,
                        "description": "Filter metode bayar",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter kasir (owner)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "customer_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter pelanggan",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Dari tanggal",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Sampai tanggal",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`csv` untuk unduh",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 2610,
                                            "number": "INV-261113-0011",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T07:18:35+07:00",
                                            "cashier": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            },
                                            "customer": {
                                                "id": 25,
                                                "code": "PLG00001",
                                                "name": "Andi Pratama"
                                            },
                                            "subtotal": 146000,
                                            "item_discount": 500,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 145500,
                                            "paid": 200000,
                                            "change": 54500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 14,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        },
                                        {
                                            "id": 1869,
                                            "number": "INV-261113-0010",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T05:55:24+07:00",
                                            "cashier": {
                                                "id": 16,
                                                "name": "Siti Aminah"
                                            },
                                            "customer": null,
                                            "subtotal": 51000,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 51000,
                                            "paid": 55000,
                                            "change": 4000,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 0,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        },
                                        {
                                            "id": 1868,
                                            "number": "INV-261113-0009",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T05:28:10+07:00",
                                            "cashier": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            },
                                            "customer": null,
                                            "subtotal": 53500,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 53500,
                                            "paid": 55000,
                                            "change": 1500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 0,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 607,
                                        "last_page": 41,
                                        "summary": {
                                            "paid_transactions": 605,
                                            "paid_total": 38429700
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/sales/{id}": {
            "get": {
                "tags": [
                    "Transaksi (POS)"
                ],
                "summary": "Detail transaksi + item",
                "description": "`receipt_url` = halaman struk cetak (thermal 58/80mm) di web (butuh login web).\n\nPeran: owner,kasir",
                "operationId": "get_sales_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID transaksi",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1869
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 1869,
                                        "number": "INV-261113-0010",
                                        "status": "paid",
                                        "sold_at": "2026-11-13T05:55:24+07:00",
                                        "cashier": {
                                            "id": 16,
                                            "name": "Siti Aminah"
                                        },
                                        "customer": null,
                                        "subtotal": 51000,
                                        "item_discount": 0,
                                        "discount": 0,
                                        "tax_percent": 0,
                                        "tax": 0,
                                        "total": 51000,
                                        "paid": 55000,
                                        "change": 4000,
                                        "payment_method": "cash",
                                        "payment_ref": null,
                                        "points_earned": 0,
                                        "note": null,
                                        "void_reason": null,
                                        "voided_at": null,
                                        "items": [
                                            {
                                                "product_id": 47,
                                                "sku": "TOK0003",
                                                "name": "Gula Pasir 1kg",
                                                "qty": 3,
                                                "price": 17000,
                                                "discount": 0,
                                                "subtotal": 51000
                                            }
                                        ],
                                        "receipt_url": "http://localhost/kasir/penjualan/1869/struk"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/sales/{id}/void": {
            "post": {
                "tags": [
                    "Transaksi (POS)"
                ],
                "summary": "Batalkan (void) transaksi",
                "description": "Stok seluruh item dikembalikan (mutasi tipe `void`) dan poin pelanggan ditarik. Transaksi void tidak dihitung di laporan.\n\nPeran: owner",
                "operationId": "post_sales_id_void",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID transaksi",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1869
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Transaksi dibatalkan, stok dikembalikan",
                                    "data": {
                                        "id": 1869,
                                        "number": "INV-261113-0010",
                                        "status": "void",
                                        "sold_at": "2026-11-13T05:55:24+07:00",
                                        "cashier": {
                                            "id": 16,
                                            "name": "Siti Aminah"
                                        },
                                        "customer": null,
                                        "subtotal": 51000,
                                        "item_discount": 0,
                                        "discount": 0,
                                        "tax_percent": 0,
                                        "tax": 0,
                                        "total": 51000,
                                        "paid": 55000,
                                        "change": 4000,
                                        "payment_method": "cash",
                                        "payment_ref": null,
                                        "points_earned": 0,
                                        "note": null,
                                        "void_reason": "Salah input",
                                        "voided_at": "2026-11-13T07:18:35+07:00",
                                        "items": [
                                            {
                                                "product_id": 47,
                                                "sku": "TOK0003",
                                                "name": "Gula Pasir 1kg",
                                                "qty": 3,
                                                "price": 17000,
                                                "discount": 0,
                                                "subtotal": 51000
                                            }
                                        ],
                                        "receipt_url": "http://localhost/kasir/penjualan/1869/struk"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "reason": {
                                        "type": "string",
                                        "description": "Alasan pembatalan",
                                        "example": "Salah input"
                                    }
                                },
                                "required": [
                                    "reason"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/shifts/current": {
            "get": {
                "tags": [
                    "Shift Kasir"
                ],
                "summary": "Shift yang sedang terbuka + ringkasan",
                "description": "Peran: owner,kasir",
                "operationId": "get_shifts_current",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Tidak ada shift terbuka",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/shifts/open": {
            "post": {
                "tags": [
                    "Shift Kasir"
                ],
                "summary": "Buka shift",
                "description": "Peran: owner,kasir",
                "operationId": "post_shifts_open",
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Shift dibuka",
                                    "data": {
                                        "user_id": 15,
                                        "opened_at": "2026-11-13T07:18:35+07:00",
                                        "opening_cash": 200000,
                                        "note": "Shift pagi",
                                        "status": "open",
                                        "updated_at": "2026-11-13T07:18:35+07:00",
                                        "created_at": "2026-11-13T07:18:35+07:00",
                                        "id": 12
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "opening_cash": {
                                        "type": "number",
                                        "description": "Saldo kas awal",
                                        "example": 200000
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Catatan",
                                        "example": "Shift pagi"
                                    }
                                },
                                "required": [
                                    "opening_cash"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/shifts/close": {
            "post": {
                "tags": [
                    "Shift Kasir"
                ],
                "summary": "Tutup shift",
                "description": "Peran: owner,kasir",
                "operationId": "post_shifts_close",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Shift ditutup",
                                    "data": {
                                        "id": 12,
                                        "user_id": 15,
                                        "opened_at": "2026-11-13T07:18:35+07:00",
                                        "closed_at": "2026-11-13T07:18:35+07:00",
                                        "opening_cash": 200000,
                                        "cash_sales": 0,
                                        "expected_cash": 200000,
                                        "closing_cash": 850000,
                                        "difference": 650000,
                                        "note": "Shift pagi",
                                        "status": "closed",
                                        "created_at": "2026-11-13T07:18:35+07:00",
                                        "updated_at": "2026-11-13T07:18:35+07:00",
                                        "user": {
                                            "id": 15,
                                            "tenant_id": 7,
                                            "name": "Budi Santoso",
                                            "email": "owner@berkah.demo",
                                            "phone": "081234567890",
                                            "role": "owner",
                                            "is_active": true,
                                            "last_login_at": "2026-11-13T07:18:34+07:00",
                                            "created_at": "2026-11-13T06:12:12+07:00",
                                            "updated_at": "2026-11-13T07:18:34+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "closing_cash": {
                                        "type": "number",
                                        "description": "Uang di laci saat tutup",
                                        "example": 850000
                                    },
                                    "note": {
                                        "type": "string",
                                        "description": "Catatan"
                                    }
                                },
                                "required": [
                                    "closing_cash"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/shifts": {
            "get": {
                "tags": [
                    "Shift Kasir"
                ],
                "summary": "Riwayat shift",
                "description": "Peran: owner,kasir",
                "operationId": "get_shifts",
                "parameters": [
                    {
                        "name": "user_id",
                        "in": "query",
                        "required": false,
                        "description": "Filter kasir (owner)",
                        "schema": {
                            "type": "integer"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 12,
                                            "user_id": 15,
                                            "opened_at": "2026-11-13T07:18:35+07:00",
                                            "closed_at": "2026-11-13T07:18:35+07:00",
                                            "opening_cash": 200000,
                                            "cash_sales": 0,
                                            "expected_cash": 200000,
                                            "closing_cash": 850000,
                                            "difference": 650000,
                                            "note": "Shift pagi",
                                            "status": "closed",
                                            "created_at": "2026-11-13T07:18:35+07:00",
                                            "updated_at": "2026-11-13T07:18:35+07:00",
                                            "user": {
                                                "id": 15,
                                                "name": "Budi Santoso"
                                            }
                                        },
                                        {
                                            "id": 7,
                                            "user_id": 16,
                                            "opened_at": "2026-11-13T06:12:31+07:00",
                                            "closed_at": null,
                                            "opening_cash": 200000,
                                            "cash_sales": 0,
                                            "expected_cash": 0,
                                            "closing_cash": null,
                                            "difference": null,
                                            "note": "Shift pagi (data demo)",
                                            "status": "open",
                                            "created_at": "2026-11-13T06:12:31+07:00",
                                            "updated_at": "2026-11-13T06:12:31+07:00",
                                            "user": {
                                                "id": 16,
                                                "name": "Siti Aminah"
                                            }
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 2,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/dashboard": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Dashboard (hari ini, bulan ini, grafik 7/30 hari, terlaris)",
                "description": "Peran: owner",
                "operationId": "get_reports_dashboard",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "today": {
                                            "from": "2026-11-13",
                                            "to": "2026-11-13",
                                            "transactions": 10,
                                            "items_sold": 39,
                                            "gross_sales": 617500,
                                            "discount": 500,
                                            "net_sales": 617000,
                                            "tax": 0,
                                            "omzet": 617000,
                                            "cost": 505100,
                                            "gross_profit": 111900,
                                            "margin_percent": 18.1,
                                            "average_ticket": 61700,
                                            "void_count": 1
                                        },
                                        "yesterday": {
                                            "from": "2026-11-12",
                                            "to": "2026-11-12",
                                            "transactions": 21,
                                            "items_sold": 104,
                                            "gross_sales": 1319500,
                                            "discount": 2500,
                                            "net_sales": 1317000,
                                            "tax": 0,
                                            "omzet": 1317000,
                                            "cost": 1059300,
                                            "gross_profit": 257700,
                                            "margin_percent": 19.6,
                                            "average_ticket": 62714,
                                            "void_count": 0
                                        },
                                        "month": {
                                            "from": "2026-11-01",
                                            "to": "2026-11-13",
                                            "transactions": 256,
                                            "items_sold": 1211,
                                            "gross_sales": 15281500,
                                            "discount": 48000,
                                            "net_sales": 15233500,
                                            "tax": 0,
                                            "omzet": 15233500,
                                            "cost": 12243400,
                                            "gross_profit": 2990100,
                                            "margin_percent": 19.6,
                                            "average_ticket": 59506,
                                            "void_count": 2
                                        },
                                        "last_7_days": [
                                            {
                                                "date": "2026-11-07",
                                                "transactions": 28,
                                                "omzet": 2272600,
                                                "net_sales": 2272600,
                                                "cost": 1807700,
                                                "gross_profit": 464900
                                            },
                                            {
                                                "date": "2026-11-08",
                                                "transactions": 28,
                                                "omzet": 1324300,
                                                "net_sales": 1324300,
                                                "cost": 1069700,
                                                "gross_profit": 254600
                                            }
                                        ],
                                        "last_30_days": [
                                            {
                                                "date": "2026-10-15",
                                                "transactions": 22,
                                                "omzet": 1387500,
                                                "net_sales": 1387500,
                                                "cost": 1129300,
                                                "gross_profit": 258200
                                            },
                                            {
                                                "date": "2026-10-16",
                                                "transactions": 21,
                                                "omzet": 1202100,
                                                "net_sales": 1202100,
                                                "cost": 961600,
                                                "gross_profit": 240500
                                            }
                                        ],
                                        "top_products": [
                                            {
                                                "product_id": 62,
                                                "sku": "TOK0018",
                                                "name": "Deterjen 800g",
                                                "qty": 158,
                                                "transactions": 80,
                                                "revenue": 3313000,
                                                "cost": 2686000,
                                                "gross_profit": 627000
                                            },
                                            {
                                                "product_id": 60,
                                                "sku": "TOK0016",
                                                "name": "Sabun Mandi",
                                                "qty": 155,
                                                "transactions": 75,
                                                "revenue": 692500,
                                                "cost": 465000,
                                                "gross_profit": 227500
                                            }
                                        ],
                                        "low_stock": [
                                            {
                                                "id": 62,
                                                "sku": "TOK0018",
                                                "name": "Deterjen 800g",
                                                "stock": 3,
                                                "min_stock": 11,
                                                "image_url": null,
                                                "is_low_stock": true
                                            },
                                            {
                                                "id": 58,
                                                "sku": "TOK0014",
                                                "name": "Wafer Coklat",
                                                "stock": 4,
                                                "min_stock": 11,
                                                "image_url": null,
                                                "is_low_stock": true
                                            },
                                            {
                                                "id": 60,
                                                "sku": "TOK0016",
                                                "name": "Sabun Mandi",
                                                "stock": 10,
                                                "min_stock": 12,
                                                "image_url": null,
                                                "is_low_stock": true
                                            }
                                        ],
                                        "low_stock_count": 3
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/summary": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Ringkasan periode",
                "description": "Peran: owner",
                "operationId": "get_reports_summary",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal awal (YYYY-MM-DD). Default awal bulan ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal akhir (YYYY-MM-DD). Default hari ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-13"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Ringkasan penjualan",
                                    "data": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "transactions": 256,
                                        "items_sold": 1211,
                                        "gross_sales": 15281500,
                                        "discount": 48000,
                                        "net_sales": 15233500,
                                        "tax": 0,
                                        "omzet": 15233500,
                                        "cost": 12243400,
                                        "gross_profit": 2990100,
                                        "margin_percent": 19.6,
                                        "average_ticket": 59506,
                                        "void_count": 2
                                    },
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13"
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/daily": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Penjualan & laba per hari",
                "description": "Peran: owner",
                "operationId": "get_reports_daily",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal awal (YYYY-MM-DD). Default awal bulan ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal akhir (YYYY-MM-DD). Default hari ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-13"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`json` (default) atau `csv` untuk mengunduh file CSV",
                        "schema": {
                            "type": "string"
                        },
                        "example": "json"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "date": "2026-11-01",
                                            "transactions": 22,
                                            "omzet": 774500,
                                            "net_sales": 774500,
                                            "cost": 617200,
                                            "gross_profit": 157300
                                        },
                                        {
                                            "date": "2026-11-02",
                                            "transactions": 21,
                                            "omzet": 1708500,
                                            "net_sales": 1708500,
                                            "cost": 1413200,
                                            "gross_profit": 295300
                                        },
                                        {
                                            "date": "2026-11-03",
                                            "transactions": 19,
                                            "omzet": 918700,
                                            "net_sales": 918700,
                                            "cost": 719800,
                                            "gross_profit": 198900
                                        }
                                    ],
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "summary": {
                                            "from": "2026-11-01",
                                            "to": "2026-11-13",
                                            "transactions": 256,
                                            "items_sold": 1211,
                                            "gross_sales": 15281500,
                                            "discount": 48000,
                                            "net_sales": 15233500,
                                            "tax": 0,
                                            "omzet": 15233500,
                                            "cost": 12243400,
                                            "gross_profit": 2990100,
                                            "margin_percent": 19.6,
                                            "average_ticket": 59506,
                                            "void_count": 2
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/products": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Penjualan per produk",
                "description": "Peran: owner",
                "operationId": "get_reports_products",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal awal (YYYY-MM-DD). Default awal bulan ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal akhir (YYYY-MM-DD). Default hari ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-13"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`json` (default) atau `csv` untuk mengunduh file CSV",
                        "schema": {
                            "type": "string"
                        },
                        "example": "json"
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`qty` (default) atau `revenue`",
                        "schema": {
                            "type": "string"
                        },
                        "example": "qty"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "product_id": 59,
                                            "sku": "TOK0015",
                                            "name": "Kacang Atom",
                                            "qty": 81,
                                            "transactions": 39,
                                            "revenue": 768500,
                                            "cost": 567000,
                                            "gross_profit": 201500
                                        },
                                        {
                                            "product_id": 60,
                                            "sku": "TOK0016",
                                            "name": "Sabun Mandi",
                                            "qty": 70,
                                            "transactions": 33,
                                            "revenue": 311500,
                                            "cost": 210000,
                                            "gross_profit": 101500
                                        },
                                        {
                                            "product_id": 53,
                                            "sku": "TOK0009",
                                            "name": "Kopi Sachet",
                                            "qty": 68,
                                            "transactions": 35,
                                            "revenue": 134000,
                                            "cost": 81600,
                                            "gross_profit": 52400
                                        }
                                    ],
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "summary": {
                                            "from": "2026-11-01",
                                            "to": "2026-11-13",
                                            "transactions": 256,
                                            "items_sold": 1211,
                                            "gross_sales": 15281500,
                                            "discount": 48000,
                                            "net_sales": 15233500,
                                            "tax": 0,
                                            "omzet": 15233500,
                                            "cost": 12243400,
                                            "gross_profit": 2990100,
                                            "margin_percent": 19.6,
                                            "average_ticket": 59506,
                                            "void_count": 2
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/cashiers": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Penjualan per kasir",
                "description": "Peran: owner",
                "operationId": "get_reports_cashiers",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal awal (YYYY-MM-DD). Default awal bulan ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal akhir (YYYY-MM-DD). Default hari ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-13"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`json` (default) atau `csv` untuk mengunduh file CSV",
                        "schema": {
                            "type": "string"
                        },
                        "example": "json"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "user_id": 15,
                                            "name": "Budi Santoso",
                                            "transactions": 95,
                                            "omzet": 5715400,
                                            "gross_profit": 1114800,
                                            "average_ticket": 60162
                                        },
                                        {
                                            "user_id": 16,
                                            "name": "Siti Aminah",
                                            "transactions": 86,
                                            "omzet": 4972200,
                                            "gross_profit": 993400,
                                            "average_ticket": 57816
                                        },
                                        {
                                            "user_id": 17,
                                            "name": "Rudi Hartono",
                                            "transactions": 75,
                                            "omzet": 4545900,
                                            "gross_profit": 881900,
                                            "average_ticket": 60612
                                        }
                                    ],
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "summary": {
                                            "from": "2026-11-01",
                                            "to": "2026-11-13",
                                            "transactions": 256,
                                            "items_sold": 1211,
                                            "gross_sales": 15281500,
                                            "discount": 48000,
                                            "net_sales": 15233500,
                                            "tax": 0,
                                            "omzet": 15233500,
                                            "cost": 12243400,
                                            "gross_profit": 2990100,
                                            "margin_percent": 19.6,
                                            "average_ticket": 59506,
                                            "void_count": 2
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/payments": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Penjualan per metode bayar",
                "description": "Peran: owner",
                "operationId": "get_reports_payments",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal awal (YYYY-MM-DD). Default awal bulan ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal akhir (YYYY-MM-DD). Default hari ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-13"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`json` (default) atau `csv` untuk mengunduh file CSV",
                        "schema": {
                            "type": "string"
                        },
                        "example": "json"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "method": "cash",
                                            "label": "Tunai",
                                            "transactions": 125,
                                            "omzet": 7319300,
                                            "percent": 48
                                        },
                                        {
                                            "method": "transfer",
                                            "label": "Transfer",
                                            "transactions": 30,
                                            "omzet": 1858000,
                                            "percent": 12.2
                                        },
                                        {
                                            "method": "qris",
                                            "label": "QRIS",
                                            "transactions": 82,
                                            "omzet": 4877000,
                                            "percent": 32
                                        }
                                    ],
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "summary": {
                                            "from": "2026-11-01",
                                            "to": "2026-11-13",
                                            "transactions": 256,
                                            "items_sold": 1211,
                                            "gross_sales": 15281500,
                                            "discount": 48000,
                                            "net_sales": 15233500,
                                            "tax": 0,
                                            "omzet": 15233500,
                                            "cost": 12243400,
                                            "gross_profit": 2990100,
                                            "margin_percent": 19.6,
                                            "average_ticket": 59506,
                                            "void_count": 2
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/profit": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Laba kotor per hari",
                "description": "Peran: owner",
                "operationId": "get_reports_profit",
                "parameters": [
                    {
                        "name": "from",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal awal (YYYY-MM-DD). Default awal bulan ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-01"
                    },
                    {
                        "name": "to",
                        "in": "query",
                        "required": false,
                        "description": "Tanggal akhir (YYYY-MM-DD). Default hari ini",
                        "schema": {
                            "type": "string",
                            "format": "date"
                        },
                        "example": "2026-11-13"
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`json` (default) atau `csv` untuk mengunduh file CSV",
                        "schema": {
                            "type": "string"
                        },
                        "example": "json"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "date": "2026-11-01",
                                            "transactions": 22,
                                            "omzet": 774500,
                                            "net_sales": 774500,
                                            "cost": 617200,
                                            "gross_profit": 157300
                                        },
                                        {
                                            "date": "2026-11-02",
                                            "transactions": 21,
                                            "omzet": 1708500,
                                            "net_sales": 1708500,
                                            "cost": 1413200,
                                            "gross_profit": 295300
                                        },
                                        {
                                            "date": "2026-11-03",
                                            "transactions": 19,
                                            "omzet": 918700,
                                            "net_sales": 918700,
                                            "cost": 719800,
                                            "gross_profit": 198900
                                        }
                                    ],
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "summary": {
                                            "from": "2026-11-01",
                                            "to": "2026-11-13",
                                            "transactions": 256,
                                            "items_sold": 1211,
                                            "gross_sales": 15281500,
                                            "discount": 48000,
                                            "net_sales": 15233500,
                                            "tax": 0,
                                            "omzet": 15233500,
                                            "cost": 12243400,
                                            "gross_profit": 2990100,
                                            "margin_percent": 19.6,
                                            "average_ticket": 59506,
                                            "void_count": 2
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/reports/stock": {
            "get": {
                "tags": [
                    "Laporan"
                ],
                "summary": "Laporan stok & nilai persediaan",
                "description": "Peran: owner",
                "operationId": "get_reports_stock",
                "parameters": [
                    {
                        "name": "filter",
                        "in": "query",
                        "required": false,
                        "description": "`low` (menipis) atau `empty` (habis)",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "format",
                        "in": "query",
                        "required": false,
                        "description": "`json` atau `csv`",
                        "schema": {
                            "type": "string"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 51,
                                            "sku": "TOK0007",
                                            "name": "Air Mineral 600ml",
                                            "category": "Minuman",
                                            "unit": "pcs",
                                            "stock": 119,
                                            "min_stock": 9,
                                            "is_low_stock": false,
                                            "cost_price": 2500,
                                            "price": 4000,
                                            "stock_value_cost": 297500,
                                            "stock_value_price": 476000
                                        },
                                        {
                                            "id": 45,
                                            "sku": "TOK0001",
                                            "name": "Beras Premium 5kg",
                                            "category": "Frozen Food (ubah)",
                                            "unit": "lusin (ubah)",
                                            "stock": 118,
                                            "min_stock": 15,
                                            "is_low_stock": false,
                                            "cost_price": 62000,
                                            "price": 73000,
                                            "stock_value_cost": 7316000,
                                            "stock_value_price": 8614000
                                        },
                                        {
                                            "id": 57,
                                            "sku": "TOK0013",
                                            "name": "Biskuit Kelapa",
                                            "category": "Makanan Ringan",
                                            "unit": "pcs",
                                            "stock": 286,
                                            "min_stock": 11,
                                            "is_low_stock": false,
                                            "cost_price": 6000,
                                            "price": 8500,
                                            "stock_value_cost": 1716000,
                                            "stock_value_price": 2431000
                                        }
                                    ],
                                    "meta": {
                                        "from": "2026-11-01",
                                        "to": "2026-11-13",
                                        "totals": {
                                            "products": 24,
                                            "units": 3056,
                                            "low_stock": 3,
                                            "stock_value_cost": 33316600,
                                            "stock_value_price": 41684100
                                        }
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/t/{slug}": {
            "get": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Info publik toko",
                "description": "",
                "operationId": "get_t_slug",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "name": "Toko Berkah Jaya",
                                        "slug": "toko-berkah-jaya",
                                        "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                        "phone": "0741-123456",
                                        "email": "owner@berkah.demo",
                                        "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                        "store_url": "http://localhost/kasir/t/toko-berkah-jaya",
                                        "point_rate": 10000
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                }
            }
        },
        "/t/{slug}/customer/register": {
            "post": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Daftar akun pelanggan",
                "description": "",
                "operationId": "post_t_slug_customer_register",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Pendaftaran pelanggan berhasil",
                                    "data": {
                                        "customer": {
                                            "id": 49,
                                            "code": "PLG00049",
                                            "name": "Pelanggan Setia",
                                            "email": "setia@example.com",
                                            "phone": "081377778888",
                                            "address": null,
                                            "points": null,
                                            "transactions": 0,
                                            "total_spent": 0
                                        },
                                        "token": {
                                            "access_token": "52|EOOLRFsnRe4ZD0TLkGmYrueBc3B6gnvMPfqiQLpbJY9nGX3v",
                                            "token_type": "Bearer",
                                            "expires_at": "2026-12-13T07:18:35+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "name": {
                                        "type": "string",
                                        "description": "Nama",
                                        "example": "Pelanggan Setia"
                                    },
                                    "email": {
                                        "type": "string",
                                        "description": "Email (unik per toko)",
                                        "example": "setia@example.com"
                                    },
                                    "phone": {
                                        "type": "string",
                                        "description": "Nomor HP",
                                        "example": "081377778888"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password (min 6)",
                                        "example": "rahasia123"
                                    },
                                    "password_confirmation": {
                                        "type": "string",
                                        "description": "Ulangi password",
                                        "example": "rahasia123"
                                    }
                                },
                                "required": [
                                    "name",
                                    "email",
                                    "phone",
                                    "password",
                                    "password_confirmation"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/t/{slug}/customer/login": {
            "post": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Login pelanggan",
                "description": "",
                "operationId": "post_t_slug_customer_login",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Login berhasil",
                                    "data": {
                                        "customer": {
                                            "id": 25,
                                            "code": "PLG00001",
                                            "name": "Andi Pratama",
                                            "email": "pelanggan@berkah.demo",
                                            "phone": "081200000001",
                                            "address": "Jl. Baru",
                                            "points": 186,
                                            "transactions": 31,
                                            "total_spent": 2023500
                                        },
                                        "token": {
                                            "access_token": "53|4tnMeuYzJeV4EkOLiwnYt6bOaCTVXjnEvakx9vzEyXMI8eb2",
                                            "token_type": "Bearer",
                                            "expires_at": "2026-12-13T07:18:36+07:00"
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "email": {
                                        "type": "string",
                                        "description": "Email",
                                        "example": "pelanggan@berkah.demo"
                                    },
                                    "password": {
                                        "type": "string",
                                        "description": "Password",
                                        "example": "password"
                                    }
                                },
                                "required": [
                                    "email",
                                    "password"
                                ]
                            }
                        }
                    }
                }
            }
        },
        "/t/{slug}/customer/me": {
            "get": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Profil & poin pelanggan",
                "description": "Peran: customer",
                "operationId": "get_t_slug_customer_me",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 25,
                                        "code": "PLG00001",
                                        "name": "Andi Pratama",
                                        "email": "pelanggan@berkah.demo",
                                        "phone": "081200000001",
                                        "address": "Jl. Baru",
                                        "points": 186,
                                        "transactions": 31,
                                        "total_spent": 2023500
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/t/{slug}/customer/sales": {
            "get": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Riwayat belanja",
                "description": "Peran: customer",
                "operationId": "get_t_slug_customer_sales",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 2610,
                                            "number": "INV-261113-0011",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T07:18:35+07:00",
                                            "cashier": null,
                                            "customer": null,
                                            "subtotal": 146000,
                                            "item_discount": 500,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 145500,
                                            "paid": 200000,
                                            "change": 54500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 14,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        },
                                        {
                                            "id": 1867,
                                            "number": "INV-261113-0008",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T04:35:45+07:00",
                                            "cashier": null,
                                            "customer": null,
                                            "subtotal": 3500,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 3500,
                                            "paid": 5000,
                                            "change": 1500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 0,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        },
                                        {
                                            "id": 1865,
                                            "number": "INV-261113-0006",
                                            "status": "paid",
                                            "sold_at": "2026-11-13T03:13:07+07:00",
                                            "cashier": null,
                                            "customer": null,
                                            "subtotal": 80500,
                                            "item_discount": 0,
                                            "discount": 0,
                                            "tax_percent": 0,
                                            "tax": 0,
                                            "total": 80500,
                                            "paid": 85000,
                                            "change": 4500,
                                            "payment_method": "cash",
                                            "payment_ref": null,
                                            "points_earned": 8,
                                            "note": null,
                                            "void_reason": null,
                                            "voided_at": null
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 31,
                                        "last_page": 3
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/t/{slug}/customer/sales/{id}": {
            "get": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Detail belanja",
                "description": "Peran: customer",
                "operationId": "get_t_slug_customer_sales_id",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    },
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID transaksi",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1867
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 1867,
                                        "number": "INV-261113-0008",
                                        "status": "paid",
                                        "sold_at": "2026-11-13T04:35:45+07:00",
                                        "cashier": null,
                                        "customer": null,
                                        "subtotal": 3500,
                                        "item_discount": 0,
                                        "discount": 0,
                                        "tax_percent": 0,
                                        "tax": 0,
                                        "total": 3500,
                                        "paid": 5000,
                                        "change": 1500,
                                        "payment_method": "cash",
                                        "payment_ref": null,
                                        "points_earned": 0,
                                        "note": null,
                                        "void_reason": null,
                                        "voided_at": null,
                                        "items": [
                                            {
                                                "product_id": 65,
                                                "sku": "TOK0021",
                                                "name": "Mi Goreng",
                                                "qty": 1,
                                                "price": 3500,
                                                "discount": 0,
                                                "subtotal": 3500
                                            }
                                        ]
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/t/{slug}/customer/logout": {
            "post": {
                "tags": [
                    "Portal Pelanggan"
                ],
                "summary": "Logout pelanggan",
                "description": "Peran: customer",
                "operationId": "post_t_slug_customer_logout",
                "parameters": [
                    {
                        "name": "slug",
                        "in": "path",
                        "required": true,
                        "description": "Slug toko",
                        "schema": {
                            "type": "string"
                        },
                        "example": "toko-berkah-jaya"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Logout berhasil",
                                    "data": null,
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/admin/stats": {
            "get": {
                "tags": [
                    "Superadmin Platform"
                ],
                "summary": "Statistik platform",
                "description": "Peran: superadmin",
                "operationId": "get_admin_stats",
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "tenants": 3,
                                        "tenants_active": 3,
                                        "tenants_new_30_days": 1,
                                        "users": 7,
                                        "customers": 20,
                                        "products": 39,
                                        "transactions": 1339,
                                        "gmv": 117514350,
                                        "transactions_today": 20,
                                        "gmv_today": 1426600,
                                        "last_30_days": [
                                            {
                                                "date": "2026-10-15",
                                                "transactions": 54,
                                                "omzet": 4878350
                                            },
                                            {
                                                "date": "2026-10-16",
                                                "transactions": 46,
                                                "omzet": 3403200
                                            }
                                        ],
                                        "top_tenants": [
                                            {
                                                "id": 8,
                                                "name": "Kopi Senja",
                                                "slug": "kopi-senja",
                                                "address": "Jl. Sultan Thaha No. 5, Jambi",
                                                "phone": "0812-7777-8888",
                                                "email": "owner@kopisenja.demo",
                                                "logo": "demo/kopi-senja/logo.png",
                                                "tax_percent": 10,
                                                "point_rate": 10000,
                                                "receipt_footer": "Terima kasih telah berbelanja di Kopi Senja!",
                                                "receipt_width": 80,
                                                "status": "active",
                                                "created_at": "2026-09-29T06:12:31+07:00",
                                                "updated_at": "2026-11-13T06:12:31+07:00",
                                                "users_count": 2,
                                                "cashiers_count": 1,
                                                "transactions_count": 735,
                                                "gmv": "79135650.00",
                                                "products_count": 15,
                                                "owner_email": "owner@kopisenja.demo",
                                                "logo_url": "http://localhost/kasir/uploads/demo/kopi-senja/logo.png",
                                                "store_url": "http://localhost/kasir/t/kopi-senja"
                                            },
                                            {
                                                "id": 7,
                                                "name": "Toko Berkah Jaya",
                                                "slug": "toko-berkah-jaya",
                                                "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                                "phone": "0741-123456",
                                                "email": "owner@berkah.demo",
                                                "logo": "demo/toko-berkah-jaya/logo.png",
                                                "tax_percent": 0,
                                                "point_rate": 10000,
                                                "receipt_footer": "Terima kasih!",
                                                "receipt_width": 58,
                                                "status": "active",
                                                "created_at": "2026-09-29T06:12:12+07:00",
                                                "updated_at": "2026-11-13T07:18:34+07:00",
                                                "users_count": 4,
                                                "cashiers_count": 3,
                                                "transactions_count": 604,
                                                "gmv": "38378700.00",
                                                "products_count": 24,
                                                "owner_email": "owner@berkah.demo",
                                                "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                                "store_url": "http://localhost/kasir/t/toko-berkah-jaya"
                                            },
                                            {
                                                "id": 12,
                                                "name": "Warung Maju",
                                                "slug": "warung-maju",
                                                "address": "Jl. Merdeka No. 1, Jambi",
                                                "phone": "081234567890",
                                                "email": "ahmad@example.com",
                                                "logo": null,
                                                "tax_percent": 0,
                                                "point_rate": 10000,
                                                "receipt_footer": "Terima kasih telah berbelanja!",
                                                "receipt_width": 58,
                                                "status": "active",
                                                "created_at": "2026-11-13T07:18:33+07:00",
                                                "updated_at": "2026-11-13T07:18:33+07:00",
                                                "users_count": 1,
                                                "cashiers_count": 0,
                                                "transactions_count": 0,
                                                "gmv": "0.00",
                                                "products_count": 0,
                                                "owner_email": "ahmad@example.com",
                                                "logo_url": null,
                                                "store_url": "http://localhost/kasir/t/warung-maju"
                                            }
                                        ]
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/admin/tenants": {
            "get": {
                "tags": [
                    "Superadmin Platform"
                ],
                "summary": "Daftar toko",
                "description": "Peran: superadmin",
                "operationId": "get_admin_tenants",
                "parameters": [
                    {
                        "name": "q",
                        "in": "query",
                        "required": false,
                        "description": "Cari nama/slug",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "status",
                        "in": "query",
                        "required": false,
                        "description": "`active` / `inactive`",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "sort",
                        "in": "query",
                        "required": false,
                        "description": "`-gmv` = omzet terbesar",
                        "schema": {
                            "type": "string"
                        }
                    },
                    {
                        "name": "page",
                        "in": "query",
                        "required": false,
                        "description": "Nomor halaman",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 1
                    },
                    {
                        "name": "per_page",
                        "in": "query",
                        "required": false,
                        "description": "Data per halaman (1-100)",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 15
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": [
                                        {
                                            "id": 12,
                                            "name": "Warung Maju",
                                            "slug": "warung-maju",
                                            "address": "Jl. Merdeka No. 1, Jambi",
                                            "phone": "081234567890",
                                            "email": "ahmad@example.com",
                                            "logo": null,
                                            "tax_percent": 0,
                                            "point_rate": 10000,
                                            "receipt_footer": "Terima kasih telah berbelanja!",
                                            "receipt_width": 58,
                                            "status": "active",
                                            "created_at": "2026-11-13T07:18:33+07:00",
                                            "updated_at": "2026-11-13T07:18:33+07:00",
                                            "users_count": 1,
                                            "cashiers_count": 0,
                                            "transactions_count": 0,
                                            "gmv": "0.00",
                                            "products_count": 0,
                                            "owner_email": "ahmad@example.com",
                                            "logo_url": null,
                                            "store_url": "http://localhost/kasir/t/warung-maju"
                                        },
                                        {
                                            "id": 8,
                                            "name": "Kopi Senja",
                                            "slug": "kopi-senja",
                                            "address": "Jl. Sultan Thaha No. 5, Jambi",
                                            "phone": "0812-7777-8888",
                                            "email": "owner@kopisenja.demo",
                                            "logo": "demo/kopi-senja/logo.png",
                                            "tax_percent": 10,
                                            "point_rate": 10000,
                                            "receipt_footer": "Terima kasih telah berbelanja di Kopi Senja!",
                                            "receipt_width": 80,
                                            "status": "active",
                                            "created_at": "2026-09-29T06:12:31+07:00",
                                            "updated_at": "2026-11-13T06:12:31+07:00",
                                            "users_count": 2,
                                            "cashiers_count": 1,
                                            "transactions_count": 735,
                                            "gmv": "79135650.00",
                                            "products_count": 15,
                                            "owner_email": "owner@kopisenja.demo",
                                            "logo_url": "http://localhost/kasir/uploads/demo/kopi-senja/logo.png",
                                            "store_url": "http://localhost/kasir/t/kopi-senja"
                                        },
                                        {
                                            "id": 7,
                                            "name": "Toko Berkah Jaya",
                                            "slug": "toko-berkah-jaya",
                                            "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                            "phone": "0741-123456",
                                            "email": "owner@berkah.demo",
                                            "logo": "demo/toko-berkah-jaya/logo.png",
                                            "tax_percent": 0,
                                            "point_rate": 10000,
                                            "receipt_footer": "Terima kasih!",
                                            "receipt_width": 58,
                                            "status": "active",
                                            "created_at": "2026-09-29T06:12:12+07:00",
                                            "updated_at": "2026-11-13T07:18:34+07:00",
                                            "users_count": 4,
                                            "cashiers_count": 3,
                                            "transactions_count": 604,
                                            "gmv": "38378700.00",
                                            "products_count": 24,
                                            "owner_email": "owner@berkah.demo",
                                            "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                            "store_url": "http://localhost/kasir/t/toko-berkah-jaya"
                                        }
                                    ],
                                    "meta": {
                                        "current_page": 1,
                                        "per_page": 15,
                                        "total": 3,
                                        "last_page": 1
                                    }
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/admin/tenants/{id}": {
            "get": {
                "tags": [
                    "Superadmin Platform"
                ],
                "summary": "Detail toko",
                "description": "Peran: superadmin",
                "operationId": "get_admin_tenants_id",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID toko",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 7
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Berhasil",
                                    "data": {
                                        "id": 7,
                                        "name": "Toko Berkah Jaya",
                                        "slug": "toko-berkah-jaya",
                                        "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                        "phone": "0741-123456",
                                        "email": "owner@berkah.demo",
                                        "logo": "demo/toko-berkah-jaya/logo.png",
                                        "tax_percent": 0,
                                        "point_rate": 10000,
                                        "receipt_footer": "Terima kasih!",
                                        "receipt_width": 58,
                                        "status": "active",
                                        "created_at": "2026-09-29T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                        "store_url": "http://localhost/kasir/t/toko-berkah-jaya",
                                        "owner": {
                                            "id": 15,
                                            "name": "Budi Santoso",
                                            "email": "owner@berkah.demo",
                                            "phone": "081234567890",
                                            "role": "owner",
                                            "is_active": true,
                                            "tenant_id": 7,
                                            "last_login_at": "2026-11-13T07:18:34+07:00",
                                            "created_at": "2026-11-13T06:12:12+07:00"
                                        },
                                        "users": [
                                            {
                                                "id": 16,
                                                "name": "Siti Aminah",
                                                "email": "kasir@berkah.demo",
                                                "phone": null,
                                                "role": "kasir",
                                                "is_active": true,
                                                "tenant_id": 7,
                                                "last_login_at": null,
                                                "created_at": "2026-11-13T06:12:12+07:00"
                                            },
                                            {
                                                "id": 17,
                                                "name": "Rudi Hartono",
                                                "email": "kasir2@berkah.demo",
                                                "phone": null,
                                                "role": "kasir",
                                                "is_active": true,
                                                "tenant_id": 7,
                                                "last_login_at": null,
                                                "created_at": "2026-11-13T06:12:12+07:00"
                                            }
                                        ],
                                        "summary_30_days": {
                                            "from": "2026-10-15",
                                            "to": "2026-11-13",
                                            "transactions": 604,
                                            "items_sold": 2926,
                                            "gross_sales": 38492200,
                                            "discount": 113500,
                                            "net_sales": 38378700,
                                            "tax": 0,
                                            "omzet": 38378700,
                                            "cost": 30979700,
                                            "gross_profit": 7399000,
                                            "margin_percent": 19.3,
                                            "average_ticket": 63541,
                                            "void_count": 3
                                        },
                                        "summary_all_time": {
                                            "from": "2000-01-01",
                                            "to": "2026-11-13",
                                            "transactions": 604,
                                            "items_sold": 2926,
                                            "gross_sales": 38492200,
                                            "discount": 113500,
                                            "net_sales": 38378700,
                                            "tax": 0,
                                            "omzet": 38378700,
                                            "cost": 30979700,
                                            "gross_profit": 7399000,
                                            "margin_percent": 19.3,
                                            "average_ticket": 63541,
                                            "void_count": 3
                                        }
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        },
        "/admin/tenants/{id}/status": {
            "patch": {
                "tags": [
                    "Superadmin Platform"
                ],
                "summary": "Aktif / nonaktifkan toko",
                "description": "Peran: superadmin",
                "operationId": "patch_admin_tenants_id_status",
                "parameters": [
                    {
                        "name": "id",
                        "in": "path",
                        "required": true,
                        "description": "ID toko",
                        "schema": {
                            "type": "integer"
                        },
                        "example": 7
                    }
                ],
                "responses": {
                    "200": {
                        "description": "Berhasil",
                        "content": {
                            "application/json": {
                                "example": {
                                    "success": true,
                                    "message": "Toko diaktifkan",
                                    "data": {
                                        "id": 7,
                                        "name": "Toko Berkah Jaya",
                                        "slug": "toko-berkah-jaya",
                                        "address": "Jl. Kapten Pattimura No. 10, Jambi",
                                        "phone": "0741-123456",
                                        "email": "owner@berkah.demo",
                                        "logo": "demo/toko-berkah-jaya/logo.png",
                                        "tax_percent": 0,
                                        "point_rate": 10000,
                                        "receipt_footer": "Terima kasih!",
                                        "receipt_width": 58,
                                        "status": "active",
                                        "created_at": "2026-09-29T06:12:12+07:00",
                                        "updated_at": "2026-11-13T07:18:34+07:00",
                                        "logo_url": "http://localhost/kasir/uploads/demo/toko-berkah-jaya/logo.png",
                                        "store_url": "http://localhost/kasir/t/toko-berkah-jaya"
                                    },
                                    "meta": null
                                }
                            }
                        }
                    },
                    "422": {
                        "description": "Validasi gagal",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/Error"
                                }
                            }
                        }
                    },
                    "401": {
                        "description": "Token tidak ada / tidak valid"
                    },
                    "403": {
                        "description": "Peran tidak diizinkan / toko nonaktif"
                    },
                    "404": {
                        "description": "Data tidak ditemukan (atau milik toko lain)"
                    }
                },
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "type": "object",
                                "properties": {
                                    "status": {
                                        "type": "string",
                                        "description": "`active` atau `inactive`",
                                        "example": "active"
                                    }
                                },
                                "required": [
                                    "status"
                                ]
                            }
                        }
                    }
                },
                "security": [
                    {
                        "bearerAuth": []
                    }
                ]
            }
        }
    },
    "components": {
        "securitySchemes": {
            "bearerAuth": {
                "type": "http",
                "scheme": "bearer",
                "description": "Token dari /auth/login, format {id}|{acak}"
            }
        },
        "schemas": {
            "Error": {
                "type": "object",
                "properties": {
                    "success": {
                        "type": "boolean",
                        "example": false
                    },
                    "message": {
                        "type": "string"
                    },
                    "data": {
                        "nullable": true,
                        "example": null
                    },
                    "meta": {
                        "nullable": true,
                        "example": null
                    },
                    "errors": {
                        "type": "object",
                        "additionalProperties": {
                            "type": "array",
                            "items": {
                                "type": "string"
                            }
                        }
                    }
                }
            }
        }
    }
}