Intial commit
This commit is contained in:
No files matched your search
+140
-249
@@ -1,297 +1,213 @@
|
||||
global:
|
||||
module_name: "api-service"
|
||||
module_name: "service-antrean"
|
||||
output_dir: "internal/handlers"
|
||||
enable_swagger: true
|
||||
enable_logging: true
|
||||
database:
|
||||
default_connection: "postgres_satudata"
|
||||
default_connection: "db_antrean"
|
||||
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"
|
||||
|
||||
services:
|
||||
pasien:
|
||||
name: "Manajemen Data Pasien"
|
||||
category: "pasien"
|
||||
package: "pasien"
|
||||
description: "API untuk mengelola data pasien dengan informasi lokasi lengkap"
|
||||
rol_pages:
|
||||
name: "Manajemen Pages Role"
|
||||
category: "pages"
|
||||
package: "pages"
|
||||
description: "Pages service for role management"
|
||||
base_url: ""
|
||||
timeout: 30
|
||||
retry_count: 3
|
||||
table_name: "m_pasien"
|
||||
table_name: "role_access.rol_pages"
|
||||
|
||||
# Define all columns once for reuse
|
||||
schema:
|
||||
columns:
|
||||
- name: "id"
|
||||
type: "serial4"
|
||||
type: "int4"
|
||||
nullable: false
|
||||
go_type: "int32"
|
||||
go_type: "int"
|
||||
primary_key: true
|
||||
unique: true
|
||||
description: "Primary key for schedule"
|
||||
- name: "nomr"
|
||||
description: "Primary key for pages"
|
||||
- name: "name"
|
||||
type: "varchar"
|
||||
nullable: true
|
||||
nullable: false
|
||||
go_type: "string"
|
||||
validation: "required,min=1,max=20"
|
||||
searchable: true
|
||||
unique: true
|
||||
description: "Nomor Rekam Medis"
|
||||
- name: "status"
|
||||
description: "Name of the page"
|
||||
- name: "icon"
|
||||
type: "varchar"
|
||||
nullable: true
|
||||
go_type: "string"
|
||||
description: "Status pasien (A = Aktif, I = Inaktif)"
|
||||
- name: "title"
|
||||
type: "varchar"
|
||||
validation: "omitempty,min=1,max=20"
|
||||
description: "Icon for the page"
|
||||
- name: "url"
|
||||
type: "text"
|
||||
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"
|
||||
validation: "omitempty,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"
|
||||
description: "URL of the page"
|
||||
- name: "level"
|
||||
type: "int2"
|
||||
nullable: false
|
||||
go_type: "int"
|
||||
searchable: true
|
||||
unique: true
|
||||
description: "Nomor kartu identitas"
|
||||
- name: "noktp_baru"
|
||||
type: "varchar"
|
||||
description: "Level of the page in hierarchy"
|
||||
- name: "sort"
|
||||
type: "int2"
|
||||
nullable: false
|
||||
go_type: "int"
|
||||
description: "Sort order of the page"
|
||||
- name: "parent"
|
||||
type: "int4"
|
||||
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"
|
||||
go_type: "int"
|
||||
validation: "omitempty,min=1"
|
||||
description: "Parent page ID"
|
||||
- name: "active"
|
||||
type: "bool"
|
||||
nullable: false
|
||||
go_type: "bool"
|
||||
description: "Active status of the page"
|
||||
|
||||
# Define relationships with other tables
|
||||
relationships:
|
||||
- name: "provinsi"
|
||||
table: "m_provinsi"
|
||||
foreign_key: "kdprovinsi"
|
||||
local_key: "idprovinsi"
|
||||
- name: "component"
|
||||
table: "role_access.rol_component"
|
||||
foreign_key: "fk_rol_pages_id"
|
||||
local_key: "id"
|
||||
columns:
|
||||
- name: "idprovinsi"
|
||||
- name: "id"
|
||||
type: "int4"
|
||||
nullable: false
|
||||
go_type: "int32"
|
||||
go_type: "int"
|
||||
primary_key: true
|
||||
- name: "namaprovinsi"
|
||||
unique: true
|
||||
description: "Primary key for component"
|
||||
- name: "name"
|
||||
type: "varchar"
|
||||
nullable: false
|
||||
go_type: "string"
|
||||
validation: "required,min=1,max=100"
|
||||
searchable: true
|
||||
description: "Name of the component"
|
||||
- name: "description"
|
||||
type: "text"
|
||||
nullable: true
|
||||
go_type: "string"
|
||||
description: "Nama provinsi"
|
||||
- name: "kota"
|
||||
table: "m_kota"
|
||||
foreign_key: "kota"
|
||||
local_key: "idkota"
|
||||
columns:
|
||||
- name: "idkota"
|
||||
validation: "omitempty,min=1,max=100"
|
||||
description: "Description of the component"
|
||||
- name: "directory"
|
||||
type: "text"
|
||||
nullable: false
|
||||
go_type: "string"
|
||||
validation: "required,min=1,max=100"
|
||||
searchable: true
|
||||
description: "Directory path of the component"
|
||||
- name: "active"
|
||||
type: "bool"
|
||||
nullable: false
|
||||
go_type: "bool"
|
||||
description: "Active status of the component"
|
||||
- name: "fk_rol_pages_id"
|
||||
type: "int4"
|
||||
nullable: false
|
||||
go_type: "int32"
|
||||
primary_key: true
|
||||
- name: "namakota"
|
||||
type: "varchar"
|
||||
go_type: "int"
|
||||
searchable: true
|
||||
description: "Foreign key to rol_pages"
|
||||
- name: "sort"
|
||||
type: "int2"
|
||||
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"
|
||||
go_type: "int"
|
||||
validation: "omitempty,min=1"
|
||||
description: "Sort order of the component"
|
||||
|
||||
# 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"]
|
||||
base_fields: ["id", "name", "icon", "url", "level", "sort", "parent", "active"]
|
||||
# location_fields: ["alamat", "kelurahan", "kdkecamatan", "kota", "kdprovinsi"]
|
||||
# identity_fields: ["agama", "no_kartu", "noktp_baru"]
|
||||
all_fields: ["id", "name", "icon", "url", "level", "sort", "parent", "active"]
|
||||
# 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"
|
||||
handler_folder: "pages"
|
||||
handler_file: "pages.go"
|
||||
methods: ["GET"]
|
||||
path: "/"
|
||||
description: "Get list of pasien with pagination and filters"
|
||||
summary: "Get Pasien List"
|
||||
tags: ["Pasien"]
|
||||
require_auth: true
|
||||
description: "Get list of pages with pagination and filters"
|
||||
summary: "Get Pages List"
|
||||
tags: ["Pages"]
|
||||
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"
|
||||
fields: "base_fields"
|
||||
response_model: "PagesGetResponse"
|
||||
|
||||
create:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
handler_folder: "pages"
|
||||
handler_file: "pages.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"
|
||||
description: "Create a new page"
|
||||
summary: "Create Page"
|
||||
tags: ["Pages"]
|
||||
fields: "base_fields"
|
||||
request_model: "PagesCreateRequest"
|
||||
response_model: "PagesCreateResponse"
|
||||
|
||||
update:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
handler_folder: "pages"
|
||||
handler_file: "pages.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"
|
||||
path: "/:id"
|
||||
description: "Update an existing page"
|
||||
summary: "Update Page"
|
||||
tags: ["Pages"]
|
||||
fields: "base_fields"
|
||||
request_model: "PagesUpdateRequest"
|
||||
response_model: "PagesUpdateResponse"
|
||||
|
||||
delete:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
handler_folder: "pages"
|
||||
handler_file: "pages.go"
|
||||
methods: ["DELETE"]
|
||||
path: "/:nomr"
|
||||
description: "Delete a pasien"
|
||||
summary: "Delete Pasien"
|
||||
tags: ["Pasien"]
|
||||
require_auth: true
|
||||
path: "/:id"
|
||||
description: "Delete a page"
|
||||
summary: "Delete Page"
|
||||
tags: ["Pages"]
|
||||
soft_delete: true
|
||||
response_model: "PasienDeleteResponse"
|
||||
response_model: "PagesDeleteResponse"
|
||||
|
||||
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"
|
||||
# dynamic:
|
||||
# handler_folder: "pages"
|
||||
# handler_file: "pages.go"
|
||||
# methods: ["GET"]
|
||||
# path: "/pages/dynamic"
|
||||
# description: "Get pages with dynamic filtering"
|
||||
# summary: "Get Pages Dynamic"
|
||||
# tags: ["Pages"]
|
||||
# require_auth: true
|
||||
# has_dynamic: true
|
||||
# fields: "base_fields"
|
||||
# response_model: "PagesGetResponse"
|
||||
|
||||
# search:
|
||||
# handler_folder: "pasien"
|
||||
@@ -317,31 +233,6 @@ services:
|
||||
# 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"
|
||||
|
||||
Reference in New Issue
Block a user