business-as-code
Version:
Primitives for expressing business logic and processes as code
62 lines • 1.78 kB
TypeScript
/**
* Business entity definition
*/
import type { BusinessDefinition } from './types.js';
/**
* Define a business entity with organizational structure, mission, and values
*
* @example
* ```ts
* const acme = Business({
* name: 'Acme Corp',
* description: 'Building the future of widgets',
* industry: 'Technology',
* mission: 'To make widgets accessible to everyone',
* values: ['Innovation', 'Customer Focus', 'Integrity'],
* targetMarket: 'SMB and Enterprise',
* foundedAt: new Date('2020-01-01'),
* teamSize: 50,
* structure: {
* departments: [
* {
* name: 'Engineering',
* head: 'Jane Smith',
* members: ['Alice', 'Bob', 'Charlie'],
* budget: 2000000,
* },
* {
* name: 'Sales',
* head: 'John Doe',
* members: ['David', 'Eve'],
* budget: 1000000,
* },
* ],
* },
* })
* ```
*/
export declare function Business(definition: BusinessDefinition): BusinessDefinition;
/**
* Get total budget across all departments
*/
export declare function getTotalBudget(business: BusinessDefinition): number;
/**
* Get total team size across all departments
*/
export declare function getTotalTeamSize(business: BusinessDefinition): number;
/**
* Get department by name
*/
export declare function getDepartment(business: BusinessDefinition, name: string): import("./types.js").Department | undefined;
/**
* Get team by name
*/
export declare function getTeam(business: BusinessDefinition, name: string): import("./types.js").Team | undefined;
/**
* Validate business definition
*/
export declare function validateBusiness(business: BusinessDefinition): {
valid: boolean;
errors: string[];
};
//# sourceMappingURL=business.d.ts.map