### Run Spring Boot Application Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Starts the Spring Boot application using Gradle. This is part of the development confirmation rule, ensuring the application is runnable. ```bash ./gradlew bootRun ``` -------------------------------- ### Gradle開発コマンド Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverプロジェクトの開発とメンテナンスに使用される一連のGradleコマンド。これらには、テストの実行、コードカバレッジレポートの生成、静的コード分析、ビルド、ステージングJARのクリーンアップなどが含まれます。 ```bash # テスト実行 ./gradlew test # コードカバレッジレポート生成 ./gradlew jacocoTestReport # 静的コード分析 ./gradlew detekt # アプリケーションのビルド ./gradlew build # デプロイ用JARファイルの準備 ./gradlew stage # ビルドのクリーンアップ ./gradlew clean # ステージングJARのクリーンアップ ./gradlew cleanJar ``` -------------------------------- ### Gradleビルドと実行可能JARファイルの作成 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md このGradleコマンドは、Kidspos-Serverアプリケーションをビルドし、実行可能JARファイルを生成します。JARファイルは、Java Runtime Environment (JRE) がインストールされている任意の環境でアプリケーションを簡単に実行するために使用されます。 ```bash # アプリケーションのビルド ./gradlew build # 実行可能JARファイルの作成 ./gradlew bootJar ``` -------------------------------- ### 開発環境と本番環境でのアプリケーション起動 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md これらのコマンドは、開発環境または本番環境でKidspos-Serverアプリケーションを起動するために使用されます。開発環境では`bootRun`が使用され、本番環境ではビルドされたJARファイルが実行されます。ステージングコマンドは、デプロイメント用にJARファイルを準備します。 ```bash 開発環境での起動: ./gradlew bootRun 本番環境での起動: # JARファイルを作成してステージング ./gradlew stage # アプリケーションを起動 java -jar app.jar ``` -------------------------------- ### リポジトリのクローンとプロジェクトディレクトリへの移動 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md このコマンドは、KidsPOS-ServerリポジトリをGitHubからクローンし、ローカルマシン上のプロジェクトディレクトリに移動します。これにより、プロジェクトのローカルコピーが準備され、ビルドと実行の次のステップに進むことができます。 ```bash git clone https://github.com/KidsPOSProject/KidsPOS-Server.git cd KidsPOS-Server ``` -------------------------------- ### Spring Bootコントローラー層 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverのバックエンドアーキテクチャにおけるコントローラー層の構造。`controller`パッケージには、REST APIコントローラー(`api`)とWeb UIコントローラー(`front`)が含まれており、それぞれ異なる機能を提供します。 ```kotlin package info.nukoneko.kidspos.server.controller // コントローラークラスの例 (実際のコードは省略) package info.nukoneko.kidspos.server.controller.api package info.nukoneko.kidspos.server.controller.front ``` -------------------------------- ### サービス層 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverのビジネスロジックを処理するサービス層の構造。`service`パッケージには、アプリケーションのコア機能を提供するサービスコンポーネントが含まれています。 ```kotlin package info.nukoneko.kidspos.server.service // サービスコンポーネントの例 (実際のコードは省略) ``` -------------------------------- ### コーディング規約と静的コード分析 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverプロジェクトのコーディング規約と静的コード分析の要件。Kotlin公式規約、Spring Bootベストプラクティス、明確な命名規則、KDocドキュメンテーション、およびdetektツールの使用が推奨されています。 ```text - Kotlin公式コーディング規約に準拠 - Spring Bootのベストプラクティスを遵守 - 明確で意味のある変数名・関数名を使用 - KDocによる包括的なドキュメンテーション - detektによる静的コード分析の実施 ``` -------------------------------- ### detekt.yml設定ファイル Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverプロジェクトで使用されるdetekt静的コード分析ツールの設定ファイル。このファイルには、Kotlinコードの品質をチェックするためのカスタムルールセットと構成が含まれています。 ```yaml config/detekt/detekt.yml ``` -------------------------------- ### レシート印刷機能 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverのレシート印刷機能に関連するKotlinクラス。`ReceiptDetail`と`ReceiptPrinter`クラスは、レシートデータの構造化とサーマルプリンターへの印刷処理を担当します。 ```kotlin package info.nukoneko.kidspos.receipt // レシート関連クラスの例 (実際のコードは省略) class ReceiptDetail class ReceiptPrinter ``` -------------------------------- ### Swagger UIとOpenAPI仕様へのアクセス Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-ServerのAPIドキュメントと対話型テスト環境へのアクセス方法。Swagger UIは、APIエンドポイントを探索し、リクエストを送信するためのWebベースのインターフェースを提供します。OpenAPI仕様は、APIの構造を定義するJSONまたはYAMLファイルです。 ```text Swagger UI: http://localhost:8080/swagger-ui.html OpenAPI仕様: http://localhost:8080/v3/api-docs ``` -------------------------------- ### Initialize Project Specification Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Initializes a new specification for a feature with a detailed project description. This is the first step in the specification creation phase. ```bash #!/bin/bash /kiro:spec-init "[detailed description]" ``` -------------------------------- ### Settings API Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Endpoints for managing system settings. ```APIDOC ## GET /api/setting ### Description Retrieves the current system settings. ### Method GET ### Endpoint /api/setting ### Response #### Success Response (200) - **settings** (object) - An object containing system settings. - **receiptHeader** (string) - Custom text for the receipt header. - **taxRate** (number) - The default tax rate applied to sales. #### Response Example ```json { "settings": { "receiptHeader": "Thank You For Shopping!", "taxRate": 0.08 } } ``` ``` ```APIDOC ## PUT /api/setting ### Description Updates the system settings. ### Method PUT ### Endpoint /api/setting ### Parameters #### Request Body - **receiptHeader** (string) - Optional - New text for the receipt header. - **taxRate** (number) - Optional - New default tax rate. ### Request Example ```json { "receiptHeader": "Happy Shopping!", "taxRate": 0.09 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating settings were updated. #### Response Example ```json { "message": "Settings updated successfully." } ``` ``` -------------------------------- ### Kotlinコードの拡張機能 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverプロジェクトで使用されるKotlin拡張機能の例。これらは、`CharExtensions`、`Commander`、`IntExtensions`、`PrintCommand`、`StringExtensions`など、共通のユーティリティ機能を提供します。 ```kotlin package info.nukoneko.kidspos.common // 拡張機能の例 (実際のコードは省略) class CharExtensions class Commander class IntExtensions class PrintCommand class StringExtensions ``` -------------------------------- ### Build Project with Gradle Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Executes the Gradle build command, excluding the detekt linting process. This is part of the development confirmation rule. ```bash ./gradlew build -x detekt ``` -------------------------------- ### JPAエンティティとリポジトリ Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverのデータアクセス層で使用されるJPAエンティティとリポジトリの構造。`entity`パッケージにはデータベーステーブルを表すエンティティが含まれ、`repository`パッケージにはデータ操作のためのインターフェースが含まれます。 ```kotlin package info.nukoneko.kidspos.server.entity // JPAエンティティの例 (実際のコードは省略) package info.nukoneko.kidspos.server.repository // Spring Data JPAリポジトリの例 (実際のコードは省略) ``` -------------------------------- ### テストと品質保証 Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Kidspos-Serverプロジェクトのテスト戦略と品質保証プロセス。JUnit 5、MockK、JaCoCoを使用したユニットテストと統合テスト、コードカバレッジの測定(85%以上)、セキュリティテスト、アーキテクチャテストが含まれます。 ```text - JUnit 5によるユニットテスト・統合テスト - MockKによるモック作成 - JaCoCo統合によるコードカバレッジ測定 - 現在のコードカバレッジ: 85%以上 - セキュリティテスト (OWASP準拠) - アーキテクチャテスト ``` -------------------------------- ### Store Management API Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Endpoints for managing store configurations, including adding and retrieving store information. ```APIDOC ## POST /api/store ### Description Adds a new store configuration. ### Method POST ### Endpoint /api/store ### Parameters #### Request Body - **name** (string) - Required - Name of the store. - **address** (string) - Optional - Address of the store. ### Request Example ```json { "name": "Downtown Branch", "address": "123 Main St" } ``` ### Response #### Success Response (201) - **storeId** (integer) - The unique identifier of the newly created store. - **message** (string) - Confirmation message. #### Response Example ```json { "storeId": 1, "message": "Store added successfully." } ``` ``` ```APIDOC ## GET /api/stores ### Description Retrieves a list of all configured stores. ### Method GET ### Endpoint /api/stores ### Response #### Success Response (200) - **stores** (array) - A list of store objects. - **storeId** (integer) - Unique identifier for the store. - **name** (string) - Name of the store. - **address** (string) - Address of the store. #### Response Example ```json { "stores": [ { "storeId": 1, "name": "Downtown Branch", "address": "123 Main St" } ] } ``` ``` -------------------------------- ### Manage Steering Documents Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Creates or updates steering documents for the project. This is an optional step and can be used before major development. ```bash #!/bin/bash /kiro:steering ``` -------------------------------- ### 商品編集・削除処理 (JavaScript) Source: https://github.com/kidsposproject/kidspos-server/blob/master/src/main/resources/templates/items/index-modern.html 商品の編集ページへの遷移と、SweetAlert2を使用した削除確認ダイアログからの削除処理の実装について説明します。 ```javascript function editItem(id) { window.location.href = '/items/' + id + '/edit'; } function deleteItem(id) { Swal.fire({ title: '削除確認', text: 'この商品を削除してもよろしいですか?', icon: 'warning', showCancelButton: true, confirmButtonColor: '#ef4444', cancelButtonColor: '#64748b', confirmButtonText: 'はい、削除します', cancelButtonText: 'キャンセル' }).then((result) => { if (result.isConfirmed) { const form = document.createElement('form'); form.method = 'POST'; form.action = '/items/' + id + '/delete'; document.body.appendChild(form); form.submit(); } }); } ``` -------------------------------- ### Create Custom Steering Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Creates custom steering configurations for specialized contexts within the project. This is an optional phase. ```bash #!/bin/bash /kiro:steering-custom ``` -------------------------------- ### REST APIエンドポイント Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md KidsPOSサーバーのREST APIエンドポイントのリスト。これらのエンドポイントは、商品、売上、スタッフ、店舗、設定などのリソースを管理するために使用されます。各APIは`/api/`プレフィックスでアクセス可能です。 ```text - /api/item - 商品API - /api/sale - 売上API - /api/staff - スタッフAPI - /api/store - 店舗API - /api/setting - 設定API ``` -------------------------------- ### Item Management API Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Endpoints for managing product information, including adding, retrieving, updating, and deleting items. ```APIDOC ## GET /api/item ### Description Retrieves a list of all available items. ### Method GET ### Endpoint /api/item ### Parameters #### Query Parameters - **page** (integer) - Optional - The page number for pagination. - **size** (integer) - Optional - The number of items per page. ### Response #### Success Response (200) - **items** (array) - A list of item objects. - **id** (integer) - Unique identifier for the item. - **name** (string) - Name of the item. - **price** (number) - Price of the item. - **barcode** (string) - Barcode of the item. #### Response Example ```json { "items": [ { "id": 1, "name": "Toy Car", "price": 5.99, "barcode": "123456789012" } ] } ``` ``` ```APIDOC ## POST /api/item ### Description Adds a new item to the system. ### Method POST ### Endpoint /api/item ### Parameters #### Request Body - **name** (string) - Required - Name of the item. - **price** (number) - Required - Price of the item. - **barcode** (string) - Required - Barcode of the item. ### Request Example ```json { "name": "Doll", "price": 12.50, "barcode": "987654321098" } ``` ### Response #### Success Response (201) - **id** (integer) - The unique identifier of the newly created item. - **message** (string) - Confirmation message. #### Response Example ```json { "id": 2, "message": "Item added successfully." } ``` ``` ```APIDOC ## GET /api/item/{id} ### Description Retrieves details for a specific item by its ID. ### Method GET ### Endpoint /api/item/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the item. ### Response #### Success Response (200) - **id** (integer) - Unique identifier for the item. - **name** (string) - Name of the item. - **price** (number) - Price of the item. - **barcode** (string) - Barcode of the item. #### Response Example ```json { "id": 1, "name": "Toy Car", "price": 5.99, "barcode": "123456789012" } ``` ``` ```APIDOC ## PUT /api/item/{id} ### Description Updates an existing item identified by its ID. ### Method PUT ### Endpoint /api/item/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the item to update. #### Request Body - **name** (string) - Optional - Updated name of the item. - **price** (number) - Optional - Updated price of the item. - **barcode** (string) - Optional - Updated barcode of the item. ### Request Example ```json { "price": 6.49 } ``` ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the item was updated. #### Response Example ```json { "message": "Item updated successfully." } ``` ``` ```APIDOC ## DELETE /api/item/{id} ### Description Deletes an item identified by its ID. ### Method DELETE ### Endpoint /api/item/{id} ### Parameters #### Path Parameters - **id** (integer) - Required - The unique identifier of the item to delete. ### Response #### Success Response (200) - **message** (string) - Confirmation message indicating the item was deleted. #### Response Example ```json { "message": "Item deleted successfully." } ``` ``` -------------------------------- ### 商品管理テーブルの初期化とインタラクション (JavaScript) Source: https://github.com/kidsposproject/kidspos-server/blob/master/src/main/resources/templates/items/index-modern.html 商品一覧を表示するDataTableの初期化と、選択削除ボタンの有効/無効化、全選択機能の実装について説明します。DataTableのローカライズにはja.jsonを使用しています。 ```javascript $(document).ready(function() { $('#itemsTable').DataTable({ language: { url: '//cdn.datatables.net/plug-ins/1.13.4/i18n/ja.json' }, pageLength: 10, responsive: true }); $('#selectAll').on('change', function() { $('.item-checkbox').prop('checked', $(this).prop('checked')); updateDeleteButton(); }); $('.item-checkbox').on('change', function() { updateDeleteButton(); }); function updateDeleteButton() { const checkedCount = $('.item-checkbox:checked').length; $('#deleteSelectedBtn').prop('disabled', checkedCount === 0); } }); ``` -------------------------------- ### Staff Management API Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Endpoints for managing staff information, including adding, retrieving, and updating staff records. ```APIDOC ## POST /api/staff ### Description Adds a new staff member to the system. ### Method POST ### Endpoint /api/staff ### Parameters #### Request Body - **name** (string) - Required - Name of the staff member. - **barcodeId** (string) - Required - Unique barcode ID for the staff member. ### Request Example ```json { "name": "Alice Smith", "barcodeId": "STAFF001" } ``` ### Response #### Success Response (201) - **staffId** (integer) - The unique identifier of the newly created staff member. - **message** (string) - Confirmation message. #### Response Example ```json { "staffId": 101, "message": "Staff member added successfully." } ``` ``` ```APIDOC ## GET /api/staff ### Description Retrieves a list of all staff members. ### Method GET ### Endpoint /api/staff ### Response #### Success Response (200) - **staffList** (array) - A list of staff member objects. - **staffId** (integer) - Unique identifier for the staff member. - **name** (string) - Name of the staff member. - **barcodeId** (string) - Barcode ID of the staff member. #### Response Example ```json { "staffList": [ { "staffId": 101, "name": "Alice Smith", "barcodeId": "STAFF001" } ] } ``` ``` -------------------------------- ### Generate Feature Requirements Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Generates the requirements document for a specified feature. This follows the initialization of the spec. ```bash #!/bin/bash /kiro:spec-requirements "[feature]" ``` -------------------------------- ### Create Feature Design Document Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Initiates an interactive process to create the design document for a feature, requiring review of the requirements.md file. ```bash #!/bin/bash /kiro:spec-design "[feature]" ``` -------------------------------- ### Generate Feature Tasks Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Confirms both requirements and design review before generating tasks for a feature. This is an interactive step in the specification process. ```bash #!/bin/bash /kiro:spec-tasks "[feature]" ``` -------------------------------- ### Sales Management API Source: https://github.com/kidsposproject/kidspos-server/blob/master/README.md Endpoints for managing sales transactions, including recording sales and retrieving sales history. ```APIDOC ## POST /api/sale ### Description Records a new sales transaction. ### Method POST ### Endpoint /api/sale ### Parameters #### Request Body - **items** (array) - Required - A list of items included in the sale. - **itemId** (integer) - Required - The ID of the item sold. - **quantity** (integer) - Required - The quantity of the item sold. - **staffId** (integer) - Required - The ID of the staff member processing the sale. - **storeId** (integer) - Required - The ID of the store where the sale occurred. ### Request Example ```json { "items": [ { "itemId": 1, "quantity": 2 } ], "staffId": 101, "storeId": 1 } ``` ### Response #### Success Response (201) - **saleId** (integer) - The unique identifier of the created sales transaction. - **message** (string) - Confirmation message. #### Response Example ```json { "saleId": 5001, "message": "Sale recorded successfully." } ``` ``` ```APIDOC ## GET /api/sales ### Description Retrieves a list of all sales transactions. ### Method GET ### Endpoint /api/sales ### Parameters #### Query Parameters - **startDate** (string) - Optional - Filter sales from this date (YYYY-MM-DD). - **endDate** (string) - Optional - Filter sales up to this date (YYYY-MM-DD). - **storeId** (integer) - Optional - Filter sales by store ID. ### Response #### Success Response (200) - **sales** (array) - A list of sales transaction objects. - **saleId** (integer) - Unique identifier for the sale. - **timestamp** (string) - Date and time of the sale. - **totalAmount** (number) - Total amount of the sale. - **storeId** (integer) - ID of the store where the sale occurred. #### Response Example ```json { "sales": [ { "saleId": 5001, "timestamp": "2023-10-27T10:30:00Z", "totalAmount": 12.98, "storeId": 1 } ] } ``` ``` -------------------------------- ### Check Specification Status Source: https://github.com/kidsposproject/kidspos-server/blob/master/CLAUDE.md Checks the current progress and phases of a specific feature's specification. Used for progress tracking. ```bash #!/bin/bash /kiro:spec-status "[feature-name]" ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.