Upstream sync
This commit is contained in:
@@ -215,6 +215,9 @@ func CreateContract(c *gin.Context) {
|
|||||||
Status: models.ContractStatusDraft,
|
Status: models.ContractStatusDraft,
|
||||||
StartPlaceName: payload.StartPlaceName,
|
StartPlaceName: payload.StartPlaceName,
|
||||||
EndPlaceName: payload.EndPlaceName,
|
EndPlaceName: payload.EndPlaceName,
|
||||||
|
Name: payload.Name,
|
||||||
|
EndLat: payload.EndLat,
|
||||||
|
EndLon: payload.EndLon,
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := db.Create(&newContract).Error; err != nil {
|
if err := db.Create(&newContract).Error; err != nil {
|
||||||
|
|||||||
@@ -123,14 +123,14 @@ func ConvertContractToContractResponse(contract Contract) ContractResponse {
|
|||||||
ID uint "json:\"id\""
|
ID uint "json:\"id\""
|
||||||
Name string "json:\"name\""
|
Name string "json:\"name\""
|
||||||
}{
|
}{
|
||||||
ID: contract.SellerID,
|
ID: contract.SellerID,
|
||||||
Name: contract.SellerName,
|
Name: contract.SellerName,
|
||||||
},
|
},
|
||||||
Buyer: struct {
|
Buyer: struct {
|
||||||
ID uint "json:\"id\""
|
ID uint "json:\"id\""
|
||||||
Name string "json:\"name\""
|
Name string "json:\"name\""
|
||||||
}{
|
}{
|
||||||
ID: contract.BuyerID,
|
ID: contract.BuyerID,
|
||||||
Name: contract.BuyerName,
|
Name: contract.BuyerName,
|
||||||
},
|
},
|
||||||
Start: struct {
|
Start: struct {
|
||||||
@@ -159,7 +159,7 @@ func ConvertContractToContractResponse(contract Contract) ContractResponse {
|
|||||||
ID uint "json:\"id\""
|
ID uint "json:\"id\""
|
||||||
Name string "json:\"name\""
|
Name string "json:\"name\""
|
||||||
}{
|
}{
|
||||||
ID: contract.ProductID,
|
ID: contract.ProductID,
|
||||||
Name: contract.ProductName,
|
Name: contract.ProductName,
|
||||||
},
|
},
|
||||||
Description: contract.Description,
|
Description: contract.Description,
|
||||||
@@ -301,6 +301,7 @@ type CreateContractRequestPayload struct {
|
|||||||
EndPlaceName string `json:"endPlaceName"`
|
EndPlaceName string `json:"endPlaceName"`
|
||||||
EndLat float64 `json:"endLat"`
|
EndLat float64 `json:"endLat"`
|
||||||
EndLon float64 `json:"endLon"`
|
EndLon float64 `json:"endLon"`
|
||||||
|
Name string `json:"name"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Contract) Update() (bool, error) {
|
func (Contract) Update() (bool, error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user