Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
de8fa47
Adding new field to types
janekamata Apr 14, 2026
5baa09b
Updating add/edit cost for interval
janekamata Apr 14, 2026
191212f
Cashflow cards styling
janekamata Apr 14, 2026
28a289a
Styling changes
janekamata Apr 14, 2026
01788ae
Initial ts script
janekamata Apr 14, 2026
c8b5b6d
Working on chart
janekamata Apr 14, 2026
5c93faa
Styling and empty state
janekamata Apr 14, 2026
f7e9a61
Changing title name
janekamata Apr 14, 2026
9df9895
Spacing fix
janekamata Apr 14, 2026
1af815b
Squashed commit of the following:
janekamata Apr 14, 2026
67f240e
Squashed commit of the following:
janekamata Apr 14, 2026
2c9e838
Squashed commit of the following:
janekamata Apr 14, 2026
860ce6c
Squashed commit of the following:
janekamata Apr 14, 2026
2a61506
Squashed commit of the following:
janekamata Apr 15, 2026
99f709f
When you click on item it goes to grant
janekamata Apr 15, 2026
c54dc73
Date filter and formatting
janekamata Apr 15, 2026
4856057
Default date, resolving frontend errors from console
janekamata Apr 15, 2026
06f5d09
Updating kpis and projection date filters
janekamata Apr 15, 2026
f386445
Saving cashflow settings on page change
janekamata Apr 15, 2026
dc308e8
Merge branch 'main' into 412-dev---update-cashflow-chart-with-live-co…
janekamata Apr 15, 2026
3c93093
Updating tests
janekamata Apr 15, 2026
14aa287
Fixing test
janekamata Apr 15, 2026
17cd6b0
Removing use effect
janekamata Apr 15, 2026
68cae25
Fixing empty settings
janekamata Apr 15, 2026
75a97b9
Fixing nan settings save
janekamata Apr 15, 2026
a1e0bb1
Formatting
janekamata Apr 15, 2026
76644ba
Styling
janekamata Apr 15, 2026
24e541e
Removing unused imports
janekamata Apr 15, 2026
8317846
Fixing duplicate revenue name on edit allowed
janekamata Apr 15, 2026
ce509b7
clear all to multi-select status, added lg breakpoint
lyannne Apr 15, 2026
c725cc7
Merge branch '412-dev---update-cashflow-chart-with-live-cost-and-reve…
lyannne Apr 15, 2026
2ea53c1
Saving button styling
janekamata Apr 15, 2026
db92478
Merge branch '412-dev---update-cashflow-chart-with-live-cost-and-reve…
janekamata Apr 15, 2026
c5d60c4
Removing commented out code
janekamata Apr 15, 2026
461e6ee
Removing alerts and logging instead
janekamata Apr 16, 2026
0fbd4c3
Squashed commit of the following:
janekamata Apr 16, 2026
00ca1f4
Updating tests
janekamata Apr 16, 2026
7af8e16
Adding inactive coloring
janekamata Apr 16, 2026
4f5779c
Fixing nan
janekamata Apr 16, 2026
503d6c2
Fixing empty date
janekamata Apr 16, 2026
32432b8
Fixing axes
janekamata Apr 16, 2026
23bf4a2
Removing unused variable
janekamata Apr 16, 2026
496374b
Preserve axis start
janekamata Apr 16, 2026
afb443a
Fixing axis and removing logs
janekamata Apr 16, 2026
92b46e1
Fixing inactive grant
janekamata Apr 16, 2026
3503de7
Spacing fix
janekamata Apr 16, 2026
f766075
Fixing tests?
janekamata Apr 17, 2026
d971339
Fixing tests?
janekamata Apr 17, 2026
73416ad
Changing test name
janekamata Apr 17, 2026
8d681bf
Removing mock return value
janekamata Apr 17, 2026
ebaed3c
Styling fixes and adding more disabled buttons to sign up and login
janekamata Apr 17, 2026
b5a5a73
Squashed commit of the following:
janekamata Apr 17, 2026
bcaf420
Settings disabled button
janekamata Apr 17, 2026
f2b1071
Styling fixes
janekamata Apr 17, 2026
8d44913
Adding keys
janekamata Apr 17, 2026
2b65282
Making contact card observable
janekamata Apr 17, 2026
c5f38fa
Saving button text cost/revenue
janekamata Apr 17, 2026
f57c509
Settings is submitting
janekamata Apr 17, 2026
0551aba
Fixing cashflow settings save error for nonadmin
janekamata Apr 17, 2026
d774cec
Squashed commit of the following:
janekamata Apr 18, 2026
33f49c0
Edit revenue confirmation fix
janekamata Apr 18, 2026
c65e9dc
Adding back lyanne fixes
janekamata Apr 18, 2026
3c9bfeb
Squashed commit of the following:
janekamata Apr 18, 2026
9a98840
Fixing revenue errors
janekamata Apr 18, 2026
deee89b
Merge branch 'main' into 412-dev---update-cashflow-chart-with-live-co…
janekamata Apr 18, 2026
ec7e8c8
Edit revenue confirmation
janekamata Apr 18, 2026
dd85778
Fixing errors
janekamata Apr 18, 2026
9413b77
Fixing navbar
janekamata Apr 18, 2026
ca37771
Fixing edit cost errors
janekamata Apr 18, 2026
6c00231
Deleting duplicate popup
janekamata Apr 18, 2026
64791f0
Confirmation styling
janekamata Apr 18, 2026
660804a
Moving generating ticks log
janekamata Apr 18, 2026
76cd98d
some small refresh things were incorrect and removed frontend referen…
prooflesben Apr 18, 2026
17078df
Fixed a small error relating to deleting access token references
prooflesben Apr 18, 2026
5fcd89a
dumb change
prooflesben Apr 18, 2026
9a42275
Remaking settings and organizing components
janekamata Apr 18, 2026
08c9e5e
Updating test
janekamata Apr 18, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 69 additions & 0 deletions backend/src/cost/__test__/cashflow-cost.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ describe('CostService', () => {
type: CostType.MealsFood,
frequency: Frequency.Yearly,
date: '2026-03-22' as TDateISO,
interval: 12,
};

const result = await service.createCost(payload);
Expand All @@ -182,6 +183,7 @@ describe('CostService', () => {
amount: 200,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22',
});
expect(mockPut).toHaveBeenCalledWith({
Expand All @@ -191,6 +193,7 @@ describe('CostService', () => {
amount: 200,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22',
},
ConditionExpression: 'attribute_not_exists(#name)',
Expand All @@ -207,6 +210,7 @@ describe('CostService', () => {
amount: 0,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -216,6 +220,7 @@ describe('CostService', () => {
amount: 0,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('amount must be a finite positive number');
Expand All @@ -228,6 +233,7 @@ describe('CostService', () => {
amount: 100,
type: 'INVALID' as unknown as CostType,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -240,6 +246,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: 'INVALID' as unknown as Frequency,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -252,6 +259,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -261,6 +269,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('name must be a non-empty string');
Expand All @@ -275,6 +284,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(ConflictException);
Expand All @@ -284,6 +294,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Cost with name Food already exists');
Expand All @@ -298,6 +309,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(InternalServerErrorException);
Expand All @@ -312,6 +324,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(InternalServerErrorException);
Expand All @@ -321,6 +334,7 @@ describe('CostService', () => {
amount: 100,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Failed to create cost');
Expand All @@ -335,6 +349,7 @@ describe('CostService', () => {
amount: 200,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22',
},
});
Expand All @@ -347,6 +362,7 @@ describe('CostService', () => {
type: CostType.Services,
frequency: Frequency.OneTime,
date: '2026-03-22' as TDateISO,
interval: 0,
};
mockPutPromise.mockResolvedValue({});

Expand All @@ -356,6 +372,7 @@ describe('CostService', () => {
type: CostType.Services,
frequency: Frequency.OneTime,
date: '2026-03-22' as TDateISO,
interval: 0,
});

expect(result).toEqual(updatedItem);
Expand All @@ -370,6 +387,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.Services,
frequency: Frequency.OneTime,
interval: 0,
date: '2026-03-22',
},
ConditionExpression: 'attribute_exists(#name)',
Expand All @@ -385,6 +403,7 @@ describe('CostService', () => {
amount: 200,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
});

Expand All @@ -393,6 +412,7 @@ describe('CostService', () => {
amount: 200,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22',
});
expect(mockPut).not.toHaveBeenCalled();
Expand All @@ -406,6 +426,7 @@ describe('CostService', () => {
amount: Number.NaN,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -418,6 +439,7 @@ describe('CostService', () => {
amount: 250,
type: 'INVALID' as unknown as CostType,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -430,6 +452,33 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: 'INVALID' as unknown as Frequency,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
});

it('throws BadRequestException for invalid interval', async () => {
await expect(
service.updateCost('Food', {
name: 'Food',
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 'INVALID' as unknown as number,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
});

it('throws BadRequestException for invalid interval', async () => {
await expect(
service.updateCost('Food', {
name: 'Food',
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 'INVALID' as unknown as number,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -442,6 +491,7 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: 'not-a-date' as unknown as TDateISO,
}),
).rejects.toThrow(BadRequestException);
Expand All @@ -451,6 +501,7 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: 'not-a-date' as unknown as TDateISO,
}),
).rejects.toThrow('date must be a valid ISO 8601 format string');
Expand All @@ -465,6 +516,7 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(NotFoundException);
Expand All @@ -474,6 +526,7 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Cost with name Food not found');
Expand All @@ -489,6 +542,7 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(InternalServerErrorException);
Expand All @@ -498,6 +552,7 @@ describe('CostService', () => {
amount: 250,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Failed to update cost Food');
Expand All @@ -513,6 +568,7 @@ describe('CostService', () => {
name: 'Meals',
amount: 300,
type: CostType.MealsFood,
interval: 12,
frequency: Frequency.Yearly,
date: '2026-03-22' as TDateISO,
});
Expand All @@ -522,6 +578,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22',
});
expect(mockGet).toHaveBeenCalledWith({
Expand All @@ -539,6 +596,7 @@ describe('CostService', () => {
type: CostType.MealsFood,
frequency: Frequency.Yearly,
date: '2026-03-22',
interval: 12,
},
ConditionExpression: 'attribute_not_exists(#name)',
ExpressionAttributeNames: {
Expand Down Expand Up @@ -571,6 +629,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
});

Expand All @@ -579,6 +638,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22',
});
});
Expand All @@ -592,6 +652,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(NotFoundException);
Expand All @@ -601,6 +662,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Cost with name Food not found');
Expand All @@ -622,6 +684,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(ConflictException);
Expand All @@ -631,6 +694,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Cost with name Meals already exists');
Expand All @@ -652,6 +716,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(NotFoundException);
Expand All @@ -661,6 +726,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Cost with name Food not found');
Expand All @@ -678,6 +744,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(InternalServerErrorException);
Expand All @@ -687,6 +754,7 @@ describe('CostService', () => {
amount: 300,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow('Failed to update cost Food');
Expand All @@ -701,6 +769,7 @@ describe('CostService', () => {
amount: 200,
type: CostType.MealsFood,
frequency: Frequency.Yearly,
interval: 12,
date: '2026-03-22' as TDateISO,
}),
).rejects.toThrow(InternalServerErrorException);
Expand Down
Loading
Loading