67 lines
1.7 KiB
Go
67 lines
1.7 KiB
Go
package models
|
|
|
|
// Peserta BPJS Models
|
|
// Generated at: 2025-08-24 16:39:05
|
|
// Category: vclaim
|
|
|
|
// Common Response Structure
|
|
type PesertaResponse struct {
|
|
Message string `json:"message"`
|
|
Data map[string]interface{} `json:"data,omitempty"`
|
|
}
|
|
|
|
type PesertaRawResponse struct {
|
|
MetaData struct {
|
|
Code string `json:"code"`
|
|
Message string `json:"message"`
|
|
} `json:"metaData"`
|
|
Response interface{} `json:"response"`
|
|
}
|
|
|
|
// Peserta POST Request Structure
|
|
type PesertaPostRequest struct {
|
|
TPeserta PesertaPost `json:"t_peserta" binding:"required"`
|
|
}
|
|
|
|
type PesertaPost struct {
|
|
// Add your specific fields here based on BPJS API requirements
|
|
NoKartu string `json:"noKartu" binding:"required"`
|
|
TglLayanan string `json:"tglLayanan" binding:"required"`
|
|
JnsPelayanan string `json:"jnsPelayanan" binding:"required"`
|
|
User string `json:"user" binding:"required"`
|
|
}
|
|
|
|
// Peserta PUT Request Structure
|
|
type PesertaPutRequest struct {
|
|
TPeserta PesertaPut `json:"t_peserta" binding:"required"`
|
|
}
|
|
|
|
type PesertaPut struct {
|
|
ID string `json:"id" binding:"required"`
|
|
NoKartu string `json:"noKartu"`
|
|
TglLayanan string `json:"tglLayanan"`
|
|
JnsPelayanan string `json:"jnsPelayanan"`
|
|
User string `json:"user" binding:"required"`
|
|
}
|
|
|
|
// Peserta DELETE Request Structure
|
|
type PesertaDeleteRequest struct {
|
|
TPeserta struct {
|
|
ID string `json:"id" binding:"required"`
|
|
User string `json:"user" binding:"required"`
|
|
} `json:"t_peserta" binding:"required"`
|
|
}
|
|
|
|
// Common Helper Structures
|
|
|
|
// Validation helpers
|
|
func IsValidStatus(status string) bool {
|
|
validStatuses := []string{"active", "inactive", "pending", "processed"}
|
|
for _, v := range validStatuses {
|
|
if v == status {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|