fix(ai-usage): resolve code review feedback for concurrency upsert and timeframe window

This commit is contained in:
yiling
2026-07-23 11:29:11 +08:00
parent f93c8ea524
commit f6c0a41151
6 changed files with 182 additions and 29 deletions
File diff suppressed because one or more lines are too long
+8 -1
View File
@@ -304,6 +304,7 @@ export type AiUsageOrderByWithRelationInput = {
export type AiUsageWhereUniqueInput = Prisma.AtLeast<{
id?: string
teamId_userId_periodStart?: Prisma.AiUsageTeamIdUserIdPeriodStartCompoundUniqueInput
AND?: Prisma.AiUsageWhereInput | Prisma.AiUsageWhereInput[]
OR?: Prisma.AiUsageWhereInput[]
NOT?: Prisma.AiUsageWhereInput | Prisma.AiUsageWhereInput[]
@@ -319,7 +320,7 @@ export type AiUsageWhereUniqueInput = Prisma.AtLeast<{
updatedAt?: Prisma.DateTimeFilter<"AiUsage"> | Date | string
team?: Prisma.XOR<Prisma.TeamScalarRelationFilter, Prisma.TeamWhereInput>
user?: Prisma.XOR<Prisma.UserNullableScalarRelationFilter, Prisma.UserWhereInput> | null
}, "id">
}, "id" | "teamId_userId_periodStart">
export type AiUsageOrderByWithAggregationInput = {
id?: Prisma.SortOrder
@@ -463,6 +464,12 @@ export type AiUsageOrderByRelationAggregateInput = {
_count?: Prisma.SortOrder
}
export type AiUsageTeamIdUserIdPeriodStartCompoundUniqueInput = {
teamId: string
userId: string
periodStart: Date | string
}
export type AiUsageCountOrderByAggregateInput = {
id?: Prisma.SortOrder
teamId?: Prisma.SortOrder