541 lines
16 KiB
YAML
541 lines
16 KiB
YAML
global:
|
|
module_name: "api-service"
|
|
output_dir: "internal/handlers"
|
|
enable_swagger: true
|
|
enable_logging: true
|
|
database:
|
|
default_connection: "postgres_satudata"
|
|
timeout_seconds: 30
|
|
|
|
services:
|
|
pasien:
|
|
name: "Manajemen Data Pasien"
|
|
category: "pasien"
|
|
package: "pasien"
|
|
description: "API untuk mengelola data pasien dengan informasi lokasi lengkap"
|
|
base_url: ""
|
|
timeout: 30
|
|
retry_count: 3
|
|
table_name: "m_pasien"
|
|
|
|
# Define all columns once for reuse
|
|
schema:
|
|
columns:
|
|
- name: "id"
|
|
type: "serial4"
|
|
nullable: false
|
|
go_type: "int32"
|
|
primary_key: true
|
|
unique: true
|
|
description: "Primary key for schedule"
|
|
- name: "nomr"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
searchable: true
|
|
unique: true
|
|
description: "Nomor Rekam Medis"
|
|
- name: "status"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Status pasien (A = Aktif, I = Inaktif)"
|
|
- name: "title"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Gelar pasien (Tn, Ny, Sdr, dll)"
|
|
- name: "nama"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
validation: "required,min=1,max=100"
|
|
searchable: true
|
|
description: "Nama lengkap pasien"
|
|
- name: "tempat"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Tempat lahir pasien"
|
|
- name: "tgllahir"
|
|
type: "date"
|
|
nullable: true
|
|
go_type: "time.Time"
|
|
description: "Tanggal lahir pasien"
|
|
- name: "jeniskelamin"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
validation: "oneof=L P"
|
|
description: "Jenis kelamin (L/P)"
|
|
- name: "alamat"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Alamat lengkap pasien"
|
|
- name: "kelurahan"
|
|
type: "int8"
|
|
nullable: true
|
|
go_type: "int64"
|
|
description: "ID Kelurahan"
|
|
- name: "kdkecamatan"
|
|
type: "int4"
|
|
nullable: true
|
|
go_type: "int32"
|
|
description: "ID Kecamatan"
|
|
- name: "kota"
|
|
type: "int4"
|
|
nullable: true
|
|
go_type: "int32"
|
|
description: "ID Kota"
|
|
- name: "kdprovinsi"
|
|
type: "int4"
|
|
nullable: true
|
|
go_type: "int32"
|
|
description: "ID Provinsi"
|
|
- name: "agama"
|
|
type: "int4"
|
|
nullable: true
|
|
go_type: "int32"
|
|
description: "ID Agama"
|
|
- name: "no_kartu"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
searchable: true
|
|
unique: true
|
|
description: "Nomor kartu identitas"
|
|
- name: "noktp_baru"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Nomor KTP baru"
|
|
- name: "created_at"
|
|
type: "timestamp"
|
|
nullable: true
|
|
go_type: "time.Time"
|
|
system_field: true
|
|
description: "Tanggal pembuatan record"
|
|
- name: "updated_at"
|
|
type: "timestamp"
|
|
nullable: true
|
|
go_type: "time.Time"
|
|
system_field: true
|
|
description: "Tanggal update record"
|
|
|
|
# Define relationships with other tables
|
|
relationships:
|
|
- name: "provinsi"
|
|
table: "m_provinsi"
|
|
foreign_key: "kdprovinsi"
|
|
local_key: "idprovinsi"
|
|
columns:
|
|
- name: "idprovinsi"
|
|
type: "int4"
|
|
nullable: false
|
|
go_type: "int32"
|
|
primary_key: true
|
|
- name: "namaprovinsi"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Nama provinsi"
|
|
- name: "kota"
|
|
table: "m_kota"
|
|
foreign_key: "kota"
|
|
local_key: "idkota"
|
|
columns:
|
|
- name: "idkota"
|
|
type: "int4"
|
|
nullable: false
|
|
go_type: "int32"
|
|
primary_key: true
|
|
- name: "namakota"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Nama kota"
|
|
- name: "kecamatan"
|
|
table: "m_kecamatan"
|
|
foreign_key: "kdkecamatan"
|
|
local_key: "idkecamatan"
|
|
columns:
|
|
- name: "idkecamatan"
|
|
type: "int8"
|
|
nullable: false
|
|
go_type: "int64"
|
|
primary_key: true
|
|
- name: "namakecamatan"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Nama kecamatan"
|
|
- name: "kelurahan"
|
|
table: "m_kelurahan"
|
|
foreign_key: "kelurahan"
|
|
local_key: "idkelurahan"
|
|
columns:
|
|
- name: "idkelurahan"
|
|
type: "int8"
|
|
nullable: false
|
|
go_type: "int64"
|
|
primary_key: true
|
|
- name: "namakelurahan"
|
|
type: "varchar"
|
|
nullable: true
|
|
go_type: "string"
|
|
description: "Nama kelurahan"
|
|
|
|
# Define reusable field groups
|
|
field_groups:
|
|
base_fields: ["nomr", "title", "nama", "tempat", "tgllahir", "jeniskelamin"]
|
|
location_fields: ["alamat", "kelurahan", "kdkecamatan", "kota", "kdprovinsi"]
|
|
identity_fields: ["agama", "no_kartu", "noktp_baru"]
|
|
all_fields: ["nomr", "title", "nama", "tempat", "tgllahir", "jeniskelamin", "alamat", "kelurahan", "kdkecamatan", "kota", "kdprovinsi", "agama", "no_kartu", "noktp_baru"]
|
|
with_location_names: ["nomr", "title", "nama", "tempat", "tgllahir", "jeniskelamin", "alamat", "kelurahan", "namakelurahan", "kdkecamatan", "namakecamatan", "kota", "namakota", "kdprovinsi", "namaprovinsi", "agama", "no_kartu", "noktp_baru"]
|
|
|
|
# Define endpoints with reusable configurations
|
|
endpoints:
|
|
list:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["GET"]
|
|
path: "/"
|
|
description: "Get list of pasien with pagination and filters"
|
|
summary: "Get Pasien List"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
cache_enabled: true
|
|
cache_ttl: 300
|
|
has_pagination: true
|
|
has_filter: true
|
|
has_search: true
|
|
has_stats: true
|
|
fields: "with_location_names"
|
|
response_model: "PasienGetResponse"
|
|
|
|
get_by_id:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["GET"]
|
|
path: "/:id"
|
|
description: "Get pasien by ID"
|
|
summary: "Get Pasien by ID"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
cache_enabled: true
|
|
cache_ttl: 300
|
|
fields: "with_location_names"
|
|
response_model: "PasienGetByIDResponse"
|
|
|
|
get_by_nomr:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["GET"]
|
|
path: "/nomr/:nomr"
|
|
description: "Get pasien by Nomr"
|
|
summary: "Get Pasien by Nomr"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
cache_enabled: true
|
|
cache_ttl: 300
|
|
fields: "with_location_names"
|
|
response_model: "PasienGetByNomrResponse"
|
|
|
|
create:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["POST"]
|
|
path: "/"
|
|
description: "Create a new pasien"
|
|
summary: "Create Pasien"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
fields: "all_fields"
|
|
request_model: "PasienCreateRequest"
|
|
response_model: "PasienCreateResponse"
|
|
|
|
update:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["PUT"]
|
|
path: "/:nomr"
|
|
description: "Update an existing pasien"
|
|
summary: "Update Pasien"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
fields: "all_fields"
|
|
request_model: "PasienUpdateRequest"
|
|
response_model: "PasienUpdateResponse"
|
|
|
|
delete:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["DELETE"]
|
|
path: "/:nomr"
|
|
description: "Delete a pasien"
|
|
summary: "Delete Pasien"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
soft_delete: true
|
|
response_model: "PasienDeleteResponse"
|
|
|
|
dynamic:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["GET"]
|
|
path: "/dynamic"
|
|
description: "Get pasien with dynamic filtering"
|
|
summary: "Get Pasien Dynamic"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
has_dynamic: true
|
|
fields: "with_location_names"
|
|
response_model: "PasienGetResponse"
|
|
|
|
# search:
|
|
# handler_folder: "pasien"
|
|
# handler_file: "pasien.go"
|
|
# methods: ["GET"]
|
|
# path: "/search"
|
|
# description: "Search pasien by name or NOMR"
|
|
# summary: "Search Pasien"
|
|
# tags: ["Pasien"]
|
|
# require_auth: true
|
|
# has_search: true
|
|
# fields: "with_location_names"
|
|
# response_model: "PasienGetResponse"
|
|
|
|
# stats:
|
|
# handler_folder: "pasien"
|
|
# handler_file: "pasien.go"
|
|
# methods: ["GET"]
|
|
# path: "/stats"
|
|
# description: "Get pasien statistics"
|
|
# summary: "Get Pasien Stats"
|
|
# tags: ["Pasien"]
|
|
# require_auth: true
|
|
# has_stats: true
|
|
# response_model: "AggregateData"
|
|
|
|
by_location:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["GET"]
|
|
path: "/by-location"
|
|
description: "Get pasien by location (provinsi, kota, kecamatan, kelurahan)"
|
|
summary: "Get Pasien by Location"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
has_filter: true
|
|
fields: "with_location_names"
|
|
response_model: "PasienGetResponse"
|
|
|
|
by_age:
|
|
handler_folder: "pasien"
|
|
handler_file: "pasien.go"
|
|
methods: ["GET"]
|
|
path: "/by-age"
|
|
description: "Get pasien statistics by age group"
|
|
summary: "Get Pasien by Age Group"
|
|
tags: ["Pasien"]
|
|
require_auth: true
|
|
has_stats: true
|
|
response_model: "PasienAgeStatsResponse"
|
|
|
|
# schedule:
|
|
# name: "Jadwal Dokter"
|
|
# category: "schedule"
|
|
# package: "schedule"
|
|
# description: "Jadwal Dokter management"
|
|
# base_url: ""
|
|
# timeout: 30
|
|
# retry_count: 3
|
|
# table_name: "daftar_jadwal_dokter"
|
|
|
|
# # Define all columns once for reuse
|
|
# schema:
|
|
# columns:
|
|
# - name: "id"
|
|
# type: "serial4"
|
|
# nullable: false
|
|
# go_type: "int32"
|
|
# primary_key: true
|
|
# description: "Primary key for schedule"
|
|
# - name: "hari"
|
|
# type: "int4"
|
|
# nullable: true
|
|
# go_type: "int32"
|
|
# description: "Day of week (1-7)"
|
|
# - name: "nama_hari"
|
|
# type: "varchar"
|
|
# nullable: true
|
|
# go_type: "string"
|
|
# searchable: true
|
|
# description: "Name of day"
|
|
# - name: "waktu"
|
|
# type: "varchar"
|
|
# nullable: true
|
|
# go_type: "string"
|
|
# searchable: true
|
|
# description: "Time schedule"
|
|
# - name: "dokter"
|
|
# type: "uuid"
|
|
# nullable: true
|
|
# go_type: "string"
|
|
# searchable: true
|
|
# description: "Doctor ID"
|
|
# - name: "spesialis"
|
|
# type: "int4"
|
|
# nullable: true
|
|
# go_type: "int32"
|
|
# description: "Specialization ID"
|
|
# - name: "sub_spesialis"
|
|
# type: "int4"
|
|
# nullable: true
|
|
# go_type: "int32"
|
|
# description: "Sub-specialization ID"
|
|
# - name: "status"
|
|
# type: "int4"
|
|
# nullable: true
|
|
# go_type: "int32"
|
|
# description: "Status (1=active, 0=inactive)"
|
|
# - name: "date_created"
|
|
# type: "timestamp"
|
|
# nullable: true
|
|
# go_type: "time.Time"
|
|
# system_field: true
|
|
# description: "Tanggal pembuatan record"
|
|
# - name: "date_updated"
|
|
# type: "timestamp"
|
|
# nullable: true
|
|
# go_type: "time.Time"
|
|
# system_field: true
|
|
# description: "Tanggal update record"
|
|
# - name: "user_created"
|
|
# type: "varchar"
|
|
# nullable: true
|
|
# go_type: "string"
|
|
# system_field: true
|
|
# description: "User yang membuat record"
|
|
# - name: "user_updated"
|
|
# type: "varchar"
|
|
# nullable: true
|
|
# go_type: "string"
|
|
# system_field: true
|
|
# description: "User yang mengupdate record"
|
|
|
|
# # Define reusable field groups
|
|
# field_groups:
|
|
# base_fields: ["id", "hari", "nama_hari", "waktu", "dokter"]
|
|
# all_fields: ["id", "hari", "nama_hari", "waktu", "dokter", "spesialis", "sub_spesialis", "status"]
|
|
|
|
# # Define endpoints with reusable configurations
|
|
# endpoints:
|
|
# list:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["GET"]
|
|
# path: "/"
|
|
# description: "Get list of schedule with pagination and filters"
|
|
# summary: "Get Schedule List"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# cache_enabled: true
|
|
# cache_ttl: 300
|
|
# has_pagination: true
|
|
# has_filter: true
|
|
# has_search: true
|
|
# has_stats: true
|
|
# fields: "all_fields"
|
|
# response_model: "ScheduleGetResponse"
|
|
|
|
# get_by_id:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["GET"]
|
|
# path: "/:id"
|
|
# description: "Get schedule by ID"
|
|
# summary: "Get Schedule by ID"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# cache_enabled: true
|
|
# cache_ttl: 300
|
|
# fields: "all_fields"
|
|
# response_model: "ScheduleGetByIDResponse"
|
|
|
|
# create:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["POST"]
|
|
# path: "/"
|
|
# description: "Create a new schedule"
|
|
# summary: "Create Schedule"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# fields: "all_fields"
|
|
# request_model: "ScheduleCreateRequest"
|
|
# response_model: "ScheduleCreateResponse"
|
|
|
|
# update:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["PUT"]
|
|
# path: "/:id"
|
|
# description: "Update an existing schedule"
|
|
# summary: "Update Schedule"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# fields: "all_fields"
|
|
# request_model: "ScheduleUpdateRequest"
|
|
# response_model: "ScheduleUpdateResponse"
|
|
|
|
# delete:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["DELETE"]
|
|
# path: "/:id"
|
|
# description: "Delete a schedule"
|
|
# summary: "Delete Schedule"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# soft_delete: true
|
|
# response_model: "ScheduleDeleteResponse"
|
|
|
|
# dynamic:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["GET"]
|
|
# path: "/dynamic"
|
|
# description: "Get schedule with dynamic filtering"
|
|
# summary: "Get Schedule Dynamic"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# has_dynamic: true
|
|
# fields: "all_fields"
|
|
# response_model: "ScheduleGetResponse"
|
|
|
|
# search:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["GET"]
|
|
# path: "/search"
|
|
# description: "Search schedule by name or doctor"
|
|
# summary: "Search Schedule"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# has_search: true
|
|
# fields: "all_fields"
|
|
# response_model: "ScheduleGetResponse"
|
|
|
|
# stats:
|
|
# handler_folder: "schedule"
|
|
# handler_file: "schedule.go"
|
|
# methods: ["GET"]
|
|
# path: "/stats"
|
|
# description: "Get schedule statistics"
|
|
# summary: "Get Schedule Stats"
|
|
# tags: ["Schedule"]
|
|
# require_auth: true
|
|
# has_stats: true
|
|
# response_model: "AggregateData" |