Skip to content

Commit

Permalink
feat: add city to report
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Jul 16, 2024
1 parent 961df59 commit aef28c9
Show file tree
Hide file tree
Showing 10 changed files with 145 additions and 26 deletions.
1 change: 1 addition & 0 deletions db/migrations/905-add_report_city.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ALTER TABLE "report" ADD COLUMN "city" TEXT;
45 changes: 36 additions & 9 deletions packages/electric-client/src/generated/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Pdf_snapshotScalarFieldEnumSchema = z.enum(['id','report_id','html'

export const QueryModeSchema = z.enum(['default','insensitive']);

export const ReportScalarFieldEnumSchema = z.enum(['id','title','projectDescription','redactedBy','meetDate','applicantName','applicantAddress','projectCadastralRef','projectSpaceType','decision','precisions','contacts','furtherInformation','createdBy','createdAt','serviceInstructeur','pdf','disabled','udap_id','redactedById','applicantEmail']);
export const ReportScalarFieldEnumSchema = z.enum(['id','title','projectDescription','redactedBy','meetDate','applicantName','applicantAddress','projectCadastralRef','projectSpaceType','decision','precisions','contacts','furtherInformation','createdBy','createdAt','serviceInstructeur','pdf','disabled','udap_id','redactedById','applicantEmail','city']);

export const Service_instructeursScalarFieldEnumSchema = z.enum(['id','full_name','short_name','email','tel','udap_id']);

Expand Down Expand Up @@ -118,6 +118,7 @@ export const ReportSchema = z.object({
udap_id: z.string().nullable(),
redactedById: z.string().nullable(),
applicantEmail: z.string().nullable(),
city: z.string().nullable(),
})

export type Report = z.infer<typeof ReportSchema>
Expand Down Expand Up @@ -263,6 +264,7 @@ export const ReportSelectSchema: z.ZodType<Prisma.ReportSelect> = z.object({
udap_id: z.boolean().optional(),
redactedById: z.boolean().optional(),
applicantEmail: z.boolean().optional(),
city: z.boolean().optional(),
user: z.union([z.boolean(),z.lazy(() => UserArgsSchema)]).optional(),
}).strict()

Expand Down Expand Up @@ -562,6 +564,7 @@ export const ReportWhereInputSchema: z.ZodType<Prisma.ReportWhereInput> = z.obje
udap_id: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
redactedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
applicantEmail: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
city: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
user: z.union([ z.lazy(() => UserRelationFilterSchema),z.lazy(() => UserWhereInputSchema) ]).optional(),
}).strict();

Expand All @@ -587,6 +590,7 @@ export const ReportOrderByWithRelationInputSchema: z.ZodType<Prisma.ReportOrderB
udap_id: z.lazy(() => SortOrderSchema).optional(),
redactedById: z.lazy(() => SortOrderSchema).optional(),
applicantEmail: z.lazy(() => SortOrderSchema).optional(),
city: z.lazy(() => SortOrderSchema).optional(),
user: z.lazy(() => UserOrderByWithRelationInputSchema).optional()
}).strict();

Expand Down Expand Up @@ -616,6 +620,7 @@ export const ReportOrderByWithAggregationInputSchema: z.ZodType<Prisma.ReportOrd
udap_id: z.lazy(() => SortOrderSchema).optional(),
redactedById: z.lazy(() => SortOrderSchema).optional(),
applicantEmail: z.lazy(() => SortOrderSchema).optional(),
city: z.lazy(() => SortOrderSchema).optional(),
_count: z.lazy(() => ReportCountOrderByAggregateInputSchema).optional(),
_avg: z.lazy(() => ReportAvgOrderByAggregateInputSchema).optional(),
_max: z.lazy(() => ReportMaxOrderByAggregateInputSchema).optional(),
Expand Down Expand Up @@ -648,6 +653,7 @@ export const ReportScalarWhereWithAggregatesInputSchema: z.ZodType<Prisma.Report
udap_id: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(),
redactedById: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(),
applicantEmail: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(),
city: z.union([ z.lazy(() => StringNullableWithAggregatesFilterSchema),z.string() ]).optional().nullable(),
}).strict();

