refactor-location #134
			
				
			
		
		
		
	| 
						 | 
					@ -33,3 +33,20 @@ func (c Product) ApplyRequest(p model.ProductApplyRequestPayload) error {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (c Product) ProcessApplyRequest(p model.ProductApplyRequestPayload) error {
 | 
				
			||||||
 | 
						msg, err := natsio.GetServer().Request(subject.Product.ProcessApplyRequest, toBytes(p))
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						var r struct {
 | 
				
			||||||
 | 
							Error string `json:"error"`
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if err = json.Unmarshal(msg.Data, &r); err != nil {
 | 
				
			||||||
 | 
							return err
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						if r.Error != "" {
 | 
				
			||||||
 | 
							return errors.New(r.Error)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						return nil
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -9,6 +9,8 @@ func getProductValue(val string) string {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var Product = struct {
 | 
					var Product = struct {
 | 
				
			||||||
	ApplyRequest        string
 | 
						ApplyRequest        string
 | 
				
			||||||
 | 
						ProcessApplyRequest string
 | 
				
			||||||
}{
 | 
					}{
 | 
				
			||||||
	ApplyRequest:        getProductValue("apply_request"),
 | 
						ApplyRequest:        getProductValue("apply_request"),
 | 
				
			||||||
 | 
						ProcessApplyRequest: getProductValue("process_apply_request"),
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue