48 lines
1.2 KiB
Java
48 lines
1.2 KiB
Java
package com.baiyue.print.dto;
|
|
|
|
import java.math.BigDecimal;
|
|
import java.util.List;
|
|
import java.util.Map;
|
|
|
|
/** A4 sea-freight document PDF request contract. */
|
|
public final class FreightA4PdfDtos {
|
|
public static final String SHIPPING_INSTRUCTION_TEMPLATE = "SEA_FREIGHT_SHIPPING_INSTRUCTION_A4_V1";
|
|
public static final String BILL_CONFIRMATION_TEMPLATE = "BILL_OF_LADING_CONFIRMATION_A4_V1";
|
|
|
|
private FreightA4PdfDtos() {
|
|
}
|
|
|
|
public record Request(
|
|
String templateCode,
|
|
PageSpec pageSpec,
|
|
String downloadFileName,
|
|
List<Document> documents
|
|
) {
|
|
}
|
|
|
|
public record PageSpec(BigDecimal widthMm, BigDecimal heightMm) {
|
|
}
|
|
|
|
public record Document(
|
|
Map<String, String> fields,
|
|
List<CargoRow> cargoRows
|
|
) {
|
|
public String field(String key) {
|
|
if (fields == null) {
|
|
return "";
|
|
}
|
|
return fields.getOrDefault(key, "");
|
|
}
|
|
}
|
|
|
|
public record CargoRow(
|
|
String marksAndNos,
|
|
String quantity,
|
|
String packaging,
|
|
String descriptionOfGoods,
|
|
String grossWeight,
|
|
String measurement
|
|
) {
|
|
}
|
|
}
|