export const Service_instructeursWhereInputSchema: z.ZodType<Prisma.Service_instructeursWhereInput> = z.object({
Expand Down Expand Up @@ -1054,6 +1060,7 @@ export const ReportCreateInputSchema: z.ZodType<Prisma.ReportCreateInput> = z.ob
udap_id: z.string().optional().nullable(),
redactedById: z.string().optional().nullable(),
applicantEmail: z.string().optional().nullable(),
city: z.string().optional().nullable(),
user: z.lazy(() => UserCreateNestedOneWithoutReportInputSchema)
}).strict();

Expand All @@ -1078,7 +1085,8 @@ export const ReportUncheckedCreateInputSchema: z.ZodType<Prisma.ReportUncheckedC
disabled: z.boolean().optional().nullable(),
udap_id: z.string().optional().nullable(),
redactedById: z.string().optional().nullable(),
applicantEmail: z.string().optional().nullable()
applicantEmail: z.string().optional().nullable(),
city: z.string().optional().nullable()
}).strict();

export const ReportUpdateInputSchema: z.ZodType<Prisma.ReportUpdateInput> = z.object({
Expand All @@ -1102,6 +1110,7 @@ export const ReportUpdateInputSchema: z.ZodType<Prisma.ReportUpdateInput> = z.ob
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
user: z.lazy(() => UserUpdateOneRequiredWithoutReportNestedInputSchema).optional()
}).strict();

Expand All @@ -1127,6 +1136,7 @@ export const ReportUncheckedUpdateInputSchema: z.ZodType<Prisma.ReportUncheckedU
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
}).strict();

export const ReportCreateManyInputSchema: z.ZodType<Prisma.ReportCreateManyInput> = z.object({
Expand All @@ -1150,7 +1160,8 @@ export const ReportCreateManyInputSchema: z.ZodType<Prisma.ReportCreateManyInput
disabled: z.boolean().optional().nullable(),
udap_id: z.string().optional().nullable(),
redactedById: z.string().optional().nullable(),
applicantEmail: z.string().optional().nullable()
applicantEmail: z.string().optional().nullable(),
city: z.string().optional().nullable()
}).strict();

export const ReportUpdateManyMutationInputSchema: z.ZodType<Prisma.ReportUpdateManyMutationInput> = z.object({
Expand All @@ -1174,6 +1185,7 @@ export const ReportUpdateManyMutationInputSchema: z.ZodType<Prisma.ReportUpdateM
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
}).strict();

export const ReportUncheckedUpdateManyInputSchema: z.ZodType<Prisma.ReportUncheckedUpdateManyInput> = z.object({
Expand All @@ -1198,6 +1210,7 @@ export const ReportUncheckedUpdateManyInputSchema: z.ZodType<Prisma.ReportUnchec
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
}).strict();

export const Service_instructeursCreateInputSchema: z.ZodType<Prisma.Service_instructeursCreateInput> = z.object({
Expand Down Expand Up @@ -1695,7 +1708,8 @@ export const ReportCountOrderByAggregateInputSchema: z.ZodType<Prisma.ReportCoun
disabled: z.lazy(() => SortOrderSchema).optional(),
udap_id: z.lazy(() => SortOrderSchema).optional(),
redactedById: z.lazy(() => SortOrderSchema).optional(),
applicantEmail: z.lazy(() => SortOrderSchema).optional()
applicantEmail: z.lazy(() => SortOrderSchema).optional(),
city: z.lazy(() => SortOrderSchema).optional()
}).strict();

export const ReportAvgOrderByAggregateInputSchema: z.ZodType<Prisma.ReportAvgOrderByAggregateInput> = z.object({
Expand Down Expand Up @@ -1723,7 +1737,8 @@ export const ReportMaxOrderByAggregateInputSchema: z.ZodType<Prisma.ReportMaxOrd
disabled: z.lazy(() => SortOrderSchema).optional(),
udap_id: z.lazy(() => SortOrderSchema).optional(),
redactedById: z.lazy(() => SortOrderSchema).optional(),
applicantEmail: z.lazy(() => SortOrderSchema).optional()
applicantEmail: z.lazy(() => SortOrderSchema).optional(),
city: z.lazy(() => SortOrderSchema).optional()
}).strict();

