business-logic-mapping

Business Logic Mapping Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "business-logic-mapping" with this command: npx skills add robertoborges/partsunlimited-demo-with-skills/robertoborges-partsunlimited-demo-with-skills-business-logic-mapping

Business Logic Mapping Skill

Use this skill to discover, map, track, and verify business logic preservation during application migration. This ensures that all business rules, calculations, validations, workflows, and media assets from the legacy application are correctly implemented in the modernized version.

When to Use This Skill

  • Migrating .NET Framework to .NET 8+ applications

  • Migrating Java EE to Spring Boot applications

  • Any migration where business logic preservation is critical

  • When you need to track what logic has been migrated vs. what remains

Business Logic Discovery

Step 1: Identify Business Logic Locations

Scan the legacy application for business logic in these common locations:

.NET Applications

Location What to Look For

Services/

Business service classes with domain logic

Domain/ or Models/

Entity classes with business methods

BusinessLogic/ or BLL/

Dedicated business logic layer

Helpers/ or Utilities/

Calculation and validation helpers

Validators/

Business rule validators

Specifications/

Specification pattern implementations

Rules/ or Policies/

Business rule engines

Controllers with logic Logic that should be in services

Stored Procedures Database-embedded business logic

Views with logic Presentation layer calculations

Java Applications

Location What to Look For

service/ or services/

Business service classes

domain/

Domain entities with behavior

businesslogic/ or bll/

Dedicated business layer

util/ or helper/

Utility calculations

validator/

Validation logic

specification/

Specification pattern

rule/ or policy/

Business rules

EJB beans Enterprise JavaBeans with business logic

Stored Procedures Database business logic

Step 2: Categorize Business Logic Types

Category Description Examples

Calculations Mathematical/financial computations Tax calculation, pricing, discounts

Validations Business rule validations Credit limit checks, age verification

Workflows Process flows and state machines Order processing, approval chains

Transformations Data transformations Format conversions, aggregations

Integrations External system interactions Payment gateways, shipping APIs

Authorization Business-level permissions Role-based access, ownership checks

Notifications Event-driven communications Email triggers, alerts

Scheduling Time-based business rules Batch jobs, scheduled reports

Business Logic Mapping Document

Create a reports/Business-Logic-Mapping.md file to track all business logic:

Business Logic Mapping Report

Application: [Application Name] Generated: [Date/Time] Migration: [Source Framework] → [Target Framework]

Executive Summary

  • Total Business Logic Items: [Count]
  • Migrated: [Count] ([Percentage]%)
  • In Progress: [Count]
  • Pending: [Count]
  • Blocked: [Count]

Business Logic Inventory

Calculations

IDNameSource LocationTarget LocationStatusVerified
BL-001Tax CalculationOrderService.CalculateTax()Services/TaxCalculator.cs✅ Migrated✅ Yes
BL-002Discount EnginePricingHelper.ApplyDiscount()Services/PricingService.cs🔄 In Progress⬜ No
BL-003Shipping CostShippingCalculator.GetRate()Pending⬜ Pending⬜ No

Validations

IDNameSource LocationTarget LocationStatusVerified
BL-010Credit Limit CheckCustomerValidator.CheckCredit()Validators/CreditValidator.cs✅ Migrated✅ Yes
BL-011Age VerificationOrderValidator.VerifyAge()Validators/AgeValidator.cs✅ Migrated⬜ No

Workflows

IDNameSource LocationTarget LocationStatusVerified
BL-020Order ProcessingOrderWorkflow.Process()Workflows/OrderStateMachine.cs🔄 In Progress⬜ No
BL-021Approval ChainApprovalService.Submit()Pending⬜ Pending⬜ No

Transformations

IDNameSource LocationTarget LocationStatusVerified
BL-030Report AggregationReportHelper.Aggregate()Services/ReportingService.cs✅ Migrated✅ Yes

Integrations

IDNameSource LocationTarget LocationStatusVerified
BL-040Payment GatewayPaymentService.Process()Services/PaymentService.cs🔄 In Progress⬜ No

Media and Static Assets

