Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "picqer-add-order-comment",
name: "Add Comment To Order",
description: "Add a comment to an order in Picqer. [See the documentation](https://picqer.com/en/api/comments#adding-comments-to-an-order)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
41 changes: 41 additions & 0 deletions components/picqer/actions/add-order-tags/add-order-tags.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-add-order-tags",
name: "Add Order Tags",
description: "Associates a tag with an order. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
],
},
tagId: {
propDefinition: [
app,
"tagId",
],
},
},
async run({ $ }) {
const response = await this.app.addOrderTags({
$,
orderId: this.orderId,
data: {
idtag: this.tagId,
},
});

$.export("$summary", `Successfully added tag to order ${this.orderId}`);
return response;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-add-product-to-order",
name: "Add Product To Order",
description: "Adds a single product to concept orders only. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
() => ({
params: {
status: "concept",
},
}),
],
},
productId: {
propDefinition: [
app,
"productId",
],
},
amount: {
type: "integer",
label: "Amount",
description: "The quantity of the product to add",
default: 1,
},
price: {
type: "string",
label: "Price",
description: "The price of the product",
optional: true,
},
name: {
type: "string",
label: "Name",
description: "The name of the product",
optional: true,
},
remarks: {
type: "string",
label: "Remarks",
description: "Remarks for the product",
optional: true,
},
},
async run({ $ }) {
const response = await this.app.addProductToOrder({
$,
orderId: this.orderId,
data: {
idproduct: this.productId,
amount: this.amount,
price: this.price,
name: this.name,
remarks: this.remarks,
},
});

$.export("$summary", `Successfully added product to order ${this.orderId}`);
return response;
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "picqer-add-return-comment",
name: "Add Comment To Return",
description: "Add a comment to a return in Picqer. [See the documentation](https://picqer.com/en/api/comments#add-a-comment-to-an-return)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
48 changes: 48 additions & 0 deletions components/picqer/actions/cancel-order/cancel-order.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-cancel-order",
name: "Cancel Order",
description: "Removes orders with 'concept' or 'expected' status only. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: true,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
],
},
force: {
type: "boolean",
label: "Force Cancel",
description: "If enabled, cancels orders regardless of status, removing attached picklists even if picked",
optional: true,
},
},
async run({ $ }) {
const {
app,
orderId,
force,
} = this;

await app.cancelOrder({
$,
orderId,
params: {
force,
},
});
$.export("$summary", "Successfully canceled order");
return {
success: true,
};
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-change-order-to-concept",
name: "Change Order To Concept",
description: "Converts expected orders back to concept status for editing. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
() => ({
params: {
status: "expected",
},
}),
],
},
},
async run({ $ }) {
const response = await this.app.changeOrderToConcept({
$,
orderId: this.orderId,
});

$.export("$summary", `Successfully changed order ${this.orderId} to concept status`);
return response;
},
};
2 changes: 1 addition & 1 deletion components/picqer/actions/create-order/create-order.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export default {
key: "picqer-create-order",
name: "Create Picqer Order",
description: "Create a new order in Picqer. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/picqer/actions/get-customer/get-customer.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "picqer-get-customer",
name: "Get Customer",
description: "Get a customer in Picqer. [See the documentation](https://picqer.com/en/api/customers#get-single-customer)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-get-order-comments",
name: "Get Order Comments",
description: "Retrieves comments linked to an order. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
],
},
},
async run({ $ }) {
const response = await this.app.getOrderComments({
$,
orderId: this.orderId,
});

$.export("$summary", `Successfully retrieved ${response.length} comment(s) for order ${this.orderId}`);
return response;
},
};
32 changes: 32 additions & 0 deletions components/picqer/actions/get-order-tags/get-order-tags.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-get-order-tags",
name: "Get Order Tags",
description: "Retrieves all tags associated with an order. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: true,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
],
},
},
async run({ $ }) {
const response = await this.app.getOrderTags({
$,
orderId: this.orderId,
});

$.export("$summary", `Successfully retrieved ${response.length} tag(s) for order ${this.orderId}`);
return response;
},
};
2 changes: 1 addition & 1 deletion components/picqer/actions/get-order/get-order.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "picqer-get-order",
name: "Get Picqer Order",
description: "Get an order in Picqer. [See the documentation](https://picqer.com/en/api/orders#get-single-order)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
2 changes: 1 addition & 1 deletion components/picqer/actions/get-picklist/get-picklist.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "picqer-get-picklist",
name: "Get Picklist",
description: "Get a picklist in Picqer. [See the documentation](https://picqer.com/en/api/picklists#h-get-single-picklist)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
key: "picqer-get-status-per-order-line",
name: "Get Status Per Order Line",
description: "Get the status per order line in Picqer. [See the documentation](https://picqer.com/en/api/orders#get-status-per-order-line)",
version: "0.0.2",
version: "0.0.3",
annotations: {
destructiveHint: false,
openWorldHint: true,
Expand Down
40 changes: 40 additions & 0 deletions components/picqer/actions/pause-order/pause-order.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import app from "../../picqer.app.mjs";

export default {
key: "picqer-pause-order",
name: "Pause Order",
description: "Suspends processing of orders with 'processing' status. Pauses underlying picklists. [See the documentation](https://picqer.com/en/api/orders)",
version: "0.0.1",
annotations: {
destructiveHint: false,
openWorldHint: true,
readOnlyHint: false,
},
type: "action",
props: {
app,
orderId: {
propDefinition: [
app,
"orderId",
],
},
reason: {
type: "string",
label: "Reason",
description: "A reason for pausing the order",
},
},
async run({ $ }) {
const response = await this.app.pauseOrder({
$,
orderId: this.orderId,
data: {
reason: this.reason,
},
});

$.export("$summary", `Successfully paused order ${this.orderId}`);
return response;
},
};
Loading
Loading