UNPKG

@simpleapps-com/augur-api

Version:

TypeScript client library for Augur microservices API endpoints

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