UNPKG

@tmlmobilidade/types

Version:
121 lines (120 loc) 4.6 kB
import { type UnixTimestamp } from '@tmlmobilidade/go-types-shared'; import { type ApprovalStatus } from '@tmlmobilidade/go-types-shared'; import { z } from 'zod'; export declare const ScopeSchema: z.ZodEnum<["stop", "lines"]>; export type Scope = z.infer<typeof ScopeSchema>; export declare const ProposedChangeSchema: z.ZodObject<{ _id: z.ZodString; created_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared/dist/dates/unix-timestamp.js").UnixTimestamp, number>; created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>; is_locked: z.ZodDefault<z.ZodBoolean>; updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared/dist/dates/unix-timestamp.js").UnixTimestamp, number>; updated_by: z.ZodOptional<z.ZodString>; } & { curr_value: z.ZodAny; field: z.ZodString; related_id: z.ZodString; scope: z.ZodEnum<["stop", "lines"]>; status: z.ZodEnum<["pending", "approved", "rejected", "none"]>; }, "strip", z.ZodTypeAny, { _id: string; created_at: number & { __brand: "UnixTimestamp"; }; created_by: string | null; is_locked: boolean; updated_at: number & { __brand: "UnixTimestamp"; }; status: "none" | "rejected" | "pending" | "approved"; scope: "lines" | "stop"; field: string; related_id: string; updated_by?: string | undefined; curr_value?: any; }, { _id: string; created_at: number; updated_at: number; status: "none" | "rejected" | "pending" | "approved"; scope: "lines" | "stop"; field: string; related_id: string; created_by?: string | null | undefined; is_locked?: boolean | undefined; updated_by?: string | undefined; curr_value?: any; }>; export type ProposedChange<T> = { [P in keyof T]: { _id: string; created_at: UnixTimestamp; created_by: string; curr_value: T[P]; field: P; related_id: string; scope: Scope; status: ApprovalStatus; updated_at: UnixTimestamp; updated_by: string; }; }[keyof T]; export declare const CreateProposedChangeSchema: z.ZodObject<Omit<{ _id: z.ZodString; created_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared/dist/dates/unix-timestamp.js").UnixTimestamp, number>; created_by: z.ZodDefault<z.ZodNullable<z.ZodString>>; is_locked: z.ZodDefault<z.ZodBoolean>; updated_at: z.ZodEffects<z.ZodNumber, import("@tmlmobilidade/go-types-shared/dist/dates/unix-timestamp.js").UnixTimestamp, number>; updated_by: z.ZodOptional<z.ZodString>; } & { curr_value: z.ZodAny; field: z.ZodString; related_id: z.ZodString; scope: z.ZodEnum<["stop", "lines"]>; status: z.ZodEnum<["pending", "approved", "rejected", "none"]>; }, "_id" | "created_at" | "updated_at">, "strip", z.ZodTypeAny, { created_by: string | null; is_locked: boolean; status: "none" | "rejected" | "pending" | "approved"; scope: "lines" | "stop"; field: string; related_id: string; updated_by?: string | undefined; curr_value?: any; }, { status: "none" | "rejected" | "pending" | "approved"; scope: "lines" | "stop"; field: string; related_id: string; created_by?: string | null | undefined; is_locked?: boolean | undefined; updated_by?: string | undefined; curr_value?: any; }>; export declare const UpdateProposedChangeSchema: z.ZodObject<{ is_locked: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>; updated_by: z.ZodOptional<z.ZodOptional<z.ZodString>>; status: z.ZodOptional<z.ZodEnum<["pending", "approved", "rejected", "none"]>>; scope: z.ZodOptional<z.ZodEnum<["stop", "lines"]>>; field: z.ZodOptional<z.ZodString>; curr_value: z.ZodOptional<z.ZodAny>; related_id: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { is_locked?: boolean | undefined; updated_by?: string | undefined; status?: "none" | "rejected" | "pending" | "approved" | undefined; scope?: "lines" | "stop" | undefined; field?: string | undefined; curr_value?: any; related_id?: string | undefined; }, { is_locked?: boolean | undefined; updated_by?: string | undefined; status?: "none" | "rejected" | "pending" | "approved" | undefined; scope?: "lines" | "stop" | undefined; field?: string | undefined; curr_value?: any; related_id?: string | undefined; }>; export type CreateProposedChangeDto<T> = Omit<ProposedChange<T>, '_id' | 'created_at' | 'updated_at'>; export type UpdateProposedChangeDto<T> = Omit<CreateProposedChangeDto<T>, 'created_by'>;