feat(shipping-notice): 添加订单文档 Profile 盲测集和样本管理功能,支持创建、执行和批准盲测,增强订单冻结和库存核验功能

This commit is contained in:
hugo committed 2026-07-23 00:15:34 +08:00
1 parent c35223d49d
commit abd8fc1e16
98 files changed
+4629 -528

No files matched your search

@@ -0,0 +1,172 @@
"""add frozen shipping order snapshots
Revision ID: 019fa1b2c3d4
Revises: a77f8091a2c3
Create Date: 2026-07-22 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
import uuid
revision = '019fa1b2c3d4'
down_revision = 'a77f8091a2c3'
branch_labels = None
depends_on = None
def upgrade():
_converge_order_field_catalog()
op.create_table(
'shipping_order_snapshots',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('task_id', sa.Integer(), nullable=False),
sa.Column('extraction_id', sa.Integer(), nullable=False),
sa.Column('schema_version_id', sa.Integer(), nullable=False),
sa.Column('customer_id', sa.Integer(), nullable=True),
sa.Column('customer_short_code_snapshot', sa.String(length=32), nullable=True),
sa.Column('order_data_version', sa.Integer(), nullable=False),
sa.Column('rule_versions_json', sa.JSON(), nullable=False),
sa.Column('header_values_json', sa.JSON(), nullable=False),
sa.Column('po_number', sa.String(length=255), nullable=True),
sa.Column('customer_code', sa.String(length=255), nullable=True),
sa.Column('customer_name', sa.Text(), nullable=True),
sa.Column('bill_to_customer', sa.Text(), nullable=True),
sa.Column('bill_to_address', sa.Text(), nullable=True),
sa.Column('ship_to_customer', sa.Text(), nullable=True),
sa.Column('ship_to_address', sa.Text(), nullable=True),
sa.Column('destination', sa.Text(), nullable=True),
sa.Column('currency', sa.String(length=16), nullable=True),
sa.Column('incoterm', sa.String(length=64), nullable=True),
sa.Column('required_date', sa.Date(), nullable=True),
sa.Column('order_date', sa.Date(), nullable=True),
sa.Column('payment_term', sa.String(length=255), nullable=True),
sa.Column('frozen_by_id', sa.Integer(), nullable=True),
sa.Column('frozen_at', sa.DateTime(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['customer_id'], ['shipping_customers.id']),
sa.ForeignKeyConstraint(['extraction_id'], ['shipping_order_extractions.id']),
sa.ForeignKeyConstraint(['frozen_by_id'], ['users.id']),
sa.ForeignKeyConstraint(['schema_version_id'], ['shipping_order_schema_versions.id']),
sa.ForeignKeyConstraint(['task_id'], ['shipping_tasks.id']),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('extraction_id', name='uq_shipping_order_snapshots_extraction'),
)
op.create_index('ix_shipping_order_snapshots_customer_created', 'shipping_order_snapshots', ['customer_id', 'created_at'])
op.create_index('ix_shipping_order_snapshots_task_id', 'shipping_order_snapshots', ['task_id'])
op.create_table(
'shipping_order_snapshot_lines',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('snapshot_id', sa.Integer(), nullable=False),
sa.Column('position', sa.Integer(), nullable=False),
sa.Column('line_no', sa.String(length=64), nullable=True),
sa.Column('part_number', sa.String(length=255), nullable=True),
sa.Column('customer_part_number', sa.String(length=255), nullable=True),
sa.Column('aws_part_number', sa.String(length=255), nullable=True),
sa.Column('reservation_id', sa.String(length=64), nullable=True),
sa.Column('qty', sa.Numeric(precision=24, scale=8), nullable=True),
sa.Column('uom', sa.String(length=64), nullable=True),
sa.Column('unit_price', sa.Numeric(precision=24, scale=8), nullable=True),
sa.Column('amount', sa.Numeric(precision=24, scale=8), nullable=True),
sa.Column('warehouse', sa.String(length=255), nullable=True),
sa.Column('inventory_source_hint', sa.String(length=255), nullable=True),
sa.Column('remark', sa.Text(), nullable=True),
sa.Column('field_values_json', sa.JSON(), nullable=False),
sa.CheckConstraint('qty IS NULL OR qty > 0', name='ck_shipping_order_snapshot_lines_positive_qty'),
sa.ForeignKeyConstraint(['snapshot_id'], ['shipping_order_snapshots.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('snapshot_id', 'position', name='uq_shipping_order_snapshot_lines_position'),
)
op.create_table(
'shipping_order_review_events',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('task_id', sa.Integer(), nullable=False),
sa.Column('extraction_id', sa.Integer(), nullable=False),
sa.Column('snapshot_id', sa.Integer(), nullable=True),
sa.Column('scope', sa.String(length=16), nullable=False),
sa.Column('line_position', sa.Integer(), nullable=True),
sa.Column('field_code', sa.String(length=64), nullable=False),
sa.Column('old_value_json', sa.JSON(), nullable=True),
sa.Column('new_value_json', sa.JSON(), nullable=True),
sa.Column('evidence_ref', sa.String(length=512), nullable=False),
sa.Column('reason', sa.Text(), nullable=False),
sa.Column('reviewed_by_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.CheckConstraint("scope IN ('header', 'line')", name='ck_shipping_order_review_events_scope'),
sa.ForeignKeyConstraint(['extraction_id'], ['shipping_order_extractions.id']),
sa.ForeignKeyConstraint(['reviewed_by_id'], ['users.id']),
sa.ForeignKeyConstraint(['snapshot_id'], ['shipping_order_snapshots.id'], ondelete='CASCADE'),
sa.ForeignKeyConstraint(['task_id'], ['shipping_tasks.id']),
sa.PrimaryKeyConstraint('id'),
)
op.create_index('ix_shipping_order_review_events_task_created', 'shipping_order_review_events', ['task_id', 'created_at'])
# batch_alter_table keeps the migration executable in the SQLite migration tests.
with op.batch_alter_table('shipping_tasks') as batch:
batch.add_column(sa.Column('order_snapshot_id', sa.Integer(), nullable=True))
batch.create_foreign_key('fk_shipping_tasks_order_snapshot_id', 'shipping_order_snapshots', ['order_snapshot_id'], ['id'])
batch.create_index('ix_shipping_tasks_order_snapshot_id', ['order_snapshot_id'], unique=True)
def _converge_order_field_catalog() -> None:
"""补齐预置核心字段;保留历史和新增扩展字段。"""
bind = op.get_bind()
inspector = sa.inspect(bind)
if 'shipping_order_schemas' not in inspector.get_table_names():
return
schema = bind.execute(sa.text("SELECT id FROM shipping_order_schemas WHERE schema_code = 'SHIPPING_ORDER'")).mappings().first()
if not schema:
return
header = (
'po_number', 'customer_code', 'customer_name', 'bill_to_customer', 'bill_to_address',
'ship_to_customer', 'ship_to_address', 'destination', 'currency', 'incoterm', 'required_date',
'order_date', 'payment_term',
)
line = (
'line_no', 'part_number', 'customer_part_number', 'aws_part_number', 'reservation_id', 'qty', 'uom',
'unit_price', 'amount', 'warehouse', 'inventory_source_hint', 'remark',
)
specs = {
**{code: ('header', 'date' if code in {'required_date', 'order_date'} else 'string') for code in header},
**{code: ('line', 'decimal' if code in {'qty', 'unit_price', 'amount'} else 'string') for code in line},
}
rows = bind.execute(
sa.text("SELECT id, field_code FROM shipping_order_fields WHERE schema_id = :schema_id"),
{'schema_id': schema['id']},
).mappings().all()
existing = {str(row['field_code']): str(row['id']) for row in rows}
for code, (scope, value_type) in specs.items():
if code in existing:
bind.execute(sa.text("""
UPDATE shipping_order_fields
SET scope = :scope, value_type = :value_type,
field_category = :field_category, collection_mode = 'llm_extraction', status = 'active'
WHERE id = :id
"""), {
'id': existing[code], 'scope': scope, 'value_type': value_type,
'field_category': 'order_header' if scope == 'header' else 'order_line',
})
continue
bind.execute(sa.text("""
INSERT INTO shipping_order_fields
(id, schema_id, field_code, scope, value_type, field_category, collection_mode, display_sequence, status, published_once, created_at, updated_at)
VALUES
(:id, :schema_id, :field_code, :scope, :value_type, :field_category, 'llm_extraction', :sequence, 'active', false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP)
"""), {
'id': str(uuid.uuid4()), 'schema_id': schema['id'], 'field_code': code, 'scope': scope,
'value_type': value_type, 'field_category': 'order_header' if scope == 'header' else 'order_line',
'sequence': list(specs).index(code) + 1,
})
def downgrade():
with op.batch_alter_table('shipping_tasks') as batch:
batch.drop_index('ix_shipping_tasks_order_snapshot_id')
batch.drop_constraint('fk_shipping_tasks_order_snapshot_id', type_='foreignkey')
batch.drop_column('order_snapshot_id')
op.drop_index('ix_shipping_order_review_events_task_created', table_name='shipping_order_review_events')
op.drop_table('shipping_order_review_events')
op.drop_table('shipping_order_snapshot_lines')
op.drop_index('ix_shipping_order_snapshots_task_id', table_name='shipping_order_snapshots')
op.drop_index('ix_shipping_order_snapshots_customer_created', table_name='shipping_order_snapshots')
op.drop_table('shipping_order_snapshots')
@@ -0,0 +1,82 @@
"""add shipping document profile blind-test quality gates
Revision ID: 020a1b2c3d4e
Revises: 019fa1b2c3d4
Create Date: 2026-07-22 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
revision = '020a1b2c3d4e'
down_revision = '019fa1b2c3d4'
branch_labels = None
depends_on = None
def upgrade() -> None:
"""建立模板盲测集、真值样本和不可变执行结果,作为自动建单资格凭证。"""
op.create_table(
'shipping_document_profile_test_suites',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('profile_id', sa.Integer(), nullable=False),
sa.Column('profile_checksum', sa.String(length=64), nullable=False),
sa.Column('status', sa.String(length=16), nullable=False, server_default='draft'),
sa.Column('approved_by_id', sa.Integer(), nullable=True),
sa.Column('approved_at', sa.DateTime(), nullable=True),
sa.Column('created_by_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.Column('updated_at', sa.DateTime(), nullable=False),
sa.CheckConstraint("status IN ('draft', 'approved', 'superseded')", name='ck_shipping_document_profile_test_suites_status'),
sa.ForeignKeyConstraint(['approved_by_id'], ['users.id']),
sa.ForeignKeyConstraint(['created_by_id'], ['users.id']),
sa.ForeignKeyConstraint(['profile_id'], ['shipping_order_document_profiles.id']),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('profile_id', name='uq_shipping_document_profile_test_suites_profile'),
)
op.create_index('ix_shipping_document_profile_test_suites_profile_id', 'shipping_document_profile_test_suites', ['profile_id'])
op.create_table(
'shipping_document_profile_test_samples',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('suite_id', sa.Integer(), nullable=False),
sa.Column('document_id', sa.Integer(), nullable=False),
sa.Column('table_id', sa.String(length=128), nullable=False),
sa.Column('expected_rows_json', sa.JSON(), nullable=False),
sa.Column('created_by_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['created_by_id'], ['users.id']),
sa.ForeignKeyConstraint(['document_id'], ['shipping_notice_documents.id']),
sa.ForeignKeyConstraint(['suite_id'], ['shipping_document_profile_test_suites.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('suite_id', 'document_id', 'table_id', name='uq_shipping_document_profile_test_samples_source'),
)
op.create_table(
'shipping_document_profile_test_runs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('suite_id', sa.Integer(), nullable=False),
sa.Column('profile_checksum', sa.String(length=64), nullable=False),
sa.Column('status', sa.String(length=16), nullable=False),
sa.Column('sample_count', sa.Integer(), nullable=False),
sa.Column('passed_sample_count', sa.Integer(), nullable=False),
sa.Column('failure_codes_json', sa.JSON(), nullable=False),
sa.Column('executed_by_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=False),
sa.CheckConstraint("status IN ('passed', 'failed')", name='ck_shipping_document_profile_test_runs_status'),
sa.ForeignKeyConstraint(['executed_by_id'], ['users.id']),
sa.ForeignKeyConstraint(['suite_id'], ['shipping_document_profile_test_suites.id'], ondelete='CASCADE'),
sa.PrimaryKeyConstraint('id'),
)
op.create_index(
'ix_shipping_document_profile_test_runs_suite_created',
'shipping_document_profile_test_runs', ['suite_id', 'created_at'],
)
def downgrade() -> None:
"""按依赖逆序移除盲测资格表。"""
op.drop_index('ix_shipping_document_profile_test_runs_suite_created', table_name='shipping_document_profile_test_runs')
op.drop_table('shipping_document_profile_test_runs')
op.drop_table('shipping_document_profile_test_samples')
op.drop_index('ix_shipping_document_profile_test_suites_profile_id', table_name='shipping_document_profile_test_suites')
op.drop_table('shipping_document_profile_test_suites')
@@ -0,0 +1,35 @@
"""add order customer match fingerprint audit
Revision ID: 021a2b3c4d5e
Revises: 020a1b2c3d4e
Create Date: 2026-07-22 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
revision = '021a2b3c4d5e'
down_revision = '020a1b2c3d4e'
branch_labels = None
depends_on = None
def upgrade() -> None:
"""为订单客户匹配增加版本化指纹与人工确认理由,保留既有原文和候选快照。"""
with op.batch_alter_table('shipping_order_customer_matches') as batch:
batch.add_column(sa.Column('identity_fingerprint', sa.String(length=64), nullable=True))
batch.add_column(sa.Column('identity_rule_version', sa.String(length=32), nullable=True))
batch.add_column(sa.Column('identity_components_json', sa.JSON(), nullable=False, server_default=sa.text("'{}'")))
batch.add_column(sa.Column('confirmation_reason', sa.Text(), nullable=True))
batch.create_index('ix_shipping_order_customer_matches_identity_fingerprint', ['identity_fingerprint'])
def downgrade() -> None:
"""移除阶段 3 的订单客户指纹审计列。"""
with op.batch_alter_table('shipping_order_customer_matches') as batch:
batch.drop_index('ix_shipping_order_customer_matches_identity_fingerprint')
batch.drop_column('confirmation_reason')
batch.drop_column('identity_components_json')
batch.drop_column('identity_rule_version')
batch.drop_column('identity_fingerprint')
@@ -0,0 +1,65 @@
"""add rolling shipment fulfillment facts
Revision ID: 022a3b4c5d6e
Revises: 021a2b3c4d5e
Create Date: 2026-07-22 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
revision = '022a3b4c5d6e'
down_revision = '021a2b3c4d5e'
branch_labels = None
depends_on = None
def upgrade() -> None:
"""建立预约单注册、库存核验轮次和 Artifact 归属,支持滚动制单。"""
op.create_table(
'shipping_reservations',
sa.Column('id', sa.Integer(), nullable=False), sa.Column('task_id', sa.Integer(), nullable=False),
sa.Column('snapshot_line_id', sa.Integer(), nullable=False), sa.Column('reservation_id', sa.String(64), nullable=False),
sa.Column('part_number', sa.String(255), nullable=False), sa.Column('required_qty', sa.Numeric(24, 8), nullable=False),
sa.Column('status', sa.String(32), nullable=False, server_default='pending'), sa.Column('current_artifact_id', sa.Integer(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column('updated_at', sa.DateTime(), nullable=False),
sa.CheckConstraint("status IN ('pending', 'available', 'artifact_reserved', 'uploaded', 'external_change_required')", name='ck_shipping_reservations_status'),
sa.ForeignKeyConstraint(['task_id'], ['shipping_tasks.id']), sa.ForeignKeyConstraint(['snapshot_line_id'], ['shipping_order_snapshot_lines.id']),
sa.ForeignKeyConstraint(['current_artifact_id'], ['shipping_export_artifacts.id']), sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('reservation_id', 'part_number', name='uq_shipping_reservations_reservation_part'),
)
op.create_index('ix_shipping_reservations_task_status', 'shipping_reservations', ['task_id', 'status'])
op.create_table(
'shipping_inventory_verifications',
sa.Column('id', sa.Integer(), nullable=False), sa.Column('task_id', sa.Integer(), nullable=False),
sa.Column('inventory_snapshot_id', sa.Integer(), nullable=True), sa.Column('source_config_version', sa.String(64), nullable=True),
sa.Column('status', sa.String(16), nullable=False, server_default='completed'), sa.Column('result_json', sa.JSON(), nullable=False), sa.Column('created_at', sa.DateTime(), nullable=False),
sa.CheckConstraint("status IN ('completed', 'expired', 'superseded')", name='ck_shipping_inventory_verifications_status'),
sa.ForeignKeyConstraint(['task_id'], ['shipping_tasks.id']), sa.ForeignKeyConstraint(['inventory_snapshot_id'], ['shipping_inventory_files.id']), sa.PrimaryKeyConstraint('id'),
)
op.create_index('ix_shipping_inventory_verifications_task_created', 'shipping_inventory_verifications', ['task_id', 'created_at'])
op.create_table(
'shipping_inventory_verification_lines',
sa.Column('id', sa.Integer(), nullable=False), sa.Column('verification_id', sa.Integer(), nullable=False), sa.Column('reservation_id', sa.Integer(), nullable=False),
sa.Column('required_qty', sa.Numeric(24, 8), nullable=False), sa.Column('available_qty', sa.Numeric(24, 8), nullable=False), sa.Column('status', sa.String(16), nullable=False), sa.Column('detail_json', sa.JSON(), nullable=False),
sa.CheckConstraint("status IN ('available', 'shortage', 'invalid')", name='ck_shipping_inventory_verification_lines_status'),
sa.ForeignKeyConstraint(['verification_id'], ['shipping_inventory_verifications.id'], ondelete='CASCADE'), sa.ForeignKeyConstraint(['reservation_id'], ['shipping_reservations.id']), sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('verification_id', 'reservation_id', name='uq_shipping_inventory_verification_lines_reservation'),
)
op.create_table(
'shipping_export_artifact_lines',
sa.Column('id', sa.Integer(), nullable=False), sa.Column('artifact_id', sa.Integer(), nullable=False), sa.Column('reservation_id', sa.Integer(), nullable=False), sa.Column('verification_line_id', sa.Integer(), nullable=False), sa.Column('created_at', sa.DateTime(), nullable=False),
sa.ForeignKeyConstraint(['artifact_id'], ['shipping_export_artifacts.id'], ondelete='CASCADE'), sa.ForeignKeyConstraint(['reservation_id'], ['shipping_reservations.id']), sa.ForeignKeyConstraint(['verification_line_id'], ['shipping_inventory_verification_lines.id']), sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('artifact_id', 'reservation_id', name='uq_shipping_export_artifact_lines_artifact_reservation'),
)
def downgrade() -> None:
"""按履约依赖逆序移除滚动制单事实表。"""
op.drop_table('shipping_export_artifact_lines')
op.drop_table('shipping_inventory_verification_lines')
op.drop_index('ix_shipping_inventory_verifications_task_created', table_name='shipping_inventory_verifications')
op.drop_table('shipping_inventory_verifications')
op.drop_index('ix_shipping_reservations_task_status', table_name='shipping_reservations')
op.drop_table('shipping_reservations')
@@ -0,0 +1,48 @@
"""add shipment upload attempts
Revision ID: 023a4b5c6d7e
Revises: 022a3b4c5d6e
Create Date: 2026-07-22 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
revision = '023a4b5c6d7e'
down_revision = '022a3b4c5d6e'
branch_labels = None
depends_on = None
def upgrade() -> None:
"""建立按 Artifact 归属的上传尝试、幂等回调和人工回执引用。"""
op.create_table(
'shipping_upload_attempts',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('artifact_id', sa.Integer(), nullable=False),
sa.Column('attempt_no', sa.Integer(), nullable=False),
sa.Column('mode', sa.String(16), nullable=False),
sa.Column('idempotency_key', sa.String(128), nullable=False),
sa.Column('callback_id', sa.String(128), nullable=True),
sa.Column('status', sa.String(16), nullable=False, server_default='pending'),
sa.Column('started_at', sa.DateTime(), nullable=True), sa.Column('finished_at', sa.DateTime(), nullable=True),
sa.Column('error_code', sa.String(64), nullable=True), sa.Column('error_message', sa.String(500), nullable=True),
sa.Column('evidence_asset_id', sa.Integer(), nullable=True), sa.Column('operator_id', sa.Integer(), nullable=True),
sa.Column('freight_ref_no', sa.String(128), nullable=True), sa.Column('created_at', sa.DateTime(), nullable=False),
sa.CheckConstraint("mode IN ('rpa', 'manual')", name='ck_shipping_upload_attempts_mode'),
sa.CheckConstraint("status IN ('pending', 'running', 'succeeded', 'failed', 'timed_out')", name='ck_shipping_upload_attempts_status'),
sa.ForeignKeyConstraint(['artifact_id'], ['shipping_export_artifacts.id']),
sa.ForeignKeyConstraint(['evidence_asset_id'], ['file_assets.id']),
sa.ForeignKeyConstraint(['operator_id'], ['users.id']), sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('artifact_id', 'attempt_no', name='uq_shipping_upload_attempts_artifact_attempt'),
sa.UniqueConstraint('idempotency_key', name='uq_shipping_upload_attempts_idempotency'),
sa.UniqueConstraint('callback_id', name='uq_shipping_upload_attempts_callback'),
)
op.create_index('ix_shipping_upload_attempts_artifact_created', 'shipping_upload_attempts', ['artifact_id', 'created_at'])
def downgrade() -> None:
"""移除上传 Attempt 事实表。"""
op.drop_index('ix_shipping_upload_attempts_artifact_created', table_name='shipping_upload_attempts')
op.drop_table('shipping_upload_attempts')
@@ -0,0 +1,30 @@
"""add order document profile sample intake purpose
Revision ID: 024a5b6c7d8e
Revises: 023a4b5c6d7e
Create Date: 2026-07-23 00:00:00.000000
"""
from alembic import op
import sqlalchemy as sa
revision = '024a5b6c7d8e'
down_revision = '023a4b5c6d7e'
branch_labels = None
depends_on = None
def upgrade() -> None:
"""限制 Intake purpose,隔离模板样本与业务发货通知解析。"""
with op.batch_alter_table('shipping_notice_intakes') as batch:
batch.create_check_constraint(
'ck_shipping_notice_intakes_purpose',
"purpose IN ('shipping_notice', 'order_document_profile_sample')",
)
def downgrade() -> None:
"""移除 purpose 约束,回到历史兼容结构。"""
with op.batch_alter_table('shipping_notice_intakes') as batch:
batch.drop_constraint('ck_shipping_notice_intakes_purpose', type_='check')