created_at to api
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/promote/production Build is passing

This commit is contained in:
2024-04-21 19:04:41 +03:00
parent b2511d9c1e
commit 8fb0c0f056
6 changed files with 71 additions and 4 deletions

View File

@@ -20,6 +20,10 @@ import (
// swagger:model Feedback
type Feedback struct {
// created at
// Format: date-time
CreatedAt strfmt.DateTime `json:"created_at,omitempty"`
// to have more context about the project
ProjectID string `json:"project_id,omitempty"`
@@ -38,6 +42,10 @@ type Feedback struct {
func (m *Feedback) Validate(formats strfmt.Registry) error {
var res []error
if err := m.validateCreatedAt(formats); err != nil {
res = append(res, err)
}
if err := m.validateType(formats); err != nil {
res = append(res, err)
}
@@ -48,6 +56,18 @@ func (m *Feedback) Validate(formats strfmt.Registry) error {
return nil
}
func (m *Feedback) validateCreatedAt(formats strfmt.Registry) error {
if swag.IsZero(m.CreatedAt) { // not required
return nil
}
if err := validate.FormatOf("created_at", "body", "date-time", m.CreatedAt.String(), formats); err != nil {
return err
}
return nil
}
var feedbackTypeTypePropEnum []interface{}
func init() {