Skip to content

Commit d53dac5

Browse files
coderabbitai[bot]CodeRabbit
andauthored
fix: apply CodeRabbit auto-fixes
Fixed 9 file(s) based on 3 unresolved review comments. Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
1 parent f161b18 commit d53dac5

9 files changed

Lines changed: 23 additions & 104 deletions

File tree

apps/backend/src/activity/activity.service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export class ActivityService {
7878
data: {
7979
groupId: params.groupId,
8080
actorUserId: params.actorUserId,
81-
type: params.type as never,
81+
type: params.type as Prisma.ActivityType,
8282
entityId: params.entityId,
8383
metadata: (params.metadata ?? {}) as Prisma.InputJsonValue,
8484
},
@@ -144,4 +144,4 @@ export class ActivityService {
144144
nextCursor: events.length === safeLimit ? safeCursor + safeLimit : null,
145145
};
146146
}
147-
}
147+
}

apps/mobile/.turbo/turbo-build.log

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

2-
> mobile@1.0.0 build D:\ak\project\FairShare\apps\mobile
2+
> mobile@1.0.0 build /home/jailuser/git/apps/mobile
33
> tsc --noEmit
4-

apps/web/.turbo/turbo-build.log

Lines changed: 3 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,6 @@
11

2-
> web@1.0.0 build D:\ak\project\FairShare\apps\web
2+
> web@1.0.0 build /home/jailuser/git/apps/web
33
> next build
44

5-
▲ Next.js 15.2.0
6-
- Environments: .env.local
7-
8-
Creating an optimized production build ...
9-
✓ Compiled successfully
10-
Linting and checking validity of types ...
11-
Collecting page data ...
12-
Generating static pages (0/28) ...
13-
Generating static pages (7/28)
14-
Generating static pages (14/28)
15-
Generating static pages (21/28)
16-
✓ Generating static pages (28/28)
17-
Finalizing page optimization ...
18-
Collecting build traces ...
19-
20-
Route (app) Size First Load JS
21-
┌ ○ / 4.26 kB 175 kB
22-
├ ○ /_not-found 181 B 118 kB
23-
├ ○ /about 3.38 kB 175 kB
24-
├ ƒ /api/activity 181 B 118 kB
25-
├ ƒ /api/auth/login 181 B 118 kB
26-
├ ƒ /api/auth/logout 181 B 118 kB
27-
├ ƒ /api/auth/register 181 B 118 kB
28-
├ ƒ /api/auth/session 181 B 118 kB
29-
├ ƒ /api/auth/token 181 B 118 kB
30-
├ ○ /blog 5.52 kB 177 kB
31-
├ ƒ /blog/[slug] 5.73 kB 177 kB
32-
├ ○ /contact 7 kB 178 kB
33-
├ ƒ /dashboard 5.47 kB 177 kB
34-
├ ƒ /dashboard/activity 5.15 kB 179 kB
35-
├ ƒ /dashboard/expenses/[expenseId] 290 B 190 kB
36-
├ ƒ /dashboard/groups 296 B 190 kB
37-
├ ƒ /dashboard/groups/[groupId] 296 B 190 kB
38-
├ ƒ /dashboard/groups/[groupId]/settle 296 B 190 kB
39-
├ ƒ /dashboard/profile 4.39 kB 176 kB
40-
├ ○ /dashboard/settings 3.72 kB 175 kB
41-
├ ○ /faq 5.67 kB 177 kB
42-
├ ○ /features 9.34 kB 168 kB
43-
├ ○ /how-it-works 3.68 kB 175 kB
44-
├ ○ /login 5.64 kB 177 kB
45-
├ ○ /pricing 4.01 kB 175 kB
46-
├ ○ /privacy 178 B 118 kB
47-
├ ○ /register 6.14 kB 177 kB
48-
├ ƒ /supabase-test 181 B 118 kB
49-
├ ○ /terms 178 B 118 kB
50-
└ ○ /waitlist 5.66 kB 177 kB
51-
+ First Load JS shared by all 118 kB
52-
├ chunks/7327-e92cc0d296786b90.js 62.6 kB
53-
├ chunks/d926b3a0-ef5c8671b7884e91.js 53 kB
54-
└ other shared chunks (total) 2.02 kB
55-
56-
57-
ƒ Middleware 84.6 kB
58-
59-
○ (Static) prerendered as static content
60-
ƒ (Dynamic) server-rendered on demand
61-
5+
sh: 1: next: not found
6+
 ELIFECYCLE  Command failed.

apps/web/src/components/groups/RecurringExpenseList.tsx

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { useToast } from '../ui/Toaster';
1818
type RecurringExpenseListProps = {
1919
recurringExpenses: RecurringExpenseDto[];
2020
members: GroupMemberSummaryDto[];
21-
currency: string;
21+
currency: CurrencyCode;
2222
onChanged?: () => void;
2323
};
2424

@@ -81,17 +81,6 @@ function formatGeneratedLabel(lastGeneratedAt?: string | null): string {
8181
return `Last generated ${new Date(lastGeneratedAt).toLocaleDateString()}`;
8282
}
8383

