Perbaikan Generate code
This commit is contained in:
+3073
-1698
File diff suppressed because it is too large
Load Diff
@@ -19,79 +19,109 @@ services:
|
||||
table_name: "m_pasien"
|
||||
|
||||
# Define all columns once for reuse
|
||||
columns:
|
||||
- name: "nomr"
|
||||
type: "varchar"
|
||||
nullable: true
|
||||
go_type: "string"
|
||||
description: "Nomor Rekam Medis"
|
||||
- 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"
|
||||
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: "Nomor kartu identitas"
|
||||
- name: "noktp_baru"
|
||||
type: "varchar"
|
||||
nullable: true
|
||||
go_type: "string"
|
||||
description: "Nomor KTP baru"
|
||||
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:
|
||||
@@ -167,6 +197,8 @@ services:
|
||||
# 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"
|
||||
@@ -182,19 +214,37 @@ services:
|
||||
fields: "with_location_names"
|
||||
response_model: "PasienGetResponse"
|
||||
|
||||
get_by_nomr:
|
||||
get_by_id:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
methods: ["GET"]
|
||||
path: "/:nomr"
|
||||
description: "Get pasien by NOMR"
|
||||
summary: "Get Pasien by NOMR"
|
||||
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: "PasienGetByNOMRResponse"
|
||||
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"
|
||||
@@ -206,6 +256,8 @@ services:
|
||||
response_model: "PasienCreateResponse"
|
||||
|
||||
update:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
methods: ["PUT"]
|
||||
path: "/:nomr"
|
||||
description: "Update an existing pasien"
|
||||
@@ -217,16 +269,20 @@ services:
|
||||
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: false
|
||||
soft_delete: true
|
||||
response_model: "PasienDeleteResponse"
|
||||
|
||||
dynamic:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
methods: ["GET"]
|
||||
path: "/dynamic"
|
||||
description: "Get pasien with dynamic filtering"
|
||||
@@ -237,28 +293,34 @@ services:
|
||||
fields: "with_location_names"
|
||||
response_model: "PasienGetResponse"
|
||||
|
||||
search:
|
||||
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"
|
||||
# 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:
|
||||
methods: ["GET"]
|
||||
path: "/stats"
|
||||
description: "Get pasien statistics"
|
||||
summary: "Get Pasien Stats"
|
||||
tags: ["Pasien"]
|
||||
require_auth: true
|
||||
has_stats: true
|
||||
response_model: "AggregateData"
|
||||
# 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)"
|
||||
@@ -270,6 +332,8 @@ services:
|
||||
response_model: "PasienGetResponse"
|
||||
|
||||
by_age:
|
||||
handler_folder: "pasien"
|
||||
handler_file: "pasien.go"
|
||||
methods: ["GET"]
|
||||
path: "/by-age"
|
||||
description: "Get pasien statistics by age group"
|
||||
@@ -277,4 +341,201 @@ services:
|
||||
tags: ["Pasien"]
|
||||
require_auth: true
|
||||
has_stats: true
|
||||
response_model: "PasienAgeStatsResponse"
|
||||
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"
|
||||
Reference in New Issue
Block a user