Files
fm_be/internal/transport/http/dto/icao_dto.go
2026-07-16 22:16:45 +07:00

102 lines
4.9 KiB
Go

package dto
// JSON:API ICAO DTOs
type ICAOAttributes struct {
LandID string `json:"land_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
FederalStateID string `json:"federal_state_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
FederalState string `json:"federal_state,omitempty" example:"Bayern"`
LandName string `json:"land_name,omitempty" example:"Germany"`
LandISOCode string `json:"land_iso_code,omitempty" example:"DE"`
ICAOCode string `json:"icao_code" example:"EDDB"`
Name string `json:"name,omitempty" example:"Berlin Base"`
SortKey *int `json:"sortkey" example:"1"`
Address string `json:"address,omitempty" example:"Muehlenstrasse 1"`
LandlineNumber string `json:"landline_number,omitempty" example:"030123456"`
MobileNumber string `json:"mobile_number,omitempty" example:"0170123456"`
Email string `json:"email,omitempty" example:"ops@example.local"`
Note string `json:"note,omitempty" example:"Night operations supported"`
IsActive bool `json:"is_active" example:"true"`
CreatedAt string `json:"created_at,omitempty" example:"2026-03-12T03:04:05Z"`
CreatedBy string `json:"created_by,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
UpdatedAt string `json:"updated_at,omitempty" example:"2026-03-12T03:04:05Z"`
UpdatedBy string `json:"updated_by,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
DeletedAt string `json:"deleted_at,omitempty" example:"2026-03-12T03:04:05Z"`
DeletedBy string `json:"deleted_by,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
}
type ICAOResource struct {
Type string `json:"type" example:"icao"`
ID string `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
Attributes ICAOAttributes `json:"attributes"`
}
type ICAOResponse struct {
Data ICAOResource `json:"data"`
}
type ICAOListResponse struct {
Data []ICAOResource `json:"data"`
Meta struct {
PageNumber int `json:"page_number" example:"1"`
PageSize int `json:"page_size" example:"20"`
Total int64 `json:"total" example:"120"`
} `json:"meta"`
}
type ICAODataTableResponse struct {
Data []ICAOResource `json:"data"`
Meta struct {
Draw int `json:"draw" example:"1"`
RecordsTotal int64 `json:"records_total" example:"120"`
RecordsFiltered int64 `json:"records_filtered" example:"12"`
} `json:"meta"`
}
type ICAOCreateAttributes struct {
LandID *string `json:"land_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
FederalStateID *string `json:"federal_state_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
ICAOCode string `json:"icao_code" validate:"required" example:"EDDB"`
Name *string `json:"name,omitempty" example:"Berlin Base"`
SortKey *int `json:"sortkey" example:"1"`
Address *string `json:"address,omitempty" example:"Muehlenstrasse 1"`
LandlineNumber *string `json:"landline_number,omitempty" example:"030123456"`
MobileNumber *string `json:"mobile_number,omitempty" example:"0170123456"`
Email *string `json:"email,omitempty" example:"ops@example.local"`
Note *string `json:"note,omitempty" example:"Night operations supported"`
IsActive *bool `json:"is_active,omitempty" example:"true"`
}
type ICAOCreateData struct {
Type string `json:"type" validate:"required,oneof=icao_create icao" example:"icao_create"`
Attributes ICAOCreateAttributes `json:"attributes" validate:"required"`
}
type ICAOCreateRequest struct {
Data ICAOCreateData `json:"data" validate:"required"`
}
type ICAOUpdateAttributes struct {
LandID *string `json:"land_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
FederalStateID *string `json:"federal_state_id,omitempty" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
ICAOCode *string `json:"icao_code,omitempty" example:"EDDB"`
Name *string `json:"name,omitempty" example:"Berlin Base"`
SortKey NullInt `json:"sortkey,omitempty" swaggertype:"integer" example:"1"`
Address *string `json:"address,omitempty" example:"Muehlenstrasse 1"`
LandlineNumber *string `json:"landline_number,omitempty" example:"030123456"`
MobileNumber *string `json:"mobile_number,omitempty" example:"0170123456"`
Email *string `json:"email,omitempty" example:"ops@example.local"`
Note *string `json:"note,omitempty" example:"Night operations supported"`
IsActive *bool `json:"is_active,omitempty" example:"true"`
}
type ICAOUpdateData struct {
Type string `json:"type" validate:"required,oneof=icao_update icao" example:"icao_update"`
ID string `json:"id" example:"018f3a5c-7a6f-7c2a-8d4a-4b5b1f6c8e9d"`
Attributes ICAOUpdateAttributes `json:"attributes" validate:"required"`
}
type ICAOUpdateRequest struct {
Data ICAOUpdateData `json:"data" validate:"required"`
}