Skip to content

Instantly share code, notes, and snippets.

module Medhavi.Domain.Validation
open System
open Medhavi.Domain
/// Reusable validation helpers for command/input checks
let required (field: string) (value: string) =
if String.IsNullOrWhiteSpace value then
Error(DomainError.Validation(DomainErrorCodes.ValidationFailed, $"{field} is required", Map.empty))
else
module Medhavi.Domain.Customer
open System
open Medhavi.Domain.Ids
open Medhavi.Domain
open Medhavi.Domain.Validation
open Medhavi.Common.ResultCE
type Customer =
{
module Medhavi.Domain.Material.BillOfMaterials
open System
open Medhavi.Domain.Ids
open Medhavi.Domain
open Medhavi.Domain.Validation
open Medhavi.Common.ResultCE
type BomItem =
{
ConstraintAbstraction we needValues inside structureFunctorIndependent contextual valuesApplicativeDependent contextual stepsMonadEffectful functionsKleisli categoryCombining valuesMonoidTransforming between contextsNatural transformationConsuming valuesContravariant functorInput-output adaptationProfunctorRecursive interpretationF-algebra / catamorphismWorkflow descriptionFree structure / DSL
1. What are the input and output types?
2. Can this step fail?
3. Are checks independent or dependent?
4. Do we want error accumulation or fail-fast?
5. Does order matter?
6. What operation do we need?
7. Which lawful abstraction fits?
# Medhāvī ProductionPlanning - Project Description Document (PDD)
**Product**: Medhāvī ProductionPlanning
**Version**: 1.0
**Date**: September 2025
**Author**: Medhāvī Development Team
**Status**: Draft - Architecture Definition Phase
---
# Demand Intelligence Specification
# Chapter 1 — Purpose & Scope
## 1.1 Purpose
Demand Intelligence is the authoritative enterprise domain responsible for developing trusted understanding of customer demand. Every forecast, segmentation, classification, prioritisation, quality evaluation, exception detection, explanation, and learning activity related to demand originates from and is governed by this specification.
Demand Intelligence provides the foundation upon which all downstream planning activities—supply planning, inventory planning, production planning, procurement, transportation, and order promising—depend.