Add responsible signature to aftersales confirmation
This commit is contained in:
@@ -329,18 +329,19 @@ func (s *AftersalesService) PublicQuery(serialNumber string) (*models.Aftersales
|
||||
}
|
||||
|
||||
view := &models.AftersalesPublicView{
|
||||
SerialNumber: order.SerialNumber,
|
||||
CompanyName: order.CompanyName,
|
||||
CompanyAddress: order.CompanyAddress,
|
||||
ContactName: order.ContactName,
|
||||
ServiceType: order.ServiceType,
|
||||
IssueDescription: order.IssueDescription,
|
||||
ResolutionNote: order.ResolutionNote,
|
||||
WorkOrderStatus: order.WorkOrderStatus,
|
||||
AuthorizationStatus: order.AuthorizationStatus,
|
||||
CreatedAt: order.CreatedAt,
|
||||
ConfirmedAt: order.ConfirmedAt,
|
||||
Signature: order.Signature,
|
||||
SerialNumber: order.SerialNumber,
|
||||
CompanyName: order.CompanyName,
|
||||
CompanyAddress: order.CompanyAddress,
|
||||
ContactName: order.ContactName,
|
||||
ServiceType: order.ServiceType,
|
||||
IssueDescription: order.IssueDescription,
|
||||
ResolutionNote: order.ResolutionNote,
|
||||
WorkOrderStatus: order.WorkOrderStatus,
|
||||
AuthorizationStatus: order.AuthorizationStatus,
|
||||
CreatedAt: order.CreatedAt,
|
||||
ConfirmedAt: order.ConfirmedAt,
|
||||
Signature: order.Signature,
|
||||
ResponsibleSignature: order.ResponsibleSignature,
|
||||
}
|
||||
if order.Technician != nil {
|
||||
view.TechnicianName = order.Technician.Name
|
||||
@@ -372,10 +373,14 @@ func (s *AftersalesService) CustomerConfirm(serialNumber string, dto models.Cust
|
||||
if err := validateSignature(dto.Signature); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := validateSignature(dto.ResponsibleSignature); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
order.WorkOrderStatus = WorkOrderStatusClosed
|
||||
order.AuthorizationStatus = AuthorizationStatusAuthorized
|
||||
order.ConfirmedAt = &now
|
||||
order.Signature = strings.TrimSpace(dto.Signature)
|
||||
order.ResponsibleSignature = strings.TrimSpace(dto.ResponsibleSignature)
|
||||
case "reject":
|
||||
reason := strings.TrimSpace(dto.RejectReason)
|
||||
if reason == "" {
|
||||
|
||||
Reference in New Issue
Block a user