Files
sam-api/app/Http/Controllers/Api/V1/Schemas/ModelFormulaSchemas.php

80 lines
3.6 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers\Api\V1\Schemas;
use OpenApi\Attributes as OA;
/**
* Model Formula related Swagger schemas
*/
#[OA\Schema(
schema: 'ModelFormulaResource',
description: 'Model formula resource',
properties: [
new OA\Property(property: 'id', type: 'integer', example: 1),
new OA\Property(property: 'model_id', type: 'integer', example: 1),
new OA\Property(property: 'name', type: 'string', example: '최종 가로 크기 계산'),
new OA\Property(property: 'target_parameter', type: 'string', example: 'W1'),
new OA\Property(property: 'expression', type: 'string', example: 'W0 + (installation_type == "A" ? 50 : 30)'),
new OA\Property(property: 'description', type: 'string', nullable: true, example: '설치 타입에 따른 최종 가로 크기 계산'),
new OA\Property(property: 'is_active', type: 'boolean', example: true),
new OA\Property(property: 'execution_order', type: 'integer', example: 1),
new OA\Property(property: 'created_at', type: 'string', format: 'date-time', example: '2024-01-01T00:00:00Z'),
new OA\Property(property: 'updated_at', type: 'string', format: 'date-time', example: '2024-01-01T00:00:00Z')
]
)]
class ModelFormulaResource {}
#[OA\Schema(
schema: 'CreateModelFormulaRequest',
description: 'Request schema for creating model formula',
required: ['name', 'target_parameter', 'expression'],
properties: [
new OA\Property(property: 'name', type: 'string', maxLength: 100, example: '최종 가로 크기 계산'),
new OA\Property(
property: 'target_parameter',
type: 'string',
maxLength: 50,
example: 'W1',
description: 'Target parameter name (alphanumeric with underscore, must start with letter)'
),
new OA\Property(
property: 'expression',
type: 'string',
maxLength: 1000,
example: 'W0 + (installation_type == "A" ? 50 : 30)',
description: 'Mathematical expression for calculating the target parameter'
),
new OA\Property(property: 'description', type: 'string', maxLength: 500, nullable: true, example: '설치 타입에 따른 최종 가로 크기 계산'),
new OA\Property(property: 'is_active', type: 'boolean', example: true),
new OA\Property(property: 'execution_order', type: 'integer', minimum: 0, example: 1)
]
)]
class CreateModelFormulaRequest {}
#[OA\Schema(
schema: 'UpdateModelFormulaRequest',
description: 'Request schema for updating model formula',
properties: [
new OA\Property(property: 'name', type: 'string', maxLength: 100, example: '최종 가로 크기 계산'),
new OA\Property(
property: 'target_parameter',
type: 'string',
maxLength: 50,
example: 'W1',
description: 'Target parameter name (alphanumeric with underscore, must start with letter)'
),
new OA\Property(
property: 'expression',
type: 'string',
maxLength: 1000,
example: 'W0 + (installation_type == "A" ? 50 : 30)',
description: 'Mathematical expression for calculating the target parameter'
),
new OA\Property(property: 'description', type: 'string', maxLength: 500, nullable: true, example: '설치 타입에 따른 최종 가로 크기 계산'),
new OA\Property(property: 'is_active', type: 'boolean', example: true),
new OA\Property(property: 'execution_order', type: 'integer', minimum: 0, example: 1)
]
)]
class UpdateModelFormulaRequest {}