feat: Add FAB with asset price update, mobile optimizations, and localized financial trend
- Add Floating Action Button (FAB) with 3 quick actions - Implement Asset Price Update dialog for bulk price updates - Add bulk price update API endpoint with transaction support - Optimize multiselect, calendar, and dropdown options for mobile (44px touch targets) - Add custom date range popover to save space in Overview header - Localize number format suffixes (k/m/b for EN, rb/jt/m for ID) - Localize date format in Financial Trend (Oct 8 vs 8 Okt) - Fix negative values in trend line chart (domain auto) - Improve Asset Price Update dialog layout (compact horizontal) - Add mobile-optimized calendar with responsive cells - Fix FAB overlay and close button position - Add translations for FAB and asset price updates
This commit is contained in:
8
apps/api/dist/otp/otp.service.js
vendored
8
apps/api/dist/otp/otp.service.js
vendored
@@ -321,11 +321,11 @@ let OtpService = class OtpService {
|
||||
}
|
||||
catch (error) {
|
||||
console.error('Failed to check WhatsApp number:', error);
|
||||
console.log(`📱 Checking WhatsApp number: ${phone} - Assumed valid`);
|
||||
console.log(`📱 Failed to check WhatsApp number: ${phone} - Webhook error`);
|
||||
return {
|
||||
success: true,
|
||||
isRegistered: true,
|
||||
message: 'Number is valid (dev mode)',
|
||||
success: false,
|
||||
isRegistered: false,
|
||||
message: 'Unable to verify WhatsApp number. Please try again.',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
2
apps/api/dist/otp/otp.service.js.map
vendored
2
apps/api/dist/otp/otp.service.js.map
vendored
File diff suppressed because one or more lines are too long
2
apps/api/dist/tsconfig.build.tsbuildinfo
vendored
2
apps/api/dist/tsconfig.build.tsbuildinfo
vendored
File diff suppressed because one or more lines are too long
48
apps/api/dist/wallets/wallets.controller.d.ts
vendored
48
apps/api/dist/wallets/wallets.controller.d.ts
vendored
@@ -11,11 +11,11 @@ export declare class WalletsController {
|
||||
constructor(wallets: WalletsService, transactions: TransactionsService);
|
||||
list(req: RequestWithUser): import("@prisma/client").Prisma.PrismaPromise<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
@@ -23,15 +23,15 @@ export declare class WalletsController {
|
||||
deletedAt: Date | null;
|
||||
}[]>;
|
||||
getAllTransactions(req: RequestWithUser): Promise<{
|
||||
category: string | null;
|
||||
id: string;
|
||||
createdAt: Date;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
walletId: string;
|
||||
date: Date;
|
||||
amount: import("@prisma/client/runtime/library").Decimal;
|
||||
direction: string;
|
||||
date: Date;
|
||||
category: string | null;
|
||||
memo: string | null;
|
||||
walletId: string;
|
||||
recurrenceId: string | null;
|
||||
}[]>;
|
||||
create(req: RequestWithUser, body: {
|
||||
@@ -43,11 +43,11 @@ export declare class WalletsController {
|
||||
pricePerUnit?: number;
|
||||
}): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
@@ -65,24 +65,48 @@ export declare class WalletsController {
|
||||
pricePerUnit?: number;
|
||||
}): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
||||
deletedAt: Date | null;
|
||||
}, never, import("@prisma/client/runtime/library").DefaultArgs, import("@prisma/client").Prisma.PrismaClientOptions>;
|
||||
bulkUpdatePrices(req: RequestWithUser, body: {
|
||||
updates: Array<{
|
||||
walletId: string;
|
||||
pricePerUnit: number;
|
||||
}>;
|
||||
}): Promise<{
|
||||
success: boolean;
|
||||
updated: number;
|
||||
wallets: {
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
||||
deletedAt: Date | null;
|
||||
}[];
|
||||
}> | {
|
||||
error: string;
|
||||
};
|
||||
delete(req: RequestWithUser, id: string): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
|
||||
14
apps/api/dist/wallets/wallets.controller.js
vendored
14
apps/api/dist/wallets/wallets.controller.js
vendored
@@ -39,6 +39,12 @@ let WalletsController = class WalletsController {
|
||||
update(req, id, body) {
|
||||
return this.wallets.update(req.user.userId, id, body);
|
||||
}
|
||||
bulkUpdatePrices(req, body) {
|
||||
if (!body?.updates || !Array.isArray(body.updates)) {
|
||||
return { error: 'updates array is required' };
|
||||
}
|
||||
return this.wallets.bulkUpdatePrices(req.user.userId, body.updates);
|
||||
}
|
||||
delete(req, id) {
|
||||
return this.wallets.delete(req.user.userId, id);
|
||||
}
|
||||
@@ -75,6 +81,14 @@ __decorate([
|
||||
__metadata("design:paramtypes", [Object, String, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], WalletsController.prototype, "update", null);
|
||||
__decorate([
|
||||
(0, common_1.Patch)('bulk-update-prices'),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
__param(1, (0, common_1.Body)()),
|
||||
__metadata("design:type", Function),
|
||||
__metadata("design:paramtypes", [Object, Object]),
|
||||
__metadata("design:returntype", void 0)
|
||||
], WalletsController.prototype, "bulkUpdatePrices", null);
|
||||
__decorate([
|
||||
(0, common_1.Delete)(':id'),
|
||||
__param(0, (0, common_1.Req)()),
|
||||
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"wallets.controller.js","sourceRoot":"","sources":["../../src/wallets/wallets.controller.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,2CAUwB;AACxB,uDAAmD;AACnD,+EAA2E;AAC3E,mDAA+C;AAUxC,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAET;IACA;IAFnB,YACmB,OAAuB,EACvB,YAAiC;QADjC,YAAO,GAAP,OAAO,CAAgB;QACvB,iBAAY,GAAZ,YAAY,CAAqB;IACjD,CAAC;IAGJ,IAAI,CAAQ,GAAoB;QAC9B,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC;IAGK,AAAN,KAAK,CAAC,kBAAkB,CAAQ,GAAoB;QAClD,OAAO,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACpD,CAAC;IAGD,MAAM,CACG,GAAoB,EAE3B,IAOC;QAED,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;YAChB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;QACvC,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACpD,CAAC;IAGD,MAAM,CACG,GAAoB,EACd,EAAU,EAEvB,IAOC;QAED,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAC,CAAC;IACxD,CAAC;IAGD,MAAM,CAAQ,GAAoB,EAAe,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AA,IAAA,YAAG,GAAE,CAAA;;;;6CAEV;AAGK;IADL,IAAA,YAAG,EAAC,cAAc,CAAC;IACM,WAAA,IAAA,YAAG,GAAE,CAAA;;;;2DAE9B;AAGD;IADC,IAAA,aAAI,GAAE;IAEJ,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+CAcR;AAGD;IADC,IAAA,YAAG,EAAC,KAAK,CAAC;IAER,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;IACX,WAAA,IAAA,aAAI,GAAE,CAAA;;;;+CAWR;AAGD;IADC,IAAA,cAAK,EAAC,oBAAoB,CAAC;IAEzB,WAAA,IAAA,YAAG,GAAE,CAAA;IACL,WAAA,IAAA,aAAI,GAAE,CAAA;;;;yDAYR;AAGD;IADC,IAAA,eAAM,EAAC,KAAK,CAAC;IACN,WAAA,IAAA,YAAG,GAAE,CAAA;IAAwB,WAAA,IAAA,cAAK,EAAC,IAAI,CAAC,CAAA;;;;+CAE/C;4BAxEU,iBAAiB;IAF7B,IAAA,mBAAU,EAAC,SAAS,CAAC;IACrB,IAAA,kBAAS,EAAC,sBAAS,CAAC;qCAGS,gCAAc;QACT,0CAAmB;GAHzC,iBAAiB,CAyE7B"}
|
||||
36
apps/api/dist/wallets/wallets.service.d.ts
vendored
36
apps/api/dist/wallets/wallets.service.d.ts
vendored
@@ -4,11 +4,11 @@ export declare class WalletsService {
|
||||
constructor(prisma: PrismaService);
|
||||
list(userId: string): import("@prisma/client").Prisma.PrismaPromise<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
@@ -24,11 +24,11 @@ export declare class WalletsService {
|
||||
pricePerUnit?: number;
|
||||
}): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
@@ -44,24 +44,44 @@ export declare class WalletsService {
|
||||
pricePerUnit?: number;
|
||||
}): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
||||
deletedAt: Date | null;
|
||||
}, never, import("@prisma/client/runtime/library").DefaultArgs, import("@prisma/client").Prisma.PrismaClientOptions>;
|
||||
bulkUpdatePrices(userId: string, updates: Array<{
|
||||
walletId: string;
|
||||
pricePerUnit: number;
|
||||
}>): Promise<{
|
||||
success: boolean;
|
||||
updated: number;
|
||||
wallets: {
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
pricePerUnit: import("@prisma/client/runtime/library").Decimal | null;
|
||||
deletedAt: Date | null;
|
||||
}[];
|
||||
}>;
|
||||
delete(userId: string, id: string): import("@prisma/client").Prisma.Prisma__WalletClient<{
|
||||
id: string;
|
||||
userId: string;
|
||||
createdAt: Date;
|
||||
updatedAt: Date;
|
||||
name: string;
|
||||
userId: string;
|
||||
kind: string;
|
||||
name: string;
|
||||
currency: string | null;
|
||||
unit: string | null;
|
||||
initialAmount: import("@prisma/client/runtime/library").Decimal | null;
|
||||
|
||||
11
apps/api/dist/wallets/wallets.service.js
vendored
11
apps/api/dist/wallets/wallets.service.js
vendored
@@ -67,6 +67,17 @@ let WalletsService = class WalletsService {
|
||||
data: updateData,
|
||||
});
|
||||
}
|
||||
async bulkUpdatePrices(userId, updates) {
|
||||
const results = await this.prisma.$transaction(updates.map((update) => this.prisma.wallet.update({
|
||||
where: { id: update.walletId, userId, kind: 'asset' },
|
||||
data: { pricePerUnit: update.pricePerUnit },
|
||||
})));
|
||||
return {
|
||||
success: true,
|
||||
updated: results.length,
|
||||
wallets: results,
|
||||
};
|
||||
}
|
||||
delete(userId, id) {
|
||||
return this.prisma.wallet.update({
|
||||
where: { id, userId },
|
||||
|
||||
2
apps/api/dist/wallets/wallets.service.js.map
vendored
2
apps/api/dist/wallets/wallets.service.js.map
vendored
@@ -1 +1 @@
|
||||
{"version":3,"file":"wallets.service.js","sourceRoot":"","sources":["../../src/wallets/wallets.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,6DAAyD;AAGlD,IAAM,cAAc,GAApB,MAAM,cAAc;IACL;IAApB,YAAoB,MAAqB;QAArB,WAAM,GAAN,MAAM,CAAe;IAAG,CAAC;IAE7C,IAAI,CAAC,MAAc;QACjB,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC;YACjC,KAAK,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE;YAClC,OAAO,EAAE,EAAE,SAAS,EAAE,KAAK,EAAE;SAC9B,CAAC,CAAC;IACL,CAAC;IAED,MAAM,CACJ,MAAc,EACd,KAOC;QAED,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,IAAI,OAAO,CAAC;QACnC,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC;YAC/B,IAAI,EAAE;gBACJ,MAAM;gBACN,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,IAAI;gBACJ,QA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AAM,CAAC,MAAM,CAAC,MAAM,CAAC;YAC/B,KAAK,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE;YACrB,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,IAAI,EAAE,EAAE;SAChC,CAAC,CAAC;IACL,CAAC;CACF,CAAA;AA1GY,wCAAc;yBAAd,cAAc;IAD1B,IAAA,mBAAU,GAAE;qCAEiB,8BAAa;GAD9B,cAAc,CA0G1B"}
|
||||
@@ -403,12 +403,12 @@ export class OtpService {
|
||||
};
|
||||
} catch (error: unknown) {
|
||||
console.error('Failed to check WhatsApp number:', error);
|
||||
// For development, assume number is valid
|
||||
console.log(`📱 Checking WhatsApp number: ${phone} - Assumed valid`);
|
||||
// Return false if webhook fails - safer approach
|
||||
console.log(`📱 Failed to check WhatsApp number: ${phone} - Webhook error`);
|
||||
return {
|
||||
success: true,
|
||||
isRegistered: true,
|
||||
message: 'Number is valid (dev mode)',
|
||||
success: false,
|
||||
isRegistered: false,
|
||||
message: 'Unable to verify WhatsApp number. Please try again.',
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import {
|
||||
Get,
|
||||
Post,
|
||||
Put,
|
||||
Patch,
|
||||
Delete,
|
||||
Param,
|
||||
UseGuards,
|
||||
@@ -73,6 +74,23 @@ export class WalletsController {
|
||||
return this.wallets.update(req.user.userId, id, body);
|
||||
}
|
||||
|
||||
@Patch('bulk-update-prices')
|
||||
bulkUpdatePrices(
|
||||
@Req() req: RequestWithUser,
|
||||
@Body()
|
||||
body: {
|
||||
updates: Array<{
|
||||
walletId: string;
|
||||
pricePerUnit: number;
|
||||
}>;
|
||||
},
|
||||
) {
|
||||
if (!body?.updates || !Array.isArray(body.updates)) {
|
||||
return { error: 'updates array is required' };
|
||||
}
|
||||
return this.wallets.bulkUpdatePrices(req.user.userId, body.updates);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
delete(@Req() req: RequestWithUser, @Param('id') id: string) {
|
||||
return this.wallets.delete(req.user.userId, id);
|
||||
|
||||
@@ -80,6 +80,27 @@ export class WalletsService {
|
||||
});
|
||||
}
|
||||
|
||||
async bulkUpdatePrices(
|
||||
userId: string,
|
||||
updates: Array<{ walletId: string; pricePerUnit: number }>,
|
||||
) {
|
||||
// Update all wallets in a transaction
|
||||
const results = await this.prisma.$transaction(
|
||||
updates.map((update) =>
|
||||
this.prisma.wallet.update({
|
||||
where: { id: update.walletId, userId, kind: 'asset' },
|
||||
data: { pricePerUnit: update.pricePerUnit },
|
||||
}),
|
||||
),
|
||||
);
|
||||
|
||||
return {
|
||||
success: true,
|
||||
updated: results.length,
|
||||
wallets: results,
|
||||
};
|
||||
}
|
||||
|
||||
delete(userId: string, id: string) {
|
||||
// Soft delete by setting deletedAt
|
||||
return this.prisma.wallet.update({
|
||||
|
||||
Reference in New Issue
Block a user