Thomas Kaul
23 hours ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with
9 additions and
3 deletions
-
CHANGELOG.md
-
apps/api/src/app/account-balance/account-balance.service.ts
-
prisma/migrations/20261014000000_added_user_id_to_unique_constraint_of_account_balance/migration.sql
-
prisma/schema.prisma
|
|
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
- Improved the colors of the muted texts and borders by enabling the dark mode of `bootstrap` |
|
|
- Improved the colors of the muted texts and borders by enabling the dark mode of `bootstrap` |
|
|
- Reduced the size of the global stylesheet by removing the unused utilities of `bootstrap` |
|
|
- Reduced the size of the global stylesheet by removing the unused utilities of `bootstrap` |
|
|
- Hardened the validation of the date in the endpoint to create an account balance |
|
|
- Hardened the validation of the date in the endpoint to create an account balance |
|
|
|
|
|
- Added `userId` to the unique constraint of the `AccountBalance` database schema |
|
|
- Upgraded `bootstrap` from version `4.6.2` to `5.3.8` |
|
|
- Upgraded `bootstrap` from version `4.6.2` to `5.3.8` |
|
|
|
|
|
|
|
|
### Fixed |
|
|
### Fixed |
|
|
|
|
|
@ -68,9 +68,9 @@ export class AccountBalanceService { |
|
|
value: balance |
|
|
value: balance |
|
|
}, |
|
|
}, |
|
|
where: { |
|
|
where: { |
|
|
userId, |
|
|
accountId_userId_date: { |
|
|
accountId_date: { |
|
|
|
|
|
accountId, |
|
|
accountId, |
|
|
|
|
|
userId, |
|
|
date: resetHours(parseISO(date)) |
|
|
date: resetHours(parseISO(date)) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
@ -0,0 +1,5 @@ |
|
|
|
|
|
-- DropIndex |
|
|
|
|
|
DROP INDEX "AccountBalance_accountId_date_key"; |
|
|
|
|
|
|
|
|
|
|
|
-- CreateIndex |
|
|
|
|
|
CREATE UNIQUE INDEX "AccountBalance_accountId_userId_date_key" ON "AccountBalance"("accountId", "userId", "date"); |
|
|
@ -65,7 +65,7 @@ model AccountBalance { |
|
|
userId String |
|
|
userId String |
|
|
value Float |
|
|
value Float |
|
|
|
|
|
|
|
|
@@unique([accountId, date]) |
|
|
@@unique([accountId, userId, date]) |
|
|
@@index([accountId]) |
|
|
@@index([accountId]) |
|
|
@@index([date]) |
|
|
@@index([date]) |
|
|
} |
|
|
} |
|
|
|