@tmlmobilidade/types
Version:
This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.
320 lines (319 loc) • 12.5 kB
TypeScript
import { MultiPolygon } from 'geojson';
import { z } from 'zod';
export interface LocationCollections {
census: Census;
districts: DistrictDocument;
localities: LocalityDocument;
municipalities: MunicipalityDocument;
parishes: ParishDocument;
}
export interface Census extends GeoJSON.Feature<MultiPolygon> {
properties: {
DT21: string;
DTMN21: string;
DTMNFR21: string;
DTMNFRSEC21: string;
fid: number;
N_ADP_1OU2_PESSOAS: number;
N_ADP_3OU4_PESSOAS: number;
N_ADP_5EMAIS_PESSOAS: number;
N_AGREGADOS_DOMESTICOS_PRIVADOS: number;
N_AGREGADOS_INSTITUCIONAIS: number;
N_ALOJAMENTOS_COLECTIVOS: number;
N_ALOJAMENTOS_FAM_CLASS_RES_SECUNDARIA: number;
N_ALOJAMENTOS_FAM_CLASS_VAGOS_OUTR_MOTIVOS: number;
N_ALOJAMENTOS_FAM_CLASS_VAGOS_VEND_ARRE: number;
N_ALOJAMENTOS_FAM_CLASSICOS: number;
N_ALOJAMENTOS_FAM_N_CLASSICOS: number;
N_ALOJAMENTOS_FAMILIARES: number;
N_ALOJAMENTOS_TOTAL: number;
N_ALOJAMENTOS_VAGOS_TOTAL: number;
N_CLASSICOS_RES_HABITUAL: number;
N_EDIFICIOS_1OU2_PISOS: number;
N_EDIFICIOS_3OU4_PISOS: number;
N_EDIFICIOS_5OU_MAIS_PISOS: number;
N_EDIFICIOS_CLASSICOS: number;
N_EDIFICIOS_CLASSICOS_1OU2_ALOJ: number;
N_EDIFICIOS_CLASSICOS_3OUMAIS_ALOJ: 0;
N_EDIFICIOS_CLASSICOS_OUTRO: number;
N_EDIFICIOS_COM_ELEVADOR: number;
N_EDIFICIOS_COM_NEC_REPARACAO: number;
N_EDIFICIOS_COM_NEC_REPARACAO_LIGEIRAS: number;
N_EDIFICIOS_COM_NEC_REPARACAO_MEDIAS: number;
N_EDIFICIOS_COM_NEC_REPARACAO_PROFUNDAS: number;
N_EDIFICIOS_CONSTR_1919A1945: number;
N_EDIFICIOS_CONSTR_1946A1960: number;
N_EDIFICIOS_CONSTR_1961A1980: number;
N_EDIFICIOS_CONSTR_1981A1990: number;
N_EDIFICIOS_CONSTR_1991A2000: number;
N_EDIFICIOS_CONSTR_2001A2005: number;
N_EDIFICIOS_CONSTR_2006A2010: number;
N_EDIFICIOS_CONSTR_2011A2015: number;
N_EDIFICIOS_CONSTR_2016A2021: number;
N_EDIFICIOS_CONSTR_ANTES_1919: number;
N_EDIFICIOS_EXCLUS_RESIDENCIAL: number;
N_EDIFICIOS_PINCIPAL_NAO_RESIDENCIAL: number;
N_EDIFICIOS_PINCIPAL_RESIDENCIAL: number;
N_EDIFICIOS_SEM_ELEVADOR: number;
N_EDIFICIOS_SEM_NEC_REPARACAO: number;
N_INDIVIDUO_ENSINCOMP_1BAS: number;
N_INDIVIDUO_ENSINCOMP_1BAS_H: number;
N_INDIVIDUO_ENSINCOMP_1BAS_M: number;
N_INDIVIDUO_ENSINCOMP_2BAS: number;
N_INDIVIDUO_ENSINCOMP_2BAS_H: number;
N_INDIVIDUO_ENSINCOMP_2BAS_M: number;
N_INDIVIDUO_ENSINCOMP_3BAS: number;
N_INDIVIDUO_ENSINCOMP_3BAS_H: number;
N_INDIVIDUO_ENSINCOMP_3BAS_M: number;
N_INDIVIDUO_ENSINCOMP_NENHUM: number;
N_INDIVIDUO_ENSINCOMP_NENHUM_H: number;
N_INDIVIDUO_ENSINCOMP_NENHUM_M: number;
N_INDIVIDUO_ENSINCOMP_SEC_E_POSSEC: number;
N_INDIVIDUO_ENSINCOMP_SEC_E_POSSEC_H: number;
N_INDIVIDUO_ENSINCOMP_SEC_E_POSSEC_M: number;
N_INDIVIDUO_ENSINCOMP_SUP: number;
N_INDIVIDUO_ENSINCOMP_SUP_H: number;
N_INDIVIDUO_ENSINCOMP_SUP_M: number;
N_INDIVIDUOS: number;
N_INDIVIDUOS_0A4: number;
N_INDIVIDUOS_0A4_H: number;
N_INDIVIDUOS_0A4_M: number;
N_INDIVIDUOS_0A14: number;
N_INDIVIDUOS_0A14_H: number;
N_INDIVIDUOS_0A14_M: number;
N_INDIVIDUOS_5A9: number;
N_INDIVIDUOS_5A9_H: number;
N_INDIVIDUOS_5A9_M: number;
N_INDIVIDUOS_10A14: number;
N_INDIVIDUOS_10A14_H: number;
N_INDIVIDUOS_10A14_M: number;
N_INDIVIDUOS_15A19: number;
N_INDIVIDUOS_15A19_H: number;
N_INDIVIDUOS_15A19_M: number;
N_INDIVIDUOS_15A24: number;
N_INDIVIDUOS_15A24_H: number;
N_INDIVIDUOS_15A24_M: number;
N_INDIVIDUOS_20A24: number;
N_INDIVIDUOS_20A24_H: number;
N_INDIVIDUOS_20A24_M: number;
N_INDIVIDUOS_25A29: number;
N_INDIVIDUOS_25A29_H: number;
N_INDIVIDUOS_25A29_M: number;
N_INDIVIDUOS_25A64: number;
N_INDIVIDUOS_25A64_H: number;
N_INDIVIDUOS_25A64_M: number;
N_INDIVIDUOS_30A34: number;
N_INDIVIDUOS_30A34_H: number;
N_INDIVIDUOS_30A34_M: number;
N_INDIVIDUOS_35A39: number;
N_INDIVIDUOS_35A39_H: number;
N_INDIVIDUOS_35A39_M: number;
N_INDIVIDUOS_40A44: number;
N_INDIVIDUOS_40A44_H: number;
N_INDIVIDUOS_40A44_M: number;
N_INDIVIDUOS_45A49: number;
N_INDIVIDUOS_45A49_H: number;
N_INDIVIDUOS_45A49_M: number;
N_INDIVIDUOS_50A54: number;
N_INDIVIDUOS_50A54_H: number;
N_INDIVIDUOS_50A54_M: number;
N_INDIVIDUOS_55A59: number;
N_INDIVIDUOS_55A59_H: number;
N_INDIVIDUOS_55A59_M: number;
N_INDIVIDUOS_60A64: number;
N_INDIVIDUOS_60A64_H: number;
N_INDIVIDUOS_60A64_M: number;
N_INDIVIDUOS_65_OU_MAIS: number;
N_INDIVIDUOS_65_OU_MAIS_H: number;
N_INDIVIDUOS_65_OU_MAIS_M: number;
N_INDIVIDUOS_65A69: number;
N_INDIVIDUOS_65A69_H: number;
N_INDIVIDUOS_65A69_M: number;
N_INDIVIDUOS_70A74: number;
N_INDIVIDUOS_70A74_H: number;
N_INDIVIDUOS_70A74_M: number;
N_INDIVIDUOS_75_OU_MAIS: number;
N_INDIVIDUOS_75_OU_MAIS_H: number;
N_INDIVIDUOS_75_OU_MAIS_M: number;
N_INDIVIDUOS_COM_ATIVIDADE_ECONOMICA: number;
N_INDIVIDUOS_COM_ATIVIDADE_ECONOMICA_H: number;
N_INDIVIDUOS_COM_ATIVIDADE_ECONOMICA_M: number;
N_INDIVIDUOS_DESEMPREGADOS_1EMP: number;
N_INDIVIDUOS_DESEMPREGADOS_1EMP_H: number;
N_INDIVIDUOS_DESEMPREGADOS_1EMP_M: number;
N_INDIVIDUOS_DESEMPREGADOS_NOVOEMP: number;
N_INDIVIDUOS_DESEMPREGADOS_NOVOEMP_H: number;
N_INDIVIDUOS_DESEMPREGADOS_NOVOEMP_M: number;
N_INDIVIDUOS_DOMESTICOS: number;
N_INDIVIDUOS_DOMESTICOS_H: number;
N_INDIVIDUOS_DOMESTICOS_M: number;
N_INDIVIDUOS_EMPREG_SECT_PRIM: number;
N_INDIVIDUOS_EMPREG_SECT_PRIM_H: number;
N_INDIVIDUOS_EMPREG_SECT_PRIM_M: number;
N_INDIVIDUOS_EMPREG_SECT_SEC: number;
N_INDIVIDUOS_EMPREG_SECT_SEC_H: number;
N_INDIVIDUOS_EMPREG_SECT_SEC_M: number;
N_INDIVIDUOS_EMPREG_SECT_TERC: number;
N_INDIVIDUOS_EMPREG_SECT_TERC_H: number;
N_INDIVIDUOS_EMPREG_SECT_TERC_M: number;
N_INDIVIDUOS_EMPREGADOS: number;
N_INDIVIDUOS_EMPREGADOS_H: number;
N_INDIVIDUOS_EMPREGADOS_M: number;
N_INDIVIDUOS_ESTUDANTES: number;
N_INDIVIDUOS_ESTUDANTES_H: number;
N_INDIVIDUOS_ESTUDANTES_M: number;
N_INDIVIDUOS_H: number;
N_INDIVIDUOS_M: number;
N_INDIVIDUOS_NAC_ESTRANGEIRA: number;
N_INDIVIDUOS_NAC_ESTRANGEIRA_H: number;
N_INDIVIDUOS_NAC_ESTRANGEIRA_M: number;
N_INDIVIDUOS_REFORMADOS: number;
N_INDIVIDUOS_REFORMADOS_H: number;
N_INDIVIDUOS_REFORMADOS_M: number;
N_INDIVIDUOS_RESID_FORA_PAIS: number;
N_INDIVIDUOS_RESID_FORA_PAIS_H: number;
N_INDIVIDUOS_RESID_FORA_PAIS_M: number;
N_INDIVIDUOS_SEM_ATIVIDADE_ECONOMICA: number;
N_INDIVIDUOS_SEM_ATIVIDADE_ECONOMICA_H: number;
N_INDIVIDUOS_SEM_ATIVIDADE_ECONOMICA_M: number;
N_RHABITUAL_1_2_DIV: number;
N_RHABITUAL_3_4_DIV: number;
N_RHABITUAL_5_MAIS_DIV: number;
N_RHABITUAL_ACESSIVEL_CADEIRAS_RODAS: number;
N_RHABITUAL_AREA_49: number;
N_RHABITUAL_AREA_50_99: number;
N_RHABITUAL_AREA_100_149: number;
N_RHABITUAL_AREA_150_199: number;
N_RHABITUAL_AREA_200MAIS: number;
N_RHABITUAL_ARRENDADOS: number;
N_RHABITUAL_COM_ESTACIONAMENTO: number;
N_RHABITUAL_NAO_ACESSIVEL_CADEIRAS_RODAS: number;
N_RHABITUAL_OCUPADOS_OUTR_SITUACAO: number;
N_RHABITUAL_PROP_OCUP: number;
N_RHABITUAL_SEM_ESTACIONAMENTO: number;
N_SS: number;
NUTS1_15: string;
NUTS2_15: string;
NUTS3_15: string;
SECNUM21: string;
Shape_Area: number;
Shape_Length: number;
};
}
export interface DistrictDocument extends GeoJSON.Feature<GeoJSON.Polygon> {
_id: string;
properties: {
area_ha: number;
name: string;
};
}
export interface MunicipalityDocument extends GeoJSON.Feature<GeoJSON.Polygon> {
_id: string;
properties: {
area_ha: number;
district_id: string;
name: string;
};
}
export interface ParishDocument extends GeoJSON.Feature<GeoJSON.Polygon> {
_id: string;
properties: {
area_ha: number;
district_id: string;
municipality_id: string;
name: string;
};
}
export type LocalityDocument = ParishDocument;
export type District = DistrictDocument['properties'] & {
_id: string;
geojson: GeoJSON.Feature<GeoJSON.Polygon>;
};
export type Municipality = MunicipalityDocument['properties'] & {
_id: string;
geojson: GeoJSON.Feature<GeoJSON.Polygon>;
};
export type Parish = ParishDocument['properties'] & {
_id: string;
geojson: GeoJSON.Feature<GeoJSON.Polygon>;
};
export type Locality = ParishDocument['properties'] & {
_id: string;
geojson: GeoJSON.Feature<GeoJSON.Polygon>;
};
export interface Location {
census?: Census | null;
district: District | null;
latitude: number;
locality: Locality | null;
longitude: number;
municipality: Municipality | null;
parish: null | Parish;
}
export declare const GetAllDistrictsQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
}, "strip", z.ZodTypeAny, {
geojson: boolean;
}, {
geojson?: unknown;
}>;
export declare const GetAllMunicipalitiesQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
} & {
district_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
}, "strip", z.ZodTypeAny, {
geojson: boolean;
district_ids?: string[] | null | undefined;
}, {
geojson?: unknown;
district_ids?: unknown;
}>;
export declare const GetAllParishesQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
} & {
district_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
} & {
municipality_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
} & {
limit: z.ZodDefault<z.ZodNumber>;
page: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
limit: number;
page: number;
geojson: boolean;
municipality_ids?: string[] | null | undefined;
district_ids?: string[] | null | undefined;
}, {
limit?: number | undefined;
page?: number | undefined;
municipality_ids?: unknown;
geojson?: unknown;
district_ids?: unknown;
}>;
export declare const GetAllLocalitiesQuerySchema: z.ZodObject<{
geojson: z.ZodEffects<z.ZodBoolean, boolean, unknown>;
district_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
municipality_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
parish_ids: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>, string[] | null | undefined, unknown>;
} & {
limit: z.ZodDefault<z.ZodNumber>;
page: z.ZodDefault<z.ZodNumber>;
}, "strip", z.ZodTypeAny, {
limit: number;
page: number;
geojson: boolean;
municipality_ids?: string[] | null | undefined;
district_ids?: string[] | null | undefined;
parish_ids?: string[] | null | undefined;
}, {
limit?: number | undefined;
page?: number | undefined;
municipality_ids?: unknown;
geojson?: unknown;
district_ids?: unknown;
parish_ids?: unknown;
}>;
export type GetAllDistrictsQuery = z.infer<typeof GetAllDistrictsQuerySchema>;
export type GetAllMunicipalitiesQuery = z.infer<typeof GetAllMunicipalitiesQuerySchema>;
export type GetAllParishesQuery = z.infer<typeof GetAllParishesQuerySchema>;
export type GetAllLocalitiesQuery = z.infer<typeof GetAllLocalitiesQuerySchema>;