syntax = "proto3";

import "google/protobuf/timestamp.proto";

option go_package = "github.com/UpmeshLTD/urus-aio/pdf/server/grpc/pb";

package pdfpb;

service pdfService {
  rpc Ping (PingRequest) returns (PingResponse) {}
  rpc Generate (GenerateRequest) returns (GenerateResponse) {}
}

message PingRequest {}

message PingResponse {
  int64 timestamps = 1;
  string environment  = 2;
  string hostname = 3;
}

message GenerateRequest {
  string Title = 1;
  string Language = 2;
  repeated ShipmentLabel ShipmentLabels = 3;
}

message GenerateResponse {
  string URL = 1;
  string Error = 2;
  repeated FailedShipment FailedShipments = 3;
}

message ShipmentLabel {
  string ID = 1;
  string Code = 2;
  string CourierCode = 3;
  string TrackingNumber = 4;
  string SenderName = 5;
  string SenderPhone = 6;
  string SenderAddress = 7;
  string ReceiverName = 8;
  string ReceiverPhone = 9;
  string ReceiverAddress = 10;
  string PickupInstruction = 11;
  string DeliveryInstruction = 12;
  string DeliveryService = 13;
  string Currency = 14;
  float Weight = 15;
  google.protobuf.Timestamp CreatedAt = 16;
  repeated ShipmentLabelItem Items = 17;
  ShipmentLabelJntThai JntThai = 18;
  ShipmentLabelJntMalaysia JntMalaysia = 19;
  ShipmentLabelJntSingapore JntSingapore = 20;
  ShipmentLabelFlashExpress FlashExpress = 21;
}

message ShipmentLabelJntThai {
  string SortingCode = 1;
  string StreetSortingNo = 2;
}

message ShipmentLabelFlashExpress {
  string SortingCode1 = 1;
  string SortingCode2 = 2;
  string SortingCode3 = 3;
  string SortingLineCode = 4;
  string DstStoreName = 5;
}

message ShipmentLabelItem {
  string Name = 1;
  string Code = 2;
  double Price = 3;
  uint32 Quantity = 4;
}

message FailedShipment {
  string ID = 1;
  string Error = 2;
}

message ShipmentLabelJntMalaysia {
  string Code = 1;
  string BusinessCode = 2;
}

message ShipmentLabelJntSingapore {
  string SortingCode = 1;
}