chore: update application configuration and UI components for improved styling and functionality

This commit is contained in:
Jennie Robinson Faber 2025-08-16 08:13:35 +01:00
parent 0af6b17792
commit 37ab8d7bab
54 changed files with 23293 additions and 1666 deletions

View file

@ -15,8 +15,11 @@ export const useBudgetStore = defineStore(
// Production costs (variable monthly)
const productionCosts = ref([]);
// Current selected period
const currentPeriod = ref("2024-01");
// Current selected period - use current month/year
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = String(currentDate.getMonth() + 1).padStart(2, '0');
const currentPeriod = ref(`${currentYear}-${currentMonth}`);
// Computed current budget
const currentBudget = computed(() => {

View file

@ -10,9 +10,9 @@ export const useCashStore = defineStore("cash", () => {
// Week that first breaches minimum cushion
const firstBreachWeek = ref(null);
// Current cash and savings balances
const currentCash = ref(5000);
const currentSavings = ref(8000);
// Current cash and savings balances - start with zeros
const currentCash = ref(0);
const currentSavings = ref(0);
// Computed weekly projections
const weeklyProjections = computed(() => {

View file

@ -6,15 +6,15 @@ export const usePoliciesStore = defineStore(
// Schema version for persistence
const schemaVersion = "1.0";
// Core policies
// Core policies - initialize with empty/zero values
const equalHourlyWage = ref(0);
const payrollOncostPct = ref(25);
const savingsTargetMonths = ref(3);
const minCashCushionAmount = ref(3000);
const payrollOncostPct = ref(0);
const savingsTargetMonths = ref(0);
const minCashCushionAmount = ref(0);
// Deferred pay limits
const deferredCapHoursPerQtr = ref(240);
const deferredSunsetMonths = ref(12);
const deferredCapHoursPerQtr = ref(0);
const deferredSunsetMonths = ref(0);
// Surplus distribution order
const surplusOrder = ref([
@ -117,11 +117,11 @@ export const usePoliciesStore = defineStore(
// Reset function
function resetPolicies() {
equalHourlyWage.value = 0;
payrollOncostPct.value = 25;
savingsTargetMonths.value = 3;
minCashCushionAmount.value = 3000;
deferredCapHoursPerQtr.value = 240;
deferredSunsetMonths.value = 12;
payrollOncostPct.value = 0;
savingsTargetMonths.value = 0;
minCashCushionAmount.value = 0;
deferredCapHoursPerQtr.value = 0;
deferredSunsetMonths.value = 0;
surplusOrder.value = [
"Deferred",
"Savings",

View file

@ -35,10 +35,10 @@ export const useScenariosStore = defineStore("scenarios", () => {
// What-if sliders state
const sliders = ref({
monthlyRevenue: 12000,
paidHoursPerMonth: 320,
winRatePct: 70,
avgPayoutDelayDays: 30,
monthlyRevenue: 0,
paidHoursPerMonth: 0,
winRatePct: 0,
avgPayoutDelayDays: 0,
hourlyWageAdjust: 0,
});
@ -47,9 +47,9 @@ export const useScenariosStore = defineStore("scenarios", () => {
// Computed scenario results (will be calculated by composables)
const scenarioResults = computed(() => ({
runway: 2.8,
monthlyCosts: 8700,
cashflowRisk: "medium",
runway: 0,
monthlyCosts: 0,
cashflowRisk: "low",
recommendations: [],
}));
@ -66,10 +66,10 @@ export const useScenariosStore = defineStore("scenarios", () => {
function resetSliders() {
sliders.value = {
monthlyRevenue: 12000,
paidHoursPerMonth: 320,
winRatePct: 70,
avgPayoutDelayDays: 30,
monthlyRevenue: 0,
paidHoursPerMonth: 0,
winRatePct: 0,
avgPayoutDelayDays: 0,
hourlyWageAdjust: 0,
};
}

View file

@ -22,8 +22,11 @@ export const useSessionStore = defineStore("session", () => {
// Session rationale text
const rationale = ref("");
// Current session period
const currentSession = ref("2024-01");
// Current session period - use current month/year
const currentDate = new Date();
const currentYear = currentDate.getFullYear();
const currentMonth = String(currentDate.getMonth() + 1).padStart(2, '0');
const currentSession = ref(`${currentYear}-${currentMonth}`);
// Saved distribution records
const savedRecords = ref([]);
@ -111,6 +114,29 @@ export const useSessionStore = defineStore("session", () => {
Object.assign(availableAmounts.value, amounts);
}
function resetSession() {
// Reset checklist
Object.keys(checklist.value).forEach((key) => {
checklist.value[key] = false;
});
// Reset allocations
Object.keys(draftAllocations.value).forEach((key) => {
draftAllocations.value[key] = 0;
});
// Reset other values
rationale.value = "";
savedRecords.value = [];
// Reset available amounts
availableAmounts.value = {
surplus: 0,
deferredOwed: 0,
savingsNeeded: 0,
};
}
return {
checklist,
draftAllocations,
@ -128,5 +154,6 @@ export const useSessionStore = defineStore("session", () => {
loadSession,
setCurrentSession,
updateAvailableAmounts,
resetSession,
};
});