Files
service_antrean/tools/general/services-config.yaml
T

432 lines
13 KiB
YAML

global:
module_name: "service-antrean"
output_dir: "internal/handlers"
enable_swagger: true
enable_logging: true
database:
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:
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: "role_access.rol_pages"
# Define all columns once for reuse
schema:
columns:
- name: "id"
type: "int4"
nullable: false
go_type: "int"
primary_key: true
unique: true
description: "Primary key for pages"
- name: "name"
type: "varchar"
nullable: false
go_type: "string"
validation: "required,min=1,max=20"
searchable: true
description: "Name of the page"
- name: "icon"
type: "varchar"
nullable: true
go_type: "string"
validation: "omitempty,min=1,max=20"
description: "Icon for the page"
- name: "url"
type: "text"
nullable: true
go_type: "string"
validation: "omitempty,min=1,max=100"
searchable: true
description: "URL of the page"
- name: "level"
type: "int2"
nullable: false
go_type: "int"
searchable: true
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: "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: "component"
table: "role_access.rol_component"
foreign_key: "fk_rol_pages_id"
local_key: "id"
columns:
- name: "id"
type: "int4"
nullable: false
go_type: "int"
primary_key: true
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"
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: "int"
searchable: true
description: "Foreign key to rol_pages"
- name: "sort"
type: "int2"
nullable: true
go_type: "int"
validation: "omitempty,min=1"
description: "Sort order of the component"
# Define reusable field groups
field_groups:
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: "pages"
handler_file: "pages.go"
methods: ["GET"]
path: "/"
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: "base_fields"
response_model: "PagesGetResponse"
create:
handler_folder: "pages"
handler_file: "pages.go"
methods: ["POST"]
path: "/"
description: "Create a new page"
summary: "Create Page"
tags: ["Pages"]
fields: "base_fields"
request_model: "PagesCreateRequest"
response_model: "PagesCreateResponse"
update:
handler_folder: "pages"
handler_file: "pages.go"
methods: ["PUT"]
path: "/:id"
description: "Update an existing page"
summary: "Update Page"
tags: ["Pages"]
fields: "base_fields"
request_model: "PagesUpdateRequest"
response_model: "PagesUpdateResponse"
delete:
handler_folder: "pages"
handler_file: "pages.go"
methods: ["DELETE"]
path: "/:id"
description: "Delete a page"
summary: "Delete Page"
tags: ["Pages"]
soft_delete: true
response_model: "PagesDeleteResponse"
# 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"
# 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"
# 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"