Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
@@ -0,0 +1,150 @@
import { parseObject } from "../../common/utils.mjs";
import offorte from "../../offorte.app.mjs";

export default {
key: "offorte-create-contact-organisation",
name: "Create Contact Organisation",
description: "Create a new contact organisation in Offorte. [See the documentation](https://www.offorte.com/api-docs/api#tag/Contacts/operation/createContactOrganisation)",
version: "0.0.1",
type: "action",
props: {
offorte,
name: {
propDefinition: [
offorte,
"name",
],
},
street: {
propDefinition: [
offorte,
"street",
],
},
zipcode: {
propDefinition: [
offorte,
"zipcode",
],
},
city: {
propDefinition: [
offorte,
"city",
],
},
state: {
propDefinition: [
offorte,
"state",
],
},
country: {
propDefinition: [
offorte,
"country",
],
},
phone: {
propDefinition: [
offorte,
"phone",
],
},
fax: {
type: "string",
label: "Fax",
description: "The fax number of the contact",
optional: true,
},
email: {
propDefinition: [
offorte,
"email",
],
optional: true,
},
internet: {
propDefinition: [
offorte,
"internet",
],
optional: true,
},
linkedin: {
propDefinition: [
offorte,
"linkedin",
],
optional: true,
},
facebook: {
propDefinition: [
offorte,
"facebook",
],
optional: true,
},
twitter: {
propDefinition: [
offorte,
"twitter",
],
optional: true,
},
instagram: {
propDefinition: [
offorte,
"instagram",
],
optional: true,
},
coc_number: {
type: "string",
label: "COC Number",
description: "The COC number of the contact",
optional: true,
},
vat_number: {
type: "string",
label: "VAT Number",
description: "The VAT number of the contact",
optional: true,
},
tags: {
propDefinition: [
offorte,
"tags",
],
optional: true,
},
},
async run({ $ }) {
const response = await this.offorte.createContactOrganisation({
$,
data: {
name: this.name,
type: "organisation",
street: this.street,
zipcode: this.zipcode,
city: this.city,
state: this.state,
country: this.country,
phone: this.phone,
fax: this.fax,
email: this.email,
internet: this.internet,
linkedin: this.linkedin,
facebook: this.facebook,
twitter: this.twitter,
instagram: this.instagram,
coc_number: this.coc_number,
vat_number: this.vat_number,
tags: parseObject(this.tags),
},
});

$.export("$summary", "Contact organisation created successfully");
return response.data;
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
import { parseObject } from "../../common/utils.mjs";
import offorte from "../../offorte.app.mjs";

export default {
key: "offorte-create-contact-person",
name: "Create Contact Person",
description: "Create a new contact person in Offorte. [See the documentation](https://www.offorte.com/api-docs/api#tag/Contacts/operation/createContactPerson)",
version: "0.0.1",
type: "action",
props: {
offorte,
organisationId: {
propDefinition: [
offorte,
"organisationId",
],
},
fullname: {
propDefinition: [
offorte,
"name",
],
},
firstname: {
type: "string",
label: "First Name",
description: "The first name of the contact",
optional: true,
},
lastname: {
type: "string",
label: "Last Name",
description: "The last name of the contact",
optional: true,
},
salutation: {
type: "string",
label: "Salutation",
description: "The salutation of the contact",
optional: true,
},
street: {
propDefinition: [
offorte,
"street",
],
optional: true,
},
zipcode: {
propDefinition: [
offorte,
"zipcode",
],
optional: true,
},
city: {
propDefinition: [
offorte,
"city",
],
optional: true,
},
state: {
propDefinition: [
offorte,
"state",
],
optional: true,
},
country: {
propDefinition: [
offorte,
"country",
],
optional: true,
},
phone: {
propDefinition: [
offorte,
"phone",
],
optional: true,
},
mobile: {
type: "string",
label: "Mobile",
description: "The mobile number of the contact",
optional: true,
},
email: {
propDefinition: [
offorte,
"email",
],
optional: true,
},
internet: {
propDefinition: [
offorte,
"internet",
],
optional: true,
},
linkedin: {
propDefinition: [
offorte,
"linkedin",
],
optional: true,
},
facebook: {
propDefinition: [
offorte,
"facebook",
],
optional: true,
},
twitter: {
propDefinition: [
offorte,
"twitter",
],
optional: true,
},
instagram: {
propDefinition: [
offorte,
"instagram",
],
optional: true,
},
tags: {
propDefinition: [
offorte,
"tags",
],
optional: true,
},
},
async run({ $ }) {
const {
offorte,
organisationId,
tags,
...data
} = this;

const response = await offorte.createContactPerson({
$,
organisationId,
data: {
...data,
tags: parseObject(tags),
},
});

$.export("$summary", "Contact person created successfully");
return response.data;
},
};
Loading
Loading