feat: dashboard overhaul, chargeability reports, dispo import enhancements, UI polish
Dashboard: expanded chargeability widget, resource/project table widgets with sorting and filters, stat cards with formatMoney integration. Chargeability: new report client with filtering, chargeability-bookings use case, updated dashboard overview logic. Dispo import: TBD project handling, parse-dispo-matrix improvements, stage-dispo-projects resource value scores, new tests. Estimates: CommercialTermsEditor component, commercial-terms engine module, expanded estimate schemas and types. UI: AppShell navigation updates, timeline filter/toolbar enhancements, role management improvements, signin page redesign, Tailwind/globals polish, SystemSettings SMTP section, anonymization support. Tests: new router tests (anonymization, chargeability, effort-rule, entitlement, estimate, experience-multiplier, notification, resource, staffing, vacation). Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
@@ -8,6 +8,8 @@ export const RESOURCE_COLUMNS: ColumnDef[] = [
|
||||
{ key: "chargeability", label: "Chargeability", defaultVisible: true, hideable: true, sortable: true },
|
||||
{ key: "lcr", label: "LCR", defaultVisible: false, hideable: true },
|
||||
{ key: "valueScore", label: "Score", defaultVisible: false, hideable: true },
|
||||
{ key: "rolledOff", label: "Rolled Off", defaultVisible: false, hideable: true },
|
||||
{ key: "departed", label: "Departed", defaultVisible: false, hideable: true },
|
||||
{ key: "isActive", label: "Status", defaultVisible: true, hideable: true },
|
||||
];
|
||||
|
||||
|
||||
@@ -334,6 +334,36 @@ export const UpdateWeeklyPhasingSchema = z.object({
|
||||
export type GenerateWeeklyPhasingInput = z.infer<typeof GenerateWeeklyPhasingSchema>;
|
||||
export type UpdateWeeklyPhasingInput = z.infer<typeof UpdateWeeklyPhasingSchema>;
|
||||
|
||||
// ─── Commercial Terms ───────────────────────────────────────────────────────
|
||||
|
||||
export const PricingModelSchema = z.enum(["fixed_price", "time_and_materials", "hybrid"]);
|
||||
|
||||
export const PaymentMilestoneSchema = z.object({
|
||||
label: z.string().min(1).max(200),
|
||||
percent: z.number().min(0).max(100),
|
||||
dueDate: z.string().regex(/^\d{4}-\d{2}-\d{2}$/).nullable().optional(),
|
||||
description: z.string().max(1000).nullable().optional(),
|
||||
});
|
||||
|
||||
export const CommercialTermsSchema = z.object({
|
||||
pricingModel: PricingModelSchema.default("fixed_price"),
|
||||
contingencyPercent: z.number().min(0).max(100).default(0),
|
||||
discountPercent: z.number().min(0).max(100).default(0),
|
||||
paymentTermDays: z.number().int().min(0).max(365).default(30),
|
||||
paymentMilestones: z.array(PaymentMilestoneSchema).default([]),
|
||||
warrantyMonths: z.number().int().min(0).max(60).default(0),
|
||||
notes: z.string().max(5_000).nullable().optional(),
|
||||
});
|
||||
|
||||
export const UpdateCommercialTermsSchema = z.object({
|
||||
estimateId: z.string(),
|
||||
versionId: z.string().optional(),
|
||||
terms: CommercialTermsSchema,
|
||||
});
|
||||
|
||||
export type CommercialTermsInput = z.infer<typeof CommercialTermsSchema>;
|
||||
export type UpdateCommercialTermsInput = z.infer<typeof UpdateCommercialTermsSchema>;
|
||||
|
||||
export type CreateEstimateInput = z.infer<typeof CreateEstimateSchema>;
|
||||
export type UpdateEstimateInput = z.infer<typeof UpdateEstimateSchema>;
|
||||
export type UpdateEstimateDraftInput = z.infer<typeof UpdateEstimateDraftSchema>;
|
||||
|
||||
@@ -326,6 +326,38 @@ export interface WeeklyPhasingConfig {
|
||||
pattern: PhasingPattern;
|
||||
}
|
||||
|
||||
// --- Commercial Terms ---
|
||||
|
||||
export type PricingModel = "fixed_price" | "time_and_materials" | "hybrid";
|
||||
|
||||
export interface PaymentMilestone {
|
||||
label: string;
|
||||
percent: number;
|
||||
dueDate?: string | null;
|
||||
description?: string | null;
|
||||
}
|
||||
|
||||
export interface CommercialTerms {
|
||||
pricingModel: PricingModel;
|
||||
contingencyPercent: number;
|
||||
discountPercent: number;
|
||||
paymentTermDays: number;
|
||||
paymentMilestones: PaymentMilestone[];
|
||||
warrantyMonths: number;
|
||||
notes?: string | null;
|
||||
}
|
||||
|
||||
export interface CommercialTermsSummary {
|
||||
baseCostCents: number;
|
||||
basePriceCents: number;
|
||||
contingencyCents: number;
|
||||
discountCents: number;
|
||||
adjustedCostCents: number;
|
||||
adjustedPriceCents: number;
|
||||
adjustedMarginCents: number;
|
||||
adjustedMarginPercent: number;
|
||||
}
|
||||
|
||||
export interface EstimatePlanningHandoffResult {
|
||||
estimateId: string;
|
||||
estimateVersionId: string;
|
||||
|
||||
@@ -52,4 +52,5 @@ export interface Resource {
|
||||
valueScore?: number | null;
|
||||
valueScoreBreakdown?: ValueScoreBreakdown | null;
|
||||
valueScoreUpdatedAt?: Date | null;
|
||||
isOwnedByCurrentUser?: boolean;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user