Asset TypeSource PathTarget PathStatus
Images/Content/images//wwwroot/images/✅ Copied
CSS/Content/css//wwwroot/css/✅ Copied
JavaScript/Scripts//wwwroot/js/✅ Copied
Documents/App_Data/docs//wwwroot/docs/✅ Copied
Uploads/Uploads/Azure Blob Storage🔄 In Progress

Migration Notes

Preserved As-Is

  • [List items that required no changes]

Modified During Migration

  • [List items that required adaptation with explanation]

Architectural Changes

  • [List items that required redesign with justification]

Verification Checklist

  • All calculations produce same results as legacy
  • All validations enforce same rules
  • All workflows follow same process flows
  • All integrations maintain same behavior
  • All media assets accessible in new application

Business Logic Patterns: .NET Framework → .NET 8

Service Layer Mapping

// ============================================================================= // LEGACY: .NET Framework Service // ============================================================================= public class OrderService { private readonly OrderRepository _orderRepository;

public decimal CalculateTotal(Order order)
{
    var subtotal = order.Items.Sum(i => i.Price * i.Quantity);
    var tax = subtotal * 0.08m; // 8% tax
    var discount = GetCustomerDiscount(order.CustomerId);
    return subtotal + tax - discount;
}

private decimal GetCustomerDiscount(int customerId)
{
    // Business rule: VIP customers get 10% discount
    var customer = _customerRepository.GetById(customerId);
    return customer.IsVip ? subtotal * 0.10m : 0;
}

}

// ============================================================================= // MODERN: .NET 8 Service (Preserve same logic, modernize patterns) // ============================================================================= public interface IOrderCalculationService { decimal CalculateTotal(Order order); }

public class OrderCalculationService : IOrderCalculationService { private readonly ICustomerRepository _customerRepository; private readonly IOptions<TaxSettings> _taxSettings; private readonly ILogger<OrderCalculationService> _logger;

public OrderCalculationService(
    ICustomerRepository customerRepository,
    IOptions&#x3C;TaxSettings> taxSettings,
    ILogger&#x3C;OrderCalculationService> logger)
{
    _customerRepository = customerRepository;
    _taxSettings = taxSettings;
    _logger = logger;
}

public decimal CalculateTotal(Order order)
{
    // PRESERVED: Same calculation logic
    var subtotal = order.Items.Sum(i => i.Price * i.Quantity);
    var tax = subtotal * _taxSettings.Value.DefaultRate; // Externalized config
    var discount = GetCustomerDiscount(order.CustomerId, subtotal);
    
    _logger.LogDebug("Order total calculated: Subtotal={Subtotal}, Tax={Tax}, Discount={Discount}", 
        subtotal, tax, discount);
    
    return subtotal + tax - discount;
}

private decimal GetCustomerDiscount(int customerId, decimal subtotal)
{
    // PRESERVED: Same business rule - VIP customers get 10% discount
    var customer = _customerRepository.GetById(customerId);
    return customer?.IsVip == true ? subtotal * 0.10m : 0;
}

}

Validation Logic Mapping

// ============================================================================= // LEGACY: .NET Framework Validator // ============================================================================= public class OrderValidator { public ValidationResult Validate(Order order) { var errors = new List<string>();

    // Business Rule: Minimum order amount
    if (order.Total &#x3C; 10.00m)
        errors.Add("Minimum order amount is $10.00");
    
    // Business Rule: Maximum items per order
    if (order.Items.Count > 100)
        errors.Add("Maximum 100 items per order");
    
    // Business Rule: Customer credit check
    if (!HasSufficientCredit(order.CustomerId, order.Total))
        errors.Add("Insufficient credit limit");
    
    return new ValidationResult(errors);
}

}

// ============================================================================= // MODERN: .NET 8 with FluentValidation (Same rules, modern pattern) // ============================================================================= public class OrderValidator : AbstractValidator<Order> { private readonly ICustomerCreditService _creditService;

