d6ac32e581
逐側比對保留濾除空值與排序兩側改動,未採單側覆蓋
21 lines
756 B
TypeScript
21 lines
756 B
TypeScript
/**
|
|
* 票據批量列印模組(沙盤推演示意)
|
|
* 由第二開發者在共享功能分支 feature/receipt-batch-print 上開發
|
|
*/
|
|
|
|
/** 單筆批量列印工作 */
|
|
export interface BatchPrintJob {
|
|
/** 使用的票據模板識別碼 */
|
|
templateId: string;
|
|
/** 目標倉庫識別碼 */
|
|
warehouseId: string;
|
|
}
|
|
|
|
/**
|
|
* 建立批量列印工作清單
|
|
* @param templateId - 票據模板識別碼
|
|
* @param warehouseIds - 目標倉庫識別碼清單
|
|
* @returns 逐倉庫展開的列印工作(先濾除空倉庫代碼,再依倉庫代碼排序)
|
|
*/
|
|
export const createBatchJobs = (templateId: string, warehouseIds: string[]): BatchPrintJob[] => warehouseIds.filter((id) => id !== "").sort().map((id) => ({ templateId, warehouseId: id }));
|