parts and areas tested
This commit is contained in:
@@ -27,8 +27,7 @@ export async function POST(request: Request) {
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { input: validatedBody };
|
||||
const data = await client.request(query, variables);
|
||||
const data = await client.request(query, { input: validatedBody });
|
||||
return NextResponse.json({ data: data.createBuildArea, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const buildAreaAddSchema = z.object({
|
||||
buildId: z.string(),
|
||||
areaName: z.string(),
|
||||
areaCode: z.string(),
|
||||
areaType: z.string(),
|
||||
@@ -10,7 +11,7 @@ export const buildAreaAddSchema = z.object({
|
||||
width: z.number(),
|
||||
size: z.number(),
|
||||
expiryStarts: z.string().optional(),
|
||||
expiryEnds: z.string().optional(),
|
||||
expiryEnds: z.string().optional()
|
||||
});
|
||||
|
||||
export type BuildAreaAdd = z.infer<typeof buildAreaAddSchema>;
|
||||
|
||||
@@ -12,26 +12,25 @@ export async function POST(request: Request) {
|
||||
const query = gql`
|
||||
query BuildAreas($input: ListArguments!) {
|
||||
buildAreas(input: $input) {
|
||||
data {
|
||||
_id
|
||||
uuid
|
||||
createdAt
|
||||
areaName
|
||||
areaCode
|
||||
areaType
|
||||
areaDirection
|
||||
areaGrossSize
|
||||
areaNetSize
|
||||
width
|
||||
size
|
||||
expiryStarts
|
||||
expiryEnds
|
||||
}
|
||||
data {
|
||||
_id
|
||||
uuid
|
||||
createdAt
|
||||
areaName
|
||||
areaCode
|
||||
areaType
|
||||
areaDirection
|
||||
areaGrossSize
|
||||
areaNetSize
|
||||
width
|
||||
size
|
||||
expiryStarts
|
||||
expiryEnds
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}`;
|
||||
const variables = { input: { limit, skip, sort, filters } };
|
||||
console.dir({ variables })
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.buildAreas.data, totalCount: data.buildAreas.totalCount });
|
||||
} catch (err: any) {
|
||||
|
||||
@@ -14,24 +14,13 @@ export async function POST(request: Request) {
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
mutation UpdateBuildAddress($uuid: String!, $input: UpdateBuildAddressInput!) {
|
||||
updateBuildAddress(uuid: $uuid, input: $input) {
|
||||
_id
|
||||
buildNumber
|
||||
doorNumber
|
||||
floorNumber
|
||||
commentAddress
|
||||
letterAddress
|
||||
shortLetterAddress
|
||||
latitude
|
||||
longitude
|
||||
street
|
||||
}
|
||||
mutation UpdateBuildArea($uuid:String!, $input: UpdateBuildAreaInput!) {
|
||||
updateBuildArea(uuid: $uuid, input: $input) { _id }
|
||||
}
|
||||
`;
|
||||
const variables = { uuid: uuid, input: validatedBody };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.updateBuildAddress, status: 200 });
|
||||
return NextResponse.json({ data: data.updateBuildArea, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const UpdateBuildAddressSchema = z.object({
|
||||
buildNumber: z.string().optional(),
|
||||
doorNumber: z.string().optional(),
|
||||
floorNumber: z.string().optional(),
|
||||
commentAddress: z.string().optional(),
|
||||
letterAddress: z.string().optional(),
|
||||
shortLetterAddress: z.string().optional(),
|
||||
latitude: z.number().optional(),
|
||||
longitude: z.number().optional(),
|
||||
street: z.string().optional(),
|
||||
buildId: z.string(),
|
||||
areaName: z.string(),
|
||||
areaCode: z.string(),
|
||||
areaType: z.string(),
|
||||
areaDirection: z.string(),
|
||||
areaGrossSize: z.number(),
|
||||
areaNetSize: z.number(),
|
||||
width: z.number(),
|
||||
size: z.number(),
|
||||
expiryStarts: z.string().optional(),
|
||||
expiryEnds: z.string().optional()
|
||||
});
|
||||
|
||||
export type UpdateBuildAddress = z.infer<typeof UpdateBuildAddressSchema>;
|
||||
|
||||
@@ -17,6 +17,8 @@ export async function POST(request: Request) {
|
||||
token
|
||||
typeToken
|
||||
description
|
||||
expiryStarts
|
||||
expiryEnds
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -5,6 +5,8 @@ export const buildTypesAddSchema = z.object({
|
||||
token: z.string(),
|
||||
typeToken: z.string(),
|
||||
description: z.string().optional().default(''),
|
||||
expiryStarts: z.string().optional(),
|
||||
expiryEnds: z.string().optional(),
|
||||
});
|
||||
|
||||
export type BuildTypesAdd = z.infer<typeof buildTypesAddSchema>;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
import { personUpdateSchema } from './schema';
|
||||
import { buildTypesUpdateSchema } from './schema';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
@@ -9,7 +9,7 @@ export async function POST(request: Request) {
|
||||
const searchUrl = new URL(request.url);
|
||||
const uuid = searchUrl.searchParams.get("uuid") || "";
|
||||
const body = await request.json();
|
||||
const validatedBody = personUpdateSchema.parse(body);
|
||||
const validatedBody = buildTypesUpdateSchema.parse(body);
|
||||
if (uuid === "") { return NextResponse.json({ error: "UUID is required" }, { status: 400 }) }
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
@@ -20,6 +20,8 @@ export async function POST(request: Request) {
|
||||
token
|
||||
typeToken
|
||||
description
|
||||
expiryStarts
|
||||
expiryEnds
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
@@ -1,22 +1,12 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const personUpdateSchema = z.object({
|
||||
firstName: z.string().optional(),
|
||||
surname: z.string().optional(),
|
||||
middleName: z.string().optional(),
|
||||
sexCode: z.string().optional(),
|
||||
personRef: z.string().optional(),
|
||||
personTag: z.string().optional(),
|
||||
fatherName: z.string().optional(),
|
||||
motherName: z.string().optional(),
|
||||
countryCode: z.string().optional(),
|
||||
nationalIdentityId: z.string().optional(),
|
||||
birthPlace: z.string().optional(),
|
||||
birthDate: z.string().optional(),
|
||||
taxNo: z.string().optional().optional(),
|
||||
birthname: z.string().optional().optional(),
|
||||
expiryStarts: z.string().optional().optional(),
|
||||
expiryEnds: z.string().optional().optional(),
|
||||
export const buildTypesUpdateSchema = z.object({
|
||||
type: z.string().optional(),
|
||||
token: z.string().optional(),
|
||||
typeToken: z.string().optional(),
|
||||
description: z.string().optional().default(''),
|
||||
expiryStarts: z.string().optional(),
|
||||
expiryEnds: z.string().optional(),
|
||||
});
|
||||
|
||||
export type PeopleUpdate = z.infer<typeof personUpdateSchema>;
|
||||
export type BuildTypesUpdate = z.infer<typeof buildTypesUpdateSchema>;
|
||||
|
||||
38
frontend/app/api/builds-parts/add/route.ts
Normal file
38
frontend/app/api/builds-parts/add/route.ts
Normal file
@@ -0,0 +1,38 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
import { buildPartsAddSchema } from './schema';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const validatedBody = buildPartsAddSchema.parse({ ...body.data, buildId: body.buildId });
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
mutation CreateBuildParts($input: CreateBuildPartsInput!) {
|
||||
createBuildPart(input: $input) {
|
||||
buildId
|
||||
addressGovCode
|
||||
level
|
||||
no
|
||||
code
|
||||
grossSize
|
||||
netSize
|
||||
defaultAccessory
|
||||
humanLivability
|
||||
key
|
||||
directionId
|
||||
typeId
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { input: validatedBody };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.createBuildPart, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
23
frontend/app/api/builds-parts/add/schema.ts
Normal file
23
frontend/app/api/builds-parts/add/schema.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const buildPartsAddSchema = z.object({
|
||||
buildId: z.string(),
|
||||
addressGovCode: z.string(),
|
||||
no: z.number(),
|
||||
level: z.number(),
|
||||
code: z.string(),
|
||||
grossSize: z.number(),
|
||||
netSize: z.number(),
|
||||
defaultAccessory: z.string(),
|
||||
humanLivability: z.boolean(),
|
||||
key: z.string(),
|
||||
directionId: z.string().optional(),
|
||||
typeId: z.string().optional(),
|
||||
active: z.boolean().default(true),
|
||||
isConfirmed: z.boolean().default(false),
|
||||
expiryStarts: z.string().optional(),
|
||||
expiryEnds: z.string().optional()
|
||||
|
||||
});
|
||||
|
||||
export type BuildPartsAdd = z.infer<typeof buildPartsAddSchema>;
|
||||
23
frontend/app/api/builds-parts/delete/route.ts
Normal file
23
frontend/app/api/builds-parts/delete/route.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
|
||||
const searchParams = new URL(request.url).searchParams;
|
||||
const uuid = searchParams.get('uuid');
|
||||
if (!uuid) { return NextResponse.json({ error: 'UUID not found in search params' }, { status: 400 }) }
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`mutation DeleteBuildPart($uuid: String!) { deleteBuildPart(uuid: $uuid) }`;
|
||||
const variables = { uuid: uuid };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.deletePerson, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
|
||||
}
|
||||
47
frontend/app/api/builds-parts/list/route.ts
Normal file
47
frontend/app/api/builds-parts/list/route.ts
Normal file
@@ -0,0 +1,47 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const { limit, skip, sort, filters } = body;
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
query BuildParts($input: ListArguments!) {
|
||||
buildParts(input: $input) {
|
||||
data {
|
||||
_id
|
||||
uuid
|
||||
addressGovCode
|
||||
no
|
||||
level
|
||||
code
|
||||
grossSize
|
||||
netSize
|
||||
defaultAccessory
|
||||
humanLivability
|
||||
key
|
||||
directionId
|
||||
typeId
|
||||
createdAt
|
||||
updatedAt
|
||||
expiryStarts
|
||||
expiryEnds
|
||||
active
|
||||
isConfirmed
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { input: { limit, skip, sort, filters } };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.buildParts.data, totalCount: data.buildParts.totalCount });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
45
frontend/app/api/builds-parts/update/route.ts
Normal file
45
frontend/app/api/builds-parts/update/route.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
import { UpdateBuildPartsSchema } from './schema';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const searchUrl = new URL(request.url);
|
||||
const uuid = searchUrl.searchParams.get("uuid") || "";
|
||||
const body = await request.json();
|
||||
const validatedBody = UpdateBuildPartsSchema.parse(body);
|
||||
if (uuid === "") { return NextResponse.json({ error: "UUID is required" }, { status: 400 }) }
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
mutation UpdateBuildPart($uuid:String!, $input: UpdateBuildPartsInput!) {
|
||||
updateBuildPart(uuid: $uuid, input: $input) {
|
||||
_id
|
||||
buildId
|
||||
addressGovCode
|
||||
code
|
||||
directionId
|
||||
expiryEnds
|
||||
expiryStarts
|
||||
grossSize
|
||||
humanLivability
|
||||
isConfirmed
|
||||
key
|
||||
level
|
||||
netSize
|
||||
no
|
||||
active
|
||||
typeId
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { uuid: uuid, input: { ...validatedBody } };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.updateBuildPart, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
24
frontend/app/api/builds-parts/update/schema.ts
Normal file
24
frontend/app/api/builds-parts/update/schema.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const UpdateBuildPartsSchema = z.object({
|
||||
|
||||
buildId: z.string().optional(),
|
||||
addressGovCode: z.string(),
|
||||
no: z.number(),
|
||||
level: z.number(),
|
||||
code: z.string(),
|
||||
grossSize: z.number(),
|
||||
netSize: z.number(),
|
||||
defaultAccessory: z.string(),
|
||||
humanLivability: z.boolean(),
|
||||
key: z.string(),
|
||||
directionId: z.string().optional(),
|
||||
typeId: z.string().optional(),
|
||||
active: z.boolean(),
|
||||
isConfirmed: z.boolean(),
|
||||
expiryStarts: z.string().optional(),
|
||||
expiryEnds: z.string().optional()
|
||||
|
||||
});
|
||||
|
||||
export type UpdateBuildParts = z.infer<typeof UpdateBuildPartsSchema>;
|
||||
51
frontend/app/api/builds/add/route.ts
Normal file
51
frontend/app/api/builds/add/route.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
import { buildTypesAddSchema } from './schema';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const validatedBody = buildTypesAddSchema.parse(body);
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
mutation CreateBuild($input: CreateBuildInput!) {
|
||||
createBuild(input: $input) {
|
||||
_id
|
||||
buildType {
|
||||
token
|
||||
typeToken
|
||||
type
|
||||
}
|
||||
collectionToken
|
||||
info {
|
||||
govAddressCode
|
||||
buildName
|
||||
buildNo
|
||||
maxFloor
|
||||
undergroundFloor
|
||||
buildDate
|
||||
decisionPeriodDate
|
||||
taxNo
|
||||
liftCount
|
||||
heatingSystem
|
||||
coolingSystem
|
||||
hotWaterSystem
|
||||
blockServiceManCount
|
||||
securityServiceManCount
|
||||
garageCount
|
||||
managementRoomId
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { input: validatedBody };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.createBuild, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
26
frontend/app/api/builds/add/schema.ts
Normal file
26
frontend/app/api/builds/add/schema.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const buildTypesAddSchema = z.object({
|
||||
buildType: z.string(),
|
||||
collectionToken: z.string(),
|
||||
info: z.object({
|
||||
govAddressCode: z.string(),
|
||||
buildName: z.string(),
|
||||
buildNo: z.string(),
|
||||
maxFloor: z.number(),
|
||||
undergroundFloor: z.number(),
|
||||
buildDate: z.string(),
|
||||
decisionPeriodDate: z.string(),
|
||||
taxNo: z.string(),
|
||||
liftCount: z.number(),
|
||||
heatingSystem: z.boolean(),
|
||||
coolingSystem: z.boolean(),
|
||||
hotWaterSystem: z.boolean(),
|
||||
blockServiceManCount: z.number(),
|
||||
securityServiceManCount: z.number(),
|
||||
garageCount: z.number(),
|
||||
managementRoomId: z.string(),
|
||||
})
|
||||
});
|
||||
|
||||
export type BuildTypesAdd = z.infer<typeof buildTypesAddSchema>;
|
||||
23
frontend/app/api/builds/delete/route.ts
Normal file
23
frontend/app/api/builds/delete/route.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function GET(request: Request) {
|
||||
|
||||
const searchParams = new URL(request.url).searchParams;
|
||||
const uuid = searchParams.get('uuid');
|
||||
if (!uuid) { return NextResponse.json({ error: 'UUID not found in search params' }, { status: 400 }) }
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`mutation DeleteBuild($uuid: String!) { deleteBuild(uuid: $uuid) }`;
|
||||
const variables = { uuid: uuid };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.deletePerson, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
|
||||
}
|
||||
53
frontend/app/api/builds/list/route.ts
Normal file
53
frontend/app/api/builds/list/route.ts
Normal file
@@ -0,0 +1,53 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const body = await request.json();
|
||||
const { limit, skip, sort, filters } = body;
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
query ListBuild($input: ListArguments!) {
|
||||
builds(input: $input) {
|
||||
data {
|
||||
_id
|
||||
collectionToken
|
||||
buildType {
|
||||
token
|
||||
typeToken
|
||||
type
|
||||
}
|
||||
info {
|
||||
govAddressCode
|
||||
buildName
|
||||
buildNo
|
||||
maxFloor
|
||||
undergroundFloor
|
||||
buildDate
|
||||
decisionPeriodDate
|
||||
taxNo
|
||||
liftCount
|
||||
heatingSystem
|
||||
coolingSystem
|
||||
hotWaterSystem
|
||||
blockServiceManCount
|
||||
securityServiceManCount
|
||||
garageCount
|
||||
managementRoomId
|
||||
}
|
||||
}
|
||||
totalCount
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { input: { limit, skip, sort, filters } };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.builds.data, totalCount: data.builds.totalCount });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
33
frontend/app/api/builds/update/route.ts
Normal file
33
frontend/app/api/builds/update/route.ts
Normal file
@@ -0,0 +1,33 @@
|
||||
'use server';
|
||||
import { NextResponse } from 'next/server';
|
||||
import { GraphQLClient, gql } from 'graphql-request';
|
||||
import { personUpdateSchema } from './schema';
|
||||
|
||||
const endpoint = "http://localhost:3001/graphql";
|
||||
|
||||
export async function POST(request: Request) {
|
||||
const searchUrl = new URL(request.url);
|
||||
const uuid = searchUrl.searchParams.get("uuid") || "";
|
||||
const body = await request.json();
|
||||
const validatedBody = personUpdateSchema.parse(body);
|
||||
if (uuid === "") { return NextResponse.json({ error: "UUID is required" }, { status: 400 }) }
|
||||
try {
|
||||
const client = new GraphQLClient(endpoint);
|
||||
const query = gql`
|
||||
mutation UpdateBuildType($uuid: String!, $input: UpdateBuildTypesInput!) {
|
||||
updateBuildType(uuid: $uuid, input: $input) {
|
||||
type
|
||||
token
|
||||
typeToken
|
||||
description
|
||||
}
|
||||
}
|
||||
`;
|
||||
const variables = { uuid: uuid, input: validatedBody };
|
||||
const data = await client.request(query, variables);
|
||||
return NextResponse.json({ data: data.updateBuildType, status: 200 });
|
||||
} catch (err: any) {
|
||||
console.error(err);
|
||||
return NextResponse.json({ error: err.message }, { status: 500 });
|
||||
}
|
||||
}
|
||||
22
frontend/app/api/builds/update/schema.ts
Normal file
22
frontend/app/api/builds/update/schema.ts
Normal file
@@ -0,0 +1,22 @@
|
||||
import { z } from "zod"
|
||||
|
||||
export const personUpdateSchema = z.object({
|
||||
firstName: z.string().optional(),
|
||||
surname: z.string().optional(),
|
||||
middleName: z.string().optional(),
|
||||
sexCode: z.string().optional(),
|
||||
personRef: z.string().optional(),
|
||||
personTag: z.string().optional(),
|
||||
fatherName: z.string().optional(),
|
||||
motherName: z.string().optional(),
|
||||
countryCode: z.string().optional(),
|
||||
nationalIdentityId: z.string().optional(),
|
||||
birthPlace: z.string().optional(),
|
||||
birthDate: z.string().optional(),
|
||||
taxNo: z.string().optional().optional(),
|
||||
birthname: z.string().optional().optional(),
|
||||
expiryStarts: z.string().optional().optional(),
|
||||
expiryEnds: z.string().optional().optional(),
|
||||
});
|
||||
|
||||
export type PeopleUpdate = z.infer<typeof personUpdateSchema>;
|
||||
Reference in New Issue
Block a user