public OrderValidator(ICustomerCreditService creditService)
{
    _creditService = creditService;

    // PRESERVED: Minimum order amount
    RuleFor(x => x.Total)
        .GreaterThanOrEqualTo(10.00m)
        .WithMessage("Minimum order amount is $10.00");

    // PRESERVED: Maximum items per order
    RuleFor(x => x.Items.Count)
        .LessThanOrEqualTo(100)
        .WithMessage("Maximum 100 items per order");

    // PRESERVED: Customer credit check
    RuleFor(x => x)
        .MustAsync(async (order, cancellation) => 
            await _creditService.HasSufficientCreditAsync(order.CustomerId, order.Total))
        .WithMessage("Insufficient credit limit");
}

}

Business Logic Patterns: Java EE → Spring Boot

EJB to Spring Service

// ============================================================================= // LEGACY: Java EE EJB // ============================================================================= @Stateless public class InvoiceServiceBean implements InvoiceService {

@EJB
private CustomerDAO customerDAO;

@EJB
private TaxCalculator taxCalculator;

public Invoice generateInvoice(Order order) {
    // Business logic: Calculate invoice with tax
    BigDecimal subtotal = calculateSubtotal(order);
    BigDecimal tax = taxCalculator.calculate(subtotal, order.getState());
    BigDecimal total = subtotal.add(tax);
    
    // Business rule: Apply early payment discount
    if (order.getPaymentTerms().equals("NET10")) {
        total = applyEarlyPaymentDiscount(total, new BigDecimal("0.02"));
    }
    
    return new Invoice(order.getId(), subtotal, tax, total);
}

private BigDecimal applyEarlyPaymentDiscount(BigDecimal amount, BigDecimal rate) {
    return amount.multiply(BigDecimal.ONE.subtract(rate));
}

}

// ============================================================================= // MODERN: Spring Boot Service (Same logic preserved) // ============================================================================= @Service @Transactional public class InvoiceService {

private final CustomerRepository customerRepository;
private final TaxCalculationService taxCalculator;
private final Logger log = LoggerFactory.getLogger(InvoiceService.class);

public InvoiceService(CustomerRepository customerRepository, 
                      TaxCalculationService taxCalculator) {
    this.customerRepository = customerRepository;
    this.taxCalculator = taxCalculator;
}

public Invoice generateInvoice(Order order) {
    // PRESERVED: Same calculation logic
    BigDecimal subtotal = calculateSubtotal(order);
    BigDecimal tax = taxCalculator.calculate(subtotal, order.getState());
    BigDecimal total = subtotal.add(tax);
    
    // PRESERVED: Same business rule - early payment discount
    if ("NET10".equals(order.getPaymentTerms())) {
        total = applyEarlyPaymentDiscount(total, new BigDecimal("0.02"));
        log.debug("Applied 2% early payment discount for order {}", order.getId());
    }
    
    return new Invoice(order.getId(), subtotal, tax, total);
}

private BigDecimal applyEarlyPaymentDiscount(BigDecimal amount, BigDecimal rate) {
    // PRESERVED: Exact same calculation
    return amount.multiply(BigDecimal.ONE.subtract(rate));
}

}

Media and Asset Preservation

Asset Types to Track

Asset Type .NET Framework Location .NET 8 Location Notes

Images /Content/images/

/wwwroot/images/

Copy as-is

CSS /Content/css/

/wwwroot/css/

May need path updates

JavaScript /Scripts/

/wwwroot/js/

Check for bundle references

Fonts /Content/fonts/

/wwwroot/fonts/

Copy as-is

Documents /App_Data/

/wwwroot/ or Azure Blob Consider cloud storage

User Uploads /Uploads/

Azure Blob Storage Migrate to cloud

Email Templates /Templates/

/Templates/ or embedded Keep same structure

Report Templates /Reports/

/Reports/

Crystal Reports → SSRS/alternatives

Asset Migration Checklist

Asset Migration Verification

Static Files

  • All images copied to wwwroot/images
  • All CSS files copied and paths updated
  • All JavaScript files copied and bundle references updated
  • Favicon and icons present
  • Fonts copied and CSS @font-face paths updated

Dynamic Content

  • Upload directory strategy defined (local vs. Azure Blob)
  • Existing uploads migrated or migration plan in place
  • Image processing libraries updated (System.Drawing → ImageSharp)

Templates

  • Email templates preserved and tested
  • PDF generation templates migrated
  • Report templates converted or alternative chosen