84-
/**
85-
* Renders a UI list of recurring bills with edit and remove capabilities.
86-
*
87-
* Displays grouped sections (overdue, today, upcoming), per-item status, next run date, payer, generated info, and formatted amount.
88-
*
89-
* @param recurringExpenses - Array of recurring expense DTOs to display
90-
* @param members - Group member summaries used to resolve payer names
91-
* @param currency - Currency code used to format displayed amounts
92-
* @param onChanged - Optional callback invoked after a successful update or removal
93-
* @returns The React element for the recurring expenses list
94-
*/
9584
export function RecurringExpenseList({ recurringExpenses, members, currency, onChanged }: RecurringExpenseListProps) {
9685
const [removingId, setRemovingId] = useState<string | null>(null);
9786
const [editingId, setEditingId] = useState<string | null>(null);
@@ -288,7 +277,7 @@ export function RecurringExpenseList({ recurringExpenses, members, currency, onC
288277
<div className="mt-3 flex items-center justify-between text-sm">
289278
<span className="font-medium text-[var(--fs-text-muted)]">Amount</span>
290279
<span className="text-lg font-extrabold text-[var(--fs-primary)]">
291-
{formatCurrencyFromCents(item.totalAmountCents, currency as CurrencyCode)}
280+
{formatCurrencyFromCents(item.totalAmountCents, currency)}
292281
</span>
293282
</div>
294283
</>
@@ -334,4 +323,4 @@ export function RecurringExpenseList({ recurringExpenses, members, currency, onC
334323
</div>
335324
</section>
336325
);
337-
}
326+
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
> infra-terraform@1.0.0 build D:\ak\project\FairShare\infra\terraform
2+
> infra-terraform@1.0.0 build /home/jailuser/git/infra/terraform
33
> echo "Terraform has no build step"
44

5-
"Terraform has no build step"
5+
Terraform has no build step
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11

2-
> @fairshare/shared-types@1.0.0 build D:\ak\project\FairShare\packages\shared-types
2+
> @fairshare/shared-types@1.0.0 build /home/jailuser/git/packages/shared-types
33
> tsc -p tsconfig.json
4-

packages/shared-types/src/index.ts

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,6 @@ const CURRENCY_SYMBOLS: Record<CurrencyCode, string> = {
55
INR: '₹',
66
};
77

8-
/**
9-
* Normalize a cents amount input into a trimmed string representing whole cents.
10-
*
11-
* @param amountCents - A `bigint`, `number`, or `string` representing cents. If a `number`, it must be an integer; if a `string`, surrounding whitespace will be trimmed.
12-
* @returns The normalized string representation of whole cents.
13-
* @throws Error if `amountCents` is a `number` that is not an integer.
14-
*/
158
function normalizeCentsInput(amountCents: bigint | number | string): string {
169
if (typeof amountCents === 'bigint') {
1710
return amountCents.toString();
@@ -24,17 +17,13 @@ function normalizeCentsInput(amountCents: bigint | number | string): string {
2417
return String(amountCents);
2518
}
2619

27-
return amountCents.trim();
20+
const trimmed = amountCents.trim();
21+
if (!/^-?\d+$/.test(trimmed)) {
22+
throw new Error('Currency formatter expects a valid integer string.');
23+
}
24+
return trimmed;
2825
}
2926

30-
/**
31-
* Format a whole-cents monetary value into a currency string with symbol, thousands separators, and two decimal places.
32-
*
33-
* @param amountCents - The amount in whole cents (`bigint | number | string`). If a `number` is provided it must be an integer; `string` inputs are trimmed.
34-
* @param currency - The target currency code used to pick the symbol (defaults to `'USD'`).
35-
* @returns The formatted currency string including the currency symbol, grouped thousands, a decimal point, and exactly two fractional digits; a leading `-` is preserved for negative values.
36-
* @throws If `amountCents` is a `number` that is not an integer.
37-
*/
3827
export function formatCurrencyFromCents(amountCents: bigint | number | string, currency: CurrencyCode = 'USD'): string {
3928
const normalized = normalizeCentsInput(amountCents);
4029
const negative = normalized.startsWith('-');
@@ -331,4 +320,4 @@ export interface CreatePaymentIntentResponseDto {
331320
paymentId: string;
332321
clientSecret: string;
333322
paymentIntentId: string;
334-
}
323+
}

packages/shared-types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22
"extends": "../../tsconfig.base.json",
33
"compilerOptions": {
44
"outDir": "dist",
5+
"rootDir": "src",
56
"declaration": true,
67
"emitDeclarationOnly": false,
78
"module": "CommonJS"
89
},
910
"include": ["src/**/*.ts"]
10-
}
11+
}

tsconfig.base.json

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"compilerOptions": {
33
"target": "ES2022",
44
"module": "CommonJS",
5-
"moduleResolution": "Node",
5+
"moduleResolution": "Bundler",
66
"strict": true,
77
"noImplicitAny": true,
88
"strictNullChecks": true,
@@ -16,9 +16,6 @@
1616
"resolveJsonModule": true,
1717
"declaration": true,
1818
"sourceMap": true,
19-
"baseUrl": ".",
20-
"paths": {
21-
"@fairshare/shared-types": ["packages/shared-types/src/index.ts"]
22-
}
19+
"ignoreDeprecations": "6.0"
2320
}
24-
}
21+
}

0 commit comments

Comments
 (0)