From daf35d0e40912190998e367e13bd707b8823fff1 Mon Sep 17 00:00:00 2001 From: "Nic D." <91558719+Venti-Bear@users.noreply.github.com> Date: Wed, 11 Mar 2026 12:51:34 -0400 Subject: [PATCH] fix(pay-periods): fix error where mileage was not being returned correctly for overviews --- .gitignore | 4 + .../prisma/client/postgres/browser.ts | 5 + .../prisma/client/postgres/client.ts | 5 + .../client/postgres/commonInputTypes.ts | 296 ++++++++++-------- .../prisma/client/postgres/internal/class.ts | 14 +- .../postgres/internal/prismaNamespace.ts | 138 +++++++- .../internal/prismaNamespaceBrowser.ts | 15 + .../prisma/client/postgres/models.ts | 1 + .../client/postgres/models/Employees.ts | 8 - .../prisma/client/postgres/models/Users.ts | 132 ++++++++ .../postgres/models/userModuleAccess.ts | 8 - .../pay-periods-build-overview.service.ts | 3 +- 12 files changed, 462 insertions(+), 167 deletions(-) diff --git a/.gitignore b/.gitignore index dfe855f..621dc53 100644 --- a/.gitignore +++ b/.gitignore @@ -55,6 +55,10 @@ pids # Diagnostic reports (https://nodejs.org/api/report.html) report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json +# Generated prisma folders (from -> npm run prisma:generated) /generated/prisma +/prisma/mariadb/generated/ +/prisma/postgres/generated/ +/prisma/prisma-legacy/generated/ !swagger-spec.json diff --git a/prisma/postgres/generated/prisma/client/postgres/browser.ts b/prisma/postgres/generated/prisma/client/postgres/browser.ts index fe780ad..fcdc2ef 100644 --- a/prisma/postgres/generated/prisma/client/postgres/browser.ts +++ b/prisma/postgres/generated/prisma/client/postgres/browser.ts @@ -22,6 +22,11 @@ export * from './enums'; * */ export type Users = Prisma.UsersModel +/** + * Model Notifications + * + */ +export type Notifications = Prisma.NotificationsModel /** * Model userModuleAccess * diff --git a/prisma/postgres/generated/prisma/client/postgres/client.ts b/prisma/postgres/generated/prisma/client/postgres/client.ts index 9c48901..931fd2e 100644 --- a/prisma/postgres/generated/prisma/client/postgres/client.ts +++ b/prisma/postgres/generated/prisma/client/postgres/client.ts @@ -42,6 +42,11 @@ export { Prisma } * */ export type Users = Prisma.UsersModel +/** + * Model Notifications + * + */ +export type Notifications = Prisma.NotificationsModel /** * Model userModuleAccess * diff --git a/prisma/postgres/generated/prisma/client/postgres/commonInputTypes.ts b/prisma/postgres/generated/prisma/client/postgres/commonInputTypes.ts index b07cbd4..7728e0e 100644 --- a/prisma/postgres/generated/prisma/client/postgres/commonInputTypes.ts +++ b/prisma/postgres/generated/prisma/client/postgres/commonInputTypes.ts @@ -140,33 +140,35 @@ export type IntFilter<$PrismaModel = never> = { not?: Prisma.NestedIntFilter<$PrismaModel> | number } -export type BoolFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +export type EnumModulesFilter<$PrismaModel = never> = { + equals?: $Enums.Modules | Prisma.EnumModulesFieldRefInput<$PrismaModel> + in?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + notIn?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumModulesFilter<$PrismaModel> | $Enums.Modules } -export type IntWithAggregatesFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> - in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> - notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> - lt?: number | Prisma.IntFieldRefInput<$PrismaModel> - lte?: number | Prisma.IntFieldRefInput<$PrismaModel> - gt?: number | Prisma.IntFieldRefInput<$PrismaModel> - gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number - _count?: Prisma.NestedIntFilter<$PrismaModel> - _avg?: Prisma.NestedFloatFilter<$PrismaModel> - _sum?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedIntFilter<$PrismaModel> - _max?: Prisma.NestedIntFilter<$PrismaModel> -} +export type JsonFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> -export type BoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedBoolFilter<$PrismaModel> - _max?: Prisma.NestedBoolFilter<$PrismaModel> +export type JsonFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string[] + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter } export type DateTimeFilter<$PrismaModel = never> = { @@ -191,15 +193,57 @@ export type DateTimeNullableFilter<$PrismaModel = never> = { not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } -export type IntNullableFilter<$PrismaModel = never> = { - equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null - in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null - notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null +export type IntWithAggregatesFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> lt?: number | Prisma.IntFieldRefInput<$PrismaModel> lte?: number | Prisma.IntFieldRefInput<$PrismaModel> gt?: number | Prisma.IntFieldRefInput<$PrismaModel> gte?: number | Prisma.IntFieldRefInput<$PrismaModel> - not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null + not?: Prisma.NestedIntWithAggregatesFilter<$PrismaModel> | number + _count?: Prisma.NestedIntFilter<$PrismaModel> + _avg?: Prisma.NestedFloatFilter<$PrismaModel> + _sum?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedIntFilter<$PrismaModel> + _max?: Prisma.NestedIntFilter<$PrismaModel> +} + +export type EnumModulesWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.Modules | Prisma.EnumModulesFieldRefInput<$PrismaModel> + in?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + notIn?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumModulesWithAggregatesFilter<$PrismaModel> | $Enums.Modules + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedEnumModulesFilter<$PrismaModel> + _max?: Prisma.NestedEnumModulesFilter<$PrismaModel> +} + +export type JsonWithAggregatesFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> + +export type JsonWithAggregatesFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string[] + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedJsonFilter<$PrismaModel> + _max?: Prisma.NestedJsonFilter<$PrismaModel> } export type DateTimeWithAggregatesFilter<$PrismaModel = never> = { @@ -230,6 +274,30 @@ export type DateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> } +export type BoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type BoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + +export type IntNullableFilter<$PrismaModel = never> = { + equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null + in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + notIn?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null + lt?: number | Prisma.IntFieldRefInput<$PrismaModel> + lte?: number | Prisma.IntFieldRefInput<$PrismaModel> + gt?: number | Prisma.IntFieldRefInput<$PrismaModel> + gte?: number | Prisma.IntFieldRefInput<$PrismaModel> + not?: Prisma.NestedIntNullableFilter<$PrismaModel> | number | null +} + export type IntNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null @@ -351,57 +419,6 @@ export type FloatWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedFloatFilter<$PrismaModel> } -export type JsonFilter<$PrismaModel = never> = -| Prisma.PatchUndefined< - Prisma.Either>, Exclude>, 'path'>>, - Required> - > -| Prisma.OptionalFlat>, 'path'>> - -export type JsonFilterBase<$PrismaModel = never> = { - equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter - path?: string[] - mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> - string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter -} - -export type JsonWithAggregatesFilter<$PrismaModel = never> = -| Prisma.PatchUndefined< - Prisma.Either>, Exclude>, 'path'>>, - Required> - > -| Prisma.OptionalFlat>, 'path'>> - -export type JsonWithAggregatesFilterBase<$PrismaModel = never> = { - equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter - path?: string[] - mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> - string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter - _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedJsonFilter<$PrismaModel> - _max?: Prisma.NestedJsonFilter<$PrismaModel> -} - export type BoolNullableFilter<$PrismaModel = never> = { equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null @@ -568,9 +585,33 @@ export type NestedEnumRolesWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedEnumRolesFilter<$PrismaModel> } -export type NestedBoolFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +export type NestedEnumModulesFilter<$PrismaModel = never> = { + equals?: $Enums.Modules | Prisma.EnumModulesFieldRefInput<$PrismaModel> + in?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + notIn?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumModulesFilter<$PrismaModel> | $Enums.Modules +} + +export type NestedDateTimeFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string +} + +export type NestedDateTimeNullableFilter<$PrismaModel = never> = { + equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null + in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null + lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> + not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null } export type NestedIntWithAggregatesFilter<$PrismaModel = never> = { @@ -600,34 +641,38 @@ export type NestedFloatFilter<$PrismaModel = never> = { not?: Prisma.NestedFloatFilter<$PrismaModel> | number } -export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { - equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> - not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean +export type NestedEnumModulesWithAggregatesFilter<$PrismaModel = never> = { + equals?: $Enums.Modules | Prisma.EnumModulesFieldRefInput<$PrismaModel> + in?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + notIn?: $Enums.Modules[] | Prisma.ListEnumModulesFieldRefInput<$PrismaModel> + not?: Prisma.NestedEnumModulesWithAggregatesFilter<$PrismaModel> | $Enums.Modules _count?: Prisma.NestedIntFilter<$PrismaModel> - _min?: Prisma.NestedBoolFilter<$PrismaModel> - _max?: Prisma.NestedBoolFilter<$PrismaModel> + _min?: Prisma.NestedEnumModulesFilter<$PrismaModel> + _max?: Prisma.NestedEnumModulesFilter<$PrismaModel> } -export type NestedDateTimeFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeFilter<$PrismaModel> | Date | string -} +export type NestedJsonFilter<$PrismaModel = never> = +| Prisma.PatchUndefined< + Prisma.Either>, Exclude>, 'path'>>, + Required> + > +| Prisma.OptionalFlat>, 'path'>> -export type NestedDateTimeNullableFilter<$PrismaModel = never> = { - equals?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> | null - in?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - notIn?: Date[] | string[] | Prisma.ListDateTimeFieldRefInput<$PrismaModel> | null - lt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - lte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gt?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - gte?: Date | string | Prisma.DateTimeFieldRefInput<$PrismaModel> - not?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> | Date | string | null +export type NestedJsonFilterBase<$PrismaModel = never> = { + equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter + path?: string[] + mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> + string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> + array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null + lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> + not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter } export type NestedDateTimeWithAggregatesFilter<$PrismaModel = never> = { @@ -658,6 +703,19 @@ export type NestedDateTimeNullableWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedDateTimeNullableFilter<$PrismaModel> } +export type NestedBoolFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolFilter<$PrismaModel> | boolean +} + +export type NestedBoolWithAggregatesFilter<$PrismaModel = never> = { + equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> + not?: Prisma.NestedBoolWithAggregatesFilter<$PrismaModel> | boolean + _count?: Prisma.NestedIntFilter<$PrismaModel> + _min?: Prisma.NestedBoolFilter<$PrismaModel> + _max?: Prisma.NestedBoolFilter<$PrismaModel> +} + export type NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = { equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null in?: number[] | Prisma.ListIntFieldRefInput<$PrismaModel> | null @@ -779,30 +837,6 @@ export type NestedFloatWithAggregatesFilter<$PrismaModel = never> = { _max?: Prisma.NestedFloatFilter<$PrismaModel> } -export type NestedJsonFilter<$PrismaModel = never> = -| Prisma.PatchUndefined< - Prisma.Either>, Exclude>, 'path'>>, - Required> - > -| Prisma.OptionalFlat>, 'path'>> - -export type NestedJsonFilterBase<$PrismaModel = never> = { - equals?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter - path?: string[] - mode?: Prisma.QueryMode | Prisma.EnumQueryModeFieldRefInput<$PrismaModel> - string_contains?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_starts_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - string_ends_with?: string | Prisma.StringFieldRefInput<$PrismaModel> - array_starts_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_ends_with?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - array_contains?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | null - lt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - lte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - gt?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - gte?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> - not?: runtime.InputJsonValue | Prisma.JsonFieldRefInput<$PrismaModel> | Prisma.JsonNullValueFilter -} - export type NestedBoolNullableFilter<$PrismaModel = never> = { equals?: boolean | Prisma.BooleanFieldRefInput<$PrismaModel> | null not?: Prisma.NestedBoolNullableFilter<$PrismaModel> | boolean | null diff --git a/prisma/postgres/generated/prisma/client/postgres/internal/class.ts b/prisma/postgres/generated/prisma/client/postgres/internal/class.ts index eb335b9..95e4244 100644 --- a/prisma/postgres/generated/prisma/client/postgres/internal/class.ts +++ b/prisma/postgres/generated/prisma/client/postgres/internal/class.ts @@ -22,7 +22,7 @@ const config: runtime.GetPrismaClientConfig = { "clientVersion": "7.3.0", "engineVersion": "9d6ad21cbbceab97458517b147a6a09ff43aa735", "activeProvider": "postgresql", - "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"generated/prisma/client/postgres\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel Users {\n id String @id @default(dbgenerated(\"gen_random_uuid()\")) @db.Uuid\n first_name String\n last_name String\n email String @unique\n phone_number String\n residence String?\n role Roles @default(EMPLOYEE)\n employee Employees? @relation(\"UserEmployee\")\n oauth_sessions OAuthSessions[] @relation(\"UserOAuthSessions\")\n preferences Preferences? @relation(\"UserPreferences\")\n user_module_access userModuleAccess? @relation(\"UserModuleAccess\")\n\n @@map(\"users\")\n}\n\nmodel userModuleAccess {\n id Int @id @default(autoincrement())\n user_id String @unique @db.Uuid\n timesheets Boolean @default(true)\n timesheets_approval Boolean @default(false)\n employee_list Boolean @default(true)\n employee_management Boolean @default(false)\n personal_profile Boolean @default(true)\n dashboard Boolean @default(true)\n chatbot Boolean @default(false)\n user Users @relation(\"UserModuleAccess\", fields: [user_id], references: [id])\n\n @@map(\"user_module_access\")\n}\n\nmodel Employees {\n id Int @id @default(autoincrement())\n user_id String @unique @db.Uuid\n external_payroll_id Int\n company_code Int\n daily_expected_hours Int\n first_work_day DateTime @db.Date\n last_work_day DateTime? @db.Date\n supervisor_id Int?\n job_title String?\n is_supervisor Boolean @default(false)\n // banked_hour_limit Int @default(0) //will need to be implemented in the future\n schedule_preset_id Int?\n schedule_preset SchedulePresets? @relation(\"EmployeesSchedulePreset\", fields: [schedule_preset_id], references: [id])\n supervisor Employees? @relation(\"EmployeeSupervisor\", fields: [supervisor_id], references: [id])\n crew Employees[] @relation(\"EmployeeSupervisor\")\n user Users @relation(\"UserEmployee\", fields: [user_id], references: [id])\n leave_request LeaveRequests[] @relation(\"LeaveRequestEmployee\")\n timesheet Timesheets[] @relation(\"TimesheetEmployee\")\n paid_time_off PaidTimeOff? @relation(\"EmployeePaidTimeOff\")\n\n @@map(\"employees\")\n}\n\nmodel LeaveRequests {\n id Int @id @default(autoincrement())\n employee_id Int\n leave_type LeaveTypes\n comment String\n approval_status LeaveApprovalStatus @default(PENDING)\n bank_code_id Int\n payable_hours Decimal? @db.Decimal(5, 2)\n requested_hours Decimal? @db.Decimal(5, 2)\n dates DateTime[] @db.Date\n bank_code BankCodes @relation(\"LeaveRequestBankCodes\", fields: [bank_code_id], references: [id])\n employee Employees @relation(\"LeaveRequestEmployee\", fields: [employee_id], references: [id])\n archive LeaveRequestsArchive? @relation(\"LeaveRequestToArchive\")\n\n @@unique([employee_id, leave_type, dates], name: \"leave_per_employee_date\")\n @@index([employee_id, dates])\n @@map(\"leave_requests\")\n}\n\nmodel LeaveRequestsArchive {\n id Int @id @default(autoincrement())\n leave_request_id Int @unique\n archived_at DateTime @default(now())\n employee_id Int\n leave_type LeaveTypes\n comment String\n approval_status LeaveApprovalStatus\n date DateTime @db.Date\n payable_hours Decimal? @db.Decimal(5, 2)\n requested_hours Decimal? @db.Decimal(5, 2)\n leave_request LeaveRequests @relation(\"LeaveRequestToArchive\", fields: [leave_request_id], references: [id])\n\n @@index([employee_id, date])\n @@map(\"leave_requests_archive\")\n}\n\nmodel Timesheets {\n id Int @id @default(autoincrement())\n employee_id Int\n is_approved Boolean @default(false)\n start_date DateTime @db.Date\n // hours_to_bank Decimal? @db.Decimal(5, 2) //will need to be implemented in the future\n expense Expenses[] @relation(\"ExpensesTimesheet\")\n shift Shifts[] @relation(\"ShiftTimesheet\")\n employee Employees @relation(\"TimesheetEmployee\", fields: [employee_id], references: [id])\n archive TimesheetsArchive[] @relation(\"TimesheetsToArchive\")\n\n // @@unique([employee_id, start_date], name: \"employee_id_start_date\")\n @@map(\"timesheets\")\n}\n\nmodel TimesheetsArchive {\n id Int @id @default(autoincrement())\n timesheet_id Int\n archive_at DateTime @default(now())\n employee_id Int\n is_approved Boolean\n timesheet Timesheets @relation(\"TimesheetsToArchive\", fields: [timesheet_id], references: [id])\n\n @@map(\"timesheets_archive\")\n}\n\nmodel SchedulePresets {\n id Int @id @default(autoincrement())\n name String\n is_default Boolean @default(false)\n employees Employees[] @relation(\"EmployeesSchedulePreset\")\n shifts SchedulePresetShifts[] @relation(\"SchedulePresetShiftsSchedulePreset\")\n\n @@map(\"schedule_presets\")\n}\n\nmodel SchedulePresetShifts {\n id Int @id @default(autoincrement())\n preset_id Int\n bank_code_id Int\n\n start_time DateTime @db.Time(0)\n end_time DateTime @db.Time(0)\n is_remote Boolean @default(false)\n week_day Weekday\n bank_code BankCodes @relation(\"SchedulePresetShiftsBankCodes\", fields: [bank_code_id], references: [id])\n preset SchedulePresets @relation(\"SchedulePresetShiftsSchedulePreset\", fields: [preset_id], references: [id])\n\n @@index([preset_id, week_day])\n @@map(\"schedule_preset_shifts\")\n}\n\nmodel Shifts {\n id Int @id @default(autoincrement())\n timesheet_id Int\n date DateTime @db.Date\n start_time DateTime @db.Time(0)\n end_time DateTime @db.Time(0)\n bank_code_id Int\n is_approved Boolean @default(false)\n is_remote Boolean @default(false)\n comment String?\n bank_code BankCodes @relation(\"ShiftBankCodes\", fields: [bank_code_id], references: [id])\n timesheet Timesheets @relation(\"ShiftTimesheet\", fields: [timesheet_id], references: [id])\n archive ShiftsArchive[] @relation(\"ShiftsToArchive\")\n\n // @@unique([timesheet_id, date, start_time], name: \"unique_ts_id_date_start_time\")\n @@map(\"shifts\")\n}\n\nmodel ShiftsArchive {\n id Int @id @default(autoincrement())\n shift_id Int\n archive_at DateTime @default(now())\n timesheet_id Int\n date DateTime @db.Date\n start_time DateTime @db.Time(0)\n end_time DateTime @db.Time(0)\n bank_code_id Int\n comment String?\n shift Shifts @relation(\"ShiftsToArchive\", fields: [shift_id], references: [id])\n\n @@map(\"shifts_archive\")\n}\n\nmodel BankCodes {\n id Int @id @default(autoincrement())\n type String\n categorie String\n modifier Float\n bank_code String\n expenses Expenses[] @relation(\"ExpenseBankCodes\")\n leaveRequests LeaveRequests[] @relation(\"LeaveRequestBankCodes\")\n SchedulePresetShifts SchedulePresetShifts[] @relation(\"SchedulePresetShiftsBankCodes\")\n shifts Shifts[] @relation(\"ShiftBankCodes\")\n\n @@map(\"bank_codes\")\n}\n\nmodel Expenses {\n id Int @id @default(autoincrement())\n timesheet_id Int\n date DateTime @db.Date\n amount Decimal? @db.Decimal(12, 2)\n is_approved Boolean @default(false)\n supervisor_comment String?\n bank_code_id Int\n comment String\n attachment_key String?\n attachment_name String?\n mileage Decimal? @db.Decimal(12, 2)\n bank_code BankCodes @relation(\"ExpenseBankCodes\", fields: [bank_code_id], references: [id])\n timesheet Timesheets @relation(\"ExpensesTimesheet\", fields: [timesheet_id], references: [id])\n archive ExpensesArchive[] @relation(\"ExpensesToArchive\")\n\n @@unique([timesheet_id, date, amount, mileage], name: \"unique_ts_id_date_amount_mileage\")\n @@map(\"expenses\")\n}\n\nmodel ExpensesArchive {\n id Int @id @default(autoincrement())\n expense_id Int\n timesheet_id Int\n archived_at DateTime @default(now())\n date DateTime @db.Date\n amount Decimal? @db.Decimal(12, 2)\n is_approved Boolean\n supervisor_comment String?\n bank_code_id Int\n comment String?\n mileage Decimal? @db.Decimal(12, 2)\n expense Expenses @relation(\"ExpensesToArchive\", fields: [expense_id], references: [id])\n\n @@map(\"expenses_archive\")\n}\n\nmodel OAuthSessions {\n id String @id @default(cuid())\n user_id String @db.Uuid\n application String\n access_token String @unique\n refresh_token String @unique\n access_token_expiry DateTime\n refresh_token_expiry DateTime?\n is_revoked Boolean @default(false)\n scopes Json @default(\"[]\")\n created_at DateTime @default(now())\n updated_at DateTime?\n sid String @unique\n user Users @relation(\"UserOAuthSessions\", fields: [user_id], references: [id])\n\n @@map(\"oauth_sessions\")\n}\n\nmodel Sessions {\n id String @id\n sid String @unique\n data String\n expiresAt DateTime\n\n @@map(\"sessions\")\n}\n\nmodel Preferences {\n user_id String @unique @db.Uuid\n id Int @id @default(autoincrement())\n display_language String @default(\"fr-FR\")\n is_dark_mode Boolean? @default(false)\n is_employee_list_grid Boolean @default(true)\n is_lefty_mode Boolean @default(false)\n is_timesheet_approval_grid Boolean @default(true)\n notifications Boolean @default(true)\n user Users @relation(\"UserPreferences\", fields: [user_id], references: [id])\n\n @@map(\"preferences\")\n}\n\nmodel PaidTimeOff {\n id Int @id @default(autoincrement())\n employee_id Int @unique\n vacation_hours Decimal @default(0) @db.Decimal(12, 2)\n banked_hours Decimal @default(0) @db.Decimal(12, 2)\n sick_hours Decimal @default(0) @db.Decimal(12, 2)\n last_updated DateTime? @db.Date\n\n employee Employees @relation(\"EmployeePaidTimeOff\", fields: [employee_id], references: [id])\n\n @@map(\"paid_time_off\")\n}\n\nview PayPeriods {\n pay_year Int\n pay_period_no Int\n period_start DateTime @db.Date\n period_end DateTime @db.Date\n payday DateTime @db.Date\n label String\n\n @@map(\"pay_period\")\n}\n\nenum AttachmentStatus {\n ACTIVE\n DELETED\n}\n\nenum RetentionPolicy {\n EXPENSE_7Y\n TICKET_2Y\n PROFILE_KEEP_LAST3\n}\n\nenum Roles {\n ADMIN\n SUPERVISOR\n HR\n ACCOUNTING\n EMPLOYEE\n DEALER\n CUSTOMER\n GUEST\n\n @@map(\"roles\")\n}\n\nenum Modules {\n timesheets\n timesheets_approval\n employee_list\n employee_management\n personal_profile\n dashboard\n chatbot\n\n @@map(\"modules\")\n}\n\nenum LeaveTypes {\n SICK\n VACATION\n UNPAID\n BEREAVEMENT\n PARENTAL\n LEGAL\n WEDDING\n HOLIDAY\n\n @@map(\"leave_types\")\n}\n\nenum LeaveApprovalStatus {\n PENDING\n APPROVED\n DENIED\n CANCELLED\n ESCALATED\n\n @@map(\"leave_approval_status\")\n}\n\nenum Weekday {\n SUN\n MON\n TUE\n WED\n THU\n FRI\n SAT\n}\n", + "inlineSchema": "generator client {\n provider = \"prisma-client\"\n output = \"generated/prisma/client/postgres\"\n previewFeatures = [\"views\"]\n}\n\ndatasource db {\n provider = \"postgresql\"\n}\n\nmodel Users {\n id String @id @default(dbgenerated(\"gen_random_uuid()\")) @db.Uuid\n first_name String\n last_name String\n email String @unique\n phone_number String\n residence String?\n role Roles @default(EMPLOYEE)\n notifications Notifications? @relation(\"UserNotification\")\n employee Employees? @relation(\"UserEmployee\")\n oauth_sessions OAuthSessions[] @relation(\"UserOAuthSessions\")\n preferences Preferences? @relation(\"UserPreferences\")\n user_module_access userModuleAccess? @relation(\"UserModuleAccess\")\n\n @@map(\"users\")\n}\n\nmodel Notifications {\n id Int @id @default(autoincrement())\n user_id String @unique @db.Uuid\n affected_module Modules\n subject String\n description String\n metadata Json @db.JsonB\n created_at DateTime @default(now())\n viewed_at DateTime?\n user Users @relation(\"UserNotification\", fields: [user_id], references: [id])\n\n @@map(\"notifications\")\n}\n\nmodel userModuleAccess {\n id Int @id @default(autoincrement())\n user_id String @unique @db.Uuid\n timesheets Boolean @default(true)\n timesheets_approval Boolean @default(false)\n employee_list Boolean @default(true)\n employee_management Boolean @default(false)\n personal_profile Boolean @default(true)\n dashboard Boolean @default(true)\n chatbot Boolean @default(false)\n user Users @relation(\"UserModuleAccess\", fields: [user_id], references: [id])\n\n @@map(\"user_module_access\")\n}\n\nmodel Employees {\n id Int @id @default(autoincrement())\n user_id String @unique @db.Uuid\n external_payroll_id Int\n company_code Int\n daily_expected_hours Int\n first_work_day DateTime @db.Date\n last_work_day DateTime? @db.Date\n supervisor_id Int?\n job_title String?\n is_supervisor Boolean @default(false)\n // banked_hour_limit Int @default(0) //will need to be implemented in the future\n schedule_preset_id Int?\n schedule_preset SchedulePresets? @relation(\"EmployeesSchedulePreset\", fields: [schedule_preset_id], references: [id])\n supervisor Employees? @relation(\"EmployeeSupervisor\", fields: [supervisor_id], references: [id])\n crew Employees[] @relation(\"EmployeeSupervisor\")\n user Users @relation(\"UserEmployee\", fields: [user_id], references: [id])\n leave_request LeaveRequests[] @relation(\"LeaveRequestEmployee\")\n timesheet Timesheets[] @relation(\"TimesheetEmployee\")\n paid_time_off PaidTimeOff? @relation(\"EmployeePaidTimeOff\")\n\n @@map(\"employees\")\n}\n\nmodel LeaveRequests {\n id Int @id @default(autoincrement())\n employee_id Int\n leave_type LeaveTypes\n comment String\n approval_status LeaveApprovalStatus @default(PENDING)\n bank_code_id Int\n payable_hours Decimal? @db.Decimal(5, 2)\n requested_hours Decimal? @db.Decimal(5, 2)\n dates DateTime[] @db.Date\n bank_code BankCodes @relation(\"LeaveRequestBankCodes\", fields: [bank_code_id], references: [id])\n employee Employees @relation(\"LeaveRequestEmployee\", fields: [employee_id], references: [id])\n archive LeaveRequestsArchive? @relation(\"LeaveRequestToArchive\")\n\n @@unique([employee_id, leave_type, dates], name: \"leave_per_employee_date\")\n @@index([employee_id, dates])\n @@map(\"leave_requests\")\n}\n\nmodel LeaveRequestsArchive {\n id Int @id @default(autoincrement())\n leave_request_id Int @unique\n archived_at DateTime @default(now())\n employee_id Int\n leave_type LeaveTypes\n comment String\n approval_status LeaveApprovalStatus\n date DateTime @db.Date\n payable_hours Decimal? @db.Decimal(5, 2)\n requested_hours Decimal? @db.Decimal(5, 2)\n leave_request LeaveRequests @relation(\"LeaveRequestToArchive\", fields: [leave_request_id], references: [id])\n\n @@index([employee_id, date])\n @@map(\"leave_requests_archive\")\n}\n\nmodel Timesheets {\n id Int @id @default(autoincrement())\n employee_id Int\n is_approved Boolean @default(false)\n start_date DateTime @db.Date\n // hours_to_bank Decimal? @db.Decimal(5, 2) //will need to be implemented in the future\n expense Expenses[] @relation(\"ExpensesTimesheet\")\n shift Shifts[] @relation(\"ShiftTimesheet\")\n employee Employees @relation(\"TimesheetEmployee\", fields: [employee_id], references: [id])\n archive TimesheetsArchive[] @relation(\"TimesheetsToArchive\")\n\n // @@unique([employee_id, start_date], name: \"employee_id_start_date\")\n @@map(\"timesheets\")\n}\n\nmodel TimesheetsArchive {\n id Int @id @default(autoincrement())\n timesheet_id Int\n archive_at DateTime @default(now())\n employee_id Int\n is_approved Boolean\n timesheet Timesheets @relation(\"TimesheetsToArchive\", fields: [timesheet_id], references: [id])\n\n @@map(\"timesheets_archive\")\n}\n\nmodel SchedulePresets {\n id Int @id @default(autoincrement())\n name String\n is_default Boolean @default(false)\n employees Employees[] @relation(\"EmployeesSchedulePreset\")\n shifts SchedulePresetShifts[] @relation(\"SchedulePresetShiftsSchedulePreset\")\n\n @@map(\"schedule_presets\")\n}\n\nmodel SchedulePresetShifts {\n id Int @id @default(autoincrement())\n preset_id Int\n bank_code_id Int\n\n start_time DateTime @db.Time(0)\n end_time DateTime @db.Time(0)\n is_remote Boolean @default(false)\n week_day Weekday\n bank_code BankCodes @relation(\"SchedulePresetShiftsBankCodes\", fields: [bank_code_id], references: [id])\n preset SchedulePresets @relation(\"SchedulePresetShiftsSchedulePreset\", fields: [preset_id], references: [id])\n\n @@index([preset_id, week_day])\n @@map(\"schedule_preset_shifts\")\n}\n\nmodel Shifts {\n id Int @id @default(autoincrement())\n timesheet_id Int\n date DateTime @db.Date\n start_time DateTime @db.Time(0)\n end_time DateTime @db.Time(0)\n bank_code_id Int\n is_approved Boolean @default(false)\n is_remote Boolean @default(false)\n comment String?\n bank_code BankCodes @relation(\"ShiftBankCodes\", fields: [bank_code_id], references: [id])\n timesheet Timesheets @relation(\"ShiftTimesheet\", fields: [timesheet_id], references: [id])\n archive ShiftsArchive[] @relation(\"ShiftsToArchive\")\n\n // @@unique([timesheet_id, date, start_time], name: \"unique_ts_id_date_start_time\")\n @@map(\"shifts\")\n}\n\nmodel ShiftsArchive {\n id Int @id @default(autoincrement())\n shift_id Int\n archive_at DateTime @default(now())\n timesheet_id Int\n date DateTime @db.Date\n start_time DateTime @db.Time(0)\n end_time DateTime @db.Time(0)\n bank_code_id Int\n comment String?\n shift Shifts @relation(\"ShiftsToArchive\", fields: [shift_id], references: [id])\n\n @@map(\"shifts_archive\")\n}\n\nmodel BankCodes {\n id Int @id @default(autoincrement())\n type String\n categorie String\n modifier Float\n bank_code String\n expenses Expenses[] @relation(\"ExpenseBankCodes\")\n leaveRequests LeaveRequests[] @relation(\"LeaveRequestBankCodes\")\n SchedulePresetShifts SchedulePresetShifts[] @relation(\"SchedulePresetShiftsBankCodes\")\n shifts Shifts[] @relation(\"ShiftBankCodes\")\n\n @@map(\"bank_codes\")\n}\n\nmodel Expenses {\n id Int @id @default(autoincrement())\n timesheet_id Int\n date DateTime @db.Date\n amount Decimal? @db.Decimal(12, 2)\n is_approved Boolean @default(false)\n supervisor_comment String?\n bank_code_id Int\n comment String\n attachment_key String?\n attachment_name String?\n mileage Decimal? @db.Decimal(12, 2)\n bank_code BankCodes @relation(\"ExpenseBankCodes\", fields: [bank_code_id], references: [id])\n timesheet Timesheets @relation(\"ExpensesTimesheet\", fields: [timesheet_id], references: [id])\n archive ExpensesArchive[] @relation(\"ExpensesToArchive\")\n\n @@unique([timesheet_id, date, amount, mileage], name: \"unique_ts_id_date_amount_mileage\")\n @@map(\"expenses\")\n}\n\nmodel ExpensesArchive {\n id Int @id @default(autoincrement())\n expense_id Int\n timesheet_id Int\n archived_at DateTime @default(now())\n date DateTime @db.Date\n amount Decimal? @db.Decimal(12, 2)\n is_approved Boolean\n supervisor_comment String?\n bank_code_id Int\n comment String?\n mileage Decimal? @db.Decimal(12, 2)\n expense Expenses @relation(\"ExpensesToArchive\", fields: [expense_id], references: [id])\n\n @@map(\"expenses_archive\")\n}\n\nmodel OAuthSessions {\n id String @id @default(cuid())\n user_id String @db.Uuid\n application String\n access_token String @unique\n refresh_token String @unique\n access_token_expiry DateTime\n refresh_token_expiry DateTime?\n is_revoked Boolean @default(false)\n scopes Json @default(\"[]\")\n created_at DateTime @default(now())\n updated_at DateTime?\n sid String @unique\n user Users @relation(\"UserOAuthSessions\", fields: [user_id], references: [id])\n\n @@map(\"oauth_sessions\")\n}\n\nmodel Sessions {\n id String @id\n sid String @unique\n data String\n expiresAt DateTime\n\n @@map(\"sessions\")\n}\n\nmodel Preferences {\n user_id String @unique @db.Uuid\n id Int @id @default(autoincrement())\n display_language String @default(\"fr-FR\")\n is_dark_mode Boolean? @default(false)\n is_employee_list_grid Boolean @default(true)\n is_lefty_mode Boolean @default(false)\n is_timesheet_approval_grid Boolean @default(true)\n notifications Boolean @default(true)\n user Users @relation(\"UserPreferences\", fields: [user_id], references: [id])\n\n @@map(\"preferences\")\n}\n\nmodel PaidTimeOff {\n id Int @id @default(autoincrement())\n employee_id Int @unique\n vacation_hours Decimal @default(0) @db.Decimal(12, 2)\n banked_hours Decimal @default(0) @db.Decimal(12, 2)\n sick_hours Decimal @default(0) @db.Decimal(12, 2)\n last_updated DateTime? @db.Date\n\n employee Employees @relation(\"EmployeePaidTimeOff\", fields: [employee_id], references: [id])\n\n @@map(\"paid_time_off\")\n}\n\nview PayPeriods {\n pay_year Int\n pay_period_no Int\n period_start DateTime @db.Date\n period_end DateTime @db.Date\n payday DateTime @db.Date\n label String\n\n @@map(\"pay_period\")\n}\n\nenum AttachmentStatus {\n ACTIVE\n DELETED\n}\n\nenum RetentionPolicy {\n EXPENSE_7Y\n TICKET_2Y\n PROFILE_KEEP_LAST3\n}\n\nenum Roles {\n ADMIN\n SUPERVISOR\n HR\n ACCOUNTING\n EMPLOYEE\n DEALER\n CUSTOMER\n GUEST\n\n @@map(\"roles\")\n}\n\nenum Modules {\n timesheets\n timesheets_approval\n employee_list\n employee_management\n personal_profile\n dashboard\n chatbot\n\n @@map(\"modules\")\n}\n\nenum LeaveTypes {\n SICK\n VACATION\n UNPAID\n BEREAVEMENT\n PARENTAL\n LEGAL\n WEDDING\n HOLIDAY\n\n @@map(\"leave_types\")\n}\n\nenum LeaveApprovalStatus {\n PENDING\n APPROVED\n DENIED\n CANCELLED\n ESCALATED\n\n @@map(\"leave_approval_status\")\n}\n\nenum Weekday {\n SUN\n MON\n TUE\n WED\n THU\n FRI\n SAT\n}\n", "runtimeDataModel": { "models": {}, "enums": {}, @@ -30,7 +30,7 @@ const config: runtime.GetPrismaClientConfig = { } } -config.runtimeDataModel = JSON.parse("{\"models\":{\"Users\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"phone_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"residence\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Roles\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"UserEmployee\"},{\"name\":\"oauth_sessions\",\"kind\":\"object\",\"type\":\"OAuthSessions\",\"relationName\":\"UserOAuthSessions\"},{\"name\":\"preferences\",\"kind\":\"object\",\"type\":\"Preferences\",\"relationName\":\"UserPreferences\"},{\"name\":\"user_module_access\",\"kind\":\"object\",\"type\":\"userModuleAccess\",\"relationName\":\"UserModuleAccess\"}],\"dbName\":\"users\"},\"userModuleAccess\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"timesheets\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"timesheets_approval\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"employee_list\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"employee_management\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"personal_profile\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"dashboard\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"chatbot\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserModuleAccess\"}],\"dbName\":\"user_module_access\"},\"Employees\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"external_payroll_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"company_code\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"daily_expected_hours\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"first_work_day\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"last_work_day\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"supervisor_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"job_title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_supervisor\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"schedule_preset_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"schedule_preset\",\"kind\":\"object\",\"type\":\"SchedulePresets\",\"relationName\":\"EmployeesSchedulePreset\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeeSupervisor\"},{\"name\":\"crew\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeeSupervisor\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserEmployee\"},{\"name\":\"leave_request\",\"kind\":\"object\",\"type\":\"LeaveRequests\",\"relationName\":\"LeaveRequestEmployee\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"TimesheetEmployee\"},{\"name\":\"paid_time_off\",\"kind\":\"object\",\"type\":\"PaidTimeOff\",\"relationName\":\"EmployeePaidTimeOff\"}],\"dbName\":\"employees\"},\"LeaveRequests\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"leave_type\",\"kind\":\"enum\",\"type\":\"LeaveTypes\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"approval_status\",\"kind\":\"enum\",\"type\":\"LeaveApprovalStatus\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"payable_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"requested_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"dates\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"LeaveRequestBankCodes\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"LeaveRequestEmployee\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"LeaveRequestsArchive\",\"relationName\":\"LeaveRequestToArchive\"}],\"dbName\":\"leave_requests\"},\"LeaveRequestsArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"leave_request_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archived_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"leave_type\",\"kind\":\"enum\",\"type\":\"LeaveTypes\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"approval_status\",\"kind\":\"enum\",\"type\":\"LeaveApprovalStatus\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"payable_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"requested_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"leave_request\",\"kind\":\"object\",\"type\":\"LeaveRequests\",\"relationName\":\"LeaveRequestToArchive\"}],\"dbName\":\"leave_requests_archive\"},\"Timesheets\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"start_date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expense\",\"kind\":\"object\",\"type\":\"Expenses\",\"relationName\":\"ExpensesTimesheet\"},{\"name\":\"shift\",\"kind\":\"object\",\"type\":\"Shifts\",\"relationName\":\"ShiftTimesheet\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"TimesheetEmployee\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"TimesheetsArchive\",\"relationName\":\"TimesheetsToArchive\"}],\"dbName\":\"timesheets\"},\"TimesheetsArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archive_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"TimesheetsToArchive\"}],\"dbName\":\"timesheets_archive\"},\"SchedulePresets\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"employees\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeesSchedulePreset\"},{\"name\":\"shifts\",\"kind\":\"object\",\"type\":\"SchedulePresetShifts\",\"relationName\":\"SchedulePresetShiftsSchedulePreset\"}],\"dbName\":\"schedule_presets\"},\"SchedulePresetShifts\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"preset_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"start_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"end_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"is_remote\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"week_day\",\"kind\":\"enum\",\"type\":\"Weekday\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"SchedulePresetShiftsBankCodes\"},{\"name\":\"preset\",\"kind\":\"object\",\"type\":\"SchedulePresets\",\"relationName\":\"SchedulePresetShiftsSchedulePreset\"}],\"dbName\":\"schedule_preset_shifts\"},\"Shifts\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"start_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"end_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_remote\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"ShiftBankCodes\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"ShiftTimesheet\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"ShiftsArchive\",\"relationName\":\"ShiftsToArchive\"}],\"dbName\":\"shifts\"},\"ShiftsArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"shift_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archive_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"start_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"end_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"shift\",\"kind\":\"object\",\"type\":\"Shifts\",\"relationName\":\"ShiftsToArchive\"}],\"dbName\":\"shifts_archive\"},\"BankCodes\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"categorie\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"modifier\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"bank_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expenses\",\"kind\":\"object\",\"type\":\"Expenses\",\"relationName\":\"ExpenseBankCodes\"},{\"name\":\"leaveRequests\",\"kind\":\"object\",\"type\":\"LeaveRequests\",\"relationName\":\"LeaveRequestBankCodes\"},{\"name\":\"SchedulePresetShifts\",\"kind\":\"object\",\"type\":\"SchedulePresetShifts\",\"relationName\":\"SchedulePresetShiftsBankCodes\"},{\"name\":\"shifts\",\"kind\":\"object\",\"type\":\"Shifts\",\"relationName\":\"ShiftBankCodes\"}],\"dbName\":\"bank_codes\"},\"Expenses\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"supervisor_comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachment_key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachment_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mileage\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"ExpenseBankCodes\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"ExpensesTimesheet\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"ExpensesArchive\",\"relationName\":\"ExpensesToArchive\"}],\"dbName\":\"expenses\"},\"ExpensesArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"expense_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archived_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"supervisor_comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mileage\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"expense\",\"kind\":\"object\",\"type\":\"Expenses\",\"relationName\":\"ExpensesToArchive\"}],\"dbName\":\"expenses_archive\"},\"OAuthSessions\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"application\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"access_token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"refresh_token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"access_token_expiry\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refresh_token_expiry\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"is_revoked\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"scopes\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserOAuthSessions\"}],\"dbName\":\"oauth_sessions\"},\"Sessions\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"data\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"sessions\"},\"Preferences\":{\"fields\":[{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"display_language\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_dark_mode\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_employee_list_grid\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_lefty_mode\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_timesheet_approval_grid\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"notifications\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserPreferences\"}],\"dbName\":\"preferences\"},\"PaidTimeOff\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"vacation_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"banked_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"sick_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"last_updated\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeePaidTimeOff\"}],\"dbName\":\"paid_time_off\"},\"PayPeriods\":{\"fields\":[{\"name\":\"pay_year\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"pay_period_no\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"period_start\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"period_end\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"payday\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"label\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"pay_period\"}},\"enums\":{},\"types\":{}}") +config.runtimeDataModel = JSON.parse("{\"models\":{\"Users\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"first_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"last_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"email\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"phone_number\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"residence\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"role\",\"kind\":\"enum\",\"type\":\"Roles\"},{\"name\":\"notifications\",\"kind\":\"object\",\"type\":\"Notifications\",\"relationName\":\"UserNotification\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"UserEmployee\"},{\"name\":\"oauth_sessions\",\"kind\":\"object\",\"type\":\"OAuthSessions\",\"relationName\":\"UserOAuthSessions\"},{\"name\":\"preferences\",\"kind\":\"object\",\"type\":\"Preferences\",\"relationName\":\"UserPreferences\"},{\"name\":\"user_module_access\",\"kind\":\"object\",\"type\":\"userModuleAccess\",\"relationName\":\"UserModuleAccess\"}],\"dbName\":\"users\"},\"Notifications\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"affected_module\",\"kind\":\"enum\",\"type\":\"Modules\"},{\"name\":\"subject\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"description\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"metadata\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"viewed_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserNotification\"}],\"dbName\":\"notifications\"},\"userModuleAccess\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"timesheets\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"timesheets_approval\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"employee_list\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"employee_management\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"personal_profile\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"dashboard\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"chatbot\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserModuleAccess\"}],\"dbName\":\"user_module_access\"},\"Employees\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"external_payroll_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"company_code\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"daily_expected_hours\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"first_work_day\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"last_work_day\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"supervisor_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"job_title\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_supervisor\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"schedule_preset_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"schedule_preset\",\"kind\":\"object\",\"type\":\"SchedulePresets\",\"relationName\":\"EmployeesSchedulePreset\"},{\"name\":\"supervisor\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeeSupervisor\"},{\"name\":\"crew\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeeSupervisor\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserEmployee\"},{\"name\":\"leave_request\",\"kind\":\"object\",\"type\":\"LeaveRequests\",\"relationName\":\"LeaveRequestEmployee\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"TimesheetEmployee\"},{\"name\":\"paid_time_off\",\"kind\":\"object\",\"type\":\"PaidTimeOff\",\"relationName\":\"EmployeePaidTimeOff\"}],\"dbName\":\"employees\"},\"LeaveRequests\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"leave_type\",\"kind\":\"enum\",\"type\":\"LeaveTypes\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"approval_status\",\"kind\":\"enum\",\"type\":\"LeaveApprovalStatus\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"payable_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"requested_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"dates\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"LeaveRequestBankCodes\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"LeaveRequestEmployee\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"LeaveRequestsArchive\",\"relationName\":\"LeaveRequestToArchive\"}],\"dbName\":\"leave_requests\"},\"LeaveRequestsArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"leave_request_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archived_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"leave_type\",\"kind\":\"enum\",\"type\":\"LeaveTypes\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"approval_status\",\"kind\":\"enum\",\"type\":\"LeaveApprovalStatus\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"payable_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"requested_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"leave_request\",\"kind\":\"object\",\"type\":\"LeaveRequests\",\"relationName\":\"LeaveRequestToArchive\"}],\"dbName\":\"leave_requests_archive\"},\"Timesheets\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"start_date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"expense\",\"kind\":\"object\",\"type\":\"Expenses\",\"relationName\":\"ExpensesTimesheet\"},{\"name\":\"shift\",\"kind\":\"object\",\"type\":\"Shifts\",\"relationName\":\"ShiftTimesheet\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"TimesheetEmployee\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"TimesheetsArchive\",\"relationName\":\"TimesheetsToArchive\"}],\"dbName\":\"timesheets\"},\"TimesheetsArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archive_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"TimesheetsToArchive\"}],\"dbName\":\"timesheets_archive\"},\"SchedulePresets\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_default\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"employees\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeesSchedulePreset\"},{\"name\":\"shifts\",\"kind\":\"object\",\"type\":\"SchedulePresetShifts\",\"relationName\":\"SchedulePresetShiftsSchedulePreset\"}],\"dbName\":\"schedule_presets\"},\"SchedulePresetShifts\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"preset_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"start_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"end_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"is_remote\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"week_day\",\"kind\":\"enum\",\"type\":\"Weekday\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"SchedulePresetShiftsBankCodes\"},{\"name\":\"preset\",\"kind\":\"object\",\"type\":\"SchedulePresets\",\"relationName\":\"SchedulePresetShiftsSchedulePreset\"}],\"dbName\":\"schedule_preset_shifts\"},\"Shifts\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"start_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"end_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_remote\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"ShiftBankCodes\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"ShiftTimesheet\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"ShiftsArchive\",\"relationName\":\"ShiftsToArchive\"}],\"dbName\":\"shifts\"},\"ShiftsArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"shift_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archive_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"start_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"end_time\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"shift\",\"kind\":\"object\",\"type\":\"Shifts\",\"relationName\":\"ShiftsToArchive\"}],\"dbName\":\"shifts_archive\"},\"BankCodes\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"type\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"categorie\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"modifier\",\"kind\":\"scalar\",\"type\":\"Float\"},{\"name\":\"bank_code\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expenses\",\"kind\":\"object\",\"type\":\"Expenses\",\"relationName\":\"ExpenseBankCodes\"},{\"name\":\"leaveRequests\",\"kind\":\"object\",\"type\":\"LeaveRequests\",\"relationName\":\"LeaveRequestBankCodes\"},{\"name\":\"SchedulePresetShifts\",\"kind\":\"object\",\"type\":\"SchedulePresetShifts\",\"relationName\":\"SchedulePresetShiftsBankCodes\"},{\"name\":\"shifts\",\"kind\":\"object\",\"type\":\"Shifts\",\"relationName\":\"ShiftBankCodes\"}],\"dbName\":\"bank_codes\"},\"Expenses\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"supervisor_comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachment_key\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"attachment_name\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mileage\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"bank_code\",\"kind\":\"object\",\"type\":\"BankCodes\",\"relationName\":\"ExpenseBankCodes\"},{\"name\":\"timesheet\",\"kind\":\"object\",\"type\":\"Timesheets\",\"relationName\":\"ExpensesTimesheet\"},{\"name\":\"archive\",\"kind\":\"object\",\"type\":\"ExpensesArchive\",\"relationName\":\"ExpensesToArchive\"}],\"dbName\":\"expenses\"},\"ExpensesArchive\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"expense_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"timesheet_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"archived_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"date\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"amount\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"is_approved\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"supervisor_comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"bank_code_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"comment\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"mileage\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"expense\",\"kind\":\"object\",\"type\":\"Expenses\",\"relationName\":\"ExpensesToArchive\"}],\"dbName\":\"expenses_archive\"},\"OAuthSessions\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"application\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"access_token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"refresh_token\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"access_token_expiry\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"refresh_token_expiry\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"is_revoked\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"scopes\",\"kind\":\"scalar\",\"type\":\"Json\"},{\"name\":\"created_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"updated_at\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"sid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserOAuthSessions\"}],\"dbName\":\"oauth_sessions\"},\"Sessions\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"sid\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"data\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"expiresAt\",\"kind\":\"scalar\",\"type\":\"DateTime\"}],\"dbName\":\"sessions\"},\"Preferences\":{\"fields\":[{\"name\":\"user_id\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"display_language\",\"kind\":\"scalar\",\"type\":\"String\"},{\"name\":\"is_dark_mode\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_employee_list_grid\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_lefty_mode\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"is_timesheet_approval_grid\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"notifications\",\"kind\":\"scalar\",\"type\":\"Boolean\"},{\"name\":\"user\",\"kind\":\"object\",\"type\":\"Users\",\"relationName\":\"UserPreferences\"}],\"dbName\":\"preferences\"},\"PaidTimeOff\":{\"fields\":[{\"name\":\"id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"employee_id\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"vacation_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"banked_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"sick_hours\",\"kind\":\"scalar\",\"type\":\"Decimal\"},{\"name\":\"last_updated\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"employee\",\"kind\":\"object\",\"type\":\"Employees\",\"relationName\":\"EmployeePaidTimeOff\"}],\"dbName\":\"paid_time_off\"},\"PayPeriods\":{\"fields\":[{\"name\":\"pay_year\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"pay_period_no\",\"kind\":\"scalar\",\"type\":\"Int\"},{\"name\":\"period_start\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"period_end\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"payday\",\"kind\":\"scalar\",\"type\":\"DateTime\"},{\"name\":\"label\",\"kind\":\"scalar\",\"type\":\"String\"}],\"dbName\":\"pay_period\"}},\"enums\":{},\"types\":{}}") async function decodeBase64AsWasm(wasmBase64: string): Promise { const { Buffer } = await import('node:buffer') @@ -188,6 +188,16 @@ export interface PrismaClient< */ get users(): Prisma.UsersDelegate; + /** + * `prisma.notifications`: Exposes CRUD operations for the **Notifications** model. + * Example usage: + * ```ts + * // Fetch zero or more Notifications + * const notifications = await prisma.notifications.findMany() + * ``` + */ + get notifications(): Prisma.NotificationsDelegate; + /** * `prisma.userModuleAccess`: Exposes CRUD operations for the **userModuleAccess** model. * Example usage: diff --git a/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespace.ts b/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespace.ts index 7ef3864..54415b3 100644 --- a/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespace.ts +++ b/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespace.ts @@ -385,6 +385,7 @@ type FieldRefInputType = Model extends never ? never : FieldRe export const ModelName = { Users: 'Users', + Notifications: 'Notifications', userModuleAccess: 'userModuleAccess', Employees: 'Employees', LeaveRequests: 'LeaveRequests', @@ -418,7 +419,7 @@ export type TypeMap + fields: Prisma.NotificationsFieldRefs + operations: { + findUnique: { + args: Prisma.NotificationsFindUniqueArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findUniqueOrThrow: { + args: Prisma.NotificationsFindUniqueOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findFirst: { + args: Prisma.NotificationsFindFirstArgs + result: runtime.Types.Utils.PayloadToResult | null + } + findFirstOrThrow: { + args: Prisma.NotificationsFindFirstOrThrowArgs + result: runtime.Types.Utils.PayloadToResult + } + findMany: { + args: Prisma.NotificationsFindManyArgs + result: runtime.Types.Utils.PayloadToResult[] + } + create: { + args: Prisma.NotificationsCreateArgs + result: runtime.Types.Utils.PayloadToResult + } + createMany: { + args: Prisma.NotificationsCreateManyArgs + result: BatchPayload + } + createManyAndReturn: { + args: Prisma.NotificationsCreateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + delete: { + args: Prisma.NotificationsDeleteArgs + result: runtime.Types.Utils.PayloadToResult + } + update: { + args: Prisma.NotificationsUpdateArgs + result: runtime.Types.Utils.PayloadToResult + } + deleteMany: { + args: Prisma.NotificationsDeleteManyArgs + result: BatchPayload + } + updateMany: { + args: Prisma.NotificationsUpdateManyArgs + result: BatchPayload + } + updateManyAndReturn: { + args: Prisma.NotificationsUpdateManyAndReturnArgs + result: runtime.Types.Utils.PayloadToResult[] + } + upsert: { + args: Prisma.NotificationsUpsertArgs + result: runtime.Types.Utils.PayloadToResult + } + aggregate: { + args: Prisma.NotificationsAggregateArgs + result: runtime.Types.Utils.Optional + } + groupBy: { + args: Prisma.NotificationsGroupByArgs + result: runtime.Types.Utils.Optional[] + } + count: { + args: Prisma.NotificationsCountArgs + result: runtime.Types.Utils.Optional | number + } + } + } userModuleAccess: { payload: Prisma.$userModuleAccessPayload fields: Prisma.userModuleAccessFieldRefs @@ -1836,6 +1911,20 @@ export const UsersScalarFieldEnum = { export type UsersScalarFieldEnum = (typeof UsersScalarFieldEnum)[keyof typeof UsersScalarFieldEnum] +export const NotificationsScalarFieldEnum = { + id: 'id', + user_id: 'user_id', + affected_module: 'affected_module', + subject: 'subject', + description: 'description', + metadata: 'metadata', + created_at: 'created_at', + viewed_at: 'viewed_at' +} as const + +export type NotificationsScalarFieldEnum = (typeof NotificationsScalarFieldEnum)[keyof typeof NotificationsScalarFieldEnum] + + export const UserModuleAccessScalarFieldEnum = { id: 'id', user_id: 'user_id', @@ -2172,9 +2261,30 @@ export type ListIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, /** - * Reference to a field of type 'Boolean' + * Reference to a field of type 'Modules' */ -export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> +export type EnumModulesFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Modules'> + + + +/** + * Reference to a field of type 'Modules[]' + */ +export type ListEnumModulesFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Modules[]'> + + + +/** + * Reference to a field of type 'Json' + */ +export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'> + + + +/** + * Reference to a field of type 'QueryMode' + */ +export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'> @@ -2192,6 +2302,13 @@ export type ListDateTimeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaM +/** + * Reference to a field of type 'Boolean' + */ +export type BooleanFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Boolean'> + + + /** * Reference to a field of type 'LeaveTypes' */ @@ -2261,20 +2378,6 @@ export type FloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, ' export type ListFloatFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Float[]'> - -/** - * Reference to a field of type 'Json' - */ -export type JsonFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Json'> - - - -/** - * Reference to a field of type 'QueryMode' - */ -export type EnumQueryModeFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'QueryMode'> - - /** * Batch Payload for updateMany & deleteMany & createMany */ @@ -2371,6 +2474,7 @@ export type PrismaClientOptions = ({ } export type GlobalOmitConfig = { users?: Prisma.UsersOmit + notifications?: Prisma.NotificationsOmit userModuleAccess?: Prisma.userModuleAccessOmit employees?: Prisma.EmployeesOmit leaveRequests?: Prisma.LeaveRequestsOmit diff --git a/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespaceBrowser.ts b/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespaceBrowser.ts index aa1adf4..fe9bbc0 100644 --- a/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespaceBrowser.ts +++ b/prisma/postgres/generated/prisma/client/postgres/internal/prismaNamespaceBrowser.ts @@ -52,6 +52,7 @@ export const AnyNull = runtime.AnyNull export const ModelName = { Users: 'Users', + Notifications: 'Notifications', userModuleAccess: 'userModuleAccess', Employees: 'Employees', LeaveRequests: 'LeaveRequests', @@ -101,6 +102,20 @@ export const UsersScalarFieldEnum = { export type UsersScalarFieldEnum = (typeof UsersScalarFieldEnum)[keyof typeof UsersScalarFieldEnum] +export const NotificationsScalarFieldEnum = { + id: 'id', + user_id: 'user_id', + affected_module: 'affected_module', + subject: 'subject', + description: 'description', + metadata: 'metadata', + created_at: 'created_at', + viewed_at: 'viewed_at' +} as const + +export type NotificationsScalarFieldEnum = (typeof NotificationsScalarFieldEnum)[keyof typeof NotificationsScalarFieldEnum] + + export const UserModuleAccessScalarFieldEnum = { id: 'id', user_id: 'user_id', diff --git a/prisma/postgres/generated/prisma/client/postgres/models.ts b/prisma/postgres/generated/prisma/client/postgres/models.ts index 3a7bc48..efa2520 100644 --- a/prisma/postgres/generated/prisma/client/postgres/models.ts +++ b/prisma/postgres/generated/prisma/client/postgres/models.ts @@ -9,6 +9,7 @@ * 🟢 You can import this file directly. */ export type * from './models/Users' +export type * from './models/Notifications' export type * from './models/userModuleAccess' export type * from './models/Employees' export type * from './models/LeaveRequests' diff --git a/prisma/postgres/generated/prisma/client/postgres/models/Employees.ts b/prisma/postgres/generated/prisma/client/postgres/models/Employees.ts index e782e30..4a98d40 100644 --- a/prisma/postgres/generated/prisma/client/postgres/models/Employees.ts +++ b/prisma/postgres/generated/prisma/client/postgres/models/Employees.ts @@ -614,14 +614,6 @@ export type EmployeesUncheckedCreateNestedManyWithoutSupervisorInput = { connect?: Prisma.EmployeesWhereUniqueInput | Prisma.EmployeesWhereUniqueInput[] } -export type DateTimeFieldUpdateOperationsInput = { - set?: Date | string -} - -export type NullableDateTimeFieldUpdateOperationsInput = { - set?: Date | string | null -} - export type EmployeesUpdateOneWithoutCrewNestedInput = { create?: Prisma.XOR connectOrCreate?: Prisma.EmployeesCreateOrConnectWithoutCrewInput diff --git a/prisma/postgres/generated/prisma/client/postgres/models/Users.ts b/prisma/postgres/generated/prisma/client/postgres/models/Users.ts index 46c7a84..5a40a8d 100644 --- a/prisma/postgres/generated/prisma/client/postgres/models/Users.ts +++ b/prisma/postgres/generated/prisma/client/postgres/models/Users.ts @@ -198,6 +198,7 @@ export type UsersWhereInput = { phone_number?: Prisma.StringFilter<"Users"> | string residence?: Prisma.StringNullableFilter<"Users"> | string | null role?: Prisma.EnumRolesFilter<"Users"> | $Enums.Roles + notifications?: Prisma.XOR | null employee?: Prisma.XOR | null oauth_sessions?: Prisma.OAuthSessionsListRelationFilter preferences?: Prisma.XOR | null @@ -212,6 +213,7 @@ export type UsersOrderByWithRelationInput = { phone_number?: Prisma.SortOrder residence?: Prisma.SortOrderInput | Prisma.SortOrder role?: Prisma.SortOrder + notifications?: Prisma.NotificationsOrderByWithRelationInput employee?: Prisma.EmployeesOrderByWithRelationInput oauth_sessions?: Prisma.OAuthSessionsOrderByRelationAggregateInput preferences?: Prisma.PreferencesOrderByWithRelationInput @@ -229,6 +231,7 @@ export type UsersWhereUniqueInput = Prisma.AtLeast<{ phone_number?: Prisma.StringFilter<"Users"> | string residence?: Prisma.StringNullableFilter<"Users"> | string | null role?: Prisma.EnumRolesFilter<"Users"> | $Enums.Roles + notifications?: Prisma.XOR | null employee?: Prisma.XOR | null oauth_sessions?: Prisma.OAuthSessionsListRelationFilter preferences?: Prisma.XOR | null @@ -269,6 +272,7 @@ export type UsersCreateInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsCreateNestedManyWithoutUserInput preferences?: Prisma.PreferencesCreateNestedOneWithoutUserInput @@ -283,6 +287,7 @@ export type UsersUncheckedCreateInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsUncheckedCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesUncheckedCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsUncheckedCreateNestedManyWithoutUserInput preferences?: Prisma.PreferencesUncheckedCreateNestedOneWithoutUserInput @@ -297,6 +302,7 @@ export type UsersUpdateInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUpdateManyWithoutUserNestedInput preferences?: Prisma.PreferencesUpdateOneWithoutUserNestedInput @@ -311,6 +317,7 @@ export type UsersUncheckedUpdateInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUncheckedUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUncheckedUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUncheckedUpdateManyWithoutUserNestedInput preferences?: Prisma.PreferencesUncheckedUpdateOneWithoutUserNestedInput @@ -394,6 +401,20 @@ export type EnumRolesFieldUpdateOperationsInput = { set?: $Enums.Roles } +export type UsersCreateNestedOneWithoutNotificationsInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UsersCreateOrConnectWithoutNotificationsInput + connect?: Prisma.UsersWhereUniqueInput +} + +export type UsersUpdateOneRequiredWithoutNotificationsNestedInput = { + create?: Prisma.XOR + connectOrCreate?: Prisma.UsersCreateOrConnectWithoutNotificationsInput + upsert?: Prisma.UsersUpsertWithoutNotificationsInput + connect?: Prisma.UsersWhereUniqueInput + update?: Prisma.XOR, Prisma.UsersUncheckedUpdateWithoutNotificationsInput> +} + export type UsersCreateNestedOneWithoutUser_module_accessInput = { create?: Prisma.XOR connectOrCreate?: Prisma.UsersCreateOrConnectWithoutUser_module_accessInput @@ -450,6 +471,78 @@ export type UsersUpdateOneRequiredWithoutPreferencesNestedInput = { update?: Prisma.XOR, Prisma.UsersUncheckedUpdateWithoutPreferencesInput> } +export type UsersCreateWithoutNotificationsInput = { + id?: string + first_name: string + last_name: string + email: string + phone_number: string + residence?: string | null + role?: $Enums.Roles + employee?: Prisma.EmployeesCreateNestedOneWithoutUserInput + oauth_sessions?: Prisma.OAuthSessionsCreateNestedManyWithoutUserInput + preferences?: Prisma.PreferencesCreateNestedOneWithoutUserInput + user_module_access?: Prisma.userModuleAccessCreateNestedOneWithoutUserInput +} + +export type UsersUncheckedCreateWithoutNotificationsInput = { + id?: string + first_name: string + last_name: string + email: string + phone_number: string + residence?: string | null + role?: $Enums.Roles + employee?: Prisma.EmployeesUncheckedCreateNestedOneWithoutUserInput + oauth_sessions?: Prisma.OAuthSessionsUncheckedCreateNestedManyWithoutUserInput + preferences?: Prisma.PreferencesUncheckedCreateNestedOneWithoutUserInput + user_module_access?: Prisma.userModuleAccessUncheckedCreateNestedOneWithoutUserInput +} + +export type UsersCreateOrConnectWithoutNotificationsInput = { + where: Prisma.UsersWhereUniqueInput + create: Prisma.XOR +} + +export type UsersUpsertWithoutNotificationsInput = { + update: Prisma.XOR + create: Prisma.XOR + where?: Prisma.UsersWhereInput +} + +export type UsersUpdateToOneWithWhereWithoutNotificationsInput = { + where?: Prisma.UsersWhereInput + data: Prisma.XOR +} + +export type UsersUpdateWithoutNotificationsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + phone_number?: Prisma.StringFieldUpdateOperationsInput | string + residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + employee?: Prisma.EmployeesUpdateOneWithoutUserNestedInput + oauth_sessions?: Prisma.OAuthSessionsUpdateManyWithoutUserNestedInput + preferences?: Prisma.PreferencesUpdateOneWithoutUserNestedInput + user_module_access?: Prisma.userModuleAccessUpdateOneWithoutUserNestedInput +} + +export type UsersUncheckedUpdateWithoutNotificationsInput = { + id?: Prisma.StringFieldUpdateOperationsInput | string + first_name?: Prisma.StringFieldUpdateOperationsInput | string + last_name?: Prisma.StringFieldUpdateOperationsInput | string + email?: Prisma.StringFieldUpdateOperationsInput | string + phone_number?: Prisma.StringFieldUpdateOperationsInput | string + residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null + role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + employee?: Prisma.EmployeesUncheckedUpdateOneWithoutUserNestedInput + oauth_sessions?: Prisma.OAuthSessionsUncheckedUpdateManyWithoutUserNestedInput + preferences?: Prisma.PreferencesUncheckedUpdateOneWithoutUserNestedInput + user_module_access?: Prisma.userModuleAccessUncheckedUpdateOneWithoutUserNestedInput +} + export type UsersCreateWithoutUser_module_accessInput = { id?: string first_name: string @@ -458,6 +551,7 @@ export type UsersCreateWithoutUser_module_accessInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsCreateNestedManyWithoutUserInput preferences?: Prisma.PreferencesCreateNestedOneWithoutUserInput @@ -471,6 +565,7 @@ export type UsersUncheckedCreateWithoutUser_module_accessInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsUncheckedCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesUncheckedCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsUncheckedCreateNestedManyWithoutUserInput preferences?: Prisma.PreferencesUncheckedCreateNestedOneWithoutUserInput @@ -500,6 +595,7 @@ export type UsersUpdateWithoutUser_module_accessInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUpdateManyWithoutUserNestedInput preferences?: Prisma.PreferencesUpdateOneWithoutUserNestedInput @@ -513,6 +609,7 @@ export type UsersUncheckedUpdateWithoutUser_module_accessInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUncheckedUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUncheckedUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUncheckedUpdateManyWithoutUserNestedInput preferences?: Prisma.PreferencesUncheckedUpdateOneWithoutUserNestedInput @@ -526,6 +623,7 @@ export type UsersCreateWithoutEmployeeInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsCreateNestedManyWithoutUserInput preferences?: Prisma.PreferencesCreateNestedOneWithoutUserInput user_module_access?: Prisma.userModuleAccessCreateNestedOneWithoutUserInput @@ -539,6 +637,7 @@ export type UsersUncheckedCreateWithoutEmployeeInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsUncheckedCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsUncheckedCreateNestedManyWithoutUserInput preferences?: Prisma.PreferencesUncheckedCreateNestedOneWithoutUserInput user_module_access?: Prisma.userModuleAccessUncheckedCreateNestedOneWithoutUserInput @@ -568,6 +667,7 @@ export type UsersUpdateWithoutEmployeeInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUpdateManyWithoutUserNestedInput preferences?: Prisma.PreferencesUpdateOneWithoutUserNestedInput user_module_access?: Prisma.userModuleAccessUpdateOneWithoutUserNestedInput @@ -581,6 +681,7 @@ export type UsersUncheckedUpdateWithoutEmployeeInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUncheckedUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUncheckedUpdateManyWithoutUserNestedInput preferences?: Prisma.PreferencesUncheckedUpdateOneWithoutUserNestedInput user_module_access?: Prisma.userModuleAccessUncheckedUpdateOneWithoutUserNestedInput @@ -594,6 +695,7 @@ export type UsersCreateWithoutOauth_sessionsInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesCreateNestedOneWithoutUserInput preferences?: Prisma.PreferencesCreateNestedOneWithoutUserInput user_module_access?: Prisma.userModuleAccessCreateNestedOneWithoutUserInput @@ -607,6 +709,7 @@ export type UsersUncheckedCreateWithoutOauth_sessionsInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsUncheckedCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesUncheckedCreateNestedOneWithoutUserInput preferences?: Prisma.PreferencesUncheckedCreateNestedOneWithoutUserInput user_module_access?: Prisma.userModuleAccessUncheckedCreateNestedOneWithoutUserInput @@ -636,6 +739,7 @@ export type UsersUpdateWithoutOauth_sessionsInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUpdateOneWithoutUserNestedInput preferences?: Prisma.PreferencesUpdateOneWithoutUserNestedInput user_module_access?: Prisma.userModuleAccessUpdateOneWithoutUserNestedInput @@ -649,6 +753,7 @@ export type UsersUncheckedUpdateWithoutOauth_sessionsInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUncheckedUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUncheckedUpdateOneWithoutUserNestedInput preferences?: Prisma.PreferencesUncheckedUpdateOneWithoutUserNestedInput user_module_access?: Prisma.userModuleAccessUncheckedUpdateOneWithoutUserNestedInput @@ -662,6 +767,7 @@ export type UsersCreateWithoutPreferencesInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsCreateNestedManyWithoutUserInput user_module_access?: Prisma.userModuleAccessCreateNestedOneWithoutUserInput @@ -675,6 +781,7 @@ export type UsersUncheckedCreateWithoutPreferencesInput = { phone_number: string residence?: string | null role?: $Enums.Roles + notifications?: Prisma.NotificationsUncheckedCreateNestedOneWithoutUserInput employee?: Prisma.EmployeesUncheckedCreateNestedOneWithoutUserInput oauth_sessions?: Prisma.OAuthSessionsUncheckedCreateNestedManyWithoutUserInput user_module_access?: Prisma.userModuleAccessUncheckedCreateNestedOneWithoutUserInput @@ -704,6 +811,7 @@ export type UsersUpdateWithoutPreferencesInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUpdateManyWithoutUserNestedInput user_module_access?: Prisma.userModuleAccessUpdateOneWithoutUserNestedInput @@ -717,6 +825,7 @@ export type UsersUncheckedUpdateWithoutPreferencesInput = { phone_number?: Prisma.StringFieldUpdateOperationsInput | string residence?: Prisma.NullableStringFieldUpdateOperationsInput | string | null role?: Prisma.EnumRolesFieldUpdateOperationsInput | $Enums.Roles + notifications?: Prisma.NotificationsUncheckedUpdateOneWithoutUserNestedInput employee?: Prisma.EmployeesUncheckedUpdateOneWithoutUserNestedInput oauth_sessions?: Prisma.OAuthSessionsUncheckedUpdateManyWithoutUserNestedInput user_module_access?: Prisma.userModuleAccessUncheckedUpdateOneWithoutUserNestedInput @@ -761,6 +870,7 @@ export type UsersSelect employee?: boolean | Prisma.Users$employeeArgs oauth_sessions?: boolean | Prisma.Users$oauth_sessionsArgs preferences?: boolean | Prisma.Users$preferencesArgs @@ -800,6 +910,7 @@ export type UsersSelectScalar = { export type UsersOmit = runtime.Types.Extensions.GetOmit<"id" | "first_name" | "last_name" | "email" | "phone_number" | "residence" | "role", ExtArgs["result"]["users"]> export type UsersInclude = { + notifications?: boolean | Prisma.Users$notificationsArgs employee?: boolean | Prisma.Users$employeeArgs oauth_sessions?: boolean | Prisma.Users$oauth_sessionsArgs preferences?: boolean | Prisma.Users$preferencesArgs @@ -812,6 +923,7 @@ export type UsersIncludeUpdateManyAndReturn = { name: "Users" objects: { + notifications: Prisma.$NotificationsPayload | null employee: Prisma.$EmployeesPayload | null oauth_sessions: Prisma.$OAuthSessionsPayload[] preferences: Prisma.$PreferencesPayload | null @@ -1219,6 +1331,7 @@ readonly fields: UsersFieldRefs; */ export interface Prisma__UsersClient extends Prisma.PrismaPromise { readonly [Symbol.toStringTag]: "PrismaPromise" + notifications = {}>(args?: Prisma.Subset>): Prisma.Prisma__NotificationsClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> employee = {}>(args?: Prisma.Subset>): Prisma.Prisma__EmployeesClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> oauth_sessions = {}>(args?: Prisma.Subset>): Prisma.PrismaPromise, T, "findMany", GlobalOmitOptions> | Null> preferences = {}>(args?: Prisma.Subset>): Prisma.Prisma__PreferencesClient, T, "findUniqueOrThrow", GlobalOmitOptions> | null, null, ExtArgs, GlobalOmitOptions> @@ -1646,6 +1759,25 @@ export type UsersDeleteManyArgs = { + /** + * Select specific fields to fetch from the Notifications + */ + select?: Prisma.NotificationsSelect | null + /** + * Omit specific fields from the Notifications + */ + omit?: Prisma.NotificationsOmit | null + /** + * Choose, which related nodes to fetch as well + */ + include?: Prisma.NotificationsInclude | null + where?: Prisma.NotificationsWhereInput +} + /** * Users.employee */ diff --git a/prisma/postgres/generated/prisma/client/postgres/models/userModuleAccess.ts b/prisma/postgres/generated/prisma/client/postgres/models/userModuleAccess.ts index f567a88..d6474f5 100644 --- a/prisma/postgres/generated/prisma/client/postgres/models/userModuleAccess.ts +++ b/prisma/postgres/generated/prisma/client/postgres/models/userModuleAccess.ts @@ -477,14 +477,6 @@ export type BoolFieldUpdateOperationsInput = { set?: boolean } -export type IntFieldUpdateOperationsInput = { - set?: number - increment?: number - decrement?: number - multiply?: number - divide?: number -} - export type userModuleAccessCreateWithoutUserInput = { timesheets?: boolean timesheets_approval?: boolean diff --git a/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts b/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts index 43161dc..1989943 100644 --- a/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts +++ b/src/time-and-attendance/pay-period/services/pay-periods-build-overview.service.ts @@ -80,6 +80,7 @@ export class GetOverviewService { expense: { select: { amount: true, + mileage: true, bank_code: { select: { type: true, modifier: true } }, }, }, @@ -191,7 +192,7 @@ export class GetOverviewService { record.expenses = Number((record.expenses + amount).toFixed(2)); const type = (expense.bank_code?.type || "").toUpperCase(); const rate = expense.bank_code?.modifier ?? 1; - const mileage = amount / rate; + const mileage = Number(expense.mileage) / rate; if (type === "MILEAGE" && rate > 0) { record.mileage = Number((record.mileage += Math.round(mileage)).toFixed(2)); }