{
  "openapi": "3.0.0",
  "paths": {
    "/api/health": {
      "get": {
        "operationId": "HealthController_check",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        },
        "tags": [
          "health"
        ]
      }
    },
    "/api/auth/sesi": {
      "post": {
        "operationId": "AuthController_createSession",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSessionDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SessionResponseDto"
                }
              }
            }
          },
          "401": {
            "description": "Token Firebase tidak valid atau pengguna belum terdaftar"
          }
        },
        "tags": [
          "auth"
        ]
      }
    },
    "/api/tenants": {
      "get": {
        "operationId": "TenantsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/TenantDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/tenants/{kode}/pilih": {
      "post": {
        "operationId": "TenantsController_pilih",
        "parameters": [
          {
            "name": "kode",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PilihTenantResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "tenants"
        ]
      }
    },
    "/api/modul/saya": {
      "get": {
        "operationId": "ModulController_listSaya",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Daftar modul yang boleh diakses pengguna, dikelompokkan per grup navigasi.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/ModulGrupDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "modul"
        ]
      }
    },
    "/api/master/barang": {
      "get": {
        "operationId": "BarangController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListBarangResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang"
        ]
      },
      "post": {
        "operationId": "BarangController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarangDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang"
        ]
      }
    },
    "/api/master/barang/{id}": {
      "delete": {
        "operationId": "BarangController_softDelete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Barang dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang"
        ]
      },
      "patch": {
        "operationId": "BarangController_patch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchBarangDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Barang berhasil diperbarui secara partial"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang"
        ]
      }
    },
    "/api/master/kontak": {
      "get": {
        "operationId": "KontakController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "tipe",
            "required": false,
            "in": "query",
            "description": "Filter tipe kontak",
            "schema": {
              "example": "pelanggan",
              "type": "string",
              "enum": [
                "pelanggan",
                "supplier",
                "pegawai",
                "lain"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListKontakResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-kontak"
        ]
      },
      "post": {
        "operationId": "KontakController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateKontakDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-kontak"
        ]
      }
    },
    "/api/master/kontak/{id}": {
      "patch": {
        "operationId": "KontakController_patch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchKontakDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Kontak berhasil diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-kontak"
        ]
      },
      "delete": {
        "operationId": "KontakController_softDelete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Kontak dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-kontak"
        ]
      }
    },
    "/api/master/lokasi": {
      "get": {
        "operationId": "LokasiController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListLokasiResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-lokasi"
        ]
      },
      "post": {
        "operationId": "LokasiController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateLokasiDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-lokasi"
        ]
      }
    },
    "/api/master/lokasi/{id}": {
      "patch": {
        "operationId": "LokasiController_patch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchLokasiDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Lokasi berhasil diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-lokasi"
        ]
      },
      "delete": {
        "operationId": "LokasiController_softDelete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Lokasi dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-lokasi"
        ]
      }
    },
    "/api/master/akun/klas": {
      "get": {
        "operationId": "AkunController_listKlas",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AkunKlasRefDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-akun"
        ]
      }
    },
    "/api/master/akun/subklas": {
      "get": {
        "operationId": "AkunController_listSubklas",
        "parameters": [
          {
            "name": "klas_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/AkunSubklasRefDto"
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-akun"
        ]
      }
    },
    "/api/master/akun": {
      "get": {
        "operationId": "AkunController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAkunResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-akun"
        ]
      },
      "post": {
        "operationId": "AkunController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAkunDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "kode": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-akun"
        ]
      }
    },
    "/api/master/akun/{kode}": {
      "patch": {
        "operationId": "AkunController_patch",
        "parameters": [
          {
            "name": "kode",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchAkunDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Akun berhasil diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-akun"
        ]
      },
      "delete": {
        "operationId": "AkunController_softDelete",
        "parameters": [
          {
            "name": "kode",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Akun dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-akun"
        ]
      }
    },
    "/api/master/jenis-transaksi": {
      "get": {
        "operationId": "JenisTransaksiController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListJenisTransaksiResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-jenis-transaksi"
        ]
      }
    },
    "/api/master/satuan": {
      "get": {
        "operationId": "SatuanController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMasterResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-satuan"
        ]
      },
      "post": {
        "operationId": "SatuanController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSatuanDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-satuan"
        ]
      }
    },
    "/api/master/satuan/{id}": {
      "patch": {
        "operationId": "SatuanController_patch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchSatuanDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Satuan diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-satuan"
        ]
      },
      "delete": {
        "operationId": "SatuanController_delete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Satuan dihapus jika belum dipakai"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-satuan"
        ]
      }
    },
    "/api/master/harga": {
      "get": {
        "operationId": "HargaController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMasterResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-harga"
        ]
      },
      "post": {
        "operationId": "HargaController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateHargaDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "kode": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-harga"
        ]
      }
    },
    "/api/master/harga/{kode}": {
      "patch": {
        "operationId": "HargaController_patch",
        "parameters": [
          {
            "name": "kode",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchHargaDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Tier harga diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-harga"
        ]
      },
      "delete": {
        "operationId": "HargaController_delete",
        "parameters": [
          {
            "name": "kode",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tier harga dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-harga"
        ]
      }
    },
    "/api/master/barang-satuan": {
      "get": {
        "operationId": "BarangSatuanController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMasterResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-satuan"
        ]
      },
      "post": {
        "operationId": "BarangSatuanController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarangSatuanDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-satuan"
        ]
      }
    },
    "/api/master/barang-satuan/{id}": {
      "patch": {
        "operationId": "BarangSatuanController_patch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchBarangSatuanDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Satuan barang diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-satuan"
        ]
      },
      "delete": {
        "operationId": "BarangSatuanController_delete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Satuan barang dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-satuan"
        ]
      }
    },
    "/api/master/barang-harga": {
      "get": {
        "operationId": "BarangHargaController_list",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "fields",
            "required": false,
            "in": "query",
            "description": "Field yang ditampilkan (comma-separated). Default: semua field standar",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Sort, contoh: nama:asc,kode:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response (legacy support), dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter tambahan (key=value pairs, dipisah koma)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "barang_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListMasterResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-harga"
        ]
      },
      "post": {
        "operationId": "BarangHargaController_create",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateBarangHargaDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-harga"
        ]
      }
    },
    "/api/master/barang-harga/{id}": {
      "patch": {
        "operationId": "BarangHargaController_patch",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchBarangHargaDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Harga barang diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-harga"
        ]
      },
      "delete": {
        "operationId": "BarangHargaController_delete",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Harga barang dinonaktifkan"
          }
        },
        "security": [
          {
            "bearer": []
          },
          {
            "bearer": []
          }
        ],
        "tags": [
          "master-barang-harga"
        ]
      }
    },
    "/api/transaksi/{jenis}": {
      "get": {
        "operationId": "TransaksiController_list",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "paginate",
            "required": false,
            "in": "query",
            "description": "Aktif/nonaktif pagination (true/false)",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci pencarian umum",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search_fields",
            "required": false,
            "in": "query",
            "description": "Daftar field pencarian, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "sorts",
            "required": false,
            "in": "query",
            "description": "Sort baru, contoh: tanggal:desc,nomor_transaksi:asc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sort",
            "required": false,
            "in": "query",
            "description": "Alias lama sort, contoh: tanggal:desc",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "custom_fields",
            "required": false,
            "in": "query",
            "description": "Field tambahan response, dipisah koma",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "filter",
            "required": false,
            "in": "query",
            "description": "Filter key:value dipisah koma, contoh: status:1,kontak_id:2,dari:2026-05-01,sampai:2026-05-31",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListTransaksiResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      },
      "post": {
        "operationId": "TransaksiController_create",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTransaksiDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "nomor_transaksi": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      }
    },
    "/api/transaksi/{jenis}/preferensi-tabel": {
      "get": {
        "operationId": "TransaksiController_getTablePreference",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransaksiTablePreferenceResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      },
      "put": {
        "operationId": "TransaksiController_putTablePreference",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutTransaksiTablePreferenceDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Preferensi tabel transaksi disimpan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      }
    },
    "/api/transaksi/{jenis}/{id}": {
      "get": {
        "operationId": "TransaksiController_get",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransaksiDetailResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      },
      "patch": {
        "operationId": "TransaksiController_patch",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchTransaksiDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Tidak dipakai untuk transaksi final; edit dilakukan lewat draft/koreksi"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      }
    },
    "/api/transaksi/{jenis}/{id}/approve": {
      "post": {
        "operationId": "TransaksiController_approve",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tidak dipakai untuk transaksi final; approval dilakukan di draft"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      }
    },
    "/api/transaksi/{jenis}/{id}/void": {
      "post": {
        "operationId": "TransaksiController_void",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "penjualan",
                "pembelian",
                "retur-penjualan",
                "retur-pembelian",
                "transfer-stok",
                "opname-stok",
                "penggunaan-persediaan",
                "order-pembelian",
                "order-penjualan",
                "kas-masuk",
                "kas-keluar",
                "kas-bank",
                "pelunasan-piutang",
                "pelunasan-hutang",
                "piutang",
                "hutang",
                "penyusutan",
                "bayar-poin",
                "jurnal-umum",
                "saldo-awal-hutang",
                "saldo-awal-piutang",
                "audit-hutang-piutang"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tidak dipakai untuk transaksi final; gunakan retur/koreksi"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "transaksi"
        ]
      }
    },
    "/api/draft/tracking/{tipe}": {
      "get": {
        "operationId": "DraftController_getTracking",
        "parameters": [
          {
            "name": "tipe",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "so",
                "po",
                "pm",
                "wo",
                "exception"
              ],
              "type": "string"
            }
          },
          {
            "name": "aktif_saja",
            "required": false,
            "in": "query",
            "description": "Hanya status belum selesai",
            "schema": {
              "default": true,
              "type": "boolean"
            }
          },
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "description": "Filter tanggal mulai",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "description": "Filter tanggal akhir",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Data tracking operasional (SO/PO/PM/WO/exception)"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}": {
      "get": {
        "operationId": "DraftController_list",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 1,
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "default": 20,
              "type": "number"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "Kata kunci: nomor_draft atau kontak_nama",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "description": "Filter status",
            "schema": {
              "type": "string",
              "enum": [
                "draft",
                "diajukan",
                "revisi",
                "disetujui",
                "ditolak",
                "diproses",
                "dikonversi",
                "batal"
              ]
            }
          },
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "description": "Filter tanggal mulai (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "description": "Filter tanggal akhir (YYYY-MM-DD)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kontak_id",
            "required": false,
            "in": "query",
            "description": "Filter ID kontak",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDraftResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      },
      "post": {
        "operationId": "DraftController_create",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDraftDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "id": {
                      "type": "number"
                    },
                    "nomor_draft": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}": {
      "get": {
        "operationId": "DraftController_get",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DraftDetailResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      },
      "patch": {
        "operationId": "DraftController_patch",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchDraftDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Draft diperbarui (hanya status draft/revisi)"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      },
      "delete": {
        "operationId": "DraftController_delete",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Draft dihapus (hanya status editable)"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/ajukan": {
      "post": {
        "operationId": "DraftController_ajukan",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Draft diajukan untuk approval"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/setujui": {
      "post": {
        "operationId": "DraftController_setujui",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetujuiDraftDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Draft disetujui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/tolak": {
      "post": {
        "operationId": "DraftController_tolak",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TolakDraftDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Draft ditolak atau dikembalikan ke revisi"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/batal": {
      "post": {
        "operationId": "DraftController_batal",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Draft dibatalkan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/konversi": {
      "post": {
        "operationId": "DraftController_konversi",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/KonversiResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/relasi": {
      "post": {
        "operationId": "DraftController_tambahRelasi",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TambahRelasiDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Relasi draft–transaksi dicatat dan qty_diproses disinkronkan"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/draft/{jenis}/{id}/riwayat-status": {
      "get": {
        "operationId": "DraftController_getRiwayatStatus",
        "parameters": [
          {
            "name": "jenis",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "order-penjualan",
                "order-pembelian",
                "permintaan-pembelian",
                "permintaan-mutasi",
                "perintah-produksi",
                "hasil-produksi",
                "penjualan",
                "pembelian",
                "transfer-stok",
                "penggunaan-persediaan"
              ],
              "type": "string"
            }
          },
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Riwayat perubahan status draft"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "draft"
        ]
      }
    },
    "/api/laporan/neraca": {
      "get": {
        "operationId": "LaporanController_neraca",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanNeracaResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/rugi-laba": {
      "get": {
        "operationId": "LaporanController_rugiLaba",
        "parameters": [
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "description": "YYYY-MM-DD (default: awal tahun berjalan)",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "description": "YYYY-MM-DD (default: hari ini)",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanRugiLabaResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/piutang": {
      "get": {
        "operationId": "LaporanController_piutang",
        "parameters": [
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kontak_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "jatuh_tempo_dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jatuh_tempo_sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "belum",
                "sebagian",
                "lunas",
                "outstanding"
              ],
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanPiutangResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/hutang": {
      "get": {
        "operationId": "LaporanController_hutang",
        "parameters": [
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kontak_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "jatuh_tempo_dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "jatuh_tempo_sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "status",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "belum",
                "sebagian",
                "lunas",
                "outstanding"
              ],
              "type": "string"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanPiutangResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/stok": {
      "get": {
        "operationId": "LaporanController_stok",
        "parameters": [
          {
            "name": "lokasi_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "barang_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanStokResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/kartu-stok/{barang_id}": {
      "get": {
        "operationId": "LaporanController_kartuStok",
        "parameters": [
          {
            "name": "barang_id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "lokasi_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanKartuStokResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/penjualan/summary": {
      "get": {
        "operationId": "LaporanController_penjualanSummary",
        "parameters": [
          {
            "name": "group_by",
            "required": false,
            "in": "query",
            "schema": {
              "enum": [
                "barang",
                "pelanggan",
                "bulan",
                "hari"
              ],
              "type": "string"
            }
          },
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kontak_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "barang_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanPenjualanSummaryResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/laporan/penjualan": {
      "get": {
        "operationId": "LaporanController_penjualan",
        "parameters": [
          {
            "name": "dari",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "sampai",
            "required": false,
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kontak_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "barang_id",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "per_page",
            "required": false,
            "in": "query",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LaporanPenjualanResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "laporan"
        ]
      }
    },
    "/api/audit/stok-selisih": {
      "get": {
        "operationId": "AuditController_stokSelisih",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditStokSelisihResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "audit"
        ]
      }
    },
    "/api/audit/jurnal-tidak-imbang": {
      "get": {
        "operationId": "AuditController_jurnalTidakImbang",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditJurnalTidakImbangResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "audit"
        ]
      }
    },
    "/api/notifikasi/perangkat": {
      "post": {
        "operationId": "NotifikasiController_registerPerangkat",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RegisterPerangkatDto"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RegisterPerangkatResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "notifikasi"
        ]
      }
    },
    "/api/notifikasi/request-akses-tenant": {
      "post": {
        "operationId": "NotifikasiController_requestAksesTenant",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RequestAksesTenantResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "notifikasi"
        ]
      }
    },
    "/api/dashboard/stream": {
      "get": {
        "operationId": "DashboardController_stream",
        "parameters": [],
        "responses": {
          "200": {
            "description": "Server-Sent Events dengan payload data { type: \"kpi_update\" } saat KPI tenant berubah",
            "content": {
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "example": "data: {\"type\":\"kpi_update\"}\n\n"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "summary": "SSE stream sinyal kpi_update per tenant (gunakan JWT)",
        "tags": [
          "dashboard"
        ]
      }
    },
    "/api/dashboard/{peran}/summary": {
      "get": {
        "operationId": "DashboardController_summary",
        "parameters": [
          {
            "name": "peran",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "direksi",
                "admin",
                "sales",
                "gudang",
                "umum",
                "customer"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardSummaryDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "dashboard"
        ]
      }
    },
    "/api/dashboard/{peran}/trend": {
      "get": {
        "operationId": "DashboardController_trend",
        "parameters": [
          {
            "name": "peran",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "direksi",
                "admin",
                "sales",
                "gudang",
                "umum",
                "customer"
              ],
              "type": "string"
            }
          },
          {
            "name": "bulan",
            "required": false,
            "in": "query",
            "description": "Jumlah bulan ke belakang (1–24, default 12)",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardTrendDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "dashboard"
        ]
      }
    },
    "/api/dashboard/{peran}/top10": {
      "get": {
        "operationId": "DashboardController_top10",
        "parameters": [
          {
            "name": "peran",
            "required": true,
            "in": "path",
            "schema": {
              "enum": [
                "direksi",
                "admin",
                "sales",
                "gudang",
                "umum",
                "customer"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Top 10 per 5 dimensi: jenis, pelanggan, kabupaten, sales, merk",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardTop10Dto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "dashboard"
        ]
      }
    },
    "/api/ops/cdc/jobs": {
      "post": {
        "operationId": "OpsCdcController_createJob",
        "parameters": [
          {
            "name": "x-idempotency-key",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "x-mode-operasi",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateJobDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "ops-cdc"
        ]
      },
      "get": {
        "operationId": "OpsCdcController_listJobs",
        "parameters": [
          {
            "name": "tenant_kode",
            "required": true,
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "ops-cdc"
        ]
      }
    },
    "/api/ops/cdc/jobs/{id}": {
      "get": {
        "operationId": "OpsCdcController_getJob",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "ops-cdc"
        ]
      }
    },
    "/api/ops/cdc/jobs/{id}/log": {
      "get": {
        "operationId": "OpsCdcController_getJobLog",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "ops-cdc"
        ]
      }
    },
    "/api/ops/cdc/jobs/{id}/aksi": {
      "post": {
        "operationId": "OpsCdcController_actionJob",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "authorization",
            "required": true,
            "in": "header",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": ""
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "ops-cdc"
        ]
      }
    },
    "/api/pengaturan/pengguna": {
      "get": {
        "operationId": "PengaturanController_listPengguna",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListPenggunaResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      },
      "post": {
        "operationId": "PengaturanController_createPengguna",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreatePenggunaDto"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatePenggunaResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      }
    },
    "/api/pengaturan/pengguna/{id}": {
      "get": {
        "operationId": "PengaturanController_getPengguna",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PenggunaItemDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      },
      "patch": {
        "operationId": "PengaturanController_patchPengguna",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchPenggunaDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Profil pengguna diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      }
    },
    "/api/pengaturan/pengguna/{id}/tenant-assignments": {
      "put": {
        "operationId": "PengaturanController_putTenantAssignments",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Tenant assignments pengguna diganti"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      }
    },
    "/api/pengaturan/pengguna/{id}/reset-password": {
      "post": {
        "operationId": "PengaturanController_resetPassword",
        "parameters": [
          {
            "name": "id",
            "required": true,
            "in": "path",
            "schema": {
              "type": "number"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "properties": {
                    "reset_link": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      }
    },
    "/api/pengaturan/tenant": {
      "get": {
        "operationId": "PengaturanController_getTenant",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TenantProfilDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      },
      "patch": {
        "operationId": "PengaturanController_patchTenant",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PatchTenantDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Profil tenant diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      }
    },
    "/api/pengaturan/tenant/modul": {
      "get": {
        "operationId": "PengaturanController_listModul",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListModulResponseDto"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      },
      "put": {
        "operationId": "PengaturanController_putModul",
        "parameters": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PutModulDto"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Status modul tenant diperbarui"
          }
        },
        "security": [
          {
            "bearer": []
          }
        ],
        "tags": [
          "pengaturan"
        ]
      }
    }
  },
  "info": {
    "title": "Lucky Jaya ERP API",
    "description": "Backend API untuk auth, tenant routing, dan data operasional ERP",
    "version": "0.1.0",
    "contact": {}
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "bearer": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http"
      }
    },
    "schemas": {
      "HealthResponse": {
        "type": "object",
        "properties": {}
      },
      "CreateSessionDto": {
        "type": "object",
        "properties": {
          "firebase_id_token": {
            "type": "string",
            "description": "Firebase ID token dari klien setelah login Firebase Auth"
          }
        },
        "required": [
          "firebase_id_token"
        ]
      },
      "SessionResponseDto": {
        "type": "object",
        "properties": {
          "terdaftar": {
            "type": "boolean",
            "description": "true jika email terdaftar di pusat.pengguna"
          },
          "access_token": {
            "type": "object",
            "nullable": true,
            "description": "null jika belum terdaftar"
          },
          "token_type": {
            "type": "string"
          },
          "expires_in": {
            "type": "string"
          },
          "nama": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "terdaftar",
          "access_token",
          "token_type",
          "expires_in",
          "nama"
        ]
      },
      "TenantDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "bidang_usaha": {
            "type": "object",
            "nullable": true
          },
          "peran": {
            "type": "string",
            "enum": [
              "none",
              "sales",
              "gudang",
              "admin",
              "direksi",
              "customer",
              "umum"
            ]
          }
        },
        "required": [
          "kode",
          "nama",
          "bidang_usaha",
          "peran"
        ]
      },
      "PenggunaAksesLokasiDto": {
        "type": "object",
        "properties": {
          "lokasi_id": {
            "type": "number"
          },
          "nama": {
            "type": "string"
          },
          "is_default": {
            "type": "boolean"
          }
        },
        "required": [
          "lokasi_id",
          "nama",
          "is_default"
        ]
      },
      "PenggunaAksesKasDto": {
        "type": "object",
        "properties": {
          "akun_kode": {
            "type": "number"
          },
          "akun_nama": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "akun_kode",
          "akun_nama"
        ]
      },
      "PilihTenantResponseDto": {
        "type": "object",
        "properties": {
          "terdaftar": {
            "type": "boolean"
          },
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string"
          },
          "expires_in": {
            "type": "string"
          },
          "peran": {
            "type": "string",
            "enum": [
              "none",
              "sales",
              "gudang",
              "admin",
              "direksi",
              "customer",
              "umum"
            ]
          },
          "nama": {
            "type": "string"
          },
          "kontak_id": {
            "type": "object",
            "nullable": true,
            "description": "ID kontak pengguna di schema tenant ini"
          },
          "akses_lokasi": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenggunaAksesLokasiDto"
            }
          },
          "akses_kas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenggunaAksesKasDto"
            }
          }
        },
        "required": [
          "terdaftar",
          "access_token",
          "token_type",
          "expires_in",
          "nama",
          "kontak_id",
          "akses_lokasi",
          "akses_kas"
        ]
      },
      "ModulItemDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "ikon": {
            "type": "object",
            "nullable": true
          },
          "jenis_transaksi_kode": {
            "type": "object",
            "nullable": true,
            "description": "Kode jenis_transaksi terkait (PB/PJ/dll)"
          }
        },
        "required": [
          "kode",
          "nama",
          "ikon",
          "jenis_transaksi_kode"
        ]
      },
      "ModulGrupDto": {
        "type": "object",
        "properties": {
          "grup": {
            "type": "string"
          },
          "modul": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModulItemDto"
            }
          }
        },
        "required": [
          "grup",
          "modul"
        ]
      },
      "ListBarangResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Array of data items"
          },
          "page": {
            "type": "number",
            "description": "Current page",
            "example": 1
          },
          "per_page": {
            "type": "number",
            "description": "Items per page",
            "example": 20
          },
          "total": {
            "type": "number",
            "description": "Total items",
            "example": 150
          },
          "total_pages": {
            "type": "number",
            "description": "Total pages",
            "example": 8
          }
        },
        "required": [
          "data",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "CreateBarangDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string",
            "example": "AC-001"
          },
          "nama": {
            "type": "string",
            "example": "ACCU GM5Z-3B"
          },
          "golongan_id": {
            "type": "number",
            "example": 1
          },
          "barcode": {
            "type": "object",
            "nullable": true,
            "example": "123456789"
          },
          "kategori_id": {
            "type": "number",
            "example": 2
          },
          "jenis_id": {
            "type": "number",
            "example": 3
          },
          "merk_id": {
            "type": "number",
            "example": 4
          },
          "satuan_default_id": {
            "type": "number",
            "example": 1
          },
          "hdasar_kode": {
            "type": "object",
            "nullable": true,
            "example": "JUAL1"
          },
          "tanpa_stok": {
            "type": "boolean",
            "example": false
          },
          "atribut": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          }
        },
        "required": [
          "kode",
          "nama",
          "golongan_id"
        ]
      },
      "PatchBarangDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string",
            "example": "ACCU GM5Z-3B FULL"
          },
          "barcode": {
            "type": "object",
            "nullable": true,
            "example": "999999999"
          },
          "golongan_id": {
            "type": "number",
            "example": 1
          },
          "kategori_id": {
            "type": "number",
            "example": 2
          },
          "jenis_id": {
            "type": "number",
            "example": 3
          },
          "merk_id": {
            "type": "number",
            "example": 4
          },
          "satuan_default_id": {
            "type": "number",
            "example": 1
          },
          "hdasar_kode": {
            "type": "object",
            "nullable": true,
            "example": "JUAL2"
          },
          "tanpa_stok": {
            "type": "boolean",
            "example": true
          },
          "is_aktif": {
            "type": "boolean",
            "example": true
          },
          "atribut": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          }
        }
      },
      "ListKontakResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            },
            "description": "Array of data items"
          },
          "page": {
            "type": "number",
            "description": "Current page",
            "example": 1
          },
          "per_page": {
            "type": "number",
            "description": "Items per page",
            "example": 20
          },
          "total": {
            "type": "number",
            "description": "Total items",
            "example": 150
          },
          "total_pages": {
            "type": "number",
            "description": "Total pages",
            "example": 8
          }
        },
        "required": [
          "data",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "CreateKontakDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string",
            "example": "C0001"
          },
          "nama": {
            "type": "string",
            "example": "AA MOTOR"
          },
          "is_pelanggan": {
            "type": "boolean",
            "description": "Customer flag",
            "example": true
          },
          "is_supplier": {
            "type": "boolean",
            "description": "Supplier flag",
            "example": false
          },
          "is_pegawai": {
            "type": "boolean",
            "description": "Employee flag",
            "example": false
          },
          "perusahaan": {
            "type": "object",
            "nullable": true,
            "example": "PT Maju Jaya"
          },
          "cabang_id": {
            "type": "number",
            "example": 1
          },
          "tingkat_harga_kode": {
            "type": "object",
            "nullable": true,
            "example": "JUAL1"
          },
          "termin_kode": {
            "type": "object",
            "nullable": true,
            "example": "K01"
          },
          "plafon_kredit": {
            "type": "object",
            "nullable": true,
            "example": 5000000
          },
          "persen_komisi": {
            "type": "object",
            "nullable": true,
            "example": 2.5
          },
          "saldo_awal": {
            "type": "object",
            "nullable": true,
            "example": 1000000
          },
          "atribut": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          }
        },
        "required": [
          "kode",
          "nama"
        ]
      },
      "PatchKontakDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string",
            "example": "AA MOTOR JAYA"
          },
          "perusahaan": {
            "type": "object",
            "nullable": true,
            "example": "PT Maju Jaya"
          },
          "is_pelanggan": {
            "type": "boolean",
            "example": true
          },
          "is_supplier": {
            "type": "boolean",
            "example": true
          },
          "is_pegawai": {
            "type": "boolean",
            "example": false
          },
          "cabang_id": {
            "type": "number",
            "example": 1
          },
          "tingkat_harga_kode": {
            "type": "object",
            "nullable": true,
            "example": "JUAL2"
          },
          "termin_kode": {
            "type": "object",
            "nullable": true,
            "example": "K01"
          },
          "plafon_kredit": {
            "type": "object",
            "nullable": true,
            "example": 10000000
          },
          "persen_komisi": {
            "type": "object",
            "nullable": true,
            "example": 5
          },
          "is_aktif": {
            "type": "boolean",
            "example": true
          },
          "atribut": {
            "type": "object",
            "nullable": true,
            "additionalProperties": true
          }
        }
      },
      "ListLokasiResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "total_pages": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "CreateLokasiDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "cabang_id": {
            "type": "number"
          }
        },
        "required": [
          "kode",
          "nama"
        ]
      },
      "PatchLokasiDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string"
          },
          "cabang_id": {
            "type": "number"
          },
          "is_aktif": {
            "type": "boolean"
          }
        }
      },
      "AkunKlasRefDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "urut": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "kode",
          "nama",
          "urut"
        ]
      },
      "AkunSubklasRefDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "akun_klas_id": {
            "type": "number"
          },
          "urut": {
            "type": "number"
          }
        },
        "required": [
          "id",
          "kode",
          "nama",
          "akun_klas_id",
          "urut"
        ]
      },
      "AkunItemDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "saldo_normal": {
            "type": "string",
            "enum": [
              "D",
              "K"
            ]
          },
          "is_aktif": {
            "type": "boolean"
          },
          "akun_klas_id": {
            "type": "object",
            "nullable": true
          },
          "akun_subklas_id": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "kode",
          "nama",
          "saldo_normal",
          "is_aktif",
          "akun_klas_id",
          "akun_subklas_id"
        ]
      },
      "AkunSubklasDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "akun": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AkunItemDto"
            }
          }
        },
        "required": [
          "id",
          "kode",
          "nama",
          "akun"
        ]
      },
      "AkunKlasDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "subklas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AkunSubklasDto"
            }
          }
        },
        "required": [
          "id",
          "kode",
          "nama",
          "subklas"
        ]
      },
      "ListAkunResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AkunKlasDto"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "CreateAkunDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string",
            "maxLength": 20
          },
          "nama": {
            "type": "string",
            "maxLength": 200
          },
          "saldo_normal": {
            "type": "string",
            "enum": [
              "D",
              "K"
            ]
          },
          "akun_subklas_id": {
            "type": "number",
            "description": "ID akun_subklas (wajib)"
          }
        },
        "required": [
          "kode",
          "nama",
          "saldo_normal",
          "akun_subklas_id"
        ]
      },
      "PatchAkunDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string",
            "maxLength": 200
          },
          "is_aktif": {
            "type": "boolean"
          },
          "akun_subklas_id": {
            "type": "number"
          }
        }
      },
      "JenisTransaksiItemDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "deskripsi": {
            "type": "object",
            "nullable": true
          },
          "kategori": {
            "type": "object",
            "nullable": true
          },
          "pengaruh_stok": {
            "type": "boolean"
          },
          "is_sistem": {
            "type": "boolean"
          }
        },
        "required": [
          "kode",
          "nama",
          "pengaruh_stok",
          "is_sistem"
        ]
      },
      "ListJenisTransaksiResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JenisTransaksiItemDto"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "ListMasterResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "total_pages": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "CreateSatuanDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string"
          }
        },
        "required": [
          "nama"
        ]
      },
      "PatchSatuanDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string"
          }
        }
      },
      "CreateHargaDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "publik": {
            "type": "boolean"
          }
        },
        "required": [
          "kode",
          "nama"
        ]
      },
      "PatchHargaDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string"
          },
          "publik": {
            "type": "boolean"
          },
          "is_aktif": {
            "type": "boolean"
          }
        }
      },
      "CreateBarangSatuanDto": {
        "type": "object",
        "properties": {
          "barang_id": {
            "type": "number"
          },
          "satuan_id": {
            "type": "number"
          },
          "isi": {
            "type": "number",
            "default": 1
          },
          "barcode": {
            "type": "object",
            "nullable": true
          },
          "poin": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "barang_id",
          "satuan_id"
        ]
      },
      "PatchBarangSatuanDto": {
        "type": "object",
        "properties": {
          "isi": {
            "type": "number"
          },
          "barcode": {
            "type": "object",
            "nullable": true
          },
          "poin": {
            "type": "object",
            "nullable": true
          },
          "is_aktif": {
            "type": "boolean"
          }
        }
      },
      "CreateBarangHargaDto": {
        "type": "object",
        "properties": {
          "barang_id": {
            "type": "number"
          },
          "satuan_id": {
            "type": "object",
            "nullable": true
          },
          "harga_kode": {
            "type": "string"
          },
          "harga": {
            "type": "number"
          },
          "markup": {
            "type": "object",
            "nullable": true
          },
          "tgl_berlaku_dari": {
            "type": "string"
          },
          "tgl_berlaku_sampai": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "barang_id",
          "harga_kode",
          "harga"
        ]
      },
      "PatchBarangHargaDto": {
        "type": "object",
        "properties": {
          "satuan_id": {
            "type": "object",
            "nullable": true
          },
          "harga_kode": {
            "type": "string"
          },
          "harga": {
            "type": "number"
          },
          "markup": {
            "type": "object",
            "nullable": true
          },
          "tgl_berlaku_dari": {
            "type": "string"
          },
          "tgl_berlaku_sampai": {
            "type": "object",
            "nullable": true
          },
          "is_aktif": {
            "type": "boolean"
          }
        }
      },
      "TransaksiHeaderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "nomor_transaksi": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "string"
          },
          "nomor_bukti": {
            "type": "number"
          },
          "sumber_perangkat": {
            "type": "object",
            "nullable": true
          },
          "tanggal": {
            "type": "string"
          },
          "status": {
            "type": "number"
          },
          "kontak_id": {
            "type": "object",
            "nullable": true
          },
          "kontak_nama": {
            "type": "object",
            "nullable": true
          },
          "pegawai_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_tujuan_id": {
            "type": "object",
            "nullable": true
          },
          "cabang_id": {
            "type": "object",
            "nullable": true
          },
          "subtotal": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "biaya": {
            "type": "number"
          },
          "pembulatan": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "dibayar": {
            "type": "number"
          },
          "kredit": {
            "type": "number"
          },
          "total_pelunasan": {
            "type": "number"
          },
          "potongnota": {
            "type": "number"
          },
          "saldo": {
            "type": "object",
            "nullable": true
          },
          "hpp_total": {
            "type": "number"
          },
          "qty_total": {
            "type": "number"
          },
          "jatuh_tempo": {
            "type": "object",
            "nullable": true
          },
          "termin_kode": {
            "type": "object",
            "nullable": true
          },
          "akun_kode": {
            "type": "object",
            "nullable": true
          },
          "akun_kas_kode": {
            "type": "object",
            "nullable": true
          },
          "akun_kredit_kode": {
            "type": "object",
            "nullable": true
          },
          "keterangan": {
            "type": "object",
            "nullable": true
          },
          "catatan": {
            "type": "object",
            "nullable": true
          },
          "dibuat_oleh": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "nomor_transaksi",
          "jenis_kode",
          "tanggal",
          "status",
          "subtotal",
          "diskon",
          "total",
          "hpp_total",
          "qty_total",
          "created_at"
        ]
      },
      "ListTransaksiResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransaksiHeaderDto"
            }
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "total_pages": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "CreateTransaksiDetailDto": {
        "type": "object",
        "properties": {
          "barang_id": {
            "type": "number",
            "description": "ID barang"
          },
          "qty_nota": {
            "type": "number",
            "description": "Qty di nota (sebelum konversi satuan)",
            "minimum": 0
          },
          "harga": {
            "type": "number",
            "description": "Harga satuan (wajib untuk PJ/PB)"
          },
          "satuan_id": {
            "type": "number"
          },
          "isi_konversi": {
            "type": "number",
            "description": "Faktor konversi satuan ke satuan dasar",
            "default": 1
          },
          "diskon": {
            "type": "number",
            "description": "Diskon per baris (nominal)",
            "default": 0
          },
          "lokasi_id": {
            "type": "number",
            "description": "Lokasi stok (override lokasi header)"
          },
          "lokasi_tujuan_id": {
            "type": "number",
            "description": "Lokasi tujuan (untuk transfer stok)"
          },
          "ref_detail_id": {
            "type": "number",
            "description": "ID detail transaksi asal (untuk retur)"
          },
          "ref_transaksi_id": {
            "type": "number",
            "description": "ID transaksi asal (untuk retur)"
          },
          "keterangan": {
            "type": "string"
          }
        },
        "required": [
          "barang_id",
          "qty_nota"
        ]
      },
      "CreateTransaksiDto": {
        "type": "object",
        "properties": {
          "tanggal": {
            "type": "string",
            "description": "Tanggal transaksi (ISO 8601, default now)"
          },
          "kontak_id": {
            "type": "number",
            "description": "ID kontak (pelanggan/supplier)"
          },
          "pegawai_id": {
            "type": "number",
            "description": "ID pegawai/sales"
          },
          "cabang_id": {
            "type": "number",
            "description": "ID cabang"
          },
          "lokasi_id": {
            "type": "number",
            "description": "ID lokasi asal"
          },
          "lokasi_tujuan_id": {
            "type": "number",
            "description": "ID lokasi tujuan (untuk transfer stok)"
          },
          "harga_kode": {
            "type": "string",
            "description": "Tier harga (FK harga.kode). Default dari kontak.tingkat_harga_kode."
          },
          "termin_kode": {
            "type": "string",
            "description": "Termin pembayaran (FK termin.kode)"
          },
          "jatuh_tempo": {
            "type": "string",
            "description": "Tanggal jatuh tempo"
          },
          "akun_kode": {
            "type": "number",
            "description": "Override akun utama (default dari jenis_transaksi)"
          },
          "akun_kas_kode": {
            "type": "number",
            "description": "Akun kas/bank (untuk transaksi keuangan)"
          },
          "akun_kredit_kode": {
            "type": "number",
            "description": "Override akun kredit (default dari jenis_transaksi)"
          },
          "diskon": {
            "type": "number",
            "description": "Diskon header (nominal)",
            "default": 0
          },
          "biaya": {
            "type": "number",
            "description": "Biaya tambahan (ongkos kirim, dll)",
            "default": 0
          },
          "pembulatan": {
            "type": "number",
            "description": "Pembulatan",
            "default": 0
          },
          "dibayar": {
            "type": "number",
            "description": "Jumlah dibayar. Untuk transaksi keuangan tanpa detail, sekaligus menjadi total."
          },
          "total": {
            "type": "number",
            "description": "Total nominal. Untuk transaksi keuangan tanpa detail (KM, KK, PP, PH, dll)."
          },
          "keterangan": {
            "type": "string"
          },
          "catatan": {
            "type": "string"
          },
          "detail": {
            "description": "Baris barang. Kosongkan untuk transaksi keuangan (KM/KK/PP/PH/JU/dll) yang tidak melibatkan barang.",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateTransaksiDetailDto"
            }
          }
        }
      },
      "TransaksiTablePreferenceItemDto": {
        "type": "object",
        "properties": {
          "field_key": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "is_visible": {
            "type": "boolean"
          },
          "urut": {
            "type": "number"
          },
          "lebar": {
            "type": "object",
            "nullable": true
          },
          "sort_arah": {
            "type": "string",
            "nullable": true,
            "enum": [
              "asc",
              "desc"
            ]
          },
          "source_scope": {
            "type": "string"
          }
        },
        "required": [
          "field_key",
          "caption",
          "is_visible",
          "urut",
          "source_scope"
        ]
      },
      "TransaksiTablePreferenceResponseDto": {
        "type": "object",
        "properties": {
          "kode_tabel": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "object",
            "nullable": true
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransaksiTablePreferenceItemDto"
            }
          }
        },
        "required": [
          "kode_tabel",
          "fields"
        ]
      },
      "PutTransaksiTablePreferenceItemDto": {
        "type": "object",
        "properties": {
          "field_key": {
            "type": "string"
          },
          "caption": {
            "type": "string"
          },
          "is_visible": {
            "type": "boolean"
          },
          "urut": {
            "type": "number"
          },
          "lebar": {
            "type": "object",
            "nullable": true
          },
          "sort_arah": {
            "type": "string",
            "nullable": true,
            "enum": [
              "asc",
              "desc"
            ]
          }
        },
        "required": [
          "field_key",
          "caption",
          "is_visible",
          "urut"
        ]
      },
      "PutTransaksiTablePreferenceDto": {
        "type": "object",
        "properties": {
          "scope": {
            "type": "string",
            "enum": [
              "tenant",
              "peran",
              "pengguna"
            ]
          },
          "peran": {
            "type": "object",
            "nullable": true,
            "description": "Isi bila scope=peran. Default peran user aktif."
          },
          "jenis_kode": {
            "type": "object",
            "nullable": true,
            "description": "Opsional override khusus jenis transaksi."
          },
          "fields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PutTransaksiTablePreferenceItemDto"
            }
          }
        },
        "required": [
          "scope",
          "fields"
        ]
      },
      "TransaksiDetailItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "urut": {
            "type": "number"
          },
          "barang_id": {
            "type": "object",
            "nullable": true
          },
          "barang_kode": {
            "type": "object",
            "nullable": true
          },
          "qty_nota": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "harga": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "jumlah": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "hpp": {
            "type": "number"
          },
          "mutasi_stok": {
            "type": "number"
          },
          "satuan_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "keterangan": {
            "type": "object",
            "nullable": true
          },
          "tipe_baris": {
            "type": "string",
            "default": "BARANG"
          },
          "akun_kode": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "id",
          "urut",
          "qty_nota",
          "qty",
          "harga",
          "diskon",
          "jumlah",
          "total",
          "hpp",
          "mutasi_stok",
          "tipe_baris"
        ]
      },
      "TransaksiDetailResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "nomor_transaksi": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "string"
          },
          "nomor_bukti": {
            "type": "number"
          },
          "sumber_perangkat": {
            "type": "object",
            "nullable": true
          },
          "tanggal": {
            "type": "string"
          },
          "status": {
            "type": "number"
          },
          "kontak_id": {
            "type": "object",
            "nullable": true
          },
          "kontak_nama": {
            "type": "object",
            "nullable": true
          },
          "pegawai_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_tujuan_id": {
            "type": "object",
            "nullable": true
          },
          "cabang_id": {
            "type": "object",
            "nullable": true
          },
          "subtotal": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "biaya": {
            "type": "number"
          },
          "pembulatan": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "dibayar": {
            "type": "number"
          },
          "kredit": {
            "type": "number"
          },
          "total_pelunasan": {
            "type": "number"
          },
          "potongnota": {
            "type": "number"
          },
          "saldo": {
            "type": "object",
            "nullable": true
          },
          "hpp_total": {
            "type": "number"
          },
          "qty_total": {
            "type": "number"
          },
          "jatuh_tempo": {
            "type": "object",
            "nullable": true
          },
          "termin_kode": {
            "type": "object",
            "nullable": true
          },
          "akun_kode": {
            "type": "object",
            "nullable": true
          },
          "akun_kas_kode": {
            "type": "object",
            "nullable": true
          },
          "akun_kredit_kode": {
            "type": "object",
            "nullable": true
          },
          "keterangan": {
            "type": "object",
            "nullable": true
          },
          "catatan": {
            "type": "object",
            "nullable": true
          },
          "dibuat_oleh": {
            "type": "string"
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TransaksiDetailItemDto"
            }
          }
        },
        "required": [
          "id",
          "nomor_transaksi",
          "jenis_kode",
          "tanggal",
          "status",
          "subtotal",
          "diskon",
          "total",
          "hpp_total",
          "qty_total",
          "created_at",
          "detail"
        ]
      },
      "PatchTransaksiDto": {
        "type": "object",
        "properties": {
          "tanggal": {
            "type": "string"
          },
          "kontak_id": {
            "type": "number"
          },
          "pegawai_id": {
            "type": "number"
          },
          "cabang_id": {
            "type": "number"
          },
          "lokasi_id": {
            "type": "number"
          },
          "lokasi_tujuan_id": {
            "type": "number"
          },
          "harga_kode": {
            "type": "string"
          },
          "termin_kode": {
            "type": "string"
          },
          "jatuh_tempo": {
            "type": "string"
          },
          "akun_kode": {
            "type": "number"
          },
          "akun_kas_kode": {
            "type": "number"
          },
          "akun_kredit_kode": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "biaya": {
            "type": "number"
          },
          "pembulatan": {
            "type": "number"
          },
          "dibayar": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "keterangan": {
            "type": "string"
          },
          "catatan": {
            "type": "string"
          }
        }
      },
      "DraftHeaderDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "nomor_draft": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "string"
          },
          "tanggal": {
            "type": "string"
          },
          "tanggal_dibutuhkan": {
            "type": "object",
            "nullable": true
          },
          "prioritas": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "tahap": {
            "type": "object",
            "nullable": true
          },
          "kontak_id": {
            "type": "object",
            "nullable": true
          },
          "kontak_nama": {
            "type": "object",
            "nullable": true
          },
          "harga_kode": {
            "type": "object",
            "nullable": true
          },
          "pegawai_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_tujuan_id": {
            "type": "object",
            "nullable": true
          },
          "cabang_id": {
            "type": "object",
            "nullable": true
          },
          "subtotal": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "biaya": {
            "type": "number"
          },
          "pembulatan": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "keterangan": {
            "type": "object",
            "nullable": true
          },
          "catatan": {
            "type": "object",
            "nullable": true
          },
          "ref_transaksi_id": {
            "type": "object",
            "nullable": true
          },
          "dibuat_oleh": {
            "type": "string"
          },
          "diajukan_oleh": {
            "type": "object",
            "nullable": true
          },
          "diajukan_at": {
            "type": "object",
            "nullable": true
          },
          "disetujui_oleh": {
            "type": "object",
            "nullable": true
          },
          "disetujui_at": {
            "type": "object",
            "nullable": true
          },
          "dikonversi_oleh": {
            "type": "object",
            "nullable": true
          },
          "dikonversi_at": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "nomor_draft",
          "jenis_kode",
          "tanggal",
          "prioritas",
          "status",
          "subtotal",
          "diskon",
          "biaya",
          "pembulatan",
          "total",
          "dibuat_oleh",
          "created_at",
          "updated_at"
        ]
      },
      "ListDraftResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DraftHeaderDto"
            }
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "total_pages": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "CreateDraftDetailDto": {
        "type": "object",
        "properties": {
          "urut": {
            "type": "number",
            "description": "Urutan baris",
            "minimum": 1
          },
          "peran_baris": {
            "type": "string",
            "enum": [
              "BARANG",
              "BAHAN",
              "HASIL",
              "BIAYA",
              "OPERASI",
              "LAIN"
            ],
            "default": "BARANG"
          },
          "barang_id": {
            "type": "number",
            "description": "ID barang"
          },
          "barang_kode": {
            "type": "string",
            "description": "Kode barang (denormalisasi)"
          },
          "satuan_id": {
            "type": "number",
            "description": "ID satuan"
          },
          "qty_nota": {
            "type": "number",
            "description": "Qty di nota (sebelum konversi)",
            "default": 0
          },
          "isi_konversi": {
            "type": "number",
            "description": "Faktor konversi satuan ke satuan dasar",
            "default": 1
          },
          "qty_disetujui": {
            "type": "number",
            "description": "Qty yang disetujui oleh approver",
            "default": 0
          },
          "harga": {
            "type": "number",
            "description": "Harga satuan",
            "default": 0
          },
          "diskon": {
            "type": "number",
            "description": "Diskon per baris (nominal)",
            "default": 0
          },
          "lokasi_id": {
            "type": "number",
            "description": "ID lokasi stok (override header)"
          },
          "lokasi_tujuan_id": {
            "type": "number",
            "description": "ID lokasi tujuan (override header)"
          },
          "ref_transaksi_detail_id": {
            "type": "number",
            "description": "ID detail transaksi asal"
          },
          "keterangan": {
            "type": "string",
            "maxLength": 150
          }
        },
        "required": [
          "urut"
        ]
      },
      "CreateDraftDto": {
        "type": "object",
        "properties": {
          "tanggal": {
            "type": "string",
            "description": "Tanggal dokumen (ISO 8601, default now)"
          },
          "tanggal_dibutuhkan": {
            "type": "string",
            "description": "Tanggal barang dibutuhkan"
          },
          "prioritas": {
            "type": "number",
            "description": "Prioritas (0=normal)",
            "default": 0
          },
          "kontak_id": {
            "type": "number",
            "description": "ID kontak (pelanggan/supplier)"
          },
          "harga_kode": {
            "type": "string",
            "description": "Kode tier harga (FK harga.kode)"
          },
          "pegawai_id": {
            "type": "number",
            "description": "ID pegawai/sales"
          },
          "lokasi_id": {
            "type": "number",
            "description": "ID lokasi asal"
          },
          "lokasi_tujuan_id": {
            "type": "number",
            "description": "ID lokasi tujuan"
          },
          "cabang_id": {
            "type": "number",
            "description": "ID cabang"
          },
          "diskon": {
            "type": "number",
            "description": "Diskon header (nominal)",
            "default": 0
          },
          "biaya": {
            "type": "number",
            "description": "Biaya tambahan",
            "default": 0
          },
          "pembulatan": {
            "type": "number",
            "description": "Pembulatan",
            "default": 0
          },
          "keterangan": {
            "type": "string",
            "maxLength": 150
          },
          "catatan": {
            "type": "string"
          },
          "ref_transaksi_id": {
            "type": "number",
            "description": "ID transaksi asal (jika draft dibuat dari dokumen final)"
          },
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateDraftDetailDto"
            }
          }
        }
      },
      "DraftDetailItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "urut": {
            "type": "number"
          },
          "peran_baris": {
            "type": "string"
          },
          "barang_id": {
            "type": "object",
            "nullable": true
          },
          "barang_kode": {
            "type": "object",
            "nullable": true
          },
          "satuan_id": {
            "type": "object",
            "nullable": true
          },
          "qty_nota": {
            "type": "number"
          },
          "isi_konversi": {
            "type": "number"
          },
          "qty": {
            "type": "number"
          },
          "qty_disetujui": {
            "type": "number"
          },
          "qty_dikonversi": {
            "type": "number"
          },
          "qty_sisa": {
            "type": "number"
          },
          "harga": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "jumlah": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_tujuan_id": {
            "type": "object",
            "nullable": true
          },
          "keterangan": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "id",
          "urut",
          "peran_baris",
          "qty_nota",
          "isi_konversi",
          "qty",
          "qty_disetujui",
          "qty_dikonversi",
          "qty_sisa",
          "harga",
          "diskon",
          "jumlah",
          "total"
        ]
      },
      "DraftDetailResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "nomor_draft": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "string"
          },
          "tanggal": {
            "type": "string"
          },
          "tanggal_dibutuhkan": {
            "type": "object",
            "nullable": true
          },
          "prioritas": {
            "type": "number"
          },
          "status": {
            "type": "string"
          },
          "tahap": {
            "type": "object",
            "nullable": true
          },
          "kontak_id": {
            "type": "object",
            "nullable": true
          },
          "kontak_nama": {
            "type": "object",
            "nullable": true
          },
          "harga_kode": {
            "type": "object",
            "nullable": true
          },
          "pegawai_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_tujuan_id": {
            "type": "object",
            "nullable": true
          },
          "cabang_id": {
            "type": "object",
            "nullable": true
          },
          "subtotal": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "biaya": {
            "type": "number"
          },
          "pembulatan": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "keterangan": {
            "type": "object",
            "nullable": true
          },
          "catatan": {
            "type": "object",
            "nullable": true
          },
          "ref_transaksi_id": {
            "type": "object",
            "nullable": true
          },
          "dibuat_oleh": {
            "type": "string"
          },
          "diajukan_oleh": {
            "type": "object",
            "nullable": true
          },
          "diajukan_at": {
            "type": "object",
            "nullable": true
          },
          "disetujui_oleh": {
            "type": "object",
            "nullable": true
          },
          "disetujui_at": {
            "type": "object",
            "nullable": true
          },
          "dikonversi_oleh": {
            "type": "object",
            "nullable": true
          },
          "dikonversi_at": {
            "type": "object",
            "nullable": true
          },
          "created_at": {
            "type": "string"
          },
          "updated_at": {
            "type": "string"
          },
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DraftDetailItemDto"
            }
          }
        },
        "required": [
          "id",
          "nomor_draft",
          "jenis_kode",
          "tanggal",
          "prioritas",
          "status",
          "subtotal",
          "diskon",
          "biaya",
          "pembulatan",
          "total",
          "dibuat_oleh",
          "created_at",
          "updated_at",
          "detail"
        ]
      },
      "PatchDraftDto": {
        "type": "object",
        "properties": {
          "tanggal": {
            "type": "string"
          },
          "tanggal_dibutuhkan": {
            "type": "string"
          },
          "prioritas": {
            "type": "number"
          },
          "kontak_id": {
            "type": "number"
          },
          "harga_kode": {
            "type": "string"
          },
          "pegawai_id": {
            "type": "number"
          },
          "lokasi_id": {
            "type": "number"
          },
          "lokasi_tujuan_id": {
            "type": "number"
          },
          "cabang_id": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "biaya": {
            "type": "number"
          },
          "pembulatan": {
            "type": "number"
          },
          "keterangan": {
            "type": "string"
          },
          "catatan": {
            "type": "string"
          },
          "detail": {
            "description": "Jika diisi, MENGGANTI SELURUH baris detail yang ada",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateDraftDetailDto"
            }
          }
        }
      },
      "SetujuiDraftDto": {
        "type": "object",
        "properties": {
          "catatan": {
            "type": "string",
            "description": "Catatan approval",
            "maxLength": 500
          }
        }
      },
      "TolakDraftDto": {
        "type": "object",
        "properties": {
          "catatan": {
            "type": "string",
            "description": "Catatan penolakan",
            "maxLength": 500
          },
          "ke_revisi": {
            "type": "boolean",
            "description": "true = kirim balik ke status revisi (bisa diedit ulang); false = ditolak permanen",
            "default": false
          }
        }
      },
      "KonversiResponseDto": {
        "type": "object",
        "properties": {
          "transaksi_id": {
            "type": "number",
            "description": "ID transaksi final yang dibuat"
          },
          "nomor_transaksi": {
            "type": "string",
            "description": "Nomor transaksi final"
          }
        },
        "required": [
          "transaksi_id",
          "nomor_transaksi"
        ]
      },
      "TambahRelasiDetailDto": {
        "type": "object",
        "properties": {
          "transaksi_draft_detail_id": {
            "type": "number",
            "description": "ID transaksi_draft_detail"
          },
          "transaksi_detail_id": {
            "type": "number",
            "description": "ID transaksi_detail final"
          },
          "qty": {
            "type": "number",
            "description": "Qty yang direalisasi (harus > 0)",
            "minimum": 0.01
          },
          "catatan": {
            "type": "string",
            "maxLength": 150
          }
        },
        "required": [
          "transaksi_draft_detail_id",
          "transaksi_detail_id",
          "qty"
        ]
      },
      "TambahRelasiDto": {
        "type": "object",
        "properties": {
          "transaksi_id": {
            "type": "number",
            "description": "ID transaksi final yang menjadi realisasi"
          },
          "jenis_relasi": {
            "type": "string",
            "description": "Jenis relasi, contoh: dikirim_menjadi, dibeli_menjadi, dipindah_menjadi",
            "maxLength": 30
          },
          "catatan": {
            "type": "string",
            "description": "Catatan relasi header",
            "maxLength": 300
          },
          "detail": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TambahRelasiDetailDto",
              "minLength": 1
            }
          }
        },
        "required": [
          "transaksi_id",
          "jenis_relasi",
          "detail"
        ]
      },
      "NeracaSubklasItemDto": {
        "type": "object",
        "properties": {
          "subklas_kode": {
            "type": "string"
          },
          "subklas_nama": {
            "type": "string"
          },
          "saldo": {
            "type": "number"
          }
        },
        "required": [
          "subklas_kode",
          "subklas_nama",
          "saldo"
        ]
      },
      "NeracaKlasItemDto": {
        "type": "object",
        "properties": {
          "klas_kode": {
            "type": "string"
          },
          "klas_nama": {
            "type": "string"
          },
          "subtotal": {
            "type": "number"
          },
          "subklas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeracaSubklasItemDto"
            }
          }
        },
        "required": [
          "klas_kode",
          "klas_nama",
          "subtotal",
          "subklas"
        ]
      },
      "LaporanNeracaResponseDto": {
        "type": "object",
        "properties": {
          "per_tanggal": {
            "type": "string",
            "description": "Per tanggal (data di mv_saldo_akun bersifat kumulatif)"
          },
          "aktiva": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeracaKlasItemDto"
            }
          },
          "kewajiban": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeracaKlasItemDto"
            }
          },
          "ekuitas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NeracaKlasItemDto"
            }
          },
          "total_aktiva": {
            "type": "number"
          },
          "total_kewajiban_ekuitas": {
            "type": "number"
          }
        },
        "required": [
          "per_tanggal",
          "aktiva",
          "kewajiban",
          "ekuitas",
          "total_aktiva",
          "total_kewajiban_ekuitas"
        ]
      },
      "RugiLabaSubklasItemDto": {
        "type": "object",
        "properties": {
          "subklas_kode": {
            "type": "string"
          },
          "subklas_nama": {
            "type": "string"
          },
          "saldo": {
            "type": "number"
          }
        },
        "required": [
          "subklas_kode",
          "subklas_nama",
          "saldo"
        ]
      },
      "RugiLabaKlasItemDto": {
        "type": "object",
        "properties": {
          "klas_kode": {
            "type": "string"
          },
          "klas_nama": {
            "type": "string"
          },
          "subtotal": {
            "type": "number"
          },
          "subklas": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RugiLabaSubklasItemDto"
            }
          }
        },
        "required": [
          "klas_kode",
          "klas_nama",
          "subtotal",
          "subklas"
        ]
      },
      "LaporanRugiLabaResponseDto": {
        "type": "object",
        "properties": {
          "dari": {
            "type": "string"
          },
          "sampai": {
            "type": "string"
          },
          "pendapatan": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RugiLabaKlasItemDto"
            }
          },
          "beban": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/RugiLabaKlasItemDto"
            }
          },
          "total_pendapatan": {
            "type": "number"
          },
          "total_beban": {
            "type": "number"
          },
          "laba_rugi": {
            "type": "number",
            "description": "Positif = laba, negatif = rugi"
          }
        },
        "required": [
          "dari",
          "sampai",
          "pendapatan",
          "beban",
          "total_pendapatan",
          "total_beban",
          "laba_rugi"
        ]
      },
      "PiutangItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "nomor_transaksi": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "string"
          },
          "tanggal": {
            "type": "string"
          },
          "jatuh_tempo": {
            "type": "object",
            "nullable": true
          },
          "kontak_id": {
            "type": "object",
            "nullable": true
          },
          "kontak_nama": {
            "type": "object",
            "nullable": true
          },
          "total": {
            "type": "number"
          },
          "total_pelunasan": {
            "type": "number"
          },
          "sisa": {
            "type": "number"
          },
          "umur_hari": {
            "type": "number",
            "description": "Hari lewat jatuh tempo (positif = terlambat, negatif = belum jatuh tempo)"
          },
          "status": {
            "type": "string",
            "enum": [
              "belum",
              "sebagian",
              "lunas"
            ]
          }
        },
        "required": [
          "id",
          "nomor_transaksi",
          "jenis_kode",
          "tanggal",
          "total",
          "total_pelunasan",
          "sisa",
          "umur_hari",
          "status"
        ]
      },
      "PiutangAgingDto": {
        "type": "object",
        "properties": {
          "belum_jatuh_tempo": {
            "type": "number"
          },
          "hari_0_30": {
            "type": "number"
          },
          "hari_31_60": {
            "type": "number"
          },
          "hari_61_90": {
            "type": "number"
          },
          "hari_90plus": {
            "type": "number"
          },
          "total_sisa": {
            "type": "number"
          }
        },
        "required": [
          "belum_jatuh_tempo",
          "hari_0_30",
          "hari_31_60",
          "hari_61_90",
          "hari_90plus",
          "total_sisa"
        ]
      },
      "LaporanPiutangResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PiutangItemDto"
            }
          },
          "aging": {
            "$ref": "#/components/schemas/PiutangAgingDto"
          },
          "total": {
            "type": "number"
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "total_pages": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "aging",
          "total",
          "page",
          "per_page",
          "total_pages"
        ]
      },
      "StokItemDto": {
        "type": "object",
        "properties": {
          "barang_id": {
            "type": "number"
          },
          "barang_kode": {
            "type": "string"
          },
          "barang_nama": {
            "type": "string"
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_nama": {
            "type": "object",
            "nullable": true
          },
          "qty": {
            "type": "number"
          }
        },
        "required": [
          "barang_id",
          "barang_kode",
          "barang_nama",
          "qty"
        ]
      },
      "LaporanStokResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StokItemDto"
            }
          },
          "total_records": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "total_records"
        ]
      },
      "KartuStokItemDto": {
        "type": "object",
        "properties": {
          "tanggal": {
            "type": "string"
          },
          "nomor_transaksi": {
            "type": "string"
          },
          "jenis_kode": {
            "type": "string"
          },
          "qty_nota": {
            "type": "number"
          },
          "mutasi_stok": {
            "type": "number"
          },
          "hpp": {
            "type": "number"
          },
          "lokasi_id": {
            "type": "object",
            "nullable": true
          },
          "lokasi_nama": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "tanggal",
          "nomor_transaksi",
          "jenis_kode",
          "qty_nota",
          "mutasi_stok",
          "hpp"
        ]
      },
      "LaporanKartuStokResponseDto": {
        "type": "object",
        "properties": {
          "barang_id": {
            "type": "number"
          },
          "barang_kode": {
            "type": "string"
          },
          "barang_nama": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/KartuStokItemDto"
            }
          }
        },
        "required": [
          "barang_id",
          "barang_kode",
          "barang_nama",
          "data"
        ]
      },
      "PenjualanSummaryGroupDto": {
        "type": "object",
        "properties": {
          "label": {
            "type": "string",
            "description": "Bisa nama barang, pelanggan, atau tanggal tergantung group_by"
          },
          "total_nota": {
            "type": "number"
          },
          "total_qty": {
            "type": "number"
          },
          "total_penjualan": {
            "type": "number"
          },
          "total_hpp": {
            "type": "number"
          },
          "total_margin": {
            "type": "number"
          }
        },
        "required": [
          "label",
          "total_nota",
          "total_qty",
          "total_penjualan",
          "total_hpp",
          "total_margin"
        ]
      },
      "PenjualanSummaryDto": {
        "type": "object",
        "properties": {
          "total_nota": {
            "type": "number"
          },
          "total_qty": {
            "type": "number"
          },
          "total_penjualan": {
            "type": "number"
          },
          "total_hpp": {
            "type": "number"
          },
          "total_margin": {
            "type": "number"
          }
        },
        "required": [
          "total_nota",
          "total_qty",
          "total_penjualan",
          "total_hpp",
          "total_margin"
        ]
      },
      "LaporanPenjualanSummaryResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenjualanSummaryGroupDto"
            }
          },
          "totals": {
            "$ref": "#/components/schemas/PenjualanSummaryDto"
          },
          "group_by": {
            "type": "string"
          }
        },
        "required": [
          "data",
          "totals"
        ]
      },
      "PenjualanItemDto": {
        "type": "object",
        "properties": {
          "tanggal": {
            "type": "string"
          },
          "nomor_transaksi": {
            "type": "string"
          },
          "pelanggan": {
            "type": "object",
            "nullable": true
          },
          "barang_id": {
            "type": "number"
          },
          "barang_nama": {
            "type": "string"
          },
          "qty": {
            "type": "number"
          },
          "harga": {
            "type": "number"
          },
          "jumlah": {
            "type": "number"
          },
          "diskon": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "hpp_total": {
            "type": "number"
          },
          "margin": {
            "type": "number"
          }
        },
        "required": [
          "tanggal",
          "nomor_transaksi",
          "barang_id",
          "barang_nama",
          "qty",
          "harga",
          "jumlah",
          "diskon",
          "total",
          "hpp_total",
          "margin"
        ]
      },
      "LaporanPenjualanResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenjualanItemDto"
            }
          },
          "summary": {
            "$ref": "#/components/schemas/PenjualanSummaryDto"
          },
          "page": {
            "type": "number"
          },
          "per_page": {
            "type": "number"
          },
          "total": {
            "type": "number"
          },
          "total_pages": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "summary",
          "page",
          "per_page",
          "total",
          "total_pages"
        ]
      },
      "StokSelisihItemDto": {
        "type": "object",
        "properties": {
          "barang_id": {
            "type": "number"
          },
          "lokasi_id": {
            "type": "number"
          },
          "qty_cache": {
            "type": "number"
          },
          "qty_seharusnya": {
            "type": "number"
          },
          "selisih": {
            "type": "number"
          }
        },
        "required": [
          "barang_id",
          "lokasi_id",
          "qty_cache",
          "qty_seharusnya",
          "selisih"
        ]
      },
      "AuditStokSelisihResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StokSelisihItemDto"
            }
          },
          "total_records": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "total_records"
        ]
      },
      "JurnalTidakImbangItemDto": {
        "type": "object",
        "properties": {
          "transaksi_id": {
            "type": "number"
          },
          "nomor_transaksi": {
            "type": "string"
          },
          "total_debit": {
            "type": "number"
          },
          "total_kredit": {
            "type": "number"
          },
          "selisih": {
            "type": "number"
          }
        },
        "required": [
          "transaksi_id",
          "nomor_transaksi",
          "total_debit",
          "total_kredit",
          "selisih"
        ]
      },
      "AuditJurnalTidakImbangResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/JurnalTidakImbangItemDto"
            }
          },
          "total_records": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "total_records"
        ]
      },
      "RegisterPerangkatDto": {
        "type": "object",
        "properties": {
          "fcm_token": {
            "type": "string",
            "description": "FCM registration token dari perangkat klien"
          },
          "platform": {
            "type": "string",
            "enum": [
              "android",
              "ios",
              "web",
              "macos",
              "windows",
              "linux"
            ]
          }
        },
        "required": [
          "fcm_token",
          "platform"
        ]
      },
      "RegisterPerangkatResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          },
          "message": {
            "type": "string",
            "example": "Token FCM tersimpan"
          }
        },
        "required": [
          "status",
          "message"
        ]
      },
      "RequestAksesTenantResponseDto": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "example": "ok"
          },
          "message": {
            "type": "string",
            "example": "Permintaan akses sudah dikirim ke admin dan direksi"
          },
          "notifikasi_terkirim": {
            "type": "number",
            "example": 4
          }
        },
        "required": [
          "status",
          "message",
          "notifikasi_terkirim"
        ]
      },
      "DashboardSummaryDto": {
        "type": "object",
        "properties": {
          "peran": {
            "type": "string",
            "example": "direksi"
          },
          "tanggal": {
            "type": "string",
            "example": "2026-05-19"
          },
          "penjualan_hari_ini": {
            "type": "number",
            "example": 23824800
          },
          "penjualan_bulan_ini": {
            "type": "number",
            "example": 226744700
          },
          "retur_bulan_ini": {
            "type": "number",
            "example": 4086900
          },
          "pelunasan_bulan_ini": {
            "type": "number",
            "example": 275862702
          },
          "saldo_kas": {
            "type": "number",
            "example": 43505775021
          },
          "piutang_terbuka": {
            "type": "number",
            "example": 70613932563
          },
          "piutang_overdue": {
            "type": "number",
            "example": 68356537704
          },
          "stok_alert": {
            "type": "number",
            "example": 2541
          },
          "jurnal_tidak_imbang": {
            "type": "number",
            "example": 2
          },
          "sinkronisasi_clickhouse": {
            "type": "string",
            "example": "ready",
            "enum": [
              "ready",
              "syncing"
            ]
          },
          "indikator_error": {
            "type": "boolean",
            "example": false,
            "description": "True jika backend mendeteksi masalah sinkronisasi/perhitungan dashboard."
          },
          "pesan_error": {
            "type": "object",
            "nullable": true,
            "example": "ClickHouse belum siap atau sedang sinkronisasi ulang. Data dashboard bisa belum lengkap."
          }
        },
        "required": [
          "peran",
          "tanggal",
          "penjualan_hari_ini",
          "penjualan_bulan_ini",
          "retur_bulan_ini",
          "pelunasan_bulan_ini",
          "saldo_kas",
          "piutang_terbuka",
          "piutang_overdue",
          "stok_alert",
          "jurnal_tidak_imbang",
          "sinkronisasi_clickhouse",
          "indikator_error"
        ]
      },
      "DashboardTrendItemDto": {
        "type": "object",
        "properties": {
          "bulan": {
            "type": "string",
            "example": "2025-09"
          },
          "penjualan": {
            "type": "number",
            "example": 787864585
          },
          "retur": {
            "type": "number",
            "example": 9754000
          },
          "pelunasan": {
            "type": "number",
            "example": 761453512
          }
        },
        "required": [
          "bulan",
          "penjualan",
          "retur",
          "pelunasan"
        ]
      },
      "DashboardTrendDto": {
        "type": "object",
        "properties": {
          "bulan_ke_belakang": {
            "type": "number",
            "example": 12
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardTrendItemDto"
            }
          }
        },
        "required": [
          "bulan_ke_belakang",
          "data"
        ]
      },
      "Top10ItemDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string",
            "example": "LAINNYA"
          },
          "total": {
            "type": "number",
            "example": 226744700
          }
        },
        "required": [
          "nama",
          "total"
        ]
      },
      "DashboardTop10Dto": {
        "type": "object",
        "properties": {
          "jenis": {
            "description": "Top 10 jenis barang",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Top10ItemDto"
            }
          },
          "pelanggan": {
            "description": "Top 10 pelanggan",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Top10ItemDto"
            }
          },
          "kabupaten": {
            "description": "Top 10 kabupaten (membutuhkan ETL kontak.atribut)",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Top10ItemDto"
            }
          },
          "sales": {
            "description": "Top 10 sales",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Top10ItemDto"
            }
          },
          "merk": {
            "description": "Top 10 merk barang",
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Top10ItemDto"
            }
          }
        },
        "required": [
          "jenis",
          "pelanggan",
          "kabupaten",
          "sales",
          "merk"
        ]
      },
      "CreateJobDto": {
        "type": "object",
        "properties": {}
      },
      "PenggunaTenantItemDto": {
        "type": "object",
        "properties": {
          "tenant_kode": {
            "type": "string"
          },
          "tenant_nama": {
            "type": "string"
          },
          "peran": {
            "type": "string"
          },
          "kontak_id_lokal": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "tenant_kode",
          "tenant_nama",
          "peran"
        ]
      },
      "PenggunaItemDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "email": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "is_aktif": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          },
          "tenants": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenggunaTenantItemDto"
            }
          }
        },
        "required": [
          "id",
          "email",
          "nama",
          "is_aktif",
          "created_at",
          "tenants"
        ]
      },
      "ListPenggunaResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PenggunaItemDto"
            }
          },
          "total": {
            "type": "number"
          }
        },
        "required": [
          "data",
          "total"
        ]
      },
      "TenantAssignmentDto": {
        "type": "object",
        "properties": {
          "tenant_kode": {
            "type": "string"
          },
          "peran": {
            "type": "string",
            "enum": [
              "none",
              "sales",
              "gudang",
              "admin",
              "direksi",
              "customer",
              "umum"
            ]
          },
          "kontak_id_lokal": {
            "type": "object",
            "nullable": true
          }
        },
        "required": [
          "tenant_kode",
          "peran"
        ]
      },
      "CreatePenggunaDto": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "tenant_assignments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TenantAssignmentDto"
            }
          }
        },
        "required": [
          "email",
          "nama"
        ]
      },
      "CreatePenggunaResponseDto": {
        "type": "object",
        "properties": {
          "id": {
            "type": "number"
          },
          "firebase_uid": {
            "type": "string"
          },
          "is_new_firebase_user": {
            "type": "boolean"
          },
          "reset_link": {
            "type": "string",
            "description": "Link reset password (hanya jika user Firebase baru)"
          }
        },
        "required": [
          "id",
          "firebase_uid",
          "is_new_firebase_user"
        ]
      },
      "PatchPenggunaDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string"
          },
          "is_aktif": {
            "type": "boolean"
          }
        }
      },
      "TenantProfilDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "bidang_usaha": {
            "type": "object",
            "nullable": true
          },
          "is_aktif": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string"
          }
        },
        "required": [
          "kode",
          "nama",
          "is_aktif",
          "created_at"
        ]
      },
      "PatchTenantDto": {
        "type": "object",
        "properties": {
          "nama": {
            "type": "string"
          },
          "bidang_usaha": {
            "type": "object",
            "nullable": true
          }
        }
      },
      "ModulStatusItemDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "nama": {
            "type": "string"
          },
          "grup": {
            "type": "string"
          },
          "urut": {
            "type": "number"
          },
          "is_aktif_tenant": {
            "type": "boolean"
          }
        },
        "required": [
          "kode",
          "nama",
          "grup",
          "urut",
          "is_aktif_tenant"
        ]
      },
      "ListModulResponseDto": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ModulStatusItemDto"
            }
          }
        },
        "required": [
          "data"
        ]
      },
      "UpdateModulItemDto": {
        "type": "object",
        "properties": {
          "kode": {
            "type": "string"
          },
          "is_aktif": {
            "type": "boolean"
          }
        },
        "required": [
          "kode",
          "is_aktif"
        ]
      },
      "PutModulDto": {
        "type": "object",
        "properties": {
          "modul": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UpdateModulItemDto"
            }
          }
        },
        "required": [
          "modul"
        ]
      }
    }
  }
}
