Merge pull request 'dev/matthieu/tickets' (#15) from dev/matthieu/tickets into main
Reviewed-on: Targo/targo_backend#15
This commit is contained in:
commit
9ca773e47b
|
|
@ -1,6 +1,6 @@
|
|||
// @ts-check
|
||||
import eslint from '@eslint/js';
|
||||
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||
// import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
|
||||
import globals from 'globals';
|
||||
import tseslint from 'typescript-eslint';
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ export default tseslint.config(
|
|||
},
|
||||
eslint.configs.recommended,
|
||||
...tseslint.configs.recommendedTypeChecked,
|
||||
eslintPluginPrettierRecommended,
|
||||
// eslintPluginPrettierRecommended,
|
||||
{
|
||||
languageOptions: {
|
||||
globals: {
|
||||
|
|
@ -26,6 +26,7 @@ export default tseslint.config(
|
|||
},
|
||||
{
|
||||
rules: {
|
||||
"no-unused-vars": "off",
|
||||
'@typescript-eslint/no-explicit-any': 'off',
|
||||
'@typescript-eslint/no-floating-promises': 'warn',
|
||||
'@typescript-eslint/no-unsafe-argument': 'warn'
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ export type compta_journal_ecriture_detail_bk = Prisma.compta_journal_ecriture_d
|
|||
export type compta_periode = Prisma.compta_periodeModel
|
||||
/**
|
||||
* Model compta_ppa_file_id
|
||||
* This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
*
|
||||
*/
|
||||
export type compta_ppa_file_id = Prisma.compta_ppa_file_idModel
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ export type compta_journal_ecriture_detail_bk = Prisma.compta_journal_ecriture_d
|
|||
export type compta_periode = Prisma.compta_periodeModel
|
||||
/**
|
||||
* Model compta_ppa_file_id
|
||||
* This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
*
|
||||
*/
|
||||
export type compta_ppa_file_id = Prisma.compta_ppa_file_idModel
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -14,15 +14,15 @@ import * as $Enums from "./enums"
|
|||
import type * as Prisma from "./internal/prismaNamespace"
|
||||
|
||||
|
||||
export type BigIntFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntFilter<$PrismaModel> | bigint | number
|
||||
export type IntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type StringNullableFilter<$PrismaModel = never> = {
|
||||
|
|
@ -66,17 +66,6 @@ export type StringFilter<$PrismaModel = never> = {
|
|||
not?: Prisma.NestedStringFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type IntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type IntNullableFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
|
@ -120,20 +109,20 @@ export type SortOrderInput = {
|
|||
nulls?: Prisma.NullsOrder
|
||||
}
|
||||
|
||||
export type BigIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number
|
||||
export type IntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
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.NestedBigIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type StringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
|
|
@ -188,22 +177,6 @@ export type StringWithAggregatesFilter<$PrismaModel = never> = {
|
|||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type IntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
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 IntNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
|
@ -260,6 +233,33 @@ export type FloatWithAggregatesFilter<$PrismaModel = never> = {
|
|||
_max?: Prisma.NestedFloatFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type BigIntFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntFilter<$PrismaModel> | bigint | number
|
||||
}
|
||||
|
||||
export type BigIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedFloatFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type FloatNullableFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
|
@ -369,15 +369,15 @@ export type DecimalNullableWithAggregatesFilter<$PrismaModel = never> = {
|
|||
_max?: Prisma.NestedDecimalNullableFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedBigIntFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntFilter<$PrismaModel> | bigint | number
|
||||
export type NestedIntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedStringNullableFilter<$PrismaModel = never> = {
|
||||
|
|
@ -421,17 +421,6 @@ export type NestedStringFilter<$PrismaModel = never> = {
|
|||
not?: Prisma.NestedStringFilter<$PrismaModel> | string
|
||||
}
|
||||
|
||||
export type NestedIntFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
lt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
lte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gt?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
gte?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedIntFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedIntNullableFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
|
@ -470,20 +459,20 @@ export type NestedFloatFilter<$PrismaModel = never> = {
|
|||
not?: Prisma.NestedFloatFilter<$PrismaModel> | number
|
||||
}
|
||||
|
||||
export type NestedBigIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number
|
||||
export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
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.NestedBigIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedStringNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
|
|
@ -549,22 +538,6 @@ export type NestedStringWithAggregatesFilter<$PrismaModel = never> = {
|
|||
_max?: Prisma.NestedStringFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel>
|
||||
in?: number[]
|
||||
notIn?: number[]
|
||||
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 NestedIntNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.IntFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
|
@ -621,6 +594,33 @@ export type NestedFloatWithAggregatesFilter<$PrismaModel = never> = {
|
|||
_max?: Prisma.NestedFloatFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedBigIntFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntFilter<$PrismaModel> | bigint | number
|
||||
}
|
||||
|
||||
export type NestedBigIntWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
in?: bigint[] | number[]
|
||||
notIn?: bigint[] | number[]
|
||||
lt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
lte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gt?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
gte?: bigint | number | Prisma.BigIntFieldRefInput<$PrismaModel>
|
||||
not?: Prisma.NestedBigIntWithAggregatesFilter<$PrismaModel> | bigint | number
|
||||
_count?: Prisma.NestedIntFilter<$PrismaModel>
|
||||
_avg?: Prisma.NestedFloatFilter<$PrismaModel>
|
||||
_sum?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_min?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
_max?: Prisma.NestedBigIntFilter<$PrismaModel>
|
||||
}
|
||||
|
||||
export type NestedFloatNullableWithAggregatesFilter<$PrismaModel = never> = {
|
||||
equals?: number | Prisma.FloatFieldRefInput<$PrismaModel> | null
|
||||
in?: number[] | null
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -14713,9 +14713,9 @@ export type account_suspensionOrderByRelevanceFieldEnum = (typeof account_suspen
|
|||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'BigInt'
|
||||
* Reference to a field of type 'Int'
|
||||
*/
|
||||
export type BigIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'BigInt'>
|
||||
export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'>
|
||||
|
||||
|
||||
|
||||
|
|
@ -14727,9 +14727,9 @@ export type StringFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel,
|
|||
|
||||
|
||||
/**
|
||||
* Reference to a field of type 'Int'
|
||||
* Reference to a field of type 'BigInt'
|
||||
*/
|
||||
export type IntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'Int'>
|
||||
export type BigIntFieldRefInput<$PrismaModel> = FieldRefInputType<$PrismaModel, 'BigInt'>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ export type AccountAvgAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type AccountSumAggregateOutputType = {
|
||||
id: bigint | null
|
||||
id: number | null
|
||||
date_orig: bigint | null
|
||||
date_last: bigint | null
|
||||
date_expire: bigint | null
|
||||
|
|
@ -65,7 +65,7 @@ export type AccountSumAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type AccountMinAggregateOutputType = {
|
||||
id: bigint | null
|
||||
id: number | null
|
||||
customer_id: string | null
|
||||
date_orig: bigint | null
|
||||
date_last: bigint | null
|
||||
|
|
@ -131,7 +131,7 @@ export type AccountMinAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type AccountMaxAggregateOutputType = {
|
||||
id: bigint | null
|
||||
id: number | null
|
||||
customer_id: string | null
|
||||
date_orig: bigint | null
|
||||
date_last: bigint | null
|
||||
|
|
@ -588,7 +588,7 @@ export type accountGroupByArgs<ExtArgs extends runtime.Types.Extensions.Internal
|
|||
}
|
||||
|
||||
export type AccountGroupByOutputType = {
|
||||
id: bigint
|
||||
id: number
|
||||
customer_id: string | null
|
||||
date_orig: bigint | null
|
||||
date_last: bigint | null
|
||||
|
|
@ -677,7 +677,7 @@ export type accountWhereInput = {
|
|||
AND?: Prisma.accountWhereInput | Prisma.accountWhereInput[]
|
||||
OR?: Prisma.accountWhereInput[]
|
||||
NOT?: Prisma.accountWhereInput | Prisma.accountWhereInput[]
|
||||
id?: Prisma.BigIntFilter<"account"> | bigint | number
|
||||
id?: Prisma.IntFilter<"account"> | number
|
||||
customer_id?: Prisma.StringNullableFilter<"account"> | string | null
|
||||
date_orig?: Prisma.BigIntNullableFilter<"account"> | bigint | number | null
|
||||
date_last?: Prisma.BigIntNullableFilter<"account"> | bigint | number | null
|
||||
|
|
@ -810,7 +810,7 @@ export type accountOrderByWithRelationInput = {
|
|||
}
|
||||
|
||||
export type accountWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
AND?: Prisma.accountWhereInput | Prisma.accountWhereInput[]
|
||||
OR?: Prisma.accountWhereInput[]
|
||||
NOT?: Prisma.accountWhereInput | Prisma.accountWhereInput[]
|
||||
|
|
@ -953,7 +953,7 @@ export type accountScalarWhereWithAggregatesInput = {
|
|||
AND?: Prisma.accountScalarWhereWithAggregatesInput | Prisma.accountScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.accountScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.accountScalarWhereWithAggregatesInput | Prisma.accountScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.BigIntWithAggregatesFilter<"account"> | bigint | number
|
||||
id?: Prisma.IntWithAggregatesFilter<"account"> | number
|
||||
customer_id?: Prisma.StringNullableWithAggregatesFilter<"account"> | string | null
|
||||
date_orig?: Prisma.BigIntNullableWithAggregatesFilter<"account"> | bigint | number | null
|
||||
date_last?: Prisma.BigIntNullableWithAggregatesFilter<"account"> | bigint | number | null
|
||||
|
|
@ -1019,7 +1019,6 @@ export type accountScalarWhereWithAggregatesInput = {
|
|||
}
|
||||
|
||||
export type accountCreateInput = {
|
||||
id?: bigint | number
|
||||
customer_id?: string | null
|
||||
date_orig?: bigint | number | null
|
||||
date_last?: bigint | number | null
|
||||
|
|
@ -1085,7 +1084,7 @@ export type accountCreateInput = {
|
|||
}
|
||||
|
||||
export type accountUncheckedCreateInput = {
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
customer_id?: string | null
|
||||
date_orig?: bigint | number | null
|
||||
date_last?: bigint | number | null
|
||||
|
|
@ -1151,7 +1150,6 @@ export type accountUncheckedCreateInput = {
|
|||
}
|
||||
|
||||
export type accountUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
date_last?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -1217,7 +1215,7 @@ export type accountUpdateInput = {
|
|||
}
|
||||
|
||||
export type accountUncheckedUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
date_last?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -1283,7 +1281,7 @@ export type accountUncheckedUpdateInput = {
|
|||
}
|
||||
|
||||
export type accountCreateManyInput = {
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
customer_id?: string | null
|
||||
date_orig?: bigint | number | null
|
||||
date_last?: bigint | number | null
|
||||
|
|
@ -1349,7 +1347,6 @@ export type accountCreateManyInput = {
|
|||
}
|
||||
|
||||
export type accountUpdateManyMutationInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
date_last?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -1415,7 +1412,7 @@ export type accountUpdateManyMutationInput = {
|
|||
}
|
||||
|
||||
export type accountUncheckedUpdateManyInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
customer_id?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
date_last?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -1722,14 +1719,6 @@ export type accountSumOrderByAggregateInput = {
|
|||
ppa_cc?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type BigIntFieldUpdateOperationsInput = {
|
||||
set?: bigint | number
|
||||
increment?: bigint | number
|
||||
decrement?: bigint | number
|
||||
multiply?: bigint | number
|
||||
divide?: bigint | number
|
||||
}
|
||||
|
||||
export type NullableStringFieldUpdateOperationsInput = {
|
||||
set?: string | null
|
||||
}
|
||||
|
|
@ -1924,7 +1913,7 @@ export type $accountPayload<ExtArgs extends runtime.Types.Extensions.InternalArg
|
|||
name: "account"
|
||||
objects: {}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: bigint
|
||||
id: number
|
||||
customer_id: string | null
|
||||
date_orig: bigint | null
|
||||
date_last: bigint | null
|
||||
|
|
@ -2356,7 +2345,7 @@ export interface Prisma__accountClient<T, Null = never, ExtArgs extends runtime.
|
|||
* Fields of the account model
|
||||
*/
|
||||
export interface accountFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"account", 'BigInt'>
|
||||
readonly id: Prisma.FieldRef<"account", 'Int'>
|
||||
readonly customer_id: Prisma.FieldRef<"account", 'String'>
|
||||
readonly date_orig: Prisma.FieldRef<"account", 'BigInt'>
|
||||
readonly date_last: Prisma.FieldRef<"account", 'BigInt'>
|
||||
|
|
|
|||
|
|
@ -468,6 +468,14 @@ export type account_memoSumOrderByAggregateInput = {
|
|||
account_id?: Prisma.SortOrder
|
||||
}
|
||||
|
||||
export type BigIntFieldUpdateOperationsInput = {
|
||||
set?: bigint | number
|
||||
increment?: bigint | number
|
||||
decrement?: bigint | number
|
||||
multiply?: bigint | number
|
||||
divide?: bigint | number
|
||||
}
|
||||
|
||||
|
||||
|
||||
export type account_memoSelect<ExtArgs extends runtime.Types.Extensions.InternalArgs = runtime.Types.Extensions.DefaultArgs> = runtime.Types.Extensions.GetSelect<{
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ import type * as Prisma from "../internal/prismaNamespace"
|
|||
|
||||
/**
|
||||
* Model compta_ppa_file_id
|
||||
* This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
*
|
||||
*/
|
||||
export type compta_ppa_file_idModel = runtime.Types.Result.DefaultSelection<Prisma.$compta_ppa_file_idPayload>
|
||||
|
||||
|
|
|
|||
|
|
@ -40,8 +40,8 @@ export type DeliveryAvgAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type DeliverySumAggregateOutputType = {
|
||||
id: bigint | null
|
||||
account_id: bigint | null
|
||||
id: number | null
|
||||
account_id: number | null
|
||||
date_orig: bigint | null
|
||||
longitude: runtime.Decimal | null
|
||||
latitude: runtime.Decimal | null
|
||||
|
|
@ -53,8 +53,8 @@ export type DeliverySumAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type DeliveryMinAggregateOutputType = {
|
||||
id: bigint | null
|
||||
account_id: bigint | null
|
||||
id: number | null
|
||||
account_id: number | null
|
||||
name: string | null
|
||||
comment: string | null
|
||||
date_orig: bigint | null
|
||||
|
|
@ -80,8 +80,8 @@ export type DeliveryMinAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type DeliveryMaxAggregateOutputType = {
|
||||
id: bigint | null
|
||||
account_id: bigint | null
|
||||
id: number | null
|
||||
account_id: number | null
|
||||
name: string | null
|
||||
comment: string | null
|
||||
date_orig: bigint | null
|
||||
|
|
@ -330,8 +330,8 @@ export type deliveryGroupByArgs<ExtArgs extends runtime.Types.Extensions.Interna
|
|||
}
|
||||
|
||||
export type DeliveryGroupByOutputType = {
|
||||
id: bigint
|
||||
account_id: bigint | null
|
||||
id: number
|
||||
account_id: number | null
|
||||
name: string
|
||||
comment: string
|
||||
date_orig: bigint | null
|
||||
|
|
@ -380,8 +380,8 @@ export type deliveryWhereInput = {
|
|||
AND?: Prisma.deliveryWhereInput | Prisma.deliveryWhereInput[]
|
||||
OR?: Prisma.deliveryWhereInput[]
|
||||
NOT?: Prisma.deliveryWhereInput | Prisma.deliveryWhereInput[]
|
||||
id?: Prisma.BigIntFilter<"delivery"> | bigint | number
|
||||
account_id?: Prisma.BigIntNullableFilter<"delivery"> | bigint | number | null
|
||||
id?: Prisma.IntFilter<"delivery"> | number
|
||||
account_id?: Prisma.IntNullableFilter<"delivery"> | number | null
|
||||
name?: Prisma.StringFilter<"delivery"> | string
|
||||
comment?: Prisma.StringFilter<"delivery"> | string
|
||||
date_orig?: Prisma.BigIntNullableFilter<"delivery"> | bigint | number | null
|
||||
|
|
@ -435,11 +435,11 @@ export type deliveryOrderByWithRelationInput = {
|
|||
}
|
||||
|
||||
export type deliveryWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
AND?: Prisma.deliveryWhereInput | Prisma.deliveryWhereInput[]
|
||||
OR?: Prisma.deliveryWhereInput[]
|
||||
NOT?: Prisma.deliveryWhereInput | Prisma.deliveryWhereInput[]
|
||||
account_id?: Prisma.BigIntNullableFilter<"delivery"> | bigint | number | null
|
||||
account_id?: Prisma.IntNullableFilter<"delivery"> | number | null
|
||||
name?: Prisma.StringFilter<"delivery"> | string
|
||||
comment?: Prisma.StringFilter<"delivery"> | string
|
||||
date_orig?: Prisma.BigIntNullableFilter<"delivery"> | bigint | number | null
|
||||
|
|
@ -500,8 +500,8 @@ export type deliveryScalarWhereWithAggregatesInput = {
|
|||
AND?: Prisma.deliveryScalarWhereWithAggregatesInput | Prisma.deliveryScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.deliveryScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.deliveryScalarWhereWithAggregatesInput | Prisma.deliveryScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.BigIntWithAggregatesFilter<"delivery"> | bigint | number
|
||||
account_id?: Prisma.BigIntNullableWithAggregatesFilter<"delivery"> | bigint | number | null
|
||||
id?: Prisma.IntWithAggregatesFilter<"delivery"> | number
|
||||
account_id?: Prisma.IntNullableWithAggregatesFilter<"delivery"> | number | null
|
||||
name?: Prisma.StringWithAggregatesFilter<"delivery"> | string
|
||||
comment?: Prisma.StringWithAggregatesFilter<"delivery"> | string
|
||||
date_orig?: Prisma.BigIntNullableWithAggregatesFilter<"delivery"> | bigint | number | null
|
||||
|
|
@ -527,8 +527,7 @@ export type deliveryScalarWhereWithAggregatesInput = {
|
|||
}
|
||||
|
||||
export type deliveryCreateInput = {
|
||||
id?: bigint | number
|
||||
account_id?: bigint | number | null
|
||||
account_id?: number | null
|
||||
name: string
|
||||
comment: string
|
||||
date_orig?: bigint | number | null
|
||||
|
|
@ -554,8 +553,8 @@ export type deliveryCreateInput = {
|
|||
}
|
||||
|
||||
export type deliveryUncheckedCreateInput = {
|
||||
id?: bigint | number
|
||||
account_id?: bigint | number | null
|
||||
id?: number
|
||||
account_id?: number | null
|
||||
name: string
|
||||
comment: string
|
||||
date_orig?: bigint | number | null
|
||||
|
|
@ -581,8 +580,7 @@ export type deliveryUncheckedCreateInput = {
|
|||
}
|
||||
|
||||
export type deliveryUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
comment?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -608,8 +606,8 @@ export type deliveryUpdateInput = {
|
|||
}
|
||||
|
||||
export type deliveryUncheckedUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
comment?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -635,8 +633,8 @@ export type deliveryUncheckedUpdateInput = {
|
|||
}
|
||||
|
||||
export type deliveryCreateManyInput = {
|
||||
id?: bigint | number
|
||||
account_id?: bigint | number | null
|
||||
id?: number
|
||||
account_id?: number | null
|
||||
name: string
|
||||
comment: string
|
||||
date_orig?: bigint | number | null
|
||||
|
|
@ -662,8 +660,7 @@ export type deliveryCreateManyInput = {
|
|||
}
|
||||
|
||||
export type deliveryUpdateManyMutationInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
comment?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -689,8 +686,8 @@ export type deliveryUpdateManyMutationInput = {
|
|||
}
|
||||
|
||||
export type deliveryUncheckedUpdateManyInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
name?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
comment?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
|
|
@ -892,8 +889,8 @@ export type $deliveryPayload<ExtArgs extends runtime.Types.Extensions.InternalAr
|
|||
name: "delivery"
|
||||
objects: {}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: bigint
|
||||
account_id: bigint | null
|
||||
id: number
|
||||
account_id: number | null
|
||||
name: string
|
||||
comment: string
|
||||
date_orig: bigint | null
|
||||
|
|
@ -1285,8 +1282,8 @@ export interface Prisma__deliveryClient<T, Null = never, ExtArgs extends runtime
|
|||
* Fields of the delivery model
|
||||
*/
|
||||
export interface deliveryFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"delivery", 'BigInt'>
|
||||
readonly account_id: Prisma.FieldRef<"delivery", 'BigInt'>
|
||||
readonly id: Prisma.FieldRef<"delivery", 'Int'>
|
||||
readonly account_id: Prisma.FieldRef<"delivery", 'Int'>
|
||||
readonly name: Prisma.FieldRef<"delivery", 'String'>
|
||||
readonly comment: Prisma.FieldRef<"delivery", 'String'>
|
||||
readonly date_orig: Prisma.FieldRef<"delivery", 'BigInt'>
|
||||
|
|
|
|||
|
|
@ -48,11 +48,11 @@ export type TicketAvgAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type TicketSumAggregateOutputType = {
|
||||
id: bigint | null
|
||||
id: number | null
|
||||
ost_id: number | null
|
||||
parent: bigint | null
|
||||
account_id: bigint | null
|
||||
delivery_id: bigint | null
|
||||
account_id: number | null
|
||||
delivery_id: number | null
|
||||
bon_id: number | null
|
||||
dept_id: number | null
|
||||
open_by: number | null
|
||||
|
|
@ -69,11 +69,11 @@ export type TicketSumAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type TicketMinAggregateOutputType = {
|
||||
id: bigint | null
|
||||
id: number | null
|
||||
ost_id: number | null
|
||||
parent: bigint | null
|
||||
account_id: bigint | null
|
||||
delivery_id: bigint | null
|
||||
account_id: number | null
|
||||
delivery_id: number | null
|
||||
bon_id: number | null
|
||||
subject: string | null
|
||||
dept_id: number | null
|
||||
|
|
@ -102,11 +102,11 @@ export type TicketMinAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type TicketMaxAggregateOutputType = {
|
||||
id: bigint | null
|
||||
id: number | null
|
||||
ost_id: number | null
|
||||
parent: bigint | null
|
||||
account_id: bigint | null
|
||||
delivery_id: bigint | null
|
||||
account_id: number | null
|
||||
delivery_id: number | null
|
||||
bon_id: number | null
|
||||
subject: string | null
|
||||
dept_id: number | null
|
||||
|
|
@ -398,11 +398,11 @@ export type ticketGroupByArgs<ExtArgs extends runtime.Types.Extensions.InternalA
|
|||
}
|
||||
|
||||
export type TicketGroupByOutputType = {
|
||||
id: bigint
|
||||
id: number
|
||||
ost_id: number | null
|
||||
parent: bigint
|
||||
account_id: bigint | null
|
||||
delivery_id: bigint
|
||||
account_id: number | null
|
||||
delivery_id: number
|
||||
bon_id: number | null
|
||||
subject: string | null
|
||||
dept_id: number | null
|
||||
|
|
@ -454,11 +454,11 @@ export type ticketWhereInput = {
|
|||
AND?: Prisma.ticketWhereInput | Prisma.ticketWhereInput[]
|
||||
OR?: Prisma.ticketWhereInput[]
|
||||
NOT?: Prisma.ticketWhereInput | Prisma.ticketWhereInput[]
|
||||
id?: Prisma.BigIntFilter<"ticket"> | bigint | number
|
||||
id?: Prisma.IntFilter<"ticket"> | number
|
||||
ost_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
parent?: Prisma.BigIntFilter<"ticket"> | bigint | number
|
||||
account_id?: Prisma.BigIntNullableFilter<"ticket"> | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntFilter<"ticket"> | bigint | number
|
||||
account_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
delivery_id?: Prisma.IntFilter<"ticket"> | number
|
||||
bon_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
subject?: Prisma.StringNullableFilter<"ticket"> | string | null
|
||||
dept_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
|
|
@ -521,14 +521,14 @@ export type ticketOrderByWithRelationInput = {
|
|||
}
|
||||
|
||||
export type ticketWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
AND?: Prisma.ticketWhereInput | Prisma.ticketWhereInput[]
|
||||
OR?: Prisma.ticketWhereInput[]
|
||||
NOT?: Prisma.ticketWhereInput | Prisma.ticketWhereInput[]
|
||||
ost_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
parent?: Prisma.BigIntFilter<"ticket"> | bigint | number
|
||||
account_id?: Prisma.BigIntNullableFilter<"ticket"> | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntFilter<"ticket"> | bigint | number
|
||||
account_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
delivery_id?: Prisma.IntFilter<"ticket"> | number
|
||||
bon_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
subject?: Prisma.StringNullableFilter<"ticket"> | string | null
|
||||
dept_id?: Prisma.IntNullableFilter<"ticket"> | number | null
|
||||
|
|
@ -598,11 +598,11 @@ export type ticketScalarWhereWithAggregatesInput = {
|
|||
AND?: Prisma.ticketScalarWhereWithAggregatesInput | Prisma.ticketScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.ticketScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.ticketScalarWhereWithAggregatesInput | Prisma.ticketScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.BigIntWithAggregatesFilter<"ticket"> | bigint | number
|
||||
id?: Prisma.IntWithAggregatesFilter<"ticket"> | number
|
||||
ost_id?: Prisma.IntNullableWithAggregatesFilter<"ticket"> | number | null
|
||||
parent?: Prisma.BigIntWithAggregatesFilter<"ticket"> | bigint | number
|
||||
account_id?: Prisma.BigIntNullableWithAggregatesFilter<"ticket"> | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntWithAggregatesFilter<"ticket"> | bigint | number
|
||||
account_id?: Prisma.IntNullableWithAggregatesFilter<"ticket"> | number | null
|
||||
delivery_id?: Prisma.IntWithAggregatesFilter<"ticket"> | number
|
||||
bon_id?: Prisma.IntNullableWithAggregatesFilter<"ticket"> | number | null
|
||||
subject?: Prisma.StringNullableWithAggregatesFilter<"ticket"> | string | null
|
||||
dept_id?: Prisma.IntNullableWithAggregatesFilter<"ticket"> | number | null
|
||||
|
|
@ -631,11 +631,10 @@ export type ticketScalarWhereWithAggregatesInput = {
|
|||
}
|
||||
|
||||
export type ticketCreateInput = {
|
||||
id?: bigint | number
|
||||
ost_id?: number | null
|
||||
parent?: bigint | number
|
||||
account_id?: bigint | number | null
|
||||
delivery_id?: bigint | number
|
||||
account_id?: number | null
|
||||
delivery_id?: number
|
||||
bon_id?: number | null
|
||||
subject?: string | null
|
||||
dept_id?: number | null
|
||||
|
|
@ -664,11 +663,11 @@ export type ticketCreateInput = {
|
|||
}
|
||||
|
||||
export type ticketUncheckedCreateInput = {
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
ost_id?: number | null
|
||||
parent?: bigint | number
|
||||
account_id?: bigint | number | null
|
||||
delivery_id?: bigint | number
|
||||
account_id?: number | null
|
||||
delivery_id?: number
|
||||
bon_id?: number | null
|
||||
subject?: string | null
|
||||
dept_id?: number | null
|
||||
|
|
@ -697,11 +696,10 @@ export type ticketUncheckedCreateInput = {
|
|||
}
|
||||
|
||||
export type ticketUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ost_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
parent?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
delivery_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
bon_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
subject?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
dept_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
|
|
@ -730,11 +728,11 @@ export type ticketUpdateInput = {
|
|||
}
|
||||
|
||||
export type ticketUncheckedUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
ost_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
parent?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
delivery_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
bon_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
subject?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
dept_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
|
|
@ -763,11 +761,11 @@ export type ticketUncheckedUpdateInput = {
|
|||
}
|
||||
|
||||
export type ticketCreateManyInput = {
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
ost_id?: number | null
|
||||
parent?: bigint | number
|
||||
account_id?: bigint | number | null
|
||||
delivery_id?: bigint | number
|
||||
account_id?: number | null
|
||||
delivery_id?: number
|
||||
bon_id?: number | null
|
||||
subject?: string | null
|
||||
dept_id?: number | null
|
||||
|
|
@ -796,11 +794,10 @@ export type ticketCreateManyInput = {
|
|||
}
|
||||
|
||||
export type ticketUpdateManyMutationInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ost_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
parent?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
delivery_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
bon_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
subject?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
dept_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
|
|
@ -829,11 +826,11 @@ export type ticketUpdateManyMutationInput = {
|
|||
}
|
||||
|
||||
export type ticketUncheckedUpdateManyInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
ost_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
parent?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
delivery_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
account_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
delivery_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
bon_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
subject?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
dept_id?: Prisma.NullableIntFieldUpdateOperationsInput | number | null
|
||||
|
|
@ -1088,11 +1085,11 @@ export type $ticketPayload<ExtArgs extends runtime.Types.Extensions.InternalArgs
|
|||
name: "ticket"
|
||||
objects: {}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: bigint
|
||||
id: number
|
||||
ost_id: number | null
|
||||
parent: bigint
|
||||
account_id: bigint | null
|
||||
delivery_id: bigint
|
||||
account_id: number | null
|
||||
delivery_id: number
|
||||
bon_id: number | null
|
||||
subject: string | null
|
||||
dept_id: number | null
|
||||
|
|
@ -1487,11 +1484,11 @@ export interface Prisma__ticketClient<T, Null = never, ExtArgs extends runtime.T
|
|||
* Fields of the ticket model
|
||||
*/
|
||||
export interface ticketFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"ticket", 'BigInt'>
|
||||
readonly id: Prisma.FieldRef<"ticket", 'Int'>
|
||||
readonly ost_id: Prisma.FieldRef<"ticket", 'Int'>
|
||||
readonly parent: Prisma.FieldRef<"ticket", 'BigInt'>
|
||||
readonly account_id: Prisma.FieldRef<"ticket", 'BigInt'>
|
||||
readonly delivery_id: Prisma.FieldRef<"ticket", 'BigInt'>
|
||||
readonly account_id: Prisma.FieldRef<"ticket", 'Int'>
|
||||
readonly delivery_id: Prisma.FieldRef<"ticket", 'Int'>
|
||||
readonly bon_id: Prisma.FieldRef<"ticket", 'Int'>
|
||||
readonly subject: Prisma.FieldRef<"ticket", 'String'>
|
||||
readonly dept_id: Prisma.FieldRef<"ticket", 'Int'>
|
||||
|
|
|
|||
|
|
@ -35,17 +35,17 @@ export type Ticket_msgAvgAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type Ticket_msgSumAggregateOutputType = {
|
||||
id: bigint | null
|
||||
ticket_id: bigint | null
|
||||
staff_id: bigint | null
|
||||
id: number | null
|
||||
ticket_id: number | null
|
||||
staff_id: number | null
|
||||
date_orig: bigint | null
|
||||
important: number | null
|
||||
}
|
||||
|
||||
export type Ticket_msgMinAggregateOutputType = {
|
||||
id: bigint | null
|
||||
ticket_id: bigint | null
|
||||
staff_id: bigint | null
|
||||
id: number | null
|
||||
ticket_id: number | null
|
||||
staff_id: number | null
|
||||
msg: string | null
|
||||
date_orig: bigint | null
|
||||
unread_csv: string | null
|
||||
|
|
@ -55,9 +55,9 @@ export type Ticket_msgMinAggregateOutputType = {
|
|||
}
|
||||
|
||||
export type Ticket_msgMaxAggregateOutputType = {
|
||||
id: bigint | null
|
||||
ticket_id: bigint | null
|
||||
staff_id: bigint | null
|
||||
id: number | null
|
||||
ticket_id: number | null
|
||||
staff_id: number | null
|
||||
msg: string | null
|
||||
date_orig: bigint | null
|
||||
unread_csv: string | null
|
||||
|
|
@ -220,9 +220,9 @@ export type ticket_msgGroupByArgs<ExtArgs extends runtime.Types.Extensions.Inter
|
|||
}
|
||||
|
||||
export type Ticket_msgGroupByOutputType = {
|
||||
id: bigint
|
||||
ticket_id: bigint
|
||||
staff_id: bigint
|
||||
id: number
|
||||
ticket_id: number
|
||||
staff_id: number
|
||||
msg: string | null
|
||||
date_orig: bigint | null
|
||||
unread_csv: string
|
||||
|
|
@ -255,9 +255,9 @@ export type ticket_msgWhereInput = {
|
|||
AND?: Prisma.ticket_msgWhereInput | Prisma.ticket_msgWhereInput[]
|
||||
OR?: Prisma.ticket_msgWhereInput[]
|
||||
NOT?: Prisma.ticket_msgWhereInput | Prisma.ticket_msgWhereInput[]
|
||||
id?: Prisma.BigIntFilter<"ticket_msg"> | bigint | number
|
||||
ticket_id?: Prisma.BigIntFilter<"ticket_msg"> | bigint | number
|
||||
staff_id?: Prisma.BigIntFilter<"ticket_msg"> | bigint | number
|
||||
id?: Prisma.IntFilter<"ticket_msg"> | number
|
||||
ticket_id?: Prisma.IntFilter<"ticket_msg"> | number
|
||||
staff_id?: Prisma.IntFilter<"ticket_msg"> | number
|
||||
msg?: Prisma.StringNullableFilter<"ticket_msg"> | string | null
|
||||
date_orig?: Prisma.BigIntNullableFilter<"ticket_msg"> | bigint | number | null
|
||||
unread_csv?: Prisma.StringFilter<"ticket_msg"> | string
|
||||
|
|
@ -280,12 +280,12 @@ export type ticket_msgOrderByWithRelationInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgWhereUniqueInput = Prisma.AtLeast<{
|
||||
id?: bigint | number
|
||||
id?: number
|
||||
AND?: Prisma.ticket_msgWhereInput | Prisma.ticket_msgWhereInput[]
|
||||
OR?: Prisma.ticket_msgWhereInput[]
|
||||
NOT?: Prisma.ticket_msgWhereInput | Prisma.ticket_msgWhereInput[]
|
||||
ticket_id?: Prisma.BigIntFilter<"ticket_msg"> | bigint | number
|
||||
staff_id?: Prisma.BigIntFilter<"ticket_msg"> | bigint | number
|
||||
ticket_id?: Prisma.IntFilter<"ticket_msg"> | number
|
||||
staff_id?: Prisma.IntFilter<"ticket_msg"> | number
|
||||
msg?: Prisma.StringNullableFilter<"ticket_msg"> | string | null
|
||||
date_orig?: Prisma.BigIntNullableFilter<"ticket_msg"> | bigint | number | null
|
||||
unread_csv?: Prisma.StringFilter<"ticket_msg"> | string
|
||||
|
|
@ -315,9 +315,9 @@ export type ticket_msgScalarWhereWithAggregatesInput = {
|
|||
AND?: Prisma.ticket_msgScalarWhereWithAggregatesInput | Prisma.ticket_msgScalarWhereWithAggregatesInput[]
|
||||
OR?: Prisma.ticket_msgScalarWhereWithAggregatesInput[]
|
||||
NOT?: Prisma.ticket_msgScalarWhereWithAggregatesInput | Prisma.ticket_msgScalarWhereWithAggregatesInput[]
|
||||
id?: Prisma.BigIntWithAggregatesFilter<"ticket_msg"> | bigint | number
|
||||
ticket_id?: Prisma.BigIntWithAggregatesFilter<"ticket_msg"> | bigint | number
|
||||
staff_id?: Prisma.BigIntWithAggregatesFilter<"ticket_msg"> | bigint | number
|
||||
id?: Prisma.IntWithAggregatesFilter<"ticket_msg"> | number
|
||||
ticket_id?: Prisma.IntWithAggregatesFilter<"ticket_msg"> | number
|
||||
staff_id?: Prisma.IntWithAggregatesFilter<"ticket_msg"> | number
|
||||
msg?: Prisma.StringNullableWithAggregatesFilter<"ticket_msg"> | string | null
|
||||
date_orig?: Prisma.BigIntNullableWithAggregatesFilter<"ticket_msg"> | bigint | number | null
|
||||
unread_csv?: Prisma.StringWithAggregatesFilter<"ticket_msg"> | string
|
||||
|
|
@ -327,9 +327,8 @@ export type ticket_msgScalarWhereWithAggregatesInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgCreateInput = {
|
||||
id?: bigint | number
|
||||
ticket_id: bigint | number
|
||||
staff_id?: bigint | number
|
||||
ticket_id: number
|
||||
staff_id?: number
|
||||
msg?: string | null
|
||||
date_orig?: bigint | number | null
|
||||
unread_csv: string
|
||||
|
|
@ -339,9 +338,9 @@ export type ticket_msgCreateInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgUncheckedCreateInput = {
|
||||
id?: bigint | number
|
||||
ticket_id: bigint | number
|
||||
staff_id?: bigint | number
|
||||
id?: number
|
||||
ticket_id: number
|
||||
staff_id?: number
|
||||
msg?: string | null
|
||||
date_orig?: bigint | number | null
|
||||
unread_csv: string
|
||||
|
|
@ -351,9 +350,8 @@ export type ticket_msgUncheckedCreateInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ticket_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
staff_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ticket_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
staff_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
msg?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
unread_csv?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
|
|
@ -363,9 +361,9 @@ export type ticket_msgUpdateInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgUncheckedUpdateInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ticket_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
staff_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
ticket_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
staff_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
msg?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
unread_csv?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
|
|
@ -375,9 +373,9 @@ export type ticket_msgUncheckedUpdateInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgCreateManyInput = {
|
||||
id?: bigint | number
|
||||
ticket_id: bigint | number
|
||||
staff_id?: bigint | number
|
||||
id?: number
|
||||
ticket_id: number
|
||||
staff_id?: number
|
||||
msg?: string | null
|
||||
date_orig?: bigint | number | null
|
||||
unread_csv: string
|
||||
|
|
@ -387,9 +385,8 @@ export type ticket_msgCreateManyInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgUpdateManyMutationInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ticket_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
staff_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ticket_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
staff_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
msg?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
unread_csv?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
|
|
@ -399,9 +396,9 @@ export type ticket_msgUpdateManyMutationInput = {
|
|||
}
|
||||
|
||||
export type ticket_msgUncheckedUpdateManyInput = {
|
||||
id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
ticket_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
staff_id?: Prisma.BigIntFieldUpdateOperationsInput | bigint | number
|
||||
id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
ticket_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
staff_id?: Prisma.IntFieldUpdateOperationsInput | number
|
||||
msg?: Prisma.NullableStringFieldUpdateOperationsInput | string | null
|
||||
date_orig?: Prisma.NullableBigIntFieldUpdateOperationsInput | bigint | number | null
|
||||
unread_csv?: Prisma.StringFieldUpdateOperationsInput | string
|
||||
|
|
@ -502,9 +499,9 @@ export type $ticket_msgPayload<ExtArgs extends runtime.Types.Extensions.Internal
|
|||
name: "ticket_msg"
|
||||
objects: {}
|
||||
scalars: runtime.Types.Extensions.GetPayloadResult<{
|
||||
id: bigint
|
||||
ticket_id: bigint
|
||||
staff_id: bigint
|
||||
id: number
|
||||
ticket_id: number
|
||||
staff_id: number
|
||||
msg: string | null
|
||||
date_orig: bigint | null
|
||||
unread_csv: string
|
||||
|
|
@ -880,9 +877,9 @@ export interface Prisma__ticket_msgClient<T, Null = never, ExtArgs extends runti
|
|||
* Fields of the ticket_msg model
|
||||
*/
|
||||
export interface ticket_msgFieldRefs {
|
||||
readonly id: Prisma.FieldRef<"ticket_msg", 'BigInt'>
|
||||
readonly ticket_id: Prisma.FieldRef<"ticket_msg", 'BigInt'>
|
||||
readonly staff_id: Prisma.FieldRef<"ticket_msg", 'BigInt'>
|
||||
readonly id: Prisma.FieldRef<"ticket_msg", 'Int'>
|
||||
readonly ticket_id: Prisma.FieldRef<"ticket_msg", 'Int'>
|
||||
readonly staff_id: Prisma.FieldRef<"ticket_msg", 'Int'>
|
||||
readonly msg: Prisma.FieldRef<"ticket_msg", 'String'>
|
||||
readonly date_orig: Prisma.FieldRef<"ticket_msg", 'BigInt'>
|
||||
readonly unread_csv: Prisma.FieldRef<"ticket_msg", 'String'>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ datasource db {
|
|||
}
|
||||
|
||||
model account {
|
||||
id BigInt @id @default(autoincrement())
|
||||
id Int @id @default(autoincrement())
|
||||
customer_id String? @db.VarChar(32) //variable string, composition varies a lot, used by customers to identify their account
|
||||
date_orig BigInt? //timestamp
|
||||
date_last BigInt? //timestamp
|
||||
|
|
@ -100,6 +100,7 @@ model account_memo {
|
|||
}
|
||||
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_comptes {
|
||||
id BigInt @id @default(autoincrement())
|
||||
category String? @db.VarChar(64)
|
||||
|
|
@ -107,6 +108,7 @@ model compta_comptes {
|
|||
desc String? @db.MediumText
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_comptes_soldes {
|
||||
id BigInt @id @default(autoincrement())
|
||||
num_compte Int
|
||||
|
|
@ -116,6 +118,7 @@ model compta_comptes_soldes {
|
|||
type String @db.VarChar(3)
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_journal_ecriture {
|
||||
id BigInt @id @default(autoincrement())
|
||||
date_orig BigInt?
|
||||
|
|
@ -132,6 +135,7 @@ model compta_journal_ecriture {
|
|||
@@index([num], map: "num")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_journal_ecriture_bk {
|
||||
id BigInt @id @default(autoincrement())
|
||||
date_orig BigInt?
|
||||
|
|
@ -148,6 +152,7 @@ model compta_journal_ecriture_bk {
|
|||
@@index([num], map: "num")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_journal_ecriture_detail {
|
||||
id BigInt @id @default(autoincrement())
|
||||
journal_id BigInt?
|
||||
|
|
@ -158,6 +163,7 @@ model compta_journal_ecriture_detail {
|
|||
@@index([journal_id], map: "journal_id")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_journal_ecriture_detail_bk {
|
||||
id BigInt @id @default(autoincrement())
|
||||
journal_id BigInt?
|
||||
|
|
@ -172,11 +178,13 @@ model compta_periode {
|
|||
month Int @id @default(7)
|
||||
}
|
||||
|
||||
/// This model or at least one of its fields has comments in the database, and requires an additional setup for migrations: Read more: https://pris.ly/d/database-comments
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_ppa_file_id {
|
||||
last_id Int @id @default(1)
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model compta_setup {
|
||||
setup_id Int @id @default(1)
|
||||
period_month Int @default(7)
|
||||
|
|
@ -189,12 +197,14 @@ model compta_setup {
|
|||
imap_token String? @db.Text
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model credit_code {
|
||||
id Int @id @default(autoincrement())
|
||||
code String @db.VarChar(16)
|
||||
desc String @db.VarChar(256)
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model tax {
|
||||
id Int @id @default(autoincrement())
|
||||
name String? @db.VarChar(128)
|
||||
|
|
@ -202,6 +212,7 @@ model tax {
|
|||
rate Float?
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model tax_group {
|
||||
id Int @id @default(autoincrement())
|
||||
name String? @db.VarChar(128)
|
||||
|
|
@ -209,6 +220,7 @@ model tax_group {
|
|||
tax String? @db.VarChar(128)
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model td_payable {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
ticket_id Int @default(0) @db.UnsignedInt
|
||||
|
|
@ -225,6 +237,7 @@ model td_payable {
|
|||
@@index([ticket_id], map: "ticket_id")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso {
|
||||
id BigInt @id @default(autoincrement())
|
||||
ip_id String? @db.VarChar(16)
|
||||
|
|
@ -236,6 +249,7 @@ model conso {
|
|||
@@index([ip_id], map: "ip_id")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_archive {
|
||||
id BigInt @id @default(autoincrement())
|
||||
ip_id String? @db.VarChar(16)
|
||||
|
|
@ -247,6 +261,7 @@ model conso_archive {
|
|||
@@index([ip_id], map: "ip_id")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_avis {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
date BigInt
|
||||
|
|
@ -257,6 +272,7 @@ model conso_avis {
|
|||
avis String @db.VarChar(32)
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_radius {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
username String @db.VarChar(32)
|
||||
|
|
@ -269,6 +285,7 @@ model conso_radius {
|
|||
@@index([username], map: "username")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_radius_daily {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
username String @db.VarChar(32)
|
||||
|
|
@ -282,6 +299,7 @@ model conso_radius_daily {
|
|||
@@index([username], map: "username")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_radius_daily2 {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
username String @db.VarChar(32)
|
||||
|
|
@ -295,6 +313,7 @@ model conso_radius_daily2 {
|
|||
@@index([username], map: "username")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_radius_hourly {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
username String @db.VarChar(32)
|
||||
|
|
@ -306,6 +325,7 @@ model conso_radius_hourly {
|
|||
@@index([username], map: "username")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_radius_monthly {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
date String @db.VarChar(32)
|
||||
|
|
@ -317,6 +337,7 @@ model conso_radius_monthly {
|
|||
@@index([username], map: "username")
|
||||
}
|
||||
|
||||
//NOT USED BY THE TICKET MODULE *********************
|
||||
model conso_radius_monthly2 {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
date String @db.VarChar(32)
|
||||
|
|
@ -330,8 +351,8 @@ model conso_radius_monthly2 {
|
|||
|
||||
|
||||
model delivery {
|
||||
id BigInt @id @default(autoincrement())
|
||||
account_id BigInt?
|
||||
id Int @id @default(autoincrement())
|
||||
account_id Int?
|
||||
name String @db.VarChar(32)
|
||||
comment String @db.VarChar(512)
|
||||
date_orig BigInt?
|
||||
|
|
@ -359,6 +380,7 @@ model delivery {
|
|||
@@index([placemarks_id], map: "placemarks_id")
|
||||
}
|
||||
|
||||
|
||||
model delivery_history {
|
||||
id Int @id @default(autoincrement()) @db.UnsignedInt
|
||||
account_id Int @db.UnsignedInt
|
||||
|
|
@ -1628,11 +1650,11 @@ model tv_mac {
|
|||
}
|
||||
|
||||
model ticket {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
id Int @id @default(autoincrement())
|
||||
ost_id Int? @db.UnsignedInt
|
||||
parent BigInt @default(0)
|
||||
account_id BigInt?
|
||||
delivery_id BigInt @default(0)
|
||||
account_id Int?
|
||||
delivery_id Int @default(0)
|
||||
bon_id Int? @db.UnsignedInt
|
||||
subject String? @db.VarChar(256)
|
||||
dept_id Int?
|
||||
|
|
@ -1707,9 +1729,9 @@ model ticket_dept {
|
|||
}
|
||||
|
||||
model ticket_msg {
|
||||
id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
|
||||
ticket_id BigInt
|
||||
staff_id BigInt @default(0)
|
||||
id Int @id @default(autoincrement())
|
||||
ticket_id Int
|
||||
staff_id Int @default(0)
|
||||
msg String? @db.MediumText
|
||||
date_orig BigInt?
|
||||
unread_csv String @db.MediumText
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Controller, Get } from '@nestjs/common';
|
||||
import { Controller } from '@nestjs/common';
|
||||
|
||||
@Controller()
|
||||
export class AppController { }
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
import { BadRequestException, Module, ValidationPipe } from '@nestjs/common';
|
||||
import { AppController } from './app.controller';
|
||||
import { AppService } from './app.service';
|
||||
import { NotificationsModule } from './shared/notifications/notifications.module';
|
||||
import { PrismaPostgresModule } from '../prisma/postgres/prisma-postgres.module';
|
||||
import { ScheduleModule } from '@nestjs/schedule';
|
||||
import { ConfigModule } from '@nestjs/config';
|
||||
|
|
@ -14,23 +13,24 @@ import { IdentityAndAccountModule } from 'src/identity-and-account/identity-and-
|
|||
import { ChatbotModule } from 'src/chatbot/chatbot.module';
|
||||
import { PrismaMariadbModule } from 'prisma/mariadb/prisma-mariadb.module';
|
||||
import { PrismaLegacyModule } from 'prisma/prisma-legacy/prisma-legacy.module';
|
||||
import { AccountModule } from 'src/customer-support/accounts/account.module';
|
||||
import { CustomerSupportModule } from 'src/customer-support/customer-support.module';
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
AccountModule,
|
||||
AuthenticationModule,
|
||||
ConfigModule.forRoot({ isGlobal: true }),
|
||||
ScheduleModule.forRoot(), //cronjobs
|
||||
NotificationsModule,
|
||||
PrismaPostgresModule,
|
||||
PrismaMariadbModule,
|
||||
PrismaLegacyModule,
|
||||
TimeAndAttendanceModule,
|
||||
IdentityAndAccountModule,
|
||||
ChatbotModule,
|
||||
CustomerSupportModule,
|
||||
],
|
||||
controllers: [
|
||||
AppController
|
||||
],
|
||||
controllers: [AppController],
|
||||
providers: [
|
||||
AppService,
|
||||
{
|
||||
|
|
|
|||
|
|
@ -8,11 +8,14 @@ import { Modules as ModulesEnum } from "prisma/postgres/generated/prisma/client/
|
|||
|
||||
@Controller('chatbot')
|
||||
export class ChatbotController {
|
||||
constructor(private readonly chatbotService: ChatbotService) {}
|
||||
constructor(private readonly chatbotService: ChatbotService) { }
|
||||
|
||||
@Post('')
|
||||
@ModuleAccessAllowed(ModulesEnum.chatbot)
|
||||
async testConnection(@Body() body: UserMessageDto, @Access('email') email: string): Promise<Message> {
|
||||
async testConnection(
|
||||
@Body() body: UserMessageDto,
|
||||
@Access('email') email: string,
|
||||
): Promise<Message> {
|
||||
return await this.chatbotService.pingExternalApi(body, email);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,4 +13,4 @@ import { ChatbotService } from 'src/chatbot/chatbot.service';
|
|||
providers: [ChatbotService],
|
||||
exports: [],
|
||||
})
|
||||
export class ChatbotModule {}
|
||||
export class ChatbotModule { }
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Injectable } from '@nestjs/common';
|
||||
import { UserMessageDto } from 'src/chatbot/dtos/user-message.dto';
|
||||
import { HttpService } from '@nestjs/axios';
|
||||
import { firstValueFrom } from 'rxjs';
|
||||
import { Message } from 'src/chatbot/dtos/dialog-message.dto';
|
||||
import { ChatbotResponseDto, UserMessageDto } from 'src/chatbot/dtos/user-message.dto';
|
||||
|
||||
@Injectable()
|
||||
export class ChatbotService {
|
||||
|
|
@ -19,7 +19,7 @@ export class ChatbotService {
|
|||
sessionId: this.sessionId,
|
||||
pageContext: body.pageContext ?? undefined
|
||||
}
|
||||
));
|
||||
))as ChatbotResponseDto;
|
||||
|
||||
if (!response.data)
|
||||
return {
|
||||
|
|
@ -46,34 +46,4 @@ export class ChatbotService {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
// async sendPageContext(body: PageContextDto, email: string) {
|
||||
// const { data } = await firstValueFrom(
|
||||
// this.httpService.post(
|
||||
// 'https://n8nai.targo.ca/webhook/chatty-Mcbot',
|
||||
// { features: body, userId: email, userInput: '' },
|
||||
// ),
|
||||
// );
|
||||
// return data;
|
||||
// }
|
||||
|
||||
// Will have to modify later on to accomodate newer versions of User Auth/User type Structure
|
||||
// async sendUserContext(user_email: string) {
|
||||
// if (!this.sessionId) {
|
||||
// this.sessionId = 'SessionId = ' + user_email;
|
||||
// }
|
||||
|
||||
// const response = await firstValueFrom(
|
||||
// this.httpService.post(
|
||||
// 'https://n8nai.targo.ca/webhook/chatty-Mcbot',
|
||||
// {
|
||||
// userId: this.sessionId,
|
||||
// userInput: '',
|
||||
// features: '',
|
||||
// },
|
||||
// { headers: { 'Content-Tyoe': 'application/json' } },
|
||||
// ),
|
||||
// );
|
||||
// return response.data;
|
||||
// }
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
import { IsBoolean, IsString } from 'class-validator';
|
||||
|
||||
export class Message {
|
||||
@IsString()
|
||||
text!: string;
|
||||
|
||||
@IsBoolean()
|
||||
sent!: boolean;
|
||||
@IsString() text: string;
|
||||
@IsBoolean() sent: boolean;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,15 +1,8 @@
|
|||
import { IsArray, IsString } from 'class-validator';
|
||||
import { IsArray, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class PageContextDto {
|
||||
@IsString()
|
||||
name: string;
|
||||
|
||||
@IsString()
|
||||
description: string;
|
||||
|
||||
@IsArray()
|
||||
features: string[];
|
||||
|
||||
@IsString()
|
||||
path?: string;
|
||||
@IsString() name: string;
|
||||
@IsString() description: string;
|
||||
@IsArray() features: string[];
|
||||
@IsString() @IsOptional() path?: string;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,11 +1,18 @@
|
|||
import { Transform, Type } from 'class-transformer';
|
||||
import { Type } from 'class-transformer';
|
||||
import { IsNotEmpty, IsOptional, IsString } from 'class-validator';
|
||||
import { PageContextDto } from './page-context.dto';
|
||||
|
||||
export class UserMessageDto {
|
||||
@IsString()
|
||||
@IsNotEmpty()
|
||||
@Transform(({ value }) => value.trim())
|
||||
userInput!: string;
|
||||
@IsString() userInput: string;
|
||||
@IsOptional() @Type(() => PageContextDto) pageContext?: PageContextDto | undefined;
|
||||
}
|
||||
|
||||
export class ChatbotResponseDto {
|
||||
@Type(() => ChatbotOutput) data: ChatbotOutput[];
|
||||
}
|
||||
|
||||
export class ChatbotOutput {
|
||||
@IsString() output: string;
|
||||
}
|
||||
|
|
@ -1,9 +1,14 @@
|
|||
import { createParamDecorator, ExecutionContext } from "@nestjs/common";
|
||||
import { UserDto } from "src/identity-and-account/users-management/user.dto";
|
||||
|
||||
export const Access = createParamDecorator(
|
||||
(data:string, ctx: ExecutionContext) => {
|
||||
const request = ctx.switchToHttp().getRequest();
|
||||
const user = request.user;
|
||||
export interface AuthenticatedRequest extends Request {
|
||||
user: UserDto;
|
||||
}
|
||||
|
||||
export const Access = createParamDecorator<keyof UserDto | undefined>(
|
||||
(data, ctx: ExecutionContext) => {
|
||||
const request = ctx.switchToHttp().getRequest<AuthenticatedRequest>();
|
||||
const user: UserDto = request.user;
|
||||
return data ? user?.[data] : user;
|
||||
},
|
||||
);
|
||||
|
|
@ -7,13 +7,7 @@ import {
|
|||
import { Reflector } from '@nestjs/core';
|
||||
import { MODULES_KEY } from '../decorators/modules-guard.decorators';
|
||||
import { Modules } from "prisma/postgres/generated/prisma/client/postgres/client";
|
||||
|
||||
|
||||
|
||||
interface RequestWithUser extends Request {
|
||||
// TODO: Create an actual user model based on OAuth signin
|
||||
user: any;
|
||||
}
|
||||
import { AuthenticatedRequest } from 'src/common/decorators/module-access.decorators';
|
||||
|
||||
@Injectable()
|
||||
export class ModulesGuard implements CanActivate {
|
||||
|
|
@ -27,7 +21,7 @@ export class ModulesGuard implements CanActivate {
|
|||
if (!requiredModules || requiredModules.length === 0) {
|
||||
return true;
|
||||
}
|
||||
const request = ctx.switchToHttp().getRequest<RequestWithUser>();
|
||||
const request = ctx.switchToHttp().getRequest<AuthenticatedRequest>();
|
||||
const user = request.user;
|
||||
|
||||
if (!user) {
|
||||
|
|
@ -36,7 +30,7 @@ export class ModulesGuard implements CanActivate {
|
|||
for (const module of requiredModules) {
|
||||
if (!user.user_module_access.includes(module)) {
|
||||
throw new ForbiddenException(
|
||||
`This account does not have required access to: ${module}. current user modules: ${user.user_module_access} , required modules: ${requiredModules}`,
|
||||
`This account does not have required access to: ${module}. current user modules: ${user.user_module_access.toString()} , required modules: ${requiredModules.toString()}`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Prisma, PrismaClient } from "prisma/postgres/generated/prisma/client/postgres/client";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { PrismaPostgresService } from "prisma/postgres/prisma-postgres.service";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
|
||||
type Tx = Prisma.TransactionClient | PrismaClient;
|
||||
|
||||
|
|
@ -25,7 +25,9 @@ export class BankCodesResolver {
|
|||
};
|
||||
|
||||
//finds only id by type
|
||||
readonly findBankCodeIDByType = async (type: string, client?: Tx
|
||||
readonly findBankCodeIDByType = async (
|
||||
type: string,
|
||||
client?: Tx
|
||||
): Promise<Result<number, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const bank_code = await db.bankCodes.findFirst({
|
||||
|
|
@ -37,7 +39,9 @@ export class BankCodesResolver {
|
|||
return { success: true, data: bank_code.id };
|
||||
}
|
||||
|
||||
readonly findTypeByBankCodeId = async (bank_code_id: number, client?: Tx
|
||||
readonly findTypeByBankCodeId = async (
|
||||
bank_code_id: number,
|
||||
client?: Tx
|
||||
): Promise<Result<string, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const bank_code = await db.bankCodes.findFirst({
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
|
||||
import { PrismaPostgresService } from "prisma/postgres/prisma-postgres.service";
|
||||
import { Injectable } from "@nestjs/common";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { PrismaPostgresService } from "prisma/postgres/prisma-postgres.service";
|
||||
import { Prisma, PrismaClient } from "prisma/postgres/generated/prisma/client/postgres/client";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
|
||||
type Tx = Prisma.TransactionClient | PrismaClient;
|
||||
|
||||
|
|
@ -12,7 +12,9 @@ export class EmailToIdResolver {
|
|||
constructor(private readonly prisma: PrismaPostgresService) { }
|
||||
|
||||
// find employee_id using email
|
||||
readonly findIdByEmail = async (email: string, client?: Tx
|
||||
readonly findIdByEmail = async (
|
||||
email: string,
|
||||
client?: Tx
|
||||
): Promise<Result<number, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const employee = await db.employees.findFirst({
|
||||
|
|
@ -24,7 +26,9 @@ export class EmailToIdResolver {
|
|||
}
|
||||
|
||||
// find user_id using email
|
||||
readonly resolveUserIdWithEmail = async (email: string, client?: Tx
|
||||
readonly resolveUserIdWithEmail = async (
|
||||
email: string,
|
||||
client?: Tx
|
||||
): Promise<Result<string, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const user = await db.users.findFirst({
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { PrismaPostgresService } from "prisma/postgres/prisma-postgres.service";
|
||||
import { Prisma, PrismaClient } from "prisma/postgres/generated/prisma/client/postgres/client";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
|
||||
type Tx = Prisma.TransactionClient | PrismaClient;
|
||||
|
||||
|
|
@ -9,7 +9,10 @@ type Tx = Prisma.TransactionClient | PrismaClient;
|
|||
export class FullNameResolver {
|
||||
constructor(private readonly prisma: PrismaPostgresService) { }
|
||||
|
||||
readonly resolveFullName = async (employee_id: number, client?: Tx): Promise<Result<string, string>> => {
|
||||
readonly resolveFullName = async (
|
||||
employee_id: number,
|
||||
client?: Tx
|
||||
): Promise<Result<string, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const employee = await db.employees.findUnique({
|
||||
where: { id: employee_id },
|
||||
|
|
|
|||
|
|
@ -19,7 +19,9 @@ interface ShiftKey {
|
|||
export class ShiftIdResolver {
|
||||
constructor(private readonly prisma: PrismaPostgresService) { }
|
||||
|
||||
readonly findShiftIdByData = async (key: ShiftKey, client?: Tx
|
||||
readonly findShiftIdByData = async (
|
||||
key: ShiftKey,
|
||||
client?: Tx
|
||||
): Promise<Result<number, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const shift = await db.shifts.findFirst({
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { PrismaPostgresService } from "prisma/postgres/prisma-postgres.service";
|
||||
import { EmailToIdResolver } from "./email-id.mapper";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { weekStartSunday } from "src/common/utils/date-utils";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { PrismaPostgresService } from "prisma/postgres/prisma-postgres.service";
|
||||
import { PrismaClient } from "prisma/postgres/generated/prisma/client/postgres/internal/class";
|
||||
import { Prisma } from "prisma/postgres/generated/prisma/client/postgres/client";
|
||||
|
||||
|
|
@ -16,7 +16,11 @@ export class EmployeeTimesheetResolver {
|
|||
private readonly emailResolver: EmailToIdResolver,
|
||||
) { }
|
||||
|
||||
readonly findTimesheetIdByEmail = async (email: string, date: Date, client?: Tx): Promise<Result<{ id: number }, string>> => {
|
||||
readonly findTimesheetIdByEmail = async (
|
||||
email: string,
|
||||
date: Date,
|
||||
client?: Tx
|
||||
): Promise<Result<{ id: number }, string>> => {
|
||||
const db = (client ?? this.prisma) as PrismaClient;
|
||||
const employee_id = await this.emailResolver.findIdByEmail(email);
|
||||
if (!employee_id.success) return { success: false, error: employee_id.error }
|
||||
|
|
|
|||
|
|
@ -20,7 +20,10 @@ export abstract class BaseApprovalService<T> {
|
|||
protected abstract delegateFor(tx: TransactionClient): UpdatableDelegate<T>;
|
||||
|
||||
//standard update Aproval
|
||||
async updateApproval(id: number, is_approved: boolean): Promise<T> {
|
||||
async updateApproval(
|
||||
id: number,
|
||||
is_approved: boolean
|
||||
): Promise<T> {
|
||||
try {
|
||||
return await this.delegate.update({
|
||||
where: { id },
|
||||
|
|
@ -34,7 +37,11 @@ export abstract class BaseApprovalService<T> {
|
|||
}
|
||||
}
|
||||
|
||||
async updateApprovalWithTransaction(tx: TransactionClient, id: number, is_approved: boolean): Promise<T> {
|
||||
async updateApprovalWithTransaction(
|
||||
tx: TransactionClient,
|
||||
id: number,
|
||||
is_approved: boolean
|
||||
): Promise<T> {
|
||||
try {
|
||||
return await this.delegateFor(tx).update({
|
||||
where: { id },
|
||||
|
|
|
|||
|
|
@ -1,21 +0,0 @@
|
|||
//Prisma 'where' clause for DTO filters
|
||||
export function buildPrismaWhere<T extends Record<string, any>>(dto: T): Record <string, any> {
|
||||
const where: Record<string,any> = {};
|
||||
|
||||
for (const [key,value] of Object.entries(dto)) {
|
||||
if (value === undefined || value === null) continue;
|
||||
|
||||
if (key.endsWith('_contains')) {
|
||||
const field = key.slice(0, - '_contains'.length);
|
||||
where[field] = { constains: value };
|
||||
} else if (key === 'start_date' || key === 'end_date') {
|
||||
where.date = where.date || {};
|
||||
const op = key === 'start_date' ? 'gte' : 'lte';
|
||||
where.date[op] = new Date(value);
|
||||
} else {
|
||||
where[key] = value;
|
||||
}
|
||||
}
|
||||
|
||||
return where;
|
||||
}
|
||||
|
|
@ -156,3 +156,11 @@ export const addHourstoDateString = (start_time: string, hours: number): string
|
|||
const mm = String(end.getUTCMinutes()).padStart(2, '0');
|
||||
return `${hh}:${mm}:00`;
|
||||
}
|
||||
|
||||
export const timestampToStringDate = (timestamp: number): string => {
|
||||
const date = new Date(timestamp);
|
||||
const dd = date.getDate().toString().padStart(2, '0');
|
||||
const mm = (date.getMonth() + 1).toString().padStart(2, '0');
|
||||
const yyyy = date.getFullYear();
|
||||
return `${dd}-${mm}-${yyyy}`;
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
# GET http://localhost:3000/accounts
|
||||
|
||||
# GET http://localhost:3000/accounts/6912
|
||||
|
||||
|
||||
GET http://localhost:3000/accounts/account/6912
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
import { Controller, Get, Param } from "@nestjs/common";
|
||||
import { AccountMemoService } from "src/customer-support/accounts/services/account-memo.service";
|
||||
import { AccountService } from "src/customer-support/accounts/services/account.service";
|
||||
|
||||
|
||||
@Controller('accounts')
|
||||
export class AccountController {
|
||||
constructor(
|
||||
private readonly accountService: AccountService,
|
||||
private readonly memoService: AccountMemoService,
|
||||
) { }
|
||||
|
||||
@Get()
|
||||
findAllAccounts() {
|
||||
return this.accountService.findAllAccounts();
|
||||
}
|
||||
|
||||
@Get('account/:id')
|
||||
findAccountById(@Param('accountId') accountId: number) {
|
||||
return this.accountService.findAccountById(accountId);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findMemosByAccountId(@Param('accountId') accountId: number) {
|
||||
return this.memoService.findMemosByAccountId(accountId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
export class Account {
|
||||
id: number;
|
||||
customerId?: string;
|
||||
language: string;
|
||||
username?: string;
|
||||
password?: string;
|
||||
groupId: number;
|
||||
status?: number;
|
||||
firstName?: string;
|
||||
lastName?: string;
|
||||
mandataire?: string; //sometimes the first_name and last_name are found here, sometimes its the name of someone who manage the account
|
||||
title?: string;
|
||||
email?: string[];
|
||||
company?: string;
|
||||
contact: string;
|
||||
address?: string[]; //string of country, city, state, zip, road, number, apt concat.
|
||||
telHome?: string;
|
||||
telOffice?: string;
|
||||
telOffice_ext?: string;
|
||||
cell?: string;
|
||||
fax?: string;
|
||||
landOwner: boolean;
|
||||
commercial: boolean;
|
||||
vip: boolean;
|
||||
notes_client?: string;
|
||||
terminateReason?: string;
|
||||
terminateCie?: string;
|
||||
terminateNote?: string;
|
||||
terminateDate?: string;
|
||||
mauvaisPayeur: boolean;
|
||||
};
|
||||
|
||||
export class AccountMemo {
|
||||
last_updated: number;
|
||||
staff_id: number;
|
||||
memo?: string;
|
||||
};
|
||||
|
|
@ -1,11 +0,0 @@
|
|||
import { Module } from "@nestjs/common";
|
||||
import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service";
|
||||
import { AccountController } from "src/customer-support/accounts/account.controller";
|
||||
import { AccountMemoService } from "src/customer-support/accounts/services/account-memo.service";
|
||||
import { AccountService } from "src/customer-support/accounts/services/account.service";
|
||||
|
||||
|
||||
@Module({
|
||||
controllers: [ AccountController ],
|
||||
providers: [ AccountService, PrismaMariaDbService, AccountMemoService ],
|
||||
}) export class AccountModule { };
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@Injectable()
|
||||
export class AccountCreateService {
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
|
||||
@Injectable()
|
||||
export class AccountMemoUpdateService {
|
||||
|
||||
}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { AccountMemo } from "src/customer-support/accounts/account.dto";
|
||||
|
||||
@Injectable()
|
||||
export class AccountMemoService {
|
||||
constructor(private readonly prismaMariaDb: PrismaMariaDbService) { }
|
||||
|
||||
findMemosByAccountId = async (accountId: number): Promise<Result<AccountMemo[], string>> => {
|
||||
const listOfMemos: AccountMemo[] = [];
|
||||
|
||||
const rawListOfMemos = await this.prismaMariaDb.account_memo.findMany({
|
||||
where: { id: accountId },
|
||||
select: { last_updated: true, staff_id: true, memo: true },
|
||||
});
|
||||
if (!rawListOfMemos) return { success: false, error: 'MEMOS_NOT_FOUND' };
|
||||
|
||||
for (const memo of rawListOfMemos) {
|
||||
listOfMemos.push({
|
||||
last_updated: Number(memo.last_updated),
|
||||
staff_id: Number(memo.staff_id),
|
||||
memo: memo.memo ? memo.memo : '',
|
||||
});
|
||||
}
|
||||
return { success: true, data: listOfMemos }
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
// import { Injectable } from "@nestjs/common";
|
||||
// import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service";
|
||||
// import { Result } from "src/common/errors/result-error.factory";
|
||||
// import { Account } from "src/customer-support/accounts/account.dto";
|
||||
|
||||
// @Injectable()
|
||||
// export class AccountUpdateService {
|
||||
// constructor(private readonly prisma: PrismaMariaDbService) { }
|
||||
|
||||
// async updateAccount(account: Account): Promise<Result<boolean, string>> {
|
||||
|
||||
// const oldAccountInfos = await this.prisma.account.findUnique({
|
||||
// where: { id: account.id },
|
||||
// });
|
||||
// if (!oldAccountInfos) return { success: false, error: 'ACCOUNT_NOT_FOUND' };
|
||||
|
||||
// await this.prisma.account.update({
|
||||
// where: { id: oldAccountInfos.id },
|
||||
// data: {
|
||||
// customer_id: account.customerId,
|
||||
// language_id: account.language,
|
||||
// username: account.username,
|
||||
// password: account.password,
|
||||
// group_id: account.groupId,
|
||||
// status: account.status,
|
||||
// first_name: account.firstName,
|
||||
// last_name: account.lastName,
|
||||
// mandataire: account.mandataire,
|
||||
// title: account.title,
|
||||
// email: account.email,
|
||||
// company: account.company,
|
||||
// contact: account.contact,
|
||||
// address1: account.address,
|
||||
// address2: account.address,
|
||||
// tel_home: account.telHome,
|
||||
// tel_office: account.telOffice,
|
||||
// tel_office_ext: account.telOffice_ext,
|
||||
// cell: account.cell,
|
||||
// fax: account.fax,
|
||||
// land_owner: account.landOwner,
|
||||
// commercial: account.commercial,
|
||||
// vip: account.vip,
|
||||
// notes_client: account.notes_client,
|
||||
// terminate_reason: account.terminateReason,
|
||||
// terminate_cie: account.terminateCie,
|
||||
// terminate_date: account.terminateDate,
|
||||
// terminate_note: account.terminateNote,
|
||||
// mauvais_payeur: account.mauvaisPayeur,
|
||||
// },
|
||||
// });
|
||||
|
||||
|
||||
|
||||
|
||||
// }
|
||||
// }
|
||||
|
|
@ -1,128 +0,0 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { Account } from "src/customer-support/accounts/account.dto";
|
||||
|
||||
|
||||
@Injectable()
|
||||
export class AccountService {
|
||||
constructor(private readonly prismaMariaDb: PrismaMariaDbService) { }
|
||||
|
||||
findAllAccounts = async (): Promise<Result<Account[], string>> => {
|
||||
const listOfAccounts: Account[] = [];
|
||||
|
||||
const rawListOfAccounts = await this.prismaMariaDb.account.findMany({});
|
||||
if (!rawListOfAccounts) return { success: false, error: 'ACCOUNTS_NOT_FOUND' }
|
||||
try {
|
||||
|
||||
for (const account of rawListOfAccounts) {
|
||||
const emailList: string[] = [
|
||||
account.email ? account.email : '',
|
||||
account.email_autre ? account.email_autre : '',
|
||||
];
|
||||
|
||||
const addressList: string[] = [
|
||||
account.address1 ? account.address1 : '',
|
||||
account.address2 ? account.address2 : '',
|
||||
account.city ? account.city : '',
|
||||
account.state ? account.state : '',
|
||||
account.zip ? account.zip : '',
|
||||
account.country_id.toString(),
|
||||
];
|
||||
|
||||
listOfAccounts.push({
|
||||
id: Number(account.id),
|
||||
customerId: account.customer_id ? account.customer_id : '',
|
||||
language: account.language_id,
|
||||
username: account.username ? account.username : '',
|
||||
password: account.password ? account.password : '',
|
||||
groupId: account.group_id ? account.group_id : 0,
|
||||
status: account.status ? account.status : 0,
|
||||
firstName: account.first_name ? account.first_name : '',
|
||||
lastName: account.last_name ? account.last_name : '',
|
||||
mandataire: account.mandataire ? account.mandataire : '',
|
||||
title: account.title ? account.title : '',
|
||||
email: emailList,
|
||||
company: account.company ? account.company : '',
|
||||
contact: account.contact,
|
||||
address: addressList,
|
||||
telHome: account.tel_home ? account.tel_home : '',
|
||||
telOffice: account.tel_office ? account.tel_office : '',
|
||||
telOffice_ext: account.tel_office_ext ? account.tel_office_ext : '',
|
||||
cell: account.cell ? account.cell : '',
|
||||
fax: account.fax ? account.fax : '',
|
||||
landOwner: account.land_owner,
|
||||
commercial: account.commercial,
|
||||
vip: account.vip,
|
||||
notes_client: account.notes_client ? account.notes_client : '',
|
||||
terminateReason: account.terminate_reason ? account.terminate_reason : '',
|
||||
terminateCie: account.terminate_cie ? account.terminate_cie : '',
|
||||
terminateNote: account.terminate_note ? account.terminate_note : '',
|
||||
terminateDate: account.terminate_date ? account.terminate_date : '',
|
||||
mauvaisPayeur: account.mauvais_payeur,
|
||||
});
|
||||
}
|
||||
console.log(listOfAccounts);
|
||||
return { success: true, data: listOfAccounts };
|
||||
|
||||
} catch (error) {
|
||||
return { success: false, error: error + " \n An error occured during retrieving the list of accounts" }
|
||||
}
|
||||
}
|
||||
|
||||
findAccountById = async (accountId: number): Promise<Result<Account, string>> => {
|
||||
|
||||
const rawAccount = await this.prismaMariaDb.account.findUnique({
|
||||
where: { id: accountId }
|
||||
});
|
||||
if (!rawAccount) return { success: false, error: 'ACCOUNT_NOT_FOUND' }
|
||||
|
||||
const emailList: string[] = [
|
||||
rawAccount.email ? rawAccount.email : '',
|
||||
rawAccount.email_autre ? rawAccount.email_autre : '',
|
||||
];
|
||||
|
||||
const addressList: string[] = [
|
||||
rawAccount.address1 ? rawAccount.address1 : '',
|
||||
rawAccount.address2 ? rawAccount.address2 : '',
|
||||
rawAccount.city ? rawAccount.city : '',
|
||||
rawAccount.state ? rawAccount.state : '',
|
||||
rawAccount.zip ? rawAccount.zip : '',
|
||||
rawAccount.country_id.toString(),
|
||||
];
|
||||
|
||||
const account: Account = {
|
||||
id: Number(rawAccount.id),
|
||||
customerId: rawAccount.customer_id ? rawAccount.customer_id : '',
|
||||
language: rawAccount.language_id,
|
||||
username: rawAccount.username ? rawAccount.username : '',
|
||||
password: rawAccount.password ? rawAccount.password : '',
|
||||
groupId: rawAccount.group_id ? rawAccount.group_id : 0,
|
||||
status: rawAccount.status ? rawAccount.status : 0,
|
||||
firstName: rawAccount.first_name ? rawAccount.first_name : '',
|
||||
lastName: rawAccount.last_name ? rawAccount.last_name : '',
|
||||
mandataire: rawAccount.mandataire ? rawAccount.mandataire : '',
|
||||
title: rawAccount.title ? rawAccount.title : '',
|
||||
email: emailList,
|
||||
company: rawAccount.company ? rawAccount.company : '',
|
||||
contact: rawAccount.contact,
|
||||
address: addressList,
|
||||
telHome: rawAccount.tel_home ? rawAccount.tel_home : '',
|
||||
telOffice: rawAccount.tel_office ? rawAccount.tel_office : '',
|
||||
telOffice_ext: rawAccount.tel_office_ext ? rawAccount.tel_office_ext : '',
|
||||
cell: rawAccount.cell ? rawAccount.cell : '',
|
||||
fax: rawAccount.fax ? rawAccount.fax : '',
|
||||
landOwner: rawAccount.land_owner,
|
||||
commercial: rawAccount.commercial,
|
||||
vip: rawAccount.vip,
|
||||
notes_client: rawAccount.notes_client ? rawAccount.notes_client : '',
|
||||
terminateReason: rawAccount.terminate_reason ? rawAccount.terminate_reason : '',
|
||||
terminateCie: rawAccount.terminate_cie ? rawAccount.terminate_cie : '',
|
||||
terminateNote: rawAccount.terminate_note ? rawAccount.terminate_note : '',
|
||||
terminateDate: rawAccount.terminate_date ? rawAccount.terminate_date : '',
|
||||
mauvaisPayeur: rawAccount.mauvais_payeur,
|
||||
}
|
||||
|
||||
return { success: true, data: account };
|
||||
}
|
||||
}
|
||||
|
|
@ -1,8 +1,13 @@
|
|||
import { Module } from "@nestjs/common";
|
||||
import { TicketController } from "src/customer-support/tickets/ticket.controller";
|
||||
import { TicketService } from "src/customer-support/tickets/ticket.service";
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [],
|
||||
providers: [],
|
||||
exports: [],
|
||||
}) export class CustomerSupportModule {}
|
||||
controllers: [
|
||||
TicketController
|
||||
],
|
||||
providers: [
|
||||
TicketService
|
||||
],
|
||||
|
||||
}) export class CustomerSupportModule { }
|
||||
1
src/customer-support/http-test-files/ticket.test.http
Normal file
1
src/customer-support/http-test-files/ticket.test.http
Normal file
|
|
@ -0,0 +1 @@
|
|||
GET http://localhost:3000/tickets/OPEN?sortOrder=last_update&sortTypes=DESC&offset=0&limit=10&email=gilles@targointernet.com
|
||||
14
src/customer-support/tickets/dtos/ticket-list.dto.ts
Normal file
14
src/customer-support/tickets/dtos/ticket-list.dto.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { IsInt, IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class TicketList {
|
||||
@IsInt() id: number;
|
||||
@IsString() status: string;
|
||||
@IsString() @IsOptional() assignTo: string;
|
||||
@IsString() deliveryAddress: string;
|
||||
@IsString() subject: string;
|
||||
@IsString() department: string;
|
||||
@IsInt() @IsOptional() parentTicketId: number;
|
||||
@IsString() dueDate: string;
|
||||
@IsString() updatedAt: string;
|
||||
@IsString() @IsOptional() completedAt: string;
|
||||
}
|
||||
69
src/customer-support/tickets/dtos/ticket.dto.ts
Normal file
69
src/customer-support/tickets/dtos/ticket.dto.ts
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
import { Type } from "class-transformer";
|
||||
import { IsBoolean, IsInt, IsOptional, IsString } from "class-validator";
|
||||
|
||||
export class DeliveryAddress {
|
||||
@IsString() address: string;
|
||||
@IsString() department: string;
|
||||
@IsString() shortDescription: string;
|
||||
@IsString() description: string;
|
||||
}
|
||||
|
||||
export class TicketHistory {
|
||||
@Type(() => Ticket) ticket: Ticket[];
|
||||
}
|
||||
|
||||
export class Message {
|
||||
@IsString() attachment: string;
|
||||
@IsString() comment: string;
|
||||
@IsString() createdBy: string;
|
||||
@IsString() createdAt: string;
|
||||
}
|
||||
|
||||
export class Service {
|
||||
@IsString() serviceType: string;
|
||||
@IsString() shortDescription: string;
|
||||
@Type(() => Number) price: number;
|
||||
@IsBoolean() status: boolean;
|
||||
}
|
||||
|
||||
export class Device {
|
||||
@IsString() name: string;
|
||||
@IsString() model: string;
|
||||
@IsString() category: string;
|
||||
@IsString() sku: string;
|
||||
@IsString() sn: string;
|
||||
@IsString() gponSn: string;
|
||||
@IsString() @IsOptional() mac?: string;
|
||||
@IsString() @IsOptional() wifiPass?: string;
|
||||
@IsString() @IsOptional() tag?: string;
|
||||
@IsString() room: string;
|
||||
@Type(() => Number) price: number;
|
||||
@IsString() @IsOptional() speed?: string;
|
||||
@IsString() description: string;
|
||||
}
|
||||
|
||||
export class Contact {
|
||||
@IsString() FirstName: string;
|
||||
@IsString() LastName: string;
|
||||
@IsString() @IsOptional() telHome?: string;
|
||||
@IsString() @IsOptional() telOffice?: string;
|
||||
@IsString() @IsOptional() telOfficeExt?: string;
|
||||
@IsString() @IsOptional() cell?: string;
|
||||
@IsString() @IsOptional() fax?: string;
|
||||
@IsString() email: string;
|
||||
}
|
||||
|
||||
export class Ticket {
|
||||
@IsInt() id: number;
|
||||
@IsString() createdAt: string;
|
||||
@Type(() => DeliveryAddress) deliveryAddress: DeliveryAddress;
|
||||
@Type(() => Message) message: Message[];
|
||||
@Type(() => Service) service: Service[];
|
||||
@Type(() => Device) device: Device[];
|
||||
@Type(() => Contact) contact: Contact[];
|
||||
@Type(() => TicketHistory) TicketHistory: TicketHistory;
|
||||
}
|
||||
|
||||
|
||||
export const sortOrders: string[] = ['id', 'status', 'assign_to', 'address1', 'subject', 'dept_id', 'parent', 'due_date', 'last_update', 'date_closed'];
|
||||
export const sortTypes: string[] = ['ASC', 'DESC'];
|
||||
|
|
@ -0,0 +1,34 @@
|
|||
import { Controller, Get, Param, ParseIntPipe, Query } from "@nestjs/common";
|
||||
import { Access } from "src/common/decorators/module-access.decorators";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { TicketList } from "src/customer-support/tickets/dtos/ticket-list.dto";
|
||||
import { TicketService } from "src/customer-support/tickets/ticket.service";
|
||||
|
||||
@Controller('tickets')
|
||||
export class TicketController {
|
||||
|
||||
constructor(private readonly getService: TicketService) { }
|
||||
|
||||
@Get(':status')
|
||||
async findTicketByFilters(
|
||||
@Access('email') email: string,
|
||||
@Param('status') status: string,
|
||||
@Query('sortOrder') sortOrder: string,
|
||||
@Query('sortType') sortType: 'DESC' | 'ASC',
|
||||
@Query('email') filterEmail?: string,
|
||||
@Query('offset', ParseIntPipe) offset?: number,
|
||||
@Query('limit', ParseIntPipe) limit?: number,
|
||||
): Promise<Result<TicketList[], string>> {
|
||||
const statusFilters = status.split(',');
|
||||
const queryEmail = filterEmail ?? email;
|
||||
|
||||
return await this.getService.getListOfAllTicketByFilters(
|
||||
statusFilters,
|
||||
offset,
|
||||
limit,
|
||||
sortOrder,
|
||||
sortType,
|
||||
queryEmail,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
import { Module } from "@nestjs/common";
|
||||
import { TicketController } from "src/customer-support/tickets/ticket.controller";
|
||||
import { TicketService } from "src/customer-support/tickets/ticket.service";
|
||||
|
||||
@Module({
|
||||
imports: [
|
||||
TicketService
|
||||
],
|
||||
providers: [
|
||||
TicketController
|
||||
]
|
||||
})
|
||||
export class TicketModule { }
|
||||
|
|
@ -0,0 +1,62 @@
|
|||
import { Injectable } from "@nestjs/common";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { PrismaMariaDbService } from "prisma/mariadb/prisma-mariadb.service";
|
||||
import { TicketList } from "src/customer-support/tickets/dtos/ticket-list.dto";
|
||||
import { sortOrders, sortTypes } from "src/customer-support/tickets/dtos/ticket.dto";
|
||||
import { Prisma } from "prisma/mariadb/generated/prisma/client/mariadb/client";
|
||||
|
||||
@Injectable()
|
||||
export class TicketService {
|
||||
constructor(private readonly prisma: PrismaMariaDbService) { }
|
||||
|
||||
getListOfAllTicketByFilters = async (
|
||||
status: string[],
|
||||
offset: number = 0,
|
||||
limit: number = 25,
|
||||
sortOrder: string = 'last_update',
|
||||
sortType: 'DESC' | 'ASC' = 'DESC',
|
||||
email?: string
|
||||
): Promise<Result<TicketList[], string>> => {
|
||||
|
||||
try {
|
||||
const staff = await this.prisma.staff.findFirst({
|
||||
where: { email },
|
||||
});
|
||||
if (!staff) return { success: false, error: 'EMPLOYEE_NOT_FOUND' }
|
||||
if (!sortOrders.includes(sortOrder) || !sortTypes.includes(sortType)) return { success: false, error: 'INVALID_FILTER' }
|
||||
|
||||
const statusList = Prisma.join(status);
|
||||
|
||||
const rawticketList = await this.prisma.$queryRaw<TicketList[]>(
|
||||
Prisma.sql`
|
||||
SELECT
|
||||
t.id AS id,
|
||||
t.status AS status,
|
||||
CONCAT(s.first_name,' ',s.last_name) AS assignTo,
|
||||
a.address1 AS deliveryAddress,
|
||||
t.subject AS subject,
|
||||
d.name AS department,
|
||||
t.parent AS parentTicketId,
|
||||
DATE_FORMAT(FROM_UNIXTIME(t.due_date / 1000), '%d/%m/%y') AS dueDate,
|
||||
DATE_FORMAT(FROM_UNIXTIME(t.last_update / 1000), '%d/%m/%y') AS updatedAt,
|
||||
CASE
|
||||
WHEN t.date_closed IS NOT NULL
|
||||
THEN DATE_FORMAT(FROM_UNIXTIME(t.date_closed / 1000), '%d/%m/%y')
|
||||
ELSE NULL
|
||||
END AS completedAt
|
||||
FROM staff s
|
||||
LEFT JOIN ticket t ON t.assign_to = s.id
|
||||
LEFT JOIN account a ON t.account_id = a.id
|
||||
LEFT JOIN ticket_dept d ON t.dept_id = d.id
|
||||
WHERE s.email = ${email}
|
||||
AND t.status IN (${statusList})
|
||||
ORDER BY ${Prisma.raw(sortOrder)} ${Prisma.raw(sortType)}
|
||||
LIMIT ${limit} OFFSET ${offset};
|
||||
`);
|
||||
|
||||
return { success: true, data: rawticketList }
|
||||
} catch (error) {
|
||||
return { success: false, error: 'TICKET_LIST_NOT_FOUND, ' + error };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -9,17 +9,23 @@ import { UsersService } from 'src/identity-and-account/users-management/services
|
|||
|
||||
|
||||
@Module({
|
||||
imports: [ PassportModule.register({
|
||||
imports: [
|
||||
PassportModule.register({
|
||||
session: true,
|
||||
defaultStrategy: 'openidconnect'
|
||||
}), UsersModule, ],
|
||||
}), UsersModule,
|
||||
],
|
||||
providers: [
|
||||
AuthentikAuthService,
|
||||
AuthentikStrategy,
|
||||
ExpressSessionSerializer,
|
||||
UsersService,
|
||||
],
|
||||
exports: [ AuthentikAuthService ],
|
||||
controllers: [AuthController],
|
||||
exports: [
|
||||
AuthentikAuthService
|
||||
],
|
||||
controllers: [
|
||||
AuthController
|
||||
],
|
||||
})
|
||||
export class AuthenticationModule {}
|
||||
export class AuthenticationModule { }
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ export class AuthController {
|
|||
|
||||
@Get('callback')
|
||||
@UseGuards(OIDCLoginGuard)
|
||||
loginCallback(@Req() req: Request, @Res() res: Response) {
|
||||
loginCallback(@Req() _req: Request, @Res() res: Response) {
|
||||
res.redirect(process.env.REDIRECT_URL_DEV!);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,12 @@
|
|||
import { ExecutionContext, Injectable } from '@nestjs/common';
|
||||
import { AuthGuard } from '@nestjs/passport';
|
||||
import { Request } from 'express';
|
||||
|
||||
@Injectable()
|
||||
export class OIDCLoginGuard extends AuthGuard('openidconnect') {
|
||||
async canActivate(context: ExecutionContext) {
|
||||
const result = (await super.canActivate(context)) as boolean;
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const request = context.switchToHttp().getRequest<Request>();
|
||||
await super.logIn(request);
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ export class ExpressSessionSerializer extends PassportSerializer {
|
|||
}
|
||||
done(null, user);
|
||||
}
|
||||
deserializeUser(payload: any, done: (err: any, payload: string) => void): any {
|
||||
deserializeUser(payload: any, done: (err: any, payload: any) => void): any {
|
||||
if (!payload){
|
||||
done(new UnauthorizedException('Deserialize user error'), payload);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,12 +1,13 @@
|
|||
|
||||
import { Injectable } from '@nestjs/common';
|
||||
import { UsersService } from 'src/identity-and-account/users-management/services/users.service';
|
||||
import { UserDto } from 'src/identity-and-account/users-management/user.dto';
|
||||
|
||||
@Injectable()
|
||||
export class AuthentikAuthService {
|
||||
constructor(private usersService: UsersService) {}
|
||||
|
||||
async validateUser(user_email: string): Promise<any> {
|
||||
async validateUser(user_email: string): Promise<Partial<UserDto>> {
|
||||
const user = await this.usersService.findOneByEmail(user_email);
|
||||
|
||||
return user;
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ export class AuthentikStrategy extends PassportStrategy(OIDCStrategy, 'openidcon
|
|||
|
||||
async validate(
|
||||
_issuer: string,
|
||||
profile: Profile,
|
||||
_profile: Profile,
|
||||
_context: any,
|
||||
_idToken: string,
|
||||
idToken: string,
|
||||
_accessToken: string,
|
||||
_refreshToken: string,
|
||||
_params: any,
|
||||
|
|
@ -50,9 +50,9 @@ export class AuthentikStrategy extends PassportStrategy(OIDCStrategy, 'openidcon
|
|||
try {
|
||||
|
||||
|
||||
const components = _idToken.split('.');
|
||||
const components = idToken.split('.');
|
||||
const payload = Buffer.from(components[1], "base64").toString('utf-8');
|
||||
const claims = JSON.parse(payload);
|
||||
const claims = JSON.parse(payload) as AuthentikPayload;
|
||||
|
||||
if (!claims.email) return cb(new Error('Missing email in OIDC profile'), false);
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,17 @@ export class EmployeesController {
|
|||
|
||||
@Get('personal-profile')
|
||||
@ModuleAccessAllowed(ModulesEnum.personal_profile)
|
||||
async findOwnProfile(@Access('email') email: string): Promise<Result<Partial<EmployeeDetailedDto>, string>> {
|
||||
async findOwnProfile(
|
||||
@Access('email') email: string
|
||||
): Promise<Result<Partial<EmployeeDetailedDto>, string>> {
|
||||
return await this.getService.findOwnProfile(email);
|
||||
}
|
||||
|
||||
@Get('profile')
|
||||
@ModuleAccessAllowed(ModulesEnum.personal_profile)
|
||||
async findProfile(@Access('email') email: string, @Query('employee_email') employee_email?: string,
|
||||
async findProfile(
|
||||
@Access('email') email: string,
|
||||
@Query('employee_email') employee_email?: string,
|
||||
): Promise<Result<Partial<EmployeeDetailedDto>, string>> {
|
||||
return await this.getService.findOneDetailedProfile(email, employee_email);
|
||||
}
|
||||
|
|
@ -37,13 +41,17 @@ export class EmployeesController {
|
|||
|
||||
@Post('create')
|
||||
@ModuleAccessAllowed(ModulesEnum.employee_management)
|
||||
async createEmployee(@Body() dto: EmployeeDetailedUpsertDto): Promise<Result<boolean, string>> {
|
||||
async createEmployee(
|
||||
@Body() dto: EmployeeDetailedUpsertDto
|
||||
): Promise<Result<boolean, string>> {
|
||||
return await this.createService.createEmployee(dto);
|
||||
}
|
||||
|
||||
@Patch('update')
|
||||
@ModuleAccessAllowed(ModulesEnum.employee_management)
|
||||
async updateEmployee(@Body() dto:EmployeeDetailedUpsertDto){
|
||||
async updateEmployee(
|
||||
@Body() dto:EmployeeDetailedUpsertDto
|
||||
){
|
||||
return await this.updateService.updateEmployee(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,8 +7,9 @@ import { EmployeesUpdateService } from 'src/identity-and-account/employees/servi
|
|||
import { EmployeesCreateService } from 'src/identity-and-account/employees/services/employees-create.service';
|
||||
|
||||
@Module({
|
||||
imports: [],
|
||||
controllers: [EmployeesController],
|
||||
controllers: [
|
||||
EmployeesController
|
||||
],
|
||||
providers: [
|
||||
EmployeesGetService,
|
||||
EmployeesUpdateService,
|
||||
|
|
@ -16,6 +17,8 @@ import { EmployeesCreateService } from 'src/identity-and-account/employees/servi
|
|||
AccessGetService,
|
||||
EmailToIdResolver
|
||||
],
|
||||
exports: [EmployeesGetService],
|
||||
exports: [
|
||||
EmployeesGetService
|
||||
],
|
||||
})
|
||||
export class EmployeesModule { }
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ export class HomePageController {
|
|||
|
||||
@Get('help')
|
||||
@ModuleAccessAllowed(ModulesEnum.dashboard)
|
||||
async getIntroductionHelper(@Access('email') email: string) {
|
||||
async getIntroductionHelper(
|
||||
@Access('email') email: string
|
||||
) {
|
||||
return await this.homePageService.buildHomePageHelpMessage(email);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,8 +4,15 @@ import { HomePageController } from "src/identity-and-account/help/help-page.cont
|
|||
import { HomePageService } from "src/identity-and-account/help/help-page.service";
|
||||
|
||||
@Module({
|
||||
controllers: [HomePageController],
|
||||
providers: [HomePageService, EmailToIdResolver],
|
||||
exports: [HomePageService],
|
||||
controllers: [
|
||||
HomePageController
|
||||
],
|
||||
providers: [
|
||||
HomePageService,
|
||||
EmailToIdResolver
|
||||
],
|
||||
exports: [
|
||||
HomePageService
|
||||
],
|
||||
})
|
||||
export class HomePageModule { };
|
||||
|
|
@ -10,7 +10,9 @@ export class HomePageService {
|
|||
private readonly emailresolver: EmailToIdResolver,
|
||||
) { }
|
||||
|
||||
buildHomePageHelpMessage = async (email: string): Promise<Result<string[], string>> => {
|
||||
buildHomePageHelpMessage = async (
|
||||
email: string
|
||||
): Promise<Result<string[], string>> => {
|
||||
const user_id = await this.emailresolver.resolveUserIdWithEmail(email);
|
||||
if (!user_id.success) return { success: false, error: 'INVALID_EMAIL' };
|
||||
|
||||
|
|
|
|||
|
|
@ -12,14 +12,19 @@ export class PreferencesController {
|
|||
|
||||
@Patch('update')
|
||||
@ModuleAccessAllowed(ModulesEnum.personal_profile)
|
||||
async updatePreferences(@Access('email') email: string, @Body() payload: PreferencesDto
|
||||
async updatePreferences(
|
||||
@Access('email') email: string,
|
||||
@Body() payload: PreferencesDto
|
||||
): Promise<Result<PreferencesDto, string>> {
|
||||
return this.service.updatePreferences(email, payload);
|
||||
}
|
||||
|
||||
@Get()
|
||||
@ModuleAccessAllowed(ModulesEnum.personal_profile)
|
||||
async findPreferences(@Access('email') email: string, @Query() employee_email?: string) {
|
||||
async findPreferences(
|
||||
@Access('email') email: string,
|
||||
@Query() employee_email?: string
|
||||
) {
|
||||
return this.service.findPreferences(email, employee_email);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,9 +4,16 @@ import { PreferencesService } from "./preferences.service";
|
|||
import { Module } from "@nestjs/common";
|
||||
|
||||
@Module({
|
||||
controllers: [ PreferencesController ],
|
||||
providers: [ PreferencesService, EmailToIdResolver ],
|
||||
exports: [ PreferencesService ],
|
||||
controllers: [
|
||||
PreferencesController
|
||||
],
|
||||
providers: [
|
||||
PreferencesService,
|
||||
EmailToIdResolver
|
||||
],
|
||||
exports: [
|
||||
PreferencesService
|
||||
],
|
||||
})
|
||||
|
||||
export class PreferencesModule {}
|
||||
|
|
@ -11,7 +11,10 @@ export class PreferencesService {
|
|||
private readonly emailResolver: EmailToIdResolver,
|
||||
) { }
|
||||
|
||||
async findPreferences(email: string, employee_email?: string): Promise<Result<PreferencesDto, string>> {
|
||||
async findPreferences(
|
||||
email: string,
|
||||
employee_email?: string
|
||||
): Promise<Result<PreferencesDto, string>> {
|
||||
const account_email = employee_email ?? email;
|
||||
const user_id = await this.emailResolver.resolveUserIdWithEmail(account_email);
|
||||
if (!user_id.success) return { success: false, error: 'EMPLOYEE_NOT_FOUND' };
|
||||
|
|
@ -42,7 +45,10 @@ export class PreferencesService {
|
|||
return { success: true, data: preferences };
|
||||
}
|
||||
|
||||
async updatePreferences(email: string, dto: PreferencesDto): Promise<Result<PreferencesDto, string>> {
|
||||
async updatePreferences(
|
||||
email: string,
|
||||
dto: PreferencesDto
|
||||
): Promise<Result<PreferencesDto, string>> {
|
||||
const user_id = await this.emailResolver.resolveUserIdWithEmail(email);
|
||||
if (!user_id.success) return { success: false, error: user_id.error }
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
import { IsBoolean } from "class-validator";
|
||||
|
||||
export class ModuleAccess {
|
||||
@IsBoolean() timesheets!: boolean;
|
||||
@IsBoolean() timesheets_approval!: boolean;
|
||||
@IsBoolean() employee_list!: boolean;
|
||||
@IsBoolean() employee_management!: boolean;
|
||||
@IsBoolean() personal_profile!: boolean;
|
||||
@IsBoolean() dashboard!: boolean;
|
||||
@IsBoolean() timesheets: boolean;
|
||||
@IsBoolean() timesheets_approval: boolean;
|
||||
@IsBoolean() employee_list: boolean;
|
||||
@IsBoolean() employee_management: boolean;
|
||||
@IsBoolean() personal_profile: boolean;
|
||||
@IsBoolean() dashboard: boolean;
|
||||
}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
import { Body, Controller, Get, Patch, Query, Req } from "@nestjs/common";
|
||||
import { Body, Controller, Get, Patch, Query } from "@nestjs/common";
|
||||
import { Access } from "src/common/decorators/module-access.decorators";
|
||||
import { Result } from "src/common/errors/result-error.factory";
|
||||
import { ModuleAccess } from "src/identity-and-account/user-module-access/module-acces.dto";
|
||||
|
|
@ -16,7 +16,9 @@ export class ModuleAccessController {
|
|||
|
||||
@Get()
|
||||
@ModuleAccessAllowed(ModulesEnum.employee_management)
|
||||
async findAccess(@Access('email') email: string, @Query('employee_email') employee_email?: string
|
||||
async findAccess(
|
||||
@Access('email') email: string,
|
||||
@Query('employee_email') employee_email?: string
|
||||
): Promise<Result<boolean, string>> {
|
||||
await this.getService.findModuleAccess(email, employee_email);
|
||||
return { success: true, data: true };
|
||||
|
|
@ -24,7 +26,10 @@ export class ModuleAccessController {
|
|||
|
||||
@Patch('update')
|
||||
@ModuleAccessAllowed(ModulesEnum.employee_management)
|
||||
async updateAccess(@Access('email') email: string, @Body() dto: ModuleAccess, @Query('employee_email') employee_email?: string
|
||||
async updateAccess(
|
||||
@Access('email') email: string,
|
||||
@Body() dto: ModuleAccess,
|
||||
@Query('employee_email') employee_email?: string
|
||||
): Promise<Result<boolean, string>> {
|
||||
await this.updateService.updateModuleAccess(email, dto, employee_email);
|
||||
return { success: true, data: true };
|
||||
|
|
|
|||
|
|
@ -5,8 +5,16 @@ import { AccessGetService } from "src/identity-and-account/user-module-access/se
|
|||
import { EmailToIdResolver } from "src/common/mappers/email-id.mapper";
|
||||
|
||||
@Module({
|
||||
controllers: [ModuleAccessController],
|
||||
providers: [AccessUpdateService, AccessGetService, EmailToIdResolver],
|
||||
exports: [AccessGetService],
|
||||
controllers: [
|
||||
ModuleAccessController
|
||||
],
|
||||
providers: [
|
||||
AccessUpdateService,
|
||||
AccessGetService,
|
||||
EmailToIdResolver
|
||||
],
|
||||
exports: [
|
||||
AccessGetService
|
||||
],
|
||||
})
|
||||
export class ModuleAccessModule { }
|
||||
|
|
@ -12,7 +12,10 @@ export class AccessGetService {
|
|||
private readonly emailResolver: EmailToIdResolver,
|
||||
) { }
|
||||
|
||||
async findModuleAccess(email: string, employee_email?: string): Promise<Result<ModuleAccess, string>> {
|
||||
async findModuleAccess(
|
||||
email: string,
|
||||
employee_email?: string
|
||||
): Promise<Result<ModuleAccess, string>> {
|
||||
const account_email = employee_email ?? email;
|
||||
const user_id = await this.emailResolver.resolveUserIdWithEmail(account_email);
|
||||
if (!user_id.success) return { success: false, error: 'EMPLOYEE_NOT_FOUND' };
|
||||
|
|
|
|||
|
|
@ -11,7 +11,11 @@ export class AccessUpdateService {
|
|||
private readonly emailResolver: EmailToIdResolver,
|
||||
) { }
|
||||
|
||||
async updateModuleAccess(email: string, dto: ModuleAccess, employee_email?: string): Promise<Result<ModuleAccess, string>> {
|
||||
async updateModuleAccess(
|
||||
email: string,
|
||||
dto: ModuleAccess,
|
||||
employee_email?: string
|
||||
): Promise<Result<ModuleAccess, string>> {
|
||||
const account_email = employee_email ?? email;
|
||||
const user_id = await this.emailResolver.resolveUserIdWithEmail(account_email);
|
||||
if (!user_id.success) return { success: false, error: 'EMPLOYEE_NOT_FOUND' };
|
||||
|
|
@ -52,7 +56,10 @@ export class AccessUpdateService {
|
|||
return { success: true, data: updated_access };
|
||||
}
|
||||
|
||||
async revokeModuleAccess(email: string, employee_email?: string): Promise<Result<ModuleAccess, string>> {
|
||||
async revokeModuleAccess(
|
||||
email: string,
|
||||
employee_email?: string
|
||||
): Promise<Result<ModuleAccess, string>> {
|
||||
const account_email = employee_email ?? email;
|
||||
const user_id = await this.emailResolver.resolveUserIdWithEmail(account_email);
|
||||
if (!user_id.success) return { success: false, error: 'EMPLOYEE_NOT_FOUND' };
|
||||
|
|
|
|||
|
|
@ -7,7 +7,9 @@ import { PrismaPostgresService } from 'prisma/postgres/prisma-postgres.service';
|
|||
export abstract class AbstractUserService {
|
||||
constructor(protected readonly prisma: PrismaPostgresService) { }
|
||||
|
||||
async findOneByEmail(email: string): Promise<Partial<Users>> {
|
||||
async findOneByEmail(
|
||||
email: string
|
||||
): Promise<Partial<Users>> {
|
||||
const user = await this.prisma.users.findUnique({
|
||||
where: { email },
|
||||
include: {
|
||||
|
|
|
|||
|
|
@ -6,5 +6,5 @@ export class UserDto {
|
|||
@IsString() last_name: string;
|
||||
@IsEmail() email: string;
|
||||
@IsEnum(Roles) role: string;
|
||||
@IsArray() @IsEnum(Modules, { each: true }) user_module_access!: Modules[];
|
||||
@IsArray() @IsEnum(Modules, { each: true }) user_module_access: Modules[];
|
||||
}
|
||||
|
|
@ -3,8 +3,14 @@ import { UsersService } from './services/users.service';
|
|||
import { PrismaPostgresModule } from 'prisma/postgres/prisma-postgres.module';
|
||||
|
||||
@Module({
|
||||
imports: [PrismaPostgresModule],
|
||||
providers: [UsersService],
|
||||
exports: [UsersService],
|
||||
imports: [
|
||||
PrismaPostgresModule
|
||||
],
|
||||
providers: [
|
||||
UsersService
|
||||
],
|
||||
exports: [
|
||||
UsersService
|
||||
],
|
||||
})
|
||||
export class UsersModule {}
|
||||
|
|
|
|||
18
src/main.ts
18
src/main.ts
|
|
@ -1,8 +1,3 @@
|
|||
import 'reflect-metadata';
|
||||
import * as nodeCrypto from 'crypto';
|
||||
if (!(globalThis as any).crypto) {
|
||||
(globalThis as any).crypto = nodeCrypto;
|
||||
}
|
||||
import { NestFactory, Reflector } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import { ModulesGuard } from './common/guards/modules.guard';
|
||||
|
|
@ -14,13 +9,14 @@ import { PrismaPostgresService } from 'prisma/postgres/prisma-postgres.service';
|
|||
const SESSION_TOKEN_DURATION_MINUTES = 180
|
||||
|
||||
async function bootstrap() {
|
||||
BigInt.prototype['toJSON'] = function () { return Number(this) };
|
||||
const app = await NestFactory.create(AppModule);
|
||||
const prisma_postgres = app.get(PrismaPostgresService);
|
||||
|
||||
const reflector = app.get(Reflector);
|
||||
|
||||
app.useGlobalGuards(
|
||||
new ModulesGuard(reflector), //deny-by-default and Module-based Access Control
|
||||
new ModulesGuard(reflector),
|
||||
);
|
||||
|
||||
// Authentication and session
|
||||
|
|
@ -45,19 +41,11 @@ async function bootstrap() {
|
|||
|
||||
// Enable CORS
|
||||
app.enableCors({
|
||||
origin: ['http://10.100.251.2:9011', 'http://10.5.14.111:9012', 'http://10.100.251.2:9013', 'http://localhost:9000', 'https://app.targo.ca', 'https://portail.targo.ca','https://staging.app.targo.ca'],
|
||||
origin: ['http://10.100.251.2:9011', 'http://10.5.14.111:9012', 'http://10.100.251.2:9013', 'http://localhost:9000', 'https://app.targo.ca', 'https://portail.targo.ca', 'https://staging.app.targo.ca'],
|
||||
credentials: true,
|
||||
});
|
||||
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
|
||||
|
||||
// migration function calls
|
||||
// await initializePaidTimeOff();
|
||||
// await initializePreferences();
|
||||
// await extractOldTimesheets();
|
||||
// await extractOldShifts();
|
||||
// await extractOldExpenses();
|
||||
// await initSupervisor();
|
||||
}
|
||||
bootstrap();
|
||||
|
|
|
|||
|
|
@ -1,34 +0,0 @@
|
|||
// import { Module } from "@nestjs/common";
|
||||
// import { ScheduleModule } from "@nestjs/schedule";
|
||||
// import { TimesheetsModule } from "../timesheets/timesheets.module";
|
||||
// import { ExpensesModule } from "../expenses/expenses.module";
|
||||
// import { ShiftsModule } from "../shifts/shifts.module";
|
||||
// import { LeaveRequestsModule } from "../leave-requests/leave-requests.module";
|
||||
// import { ArchivalService } from "./services/archival.service";
|
||||
// import { EmployeesArchiveController } from "./controllers/employees-archive.controller";
|
||||
// import { ExpensesArchiveController } from "./controllers/expenses-archive.controller";
|
||||
// import { LeaveRequestsArchiveController } from "./controllers/leave-requests-archive.controller";
|
||||
// import { ShiftsArchiveController } from "./controllers/shifts-archive.controller";
|
||||
// import { TimesheetsArchiveController } from "./controllers/timesheets-archive.controller";
|
||||
// import { EmployeesModule } from "../employees/employees.module";
|
||||
|
||||
// @Module({
|
||||
// imports: [
|
||||
// EmployeesModule,
|
||||
// ScheduleModule,
|
||||
// TimesheetsModule,
|
||||
// ExpensesModule,
|
||||
// ShiftsModule,
|
||||
// LeaveRequestsModule,
|
||||
// ],
|
||||
// providers: [ArchivalService],
|
||||
// controllers: [
|
||||
// EmployeesArchiveController,
|
||||
// ExpensesArchiveController,
|
||||
// LeaveRequestsArchiveController,
|
||||
// ShiftsArchiveController,
|
||||
// TimesheetsArchiveController,
|
||||
// ],
|
||||
// })
|
||||
|
||||
// export class ArchivalModule {}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user