export const ReportMinOrderByAggregateInputSchema: z.ZodType<Prisma.ReportMinOrderByAggregateInput> = z.object({
Expand All @@ -1747,7 +1762,8 @@ export const ReportMinOrderByAggregateInputSchema: z.ZodType<Prisma.ReportMinOrd
disabled: z.lazy(() => SortOrderSchema).optional(),
udap_id: z.lazy(() => SortOrderSchema).optional(),
redactedById: z.lazy(() => SortOrderSchema).optional(),
applicantEmail: z.lazy(() => SortOrderSchema).optional()
applicantEmail: z.lazy(() => SortOrderSchema).optional(),
city: z.lazy(() => SortOrderSchema).optional()
}).strict();

export const ReportSumOrderByAggregateInputSchema: z.ZodType<Prisma.ReportSumOrderByAggregateInput> = z.object({
Expand Down Expand Up @@ -2639,7 +2655,8 @@ export const ReportCreateWithoutUserInputSchema: z.ZodType<Prisma.ReportCreateWi
disabled: z.boolean().optional().nullable(),
udap_id: z.string().optional().nullable(),
redactedById: z.string().optional().nullable(),
applicantEmail: z.string().optional().nullable()
applicantEmail: z.string().optional().nullable(),
city: z.string().optional().nullable()
}).strict();

export const ReportUncheckedCreateWithoutUserInputSchema: z.ZodType<Prisma.ReportUncheckedCreateWithoutUserInput> = z.object({
Expand All @@ -2662,7 +2679,8 @@ export const ReportUncheckedCreateWithoutUserInputSchema: z.ZodType<Prisma.Repor
disabled: z.boolean().optional().nullable(),
udap_id: z.string().optional().nullable(),
redactedById: z.string().optional().nullable(),
applicantEmail: z.string().optional().nullable()
applicantEmail: z.string().optional().nullable(),
city: z.string().optional().nullable()
}).strict();

export const ReportCreateOrConnectWithoutUserInputSchema: z.ZodType<Prisma.ReportCreateOrConnectWithoutUserInput> = z.object({
Expand Down Expand Up @@ -2793,6 +2811,7 @@ export const ReportScalarWhereInputSchema: z.ZodType<Prisma.ReportScalarWhereInp
udap_id: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
redactedById: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
applicantEmail: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
city: z.union([ z.lazy(() => StringNullableFilterSchema),z.string() ]).optional().nullable(),
}).strict();

export const UdapUpsertWithoutUserInputSchema: z.ZodType<Prisma.UdapUpsertWithoutUserInput> = z.object({
Expand Down Expand Up @@ -2886,7 +2905,8 @@ export const ReportCreateManyUserInputSchema: z.ZodType<Prisma.ReportCreateManyU
disabled: z.boolean().optional().nullable(),
udap_id: z.string().optional().nullable(),
redactedById: z.string().optional().nullable(),
applicantEmail: z.string().optional().nullable()
applicantEmail: z.string().optional().nullable(),
city: z.string().optional().nullable()
}).strict();

export const DelegationUpdateWithoutUser_delegation_createdByTouserInputSchema: z.ZodType<Prisma.DelegationUpdateWithoutUser_delegation_createdByTouserInput> = z.object({
Expand Down Expand Up @@ -2934,6 +2954,7 @@ export const ReportUpdateWithoutUserInputSchema: z.ZodType<Prisma.ReportUpdateWi
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
}).strict();

export const ReportUncheckedUpdateWithoutUserInputSchema: z.ZodType<Prisma.ReportUncheckedUpdateWithoutUserInput> = z.object({
Expand All @@ -2957,6 +2978,7 @@ export const ReportUncheckedUpdateWithoutUserInputSchema: z.ZodType<Prisma.Repor
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
}).strict();

export const ReportUncheckedUpdateManyWithoutReportInputSchema: z.ZodType<Prisma.ReportUncheckedUpdateManyWithoutReportInput> = z.object({
Expand All @@ -2980,6 +3002,7 @@ export const ReportUncheckedUpdateManyWithoutReportInputSchema: z.ZodType<Prisma
udap_id: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
redactedById: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
applicantEmail: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
city: z.union([ z.string(),z.lazy(() => NullableStringFieldUpdateOperationsInputSchema) ]).optional().nullable(),
}).strict();

/////////////////////////////////////////
Expand Down Expand Up @@ -4090,6 +4113,10 @@ export const tableSchemas = {
[
"applicantEmail",
"TEXT"
],
[
"city",
"TEXT"
]
]),
relations: [
Expand Down
Loading

0 comments on commit aef28c9

Please sign in to comment.