Browse Source
Feature/rename orders to activities in Tag database schema (#4783)
* Rename orders to activities in Tag database schema
* Update changelog
pull/4787/head
Thomas Kaul
1 month ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with
10 additions and
9 deletions
-
CHANGELOG.md
-
apps/api/src/services/tag/tag.service.ts
-
prisma/schema.prisma
|
|
@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 |
|
|
|
|
|
|
|
### Changed |
|
|
|
|
|
|
|
- Renamed `orders` to `activities` in the `Tag` database schema |
|
|
|
- Improved the language localization for Dutch (`nl`) |
|
|
|
|
|
|
|
## 2.164.0 - 2025-05-28 |
|
|
|
|
|
@ -52,7 +52,7 @@ export class TagService { |
|
|
|
include: { |
|
|
|
_count: { |
|
|
|
select: { |
|
|
|
orders: { |
|
|
|
activities: { |
|
|
|
where: { |
|
|
|
userId |
|
|
|
} |
|
|
@ -79,7 +79,7 @@ export class TagService { |
|
|
|
id, |
|
|
|
name, |
|
|
|
userId, |
|
|
|
isUsed: _count.orders > 0 |
|
|
|
isUsed: _count.activities > 0 |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
@ -87,7 +87,7 @@ export class TagService { |
|
|
|
const tagsWithOrderCount = await this.prismaService.tag.findMany({ |
|
|
|
include: { |
|
|
|
_count: { |
|
|
|
select: { orders: true } |
|
|
|
select: { activities: true } |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
@ -97,7 +97,7 @@ export class TagService { |
|
|
|
id, |
|
|
|
name, |
|
|
|
userId, |
|
|
|
activityCount: _count.orders |
|
|
|
activityCount: _count.activities |
|
|
|
}; |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
@ -233,11 +233,11 @@ model Subscription { |
|
|
|
} |
|
|
|
|
|
|
|
model Tag { |
|
|
|
id String @id @default(uuid()) |
|
|
|
name String |
|
|
|
orders Order[] |
|
|
|
userId String? |
|
|
|
User User? @relation(fields: [userId], onDelete: Cascade, references: [id]) |
|
|
|
activities Order[] |
|
|
|
id String @id @default(uuid()) |
|
|
|
name String |
|
|
|
userId String? |
|
|
|
User User? @relation(fields: [userId], onDelete: Cascade, references: [id]) |
|
|
|
|
|
|
|
@@unique([name, userId]) |
|
|
|
@@index([name]) |
|
|
|