test(auth): add unit tests for KYC presigned upload and submit handlers
Cover GenerateKycUploadUrlsHandler (10 tests) and SubmitKycHandler (10 tests): presigned URL flow, legacy file upload, status validation, error handling. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
@@ -40,7 +40,7 @@ const GetMacroDataSchema = {
|
||||
};
|
||||
|
||||
export function createReportsServer(deps: ReportsDeps): McpServer {
|
||||
const baseUrl = deps.aiServiceBaseUrl.replace(/\/$/, '');
|
||||
const baseUrl = deps.apiBaseUrl.replace(/\/$/, '');
|
||||
|
||||
const server = new McpServer({
|
||||
name: 'goodgo-reports',
|
||||
@@ -108,15 +108,15 @@ export function createReportsServer(deps: ReportsDeps): McpServer {
|
||||
'Retrieve macro-economic data (GDP, population, FDI, infrastructure) for a Vietnamese province.',
|
||||
GetMacroDataSchema,
|
||||
async (params: z.infer<z.ZodObject<typeof GetMacroDataSchema>>) => {
|
||||
const response = await fetch(`${baseUrl}/reports/macro-data`, {
|
||||
method: 'POST',
|
||||
const qs = new URLSearchParams();
|
||||
qs.set('province', params.province);
|
||||
for (const cat of params.categories) qs.append('categories', cat);
|
||||
qs.set('fromYear', String(params.fromYear));
|
||||
qs.set('toYear', String(params.toYear));
|
||||
|
||||
const response = await fetch(`${baseUrl}/reports/macro-data?${qs.toString()}`, {
|
||||
method: 'GET',
|
||||
headers: { 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({
|
||||
province: params.province,
|
||||
categories: params.categories,
|
||||
from_year: params.fromYear,
|
||||
to_year: params.toYear,
|
||||
}),
|
||||
});
|
||||
|
||||
if (!response.ok) {
|
||||
|
||||
Reference in New Issue
Block a user