UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

49 lines 2.36 kB
import { z } from 'zod'; import { BaseResponseSchema } from '../../../core/schemas'; import { createListParamsSchema, createGetParamsSchema } from '../../../core/schema-factories'; // Legacy State Management schemas (based on State.json - uses camelCase) export const StateSchema = z.object({ stateUid: z.number(), countryUid: z.number().nullable().optional(), twoLetterCode: z.string().max(2).nullable().optional(), stateName: z.string().max(255).nullable().optional(), dateCreated: z.string().nullable().optional(), createdBy: z.string().max(255).nullable().optional(), dateLastModified: z.string().nullable().optional(), lastMaintainedBy: z.string().max(255).nullable().optional(), combinedFederalState1099No: z.number().nullable().optional(), telecheckStateCode: z.number().nullable().optional(), updateCd: z.number(), active: z.number().nullable().optional(), // 0=inactive, 1=active taxRate: z.number().nullable().optional(), // decimal(19,9) dateLastChecked: z.string().nullable().optional(), taxShipping: z.number().nullable().optional(), // 0=no, 1=yes statusCd: z.number(), processCd: z.number(), }); export const StateListParamsSchema = createListParamsSchema({ twoLetterCode: z.string().max(2).optional(), }); export const StateGetParamsSchema = createGetParamsSchema({ twoLetterCode: z.string().max(2).optional(), }); export const CreateStateRequestSchema = z.object({ countryUid: z.number().nullable().optional(), twoLetterCode: z.string().max(2), stateName: z.string().max(255), createdBy: z.string().max(255).optional().default(''), combinedFederalState1099No: z.number().nullable().optional(), telecheckStateCode: z.number().nullable().optional(), active: z.number().optional().default(0), taxRate: z.number().optional().default(0.0), taxShipping: z.number().optional().default(0), }); export const UpdateStateRequestSchema = z.object({ active: z.number().nullable().optional(), taxRate: z.number().nullable().optional(), taxShipping: z.number().nullable().optional(), }); // Response schemas using BaseResponseSchema (8-field format) export const StateListResponseSchema = BaseResponseSchema(z.array(StateSchema)); export const StateResponseSchema = BaseResponseSchema(StateSchema); //# sourceMappingURL=states.js.map