Files
EstiMaker/src/types.ts
T
2026-03-18 18:00:35 -05:00

87 lines
1.8 KiB
TypeScript

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 interface StandardPrice {
id: string;
category: string;
name: string;
price: number;
supplier?: string;
}