173 lines
5.1 KiB
JavaScript
173 lines
5.1 KiB
JavaScript
const swaggerAutogen = require('swagger-autogen')({ openapi: '3.0.0' });
|
|
const config = require('config');
|
|
|
|
const doc = {
|
|
info: {
|
|
title: config.get('app.name'),
|
|
description: config.get('app.description'),
|
|
version: config.get('app.version')
|
|
},
|
|
servers: [
|
|
{
|
|
url: config.get('server.host_swagger'),
|
|
description: 'Environtment ' + config.get('app.env')
|
|
},
|
|
],
|
|
components: {
|
|
schemas: {
|
|
product: {
|
|
$code: "123456",
|
|
$name: "Product name",
|
|
$description: "Product description",
|
|
$source: "trialBalanceBranch / cifAccount / lnkolek",
|
|
$status: "Y",
|
|
},
|
|
branch: {
|
|
$code: "123456",
|
|
$name: "Branch name",
|
|
$status: "Y",
|
|
},
|
|
menu: {
|
|
$module: "Dashboard",
|
|
$name: "Dashboard",
|
|
$link: "/",
|
|
$id_parent: "",
|
|
$order_number: 1,
|
|
$icon: "",
|
|
$application: "ukln",
|
|
$status: "Y"
|
|
},
|
|
administrativu: {
|
|
$code: '123456',
|
|
$name: 'Administrativu name',
|
|
$status: "Y",
|
|
$munisipo_id: "uuid-string"
|
|
},
|
|
application: {
|
|
$id: 'ukln',
|
|
$name: 'Dashboard Performance Business',
|
|
$reset_password_url: 'https://brilianapps.britimorleste.tl/ukln/auth/reset-password/',
|
|
$status: "Y"
|
|
},
|
|
aldeia: {
|
|
$code: '123456',
|
|
$name: 'Aldeia name',
|
|
$status: "Y",
|
|
$suco_id: "uuid-string"
|
|
},
|
|
class_economi: {
|
|
$code: '123456',
|
|
$name: 'Class economi name',
|
|
$status: "Y"
|
|
},
|
|
district: {
|
|
$code: '123456',
|
|
$name: 'District name',
|
|
$status: "Y"
|
|
},
|
|
income_tier: {
|
|
$code: '123456',
|
|
$name: 'Income tier name',
|
|
$status: "Y"
|
|
},
|
|
munisipo: {
|
|
$code: '123456',
|
|
$name: 'Munisipo name',
|
|
$status: "Y"
|
|
},
|
|
suco: {
|
|
$code: '123456',
|
|
$name: 'Suco name',
|
|
$status: "Y",
|
|
$administrativu_id: "uuid-string"
|
|
},
|
|
nationality: {
|
|
$code: '123456',
|
|
$name: 'Nationality name',
|
|
$status: "Y"
|
|
},
|
|
classEconomi: {
|
|
$code: '123456',
|
|
$name: 'Class Economi name',
|
|
$status: "Y"
|
|
},
|
|
incomeTier: {
|
|
$code: '123456',
|
|
$name: 'Income Tier name',
|
|
$status: "Y"
|
|
},
|
|
diagnosis: {
|
|
$diagnosis: "Diagnosis name (ICD-11)",
|
|
$code: "ABC123",
|
|
$status: "Y"
|
|
},
|
|
diagnostic_procedure: {
|
|
$diagnosticProcedure: "Procedure name (ICD-9)",
|
|
$code: "XYZ789",
|
|
$status: "Y"
|
|
},
|
|
room: {
|
|
$room: "Room name",
|
|
$code: "R001",
|
|
$description: "Optional description",
|
|
$department_id: "uuid-string",
|
|
$status: "Y"
|
|
},
|
|
serviceType: {
|
|
$name: "Registration & Tickets",
|
|
$status: { "@enum": ["Y", "N"] }
|
|
},
|
|
serviceClass: {
|
|
$name: "Class name"
|
|
},
|
|
service: {
|
|
$name: "e.g. ER Registration",
|
|
$service_type_id: "uuid-string",
|
|
$room_ids: ["uuid-string"]
|
|
},
|
|
servicetodepart: {
|
|
$room_ids: ["uuid-string"]
|
|
},
|
|
serviceFare: {
|
|
$service_class_id: "uuid-string",
|
|
$service_id: "uuid-string",
|
|
$fare: 100000
|
|
},
|
|
servicePackage: {
|
|
$name: "Package name",
|
|
$service_class_id: "uuid-string",
|
|
$fare: 500000,
|
|
$service_ids: ["uuid-string"]
|
|
},
|
|
department: {
|
|
$name: "igd",
|
|
$status: { "@enum": ["Y", "N"] }
|
|
},
|
|
doctorSchedule: {
|
|
$day: "Senin",
|
|
$start_time: "08:00",
|
|
$end_time: "12:00",
|
|
$doctor_id: "uuid-string",
|
|
$room_id: "uuid-string",
|
|
$quota: "20",
|
|
$status: { "@enum": ["Y", "N"] }
|
|
},
|
|
},
|
|
parameters: {
|
|
|
|
},
|
|
securitySchemes: {
|
|
bearerAuth: {
|
|
type: 'http',
|
|
scheme: 'bearer'
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
const outputFile = './swagger.json';
|
|
const routes = ['../routes/private.ts', '../routes/public.ts'];
|
|
|
|
swaggerAutogen(outputFile, routes, doc);
|
|
|