Configuration Files

  • XML configs transformed to JSON
  • Resource files (.resx) migrated
  • Localization files preserved

Verification Strategies

Unit Test Generation for Business Logic

For each business logic item, generate a verification test:

// Test to verify business logic preservation [Fact] public void CalculateTotal_WithVipCustomer_AppliesTenPercentDiscount() { // Arrange - Same inputs as legacy system test var order = new Order { CustomerId = 123, // VIP customer Items = new List<OrderItem> { new() { Price = 100m, Quantity = 1 } } };

// Act
var total = _orderService.CalculateTotal(order);

// Assert - Must match legacy system output
// Subtotal: 100, Tax (8%): 8, Discount (10%): 10, Total: 98
Assert.Equal(98.00m, total);

}

Comparison Testing

// Run same input through legacy and modern systems, compare outputs [Theory] [MemberData(nameof(GetLegacyTestCases))] public void ModernSystem_ProducesSameOutput_AsLegacy( TestInput input, LegacyOutput expectedOutput) { // Act var modernOutput = _modernService.Process(input);

// Assert - Outputs must match
Assert.Equal(expectedOutput.Result, modernOutput.Result);
Assert.Equal(expectedOutput.SideEffects, modernOutput.SideEffects);

}

Tracking During Migration

Status Codes

Status Icon Meaning

Pending ⬜ Not yet started

In Progress 🔄 Currently being migrated

Migrated ✅ Migration complete

Verified ✅✅ Migration verified with tests

Blocked 🚫 Cannot migrate, needs decision

Modified ⚠️ Logic changed (documented)

Update Protocol

After each migration session, update the Business-Logic-Mapping.md:

  • Mark completed items with status change

  • Add new discoveries to the inventory

  • Document any modifications with justification

  • Update verification status after testing

  • Note blockers with required decisions

Integration with Migration Phases

Phase 1 (Assessment)

  • Create initial Business-Logic-Mapping.md

  • Identify all business logic locations

  • Categorize by type and complexity

  • Estimate migration effort per item

Phase 2 (Code Migration)

  • Reference mapping during migration

  • Update status as items are migrated

  • Preserve logic exactly unless documented

  • Generate verification tests

Phase 3+ (Infrastructure/Deploy)

  • Verify media assets are accessible

  • Confirm cloud storage for uploads

  • Test integrations end-to-end

Templates and Examples

See the examples directory for:

Report Template

  • Business-Logic-Mapping-Template.md - Copy to reports/ and fill in during migration

.NET Code Conversion Examples

  • controller-example.cs - .NET Framework MVC to .NET 8 controller

  • service-example.cs - .NET Framework service to .NET 8 with caching and logging

  • model-example.cs - EF6 entity to EF Core with business methods

Java Code Conversion Examples

  • controller-example.java - Java EE JAX-RS to Spring Boot REST controller

  • service-example.java - EJB to Spring Boot service with business logic preservation

  • model-example.java - Java EE JPA to Spring Boot JPA entity with business methods

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

neo

Browse websites, read web pages, interact with web apps, call website APIs, and automate web tasks. Use Neo when: user asks to check a website, read a web page, post on social media (Twitter/X), interact with any web app, look up information on a specific site, scrape data from websites, automate browser tasks, or when you need to call any website's API. Keywords: website, web page, browse, URL, http, API, twitter, tweet, post, scrape, web app, open site, check site, read page, social media, online service.

Archived SourceRecently Updated
General

image-gen

Generate AI images from text prompts. Triggers on: "生成图片", "画一张", "AI图", "generate image", "配图", "create picture", "draw", "visualize", "generate an image".

Archived SourceRecently Updated
General

explainer

Create explainer videos with narration and AI-generated visuals. Triggers on: "解说视频", "explainer video", "explain this as a video", "tutorial video", "introduce X (video)", "解释一下XX(视频形式)".

Archived SourceRecently Updated
General

asr

Transcribe audio files to text using local speech recognition. Triggers on: "转录", "transcribe", "语音转文字", "ASR", "识别音频", "把这段音频转成文字".

Archived SourceRecently Updated