export interface Scope { id: string; name: string; managementFee: number; managementFeeType: 'percent' | 'amount'; managementFeeQuantity: number; managementFeeRate: number; deliveryFee: number; deliveryFeeType: 'percent' | 'amount'; deliveryFeeQuantity: number; deliveryFeeRate: number; useManagementLogic: 'percent' | 'simple'; useDeliveryLogic: 'percent' | 'simple'; estimatorNotes?: string; bidDescription?: string; supplier?: string; } export type ModifierType = 'tax' | 'man-hours' | 'custom'; export interface Modifier { id: string; moduleId: string; name: string; value: number; valueType: 'percent' | 'amount' | 'unit'; type: ModifierType; unitLabel?: string; // e.g. "hrs" for man-hours includeInTotal: boolean; } export interface SubScope { id: string; name: string; scopeId: string; modifiers?: Modifier[]; } export interface JobInfo { number: string; name: string; address: string; workOrder: string; } export type PricingType = 'percent' | 'amount'; export interface EstimateItem { id: string; description: string; quantity: number; unitPrice: number; markup: number; markupType: PricingType; contingency: number; contingencyType: PricingType; scopeId?: string; subScopeId?: string; } export interface TemplateItem { id: string; description: string; quantity: number; unitPrice: number; markup: number; markupType: PricingType; contingency: number; contingencyType: PricingType; } export interface Template { id: string; name: string; items: TemplateItem[]; modifiers?: Modifier[]; defaultSubScopeName?: string; } export type ScopeTextTemplateType = 'estimatorNotes' | 'bidDescription'; export type ScopeTextTemplateDiffOp = 'equal' | 'add' | 'remove'; export interface ScopeTextTemplateDiffLine { op: ScopeTextTemplateDiffOp; text: string; } export interface ScopeTextTemplateHistoryEntry { id: string; timestamp: string; updatedBy: string; action: 'created' | 'updated'; previousContent: string; nextContent: string; diff: ScopeTextTemplateDiffLine[]; } export interface ScopeTextTemplate { id: string; name: string; type: ScopeTextTemplateType; content: string; lastUpdatedBy?: string; history?: ScopeTextTemplateHistoryEntry[]; createdAt: string; updatedAt: string; } export interface StandardPrice { id: string; category: string; name: string; price: number; supplier?: string; }