{
  "ok": true,
  "scope": "payment_order_repository_preview",
  "status": "blocked_before_live_payment_order_repository",
  "date": "2026-06-17",
  "repository": {
    "code": "payment_order_and_entitlement_repository",
    "status": "preview_transaction_repository_ready",
    "repositoryKind": "transactional_payment_repository",
    "readMethods": [
      "getOrderForOwner",
      "getProviderEventStatus",
      "getEntitlementGrantStatus",
      "getAdminOrderReadModel",
      "getRepairJobStatus"
    ],
    "writeMethods": [
      "createPaymentOrder",
      "recordProviderEvent",
      "grantEntitlementOnce",
      "requestRefund",
      "recordRepairJob"
    ],
    "liveTables": [
      "payment_orders",
      "payment_provider_events",
      "points_ledger_entries",
      "payment_entitlement_grants",
      "payment_refunds",
      "payment_repair_jobs"
    ],
    "transactionBoundary": "verified_provider_event_then_single_entitlement_grant",
    "idempotencyKey": "paymentOrderId:providerEventId:entitlementGrant",
    "promotionGate": "payment_core_migration_provider_credentials_https_notify_and_manual_approval_ready"
  },
  "request": {
    "provider": "alipay_h5",
    "productType": "points_pack",
    "planId": "preview-points-68",
    "clientOrderId": "client-order-preview-001"
  },
  "product": {
    "type": "points_pack",
    "planId": "preview-points-68",
    "amountFen": 6800,
    "currency": "CNY",
    "entitlement": {
      "type": "points",
      "quantity": 680
    }
  },
  "readPlan": {
    "ownerOrder": {
      "method": "getOrderForOwner",
      "status": "blocked_until_payment_core_repository_live",
      "source": "payment_orders",
      "ownerFilter": "user_id = authenticated_user_id and id = requested_payment_order_id"
    },
    "providerEventStatus": {
      "method": "getProviderEventStatus",
      "status": "blocked_until_provider_event_repository_live",
      "source": "payment_provider_events",
      "visibleToUser": false
    },
    "entitlementGrantStatus": {
      "method": "getEntitlementGrantStatus",
      "status": "blocked_until_entitlement_grant_repository_live",
      "source": "payment_entitlement_grants"
    },
    "adminReadModel": {
      "method": "getAdminOrderReadModel",
      "status": "blocked_before_admin_payment_read_model",
      "columns": [
        "payment_order_id",
        "user_id",
        "provider",
        "out_trade_no",
        "amount_fen",
        "product_type",
        "entitlement_type",
        "entitlement_quantity",
        "order_status",
        "latest_provider_event_decision",
        "entitlement_grant_status",
        "points_ledger_status",
        "latest_refund_status",
        "latest_repair_status",
        "abnormal_reason",
        "updated_at"
      ]
    }
  },
  "writePlan": {
    "paymentOrder": {
      "method": "createPaymentOrder",
      "status": "blocked",
      "targetTable": "payment_orders",
      "requiredBeforeWrite": [
        "authenticated_user_id",
        "active_recharge_plan",
        "unique_client_order_id"
      ]
    },
    "providerEvent": {
      "method": "recordProviderEvent",
      "status": "blocked",
      "targetTable": "payment_provider_events",
      "requiredBeforeWrite": [
        "unique_provider_event_id_or_idempotency_key",
        "redacted_payload_ref",
        "order_row_lock",
        "signature_verified_or_server_query_audit",
        "amount_matched",
        "out_trade_no_matched",
        "user_plan_matched"
      ]
    },
    "entitlementGrant": {
      "method": "grantEntitlementOnce",
      "status": "blocked",
      "targetTable": "payment_entitlement_grants",
      "requiredBeforeWrite": [
        "paid_order_locked",
        "unique_entitlement_grant_key"
      ]
    },
    "refund": {
      "method": "requestRefund",
      "status": "blocked",
      "targetTable": "payment_refunds",
      "requiredBeforeWrite": [
        "admin_actor",
        "audit_reason",
        "provider_refund_api_ready"
      ]
    },
    "repairJob": {
      "method": "recordRepairJob",
      "status": "blocked",
      "targetTable": "payment_repair_jobs",
      "requiredBeforeWrite": [
        "unknown_or_abnormal_order_state",
        "repair_idempotency_key"
      ]
    }
  },
  "previewContracts": {
    "orderTransaction": {
      "scope": "payment_order_transaction_plan_preview",
      "status": "blocked_before_live_payment_transaction",
      "blockers": [
        "payment_core_migration_not_applied",
        "payment_provider_credentials_missing",
        "https_notify_url_missing",
        "idempotent_entitlement_grant_not_live",
        "refund_reversal_policy_not_approved"
      ],
      "boundaries": [
        "plan_preview_only",
        "does_not_create_real_payment_order",
        "does_not_call_payment_provider",
        "does_not_grant_points_or_membership",
        "does_not_write_production_database",
        "return_url_is_not_payment_proof"
      ]
    },
    "providerEventRepository": {
      "scope": "payment_provider_event_repository_plan_preview",
      "status": "blocked_before_live_provider_event_repository",
      "blockers": [
        "payment_provider_events_repository_not_live",
        "provider_event_unique_constraint_not_verified_live",
        "payment_order_row_lock_not_live",
        "redacted_payload_storage_not_live",
        "entitlement_idempotency_not_live",
        "payment_core_migration_not_applied",
        "payment_provider_credentials_missing",
        "https_notify_url_missing",
        "idempotent_entitlement_grant_not_live",
        "refund_reversal_policy_not_approved",
        "live_payment_order_repository_not_implemented",
        "provider_event_idempotency_lock_not_live",
        "signature_not_verified",
        "amount_not_matched",
        "out_trade_no_not_matched"
      ],
      "boundaries": [
        "provider_event_repository_plan_only",
        "does_not_persist_provider_event",
        "does_not_ack_provider_notify_success",
        "does_not_mutate_order_status",
        "does_not_grant_points_or_membership",
        "does_not_write_production_database",
        "does_not_return_raw_provider_payload_or_secret"
      ]
    },
    "entitlementSettlement": {
      "scope": "payment_entitlement_settlement_plan_preview",
      "status": "blocked_before_live_entitlement_settlement",
      "blockers": [
        "payment_entitlement_grants_table_not_live",
        "points_ledger_live_transaction_missing",
        "membership_grant_repository_missing",
        "provider_notify_query_verification_not_live",
        "refund_reversal_policy_not_approved",
        "admin_audit_log_not_live"
      ],
      "boundaries": [
        "plan_preview_only",
        "does_not_grant_points_or_membership",
        "does_not_reverse_points_or_membership",
        "does_not_write_production_database",
        "does_not_query_or_refund_real_provider",
        "return_url_is_not_payment_proof"
      ]
    },
    "adminOrderStatus": {
      "scope": "payment_admin_order_status_plan_preview",
      "status": "blocked_before_admin_payment_console",
      "blockers": [
        "payment_core_migration_not_applied",
        "payment_provider_credentials_missing",
        "https_notify_url_missing",
        "idempotent_entitlement_grant_not_live",
        "refund_reversal_policy_not_approved",
        "payment_entitlement_grants_table_not_live",
        "points_ledger_live_transaction_missing",
        "membership_grant_repository_missing",
        "provider_notify_query_verification_not_live",
        "refund_reversal_policy_not_approved",
        "admin_audit_log_not_live",
        "admin_payment_console_not_implemented",
        "admin_audit_log_not_live"
      ],
      "boundaries": [
        "admin_preview_only",
        "does_not_query_real_provider",
        "does_not_refund_real_payment",
        "does_not_mutate_order_status",
        "does_not_write_production_database"
      ]
    },
    "adminOrderReadModel": {
      "scope": "payment_admin_order_read_model_preview",
      "status": "blocked_before_admin_payment_read_model",
      "blockers": [
        "admin_payment_read_model_not_implemented",
        "payment_core_live_repository_missing",
        "payment_repair_worker_not_live",
        "refund_reversal_policy_not_approved",
        "admin_access_log_not_live"
      ],
      "boundaries": [
        "admin_preview_only",
        "read_model_preview_only",
        "does_not_query_live_database",
        "does_not_query_real_provider",
        "does_not_mutate_order_status",
        "does_not_refund_real_payment",
        "does_not_export_finance_data"
      ]
    },
    "adminRepairAction": {
      "scope": "payment_admin_order_action_plan_preview",
      "status": "blocked_before_admin_payment_action",
      "blockers": [
        "admin_payment_action_repository_not_implemented",
        "payment_core_live_repository_missing",
        "provider_query_refund_adapter_not_live",
        "admin_audit_log_not_live",
        "refund_reversal_policy_not_approved"
      ],
      "boundaries": [
        "admin_action_preview_only",
        "does_not_query_live_database",
        "does_not_call_payment_provider",
        "does_not_mutate_order_status",
        "does_not_create_refund",
        "does_not_grant_or_reverse_entitlement",
        "does_not_export_finance_data"
      ]
    }
  },
  "executionOrder": [
    "createPaymentOrder",
    "createProviderPaymentRequest",
    "recordProviderEventAfterNotifyOrQuery",
    "lockPaidPaymentOrder",
    "grantEntitlementOnce",
    "postPointsOrMembershipLedgerEntry",
    "markPaymentOrderSettled",
    "recordRepairOrRefundWhenNeeded"
  ],
  "providerSafety": {
    "provider": "alipay_h5",
    "returnUrlRule": "return_url_is_not_payment_proof",
    "providerEventAckRule": "never_ack_or_grant_based_on_browser_return_url",
    "providerEventEvidence": null,
    "paidEvidence": [
      "payment_order_locked_in_paid_or_repair_success_state",
      "provider_event_signature_verified",
      "provider_amount_matches_payment_order",
      "provider_trade_status_success",
      "order_user_and_plan_still_match"
    ],
    "refundPolicy": "do_not_reverse_without_admin_reason_and_refund_query_success"
  },
  "blockers": [
    "payment_core_migration_not_applied",
    "payment_provider_credentials_missing",
    "https_notify_url_missing",
    "idempotent_entitlement_grant_not_live",
    "refund_reversal_policy_not_approved",
    "payment_provider_events_repository_not_live",
    "provider_event_unique_constraint_not_verified_live",
    "payment_order_row_lock_not_live",
    "redacted_payload_storage_not_live",
    "entitlement_idempotency_not_live",
    "live_payment_order_repository_not_implemented",
    "provider_event_idempotency_lock_not_live",
    "signature_not_verified",
    "amount_not_matched",
    "out_trade_no_not_matched",
    "payment_entitlement_grants_table_not_live",
    "points_ledger_live_transaction_missing",
    "membership_grant_repository_missing",
    "provider_notify_query_verification_not_live",
    "admin_audit_log_not_live",
    "admin_payment_console_not_implemented",
    "admin_payment_read_model_not_implemented",
    "payment_core_live_repository_missing",
    "payment_repair_worker_not_live",
    "admin_access_log_not_live",
    "admin_payment_action_repository_not_implemented",
    "provider_query_refund_adapter_not_live"
  ],
  "nextStep": "replace preview repository with live payment order repository only after payment core migration, provider credentials, HTTPS notify URL, entitlement idempotency, refund policy, and manual approval are ready",
  "boundaries": [
    "payment_order_repository_preview_only",
    "does_not_create_real_payment_order",
    "does_not_call_payment_provider",
    "does_not_sign_provider_request",
    "does_not_grant_points_or_membership",
    "does_not_reverse_points_or_membership",
    "does_not_write_production_database",
    "does_not_expose_payment_secrets"
  ]
}