@tmlmobilidade/types 20250916.1050.43 → 20250916.1601.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -186,4 +186,8 @@ export declare const CommentSchema: z.ZodEffects<z.ZodDiscriminatedUnion<"type",
186
186
  }>;
187
187
  export type Comment = z.infer<typeof CommentSchema>;
188
188
  export type NoteComment = z.infer<typeof NoteCommentSchema>;
189
- export type FieldChangedComment = z.infer<typeof FieldChangedCommentSchema>;
189
+ export interface FieldChangedComment<T, K extends keyof T> extends Omit<z.infer<typeof FieldChangedCommentSchema>, 'curr_value' | 'field' | 'prev_value'> {
190
+ curr_value: T[K];
191
+ field: K;
192
+ prev_value: T[K];
193
+ }
@@ -1,6 +1,31 @@
1
1
  import { z } from 'zod';
2
2
  export declare const RIDE_ANALYSIS_GRADE_OPTIONS: readonly ["pass", "fail", "skip", "error"];
3
3
  export declare const RideAnalysisGradeSchema: z.ZodEnum<["pass", "fail", "skip", "error"]>;
4
+ /**
5
+ * Schema for ride analysis summary.
6
+ *
7
+ * This schema represents a record where each key is a string and the value is an object
8
+ * containing:
9
+ * - grade: A value from the RideAnalysisGradeSchema, indicating the result of the analysis.
10
+ * - reason: A string providing the reason for the given grade.
11
+ *
12
+ * @example
13
+ * {
14
+ * TEST_1: { grade: 'failed', reason: 'TEST_REASON' },
15
+ * TEST_2: { grade: 'failed', reason: 'TEST_REASON' },
16
+ * }
17
+ */
18
+ export declare const RideAnalysisSummarySchema: z.ZodRecord<z.ZodString, z.ZodObject<{
19
+ grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
20
+ reason: z.ZodString;
21
+ }, "strip", z.ZodTypeAny, {
22
+ grade: "error" | "pass" | "fail" | "skip";
23
+ reason: string;
24
+ }, {
25
+ grade: "error" | "pass" | "fail" | "skip";
26
+ reason: string;
27
+ }>>;
28
+ export type RideAnalysisSummary = z.infer<typeof RideAnalysisSummarySchema>;
4
29
  export declare const RideAnalysisSchema: z.ZodObject<{
5
30
  error_message: z.ZodOptional<z.ZodString>;
6
31
  grade: z.ZodEnum<["pass", "fail", "skip", "error"]>;
@@ -4,6 +4,25 @@ import { z } from 'zod';
4
4
  export const RIDE_ANALYSIS_GRADE_OPTIONS = ['pass', 'fail', 'skip', 'error'];
5
5
  export const RideAnalysisGradeSchema = z.enum(RIDE_ANALYSIS_GRADE_OPTIONS);
6
6
  /* * */
7
+ /**
8
+ * Schema for ride analysis summary.
9
+ *
10
+ * This schema represents a record where each key is a string and the value is an object
11
+ * containing:
12
+ * - grade: A value from the RideAnalysisGradeSchema, indicating the result of the analysis.
13
+ * - reason: A string providing the reason for the given grade.
14
+ *
15
+ * @example
16
+ * {
17
+ * TEST_1: { grade: 'failed', reason: 'TEST_REASON' },
18
+ * TEST_2: { grade: 'failed', reason: 'TEST_REASON' },
19
+ * }
20
+ */
21
+ export const RideAnalysisSummarySchema = z.record(z.string(), z.object({
22
+ grade: RideAnalysisGradeSchema,
23
+ reason: z.string(),
24
+ }));
25
+ /* * */
7
26
  export const RideAnalysisSchema = z.object({
8
27
  error_message: z.string().optional(),
9
28
  grade: RideAnalysisGradeSchema,