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

133 lines
5.8 KiB
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers\Api\V1\Schemas;
use OpenApi\Attributes as OA;
/**
* BOM Condition Rule related Swagger schemas
*/
#[OA\Schema(
schema: 'BomConditionRuleResource',
description: 'BOM condition rule resource',
properties: [
new OA\Property(property: 'id', type: 'integer', example: 1),
new OA\Property(property: 'bom_template_id', type: 'integer', example: 1),
new OA\Property(property: 'name', type: 'string', example: '브라켓 선택 규칙'),
new OA\Property(property: 'ref_type', type: 'string', enum: ['MATERIAL', 'PRODUCT'], example: 'MATERIAL'),
new OA\Property(property: 'ref_id', type: 'integer', example: 101),
new OA\Property(
property: 'condition_expression',
type: 'string',
example: 'W1 >= 1000 && installation_type == "A"',
description: 'Boolean expression to determine if this rule applies'
),
new OA\Property(
property: 'quantity_expression',
type: 'string',
nullable: true,
example: 'ceiling(W1 / 500)',
description: 'Expression to calculate required quantity'
),
new OA\Property(
property: 'waste_rate_expression',
type: 'string',
nullable: true,
example: '0.05',
description: 'Expression to calculate waste rate (0.0-1.0)'
),
new OA\Property(property: 'description', type: 'string', nullable: true, example: '가로 1000mm 이상, A타입 설치시 브라켓 적용'),
new OA\Property(property: 'priority', type: 'integer', example: 1),
new OA\Property(property: 'is_active', type: 'boolean', example: true),
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'),
new OA\Property(
property: 'reference',
type: 'object',
description: 'Referenced material or product information',
properties: [
new OA\Property(property: 'id', type: 'integer', example: 101),
new OA\Property(property: 'code', type: 'string', example: 'BR-001'),
new OA\Property(property: 'name', type: 'string', example: '표준 브라켓'),
new OA\Property(property: 'unit', type: 'string', example: 'EA')
]
)
]
)]
class BomConditionRuleResource {}
#[OA\Schema(
schema: 'CreateBomConditionRuleRequest',
description: 'Request schema for creating BOM condition rule',
required: ['name', 'ref_type', 'ref_id', 'condition_expression'],
properties: [
new OA\Property(property: 'name', type: 'string', maxLength: 100, example: '브라켓 선택 규칙'),
new OA\Property(property: 'ref_type', type: 'string', enum: ['MATERIAL', 'PRODUCT'], example: 'MATERIAL'),
new OA\Property(property: 'ref_id', type: 'integer', minimum: 1, example: 101),
new OA\Property(
property: 'condition_expression',
type: 'string',
maxLength: 1000,
example: 'W1 >= 1000 && installation_type == "A"',
description: 'Boolean expression to determine if this rule applies'
),
new OA\Property(
property: 'quantity_expression',
type: 'string',
maxLength: 500,
nullable: true,
example: 'ceiling(W1 / 500)',
description: 'Expression to calculate required quantity'
),
new OA\Property(
property: 'waste_rate_expression',
type: 'string',
maxLength: 500,
nullable: true,
example: '0.05',
description: 'Expression to calculate waste rate (0.0-1.0)'
),
new OA\Property(property: 'description', type: 'string', maxLength: 500, nullable: true, example: '가로 1000mm 이상, A타입 설치시 브라켓 적용'),
new OA\Property(property: 'priority', type: 'integer', minimum: 0, example: 1),
new OA\Property(property: 'is_active', type: 'boolean', example: true)
]
)]
class CreateBomConditionRuleRequest {}
#[OA\Schema(
schema: 'UpdateBomConditionRuleRequest',
description: 'Request schema for updating BOM condition rule',
properties: [
new OA\Property(property: 'name', type: 'string', maxLength: 100, example: '브라켓 선택 규칙'),
new OA\Property(property: 'ref_type', type: 'string', enum: ['MATERIAL', 'PRODUCT'], example: 'MATERIAL'),
new OA\Property(property: 'ref_id', type: 'integer', minimum: 1, example: 101),
new OA\Property(
property: 'condition_expression',
type: 'string',
maxLength: 1000,
example: 'W1 >= 1000 && installation_type == "A"',
description: 'Boolean expression to determine if this rule applies'
),
new OA\Property(
property: 'quantity_expression',
type: 'string',
maxLength: 500,
nullable: true,
example: 'ceiling(W1 / 500)',
description: 'Expression to calculate required quantity'
),
new OA\Property(
property: 'waste_rate_expression',
type: 'string',
maxLength: 500,
nullable: true,
example: '0.05',
description: 'Expression to calculate waste rate (0.0-1.0)'
),
new OA\Property(property: 'description', type: 'string', maxLength: 500, nullable: true, example: '가로 1000mm 이상, A타입 설치시 브라켓 적용'),
new OA\Property(property: 'priority', type: 'integer', minimum: 0, example: 1),
new OA\Property(property: 'is_active', type: 'boolean', example: true)
]
)]
class UpdateBomConditionRuleRequest {}