feat: add initial application structure with configuration, UI components, and state management
This commit is contained in:
parent
fadf94002c
commit
0af6b17792
56 changed files with 6137 additions and 129 deletions
95
stores/scenarios.ts
Normal file
95
stores/scenarios.ts
Normal file
|
|
@ -0,0 +1,95 @@
|
|||
import { defineStore } from "pinia";
|
||||
|
||||
export const useScenariosStore = defineStore("scenarios", () => {
|
||||
// Scenario presets
|
||||
const presets = ref({
|
||||
current: {
|
||||
name: "Operate Current Plan",
|
||||
description: "Continue with existing revenue and capacity",
|
||||
settings: {},
|
||||
},
|
||||
quitDayJobs: {
|
||||
name: "Quit Day Jobs",
|
||||
description: "Members leave external work, increase co-op hours",
|
||||
settings: {
|
||||
targetHoursMultiplier: 1.5,
|
||||
externalCoverageReduction: 0.8,
|
||||
},
|
||||
},
|
||||
startProduction: {
|
||||
name: "Start Production",
|
||||
description: "Launch product development phase",
|
||||
settings: {
|
||||
productionCostsIncrease: 2000,
|
||||
effortHoursIncrease: 100,
|
||||
},
|
||||
},
|
||||
sixMonth: {
|
||||
name: "6-Month Plan",
|
||||
description: "Extended planning horizon",
|
||||
settings: {
|
||||
timeHorizonMonths: 6,
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
// What-if sliders state
|
||||
const sliders = ref({
|
||||
monthlyRevenue: 12000,
|
||||
paidHoursPerMonth: 320,
|
||||
winRatePct: 70,
|
||||
avgPayoutDelayDays: 30,
|
||||
hourlyWageAdjust: 0,
|
||||
});
|
||||
|
||||
// Selected scenario
|
||||
const activeScenario = ref("current");
|
||||
|
||||
// Computed scenario results (will be calculated by composables)
|
||||
const scenarioResults = computed(() => ({
|
||||
runway: 2.8,
|
||||
monthlyCosts: 8700,
|
||||
cashflowRisk: "medium",
|
||||
recommendations: [],
|
||||
}));
|
||||
|
||||
// Actions
|
||||
function setActiveScenario(scenarioKey) {
|
||||
activeScenario.value = scenarioKey;
|
||||
}
|
||||
|
||||
function updateSlider(key, value) {
|
||||
if (key in sliders.value) {
|
||||
sliders.value[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
function resetSliders() {
|
||||
sliders.value = {
|
||||
monthlyRevenue: 12000,
|
||||
paidHoursPerMonth: 320,
|
||||
winRatePct: 70,
|
||||
avgPayoutDelayDays: 30,
|
||||
hourlyWageAdjust: 0,
|
||||
};
|
||||
}
|
||||
|
||||
function saveCustomScenario(name, settings) {
|
||||
presets.value[name.toLowerCase().replace(/\s+/g, "")] = {
|
||||
name,
|
||||
description: "Custom scenario",
|
||||
settings,
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
presets: readonly(presets),
|
||||
sliders,
|
||||
activeScenario: readonly(activeScenario),
|
||||
scenarioResults,
|
||||
setActiveScenario,
|
||||
updateSlider,
|
||||
resetSliders,
|
||||
saveCustomScenario,
|
||||
};
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue