portfolio_id_maskedCapMarkets(Trading)

Mock Jutsu HOW-TO | EN

The portfolio_id_masked function is a specialized utility within the mock-jutsu library designed for the Capital Markets domain. This function generates synthetic portfolio identifiers that follow a specific obfuscation pattern, where only the final four characters of the alphanumeric suffix remain visible. By producing mock data such as "PRTF-****B2C3," the tool allows developers to simulate the appearance of sensitive financial records without exposing actual internal account details. This balance of realism and privacy is essential for building robust financial applications that require high-fidelity data for development and demonstration purposes.

Central to the design of portfolio_id_masked is its alignment with international financial regulations, specifically MiFID II Article 25. This regulation mandates the use of internal reference codes for transaction reporting and record-keeping. The function mirrors these requirements by providing a structured format that represents a masked internal identifier, making it an indispensable asset for teams building compliance-heavy trading platforms or regulatory reporting engines. Using this specific test data ensures that the systems being developed are prepared to handle the precise string formats and character lengths encountered in live European financial markets.

From a testing perspective, the portfolio_id_masked function is ideal for several critical scenarios. QA engineers can use it to verify UI/UX components on trader dashboards, ensuring that masked IDs are rendered correctly within tables and reports. It is equally valuable for integration testing, where developers need to validate that downstream APIs and databases can process and store masked strings without truncation or encoding errors. By leveraging mock-jutsu to generate these IDs, teams can conduct stress tests on reporting pipelines, simulating thousands of unique trade records to ensure system stability under the weight of MiFID II-compliant data volumes.

The developer benefits of mock-jutsu extend to its seamless integration across various environments. Whether you are working directly in a Python script using jutsu.generate('portfolio_id_masked'), executing quick data generation via the CLI, or conducting performance testing through a JMeter function, the library provides consistent results. This versatility reduces the time spent on manual data preparation and complex regex scripting. Ultimately, the portfolio_id_masked function bridges the gap between functional realism and data security, empowering fintech developers to build safer, more compliant software with ease.

CLI Usage
mockjutsu generate portfolio_id_maskedmockjutsu bulk portfolio_id_masked --count 10mockjutsu export portfolio_id_masked --count 10 --format jsonmockjutsu export portfolio_id_masked --count 10 --format csvmockjutsu export portfolio_id_masked --count 10 --format sql
Python API
from mockjutsu import jutsujutsu.generate('portfolio_id_masked')jutsu.bulk('portfolio_id_masked', count=10)jutsu.template(['portfolio_id_masked'], count=5)
JMeter
${__mockjutsu_markets(portfolio_id_masked)}# JMeter Function: __mockjutsu_markets# Parameter 1: portfolio_id_masked# Parameter 2: (not required for this function)
REST API
GET /generate/portfolio_id_masked# → {"type":"portfolio_id_masked","result":"...","status":"ok"}GET /bulk/portfolio_id_masked?count=10POST /template {"types":["portfolio_id_masked"],"count":1}

Other Languages