import { z } from 'zod';
export const ContextSchema = z.object({
domain: z.string(),
country: z.string(),
city: z.string(),
action: z.string(),
core_version: z.string(),
bap_id: z.string(),
bap_uri: z.string(),
bpp_id: z.string().optional(),
bpp_uri: z.string().optional(),
transaction_id: z.string(),
message_id: z.string(),
timestamp: z.string(),
ttl: z.string().optional(),
});
export const DescriptorSchema = z.object({
name: z.string().optional(),
code: z.string().optional(),
symbol: z.string().optional(),
short_desc: z.string().optional(),
long_desc: z.string().optional(),
images: z.array(z.string()).optional(),
});
export const ProviderSchema = z.object({
id: z.string(),
descriptor: DescriptorSchema.optional(),
category_id: z.string().optional(),
});
export const ItemSchema = z.object({
id: z.string(),
descriptor: DescriptorSchema.optional(),
price: z.object({
currency: z.string(),
value: z.string(),
}).optional(),
category_id: z.string().optional(),
fulfillment_id: z.string().optional(),
});
export const FulfillmentSchema = z.object({
id: z.string(),
type: z.string().optional(),
start: z.object({
location: z.object({
gps: z.string(),
}).optional(),
}).optional(),
end: z.object({
location: z.object({
gps: z.string(),
}).optional(),
}).optional(),
});
export const SearchMessageSchema = z.object({
intent: z.object({
fulfillment: z.object({
start: z.object({
location: z.object({
gps: z.string(),
}),
}),
end: z.object({
location: z.object({
gps: z.string(),
}),
}),
}),
}),
});
export const SelectMessageSchema = z.object({
order: z.object({
provider: z.object({
id: z.string(),
}),
items: z.array(z.object({
id: z.string(),
})),
}),
});
export const InitMessageSchema = z.object({
order: z.object({
provider: z.object({
id: z.string(),
}),
items: z.array(z.object({
id: z.string(),
})),
billing: z.object({
name: z.string(),
email: z.string(),
phone: z.string(),
}),
}),
});
export const ConfirmMessageSchema = z.object({
order: z.object({
id: z.string().optional(),
provider: z.object({
id: z.string(),
}),
items: z.array(z.object({
id: z.string(),
})),
fulfillment: z.object({
id: z.string(),
customer: z.object({
person: z.object({
name: z.string(),
}),
contact: z.object({
phone: z.string(),
}),
}),
}).optional(),
}),
});