Skip to content

Commit

Permalink
feat(obligation): category field added in obligation get, post, patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourav Bhowmik committed Oct 30, 2024
1 parent a90a43d commit 40bfbca
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
12 changes: 12 additions & 0 deletions cmd/laas/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -2146,6 +2146,18 @@
"active": {
"type": "boolean"
},
"category": {
"type": "string",
"enum": [
"Distribution",
"Patent",
"Internal",
"Contractual",
"Export Control",
"General"
],
"example": "Distribution"
},
"classification": {
"$ref": "#/definitions/models.ObligationClassification"
},
Expand Down
10 changes: 10 additions & 0 deletions cmd/laas/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,16 @@ definitions:
properties:
active:
type: boolean
category:
enum:
- Distribution
- Patent
- Internal
- Contractual
- Export Control
- General
example: Distribution
type: string
classification:
$ref: '#/definitions/models.ObligationClassification'
comment:
Expand Down
1 change: 1 addition & 0 deletions pkg/models/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ type Obligation struct {
Licenses []*LicenseDB `gorm:"many2many:obligation_licenses;"`
Type *ObligationType `gorm:"foreignKey:ObligationTypeId"`
Classification *ObligationClassification `gorm:"foreignKey:ObligationClassificationId"`
Category string `json:"category" enums:"Distribution,Patent,Internal,Contractual,Export Control,General" example:"Distribution"`
}

func (o *Obligation) BeforeCreate(tx *gorm.DB) (err error) {
Expand Down

0 comments on commit 40bfbca

Please sign in to comment.