Skip to content

Commit

Permalink
feat!: 💥 add new required sender to createBatch
Browse files Browse the repository at this point in the history
  • Loading branch information
SophiaH67 committed May 16, 2024
1 parent 44a084a commit b0a7234
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/PrintOne.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,7 @@ export class PrintOne {
templateId: templateId,
finish: data.finish,
ready: ready ? ready : null,
sender: data.sender,
});

return new Batch(this.protected, response);
Expand Down
1 change: 1 addition & 0 deletions src/models/Batch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type CreateBatch = {
template: string | Template;
finish: Finish;
ready?: Date | boolean;
sender: Address;
};

export type CreateBatchOrder = {
Expand Down
11 changes: 11 additions & 0 deletions test/Batch.spec.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
Address,
Batch,
CreateBatchCsvOrder,
CsvOrder,
Expand All @@ -17,6 +18,14 @@ import { sleep } from "../src/utils";
let batch: Batch = null as unknown as Batch;
let template: Template = null as unknown as Template;

const address: Address = {
name: "Jane Doe",
address: "123 Main Street",
postalCode: "1234 AB",
city: "Somecity",
country: "NL",
};

beforeAll(async function () {
template = await client.createTemplate({
name: `Test Order ${new Date().toISOString().replaceAll(":", "-")}`,
Expand All @@ -31,6 +40,7 @@ beforeEach(async function () {
template: template,
name: `Test Batch ${new Date().toISOString().replaceAll(":", "-")}`,
finish: Finish.GLOSSY,
sender: address,
});
});

Expand Down Expand Up @@ -347,6 +357,7 @@ describe("getOrder", function () {
template: template,
name: `Test Batch ${new Date().toISOString().replaceAll(":", "-")}`,
finish: Finish.GLOSSY,
sender: address,
});
const order = await batch2.createOrder({
recipient: {
Expand Down

0 comments on commit b0a7234

Please sign in to comment.