notify change price product #149
			
				
			
		
		
		
	| 
						 | 
					@ -67,3 +67,20 @@ func (c Product) ProcessApplyRequest(p model.ProductApplyRequestPayload) error {
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return nil
 | 
						return nil
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func (c Product) RequestChangeStatus(p model.ProductRequestChangeStatus) error {
 | 
				
			||||||
 | 
						msg, err := natsio.GetServer().Request(subject.Product.RequestChangeStatus, 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
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,3 +7,8 @@ type ProductApplyRequestPayload struct {
 | 
				
			||||||
type ProductCreateStepsPayload struct {
 | 
					type ProductCreateStepsPayload struct {
 | 
				
			||||||
	RequestID string `json:"requestId"`
 | 
						RequestID string `json:"requestId"`
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type ProductRequestChangeStatus struct {
 | 
				
			||||||
 | 
						RequestID string `json:"requestId"`
 | 
				
			||||||
 | 
						Status    string `json:"status"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,8 +11,10 @@ var Product = struct {
 | 
				
			||||||
	ApplyRequest        string
 | 
						ApplyRequest        string
 | 
				
			||||||
	CreateRequestStep   string
 | 
						CreateRequestStep   string
 | 
				
			||||||
	ProcessApplyRequest string
 | 
						ProcessApplyRequest string
 | 
				
			||||||
 | 
						RequestChangeStatus string
 | 
				
			||||||
}{
 | 
					}{
 | 
				
			||||||
	ApplyRequest:        getProductValue("apply_request"),
 | 
						ApplyRequest:        getProductValue("apply_request"),
 | 
				
			||||||
	CreateRequestStep:   getProductValue("create_request_step"),
 | 
						CreateRequestStep:   getProductValue("create_request_step"),
 | 
				
			||||||
	ProcessApplyRequest: getProductValue("process_apply_request"),
 | 
						ProcessApplyRequest: getProductValue("process_apply_request"),
 | 
				
			||||||
 | 
						RequestChangeStatus: getProductValue("request_change_status"),
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue