Skip to content
Open
Show file tree
Hide file tree
Changes from 11 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
df68a52
Created initial odoo helpdesk typing and outline
erichugy Jan 13, 2026
808d2b1
Created helpdesk and ticketing actions
erichugy Jan 15, 2026
7e42bec
Bug: Force to requthenticate
erichugy Jan 15, 2026
bd436c4
Managed to get the helpdesk teams and keep session alive
erichugy Jan 15, 2026
be82415
Feat: Odoo Registration and Helpdesk Teams and Stages
erichugy Jan 15, 2026
80e2f34
Creating customers
erichugy Jan 15, 2026
9e78264
Update Odoo Helpdesk integration: bump package manager version, enhan…
erichugy Jan 16, 2026
85f84c7
Fixed customer creation
erichugy Jan 16, 2026
1271a7e
Completed Create ticket to a final working state
erichugy Jan 18, 2026
866e692
Got Update to work
erichugy Jan 18, 2026
d62bd32
Added Readme for Odoo Helpdesk
erichugy Jan 19, 2026
9a101ba
Fix: Formatting, Integration Version and Name, More Strict Types
erichugy Jan 19, 2026
409f70b
Fix: Reverting root package.json updates
erichugy Jan 19, 2026
f30f9fe
Fix: Made version 1.0.0 and renamed integration name
erichugy Jan 19, 2026
caa22f2
Fix: Removed unused Priority Class. Forced OdooId to be a number. Mad…
erichugy Jan 19, 2026
5c96ce1
Fix: Formatted with Prettier
erichugy Jan 19, 2026
366b0ac
Chore: Added TTYL to cookie cache
erichugy Jan 19, 2026
3d33904
Fix: Added copilot revisions
erichugy Jan 19, 2026
122cd38
Updated Logo
erichugy Jan 19, 2026
4ed650b
Fix: Removed `as unknown`, `as` casts when possible, Non-null asserti…
erichugy Jan 20, 2026
5943d20
fix: Reverted integration definition for production
erichugy Jan 20, 2026
570b103
Fix: Aligned customer schema with create customer function and schemas
erichugy Jan 20, 2026
ab5e093
Refactor: Update Odoo Helpdesk integration with new repository struct…
erichugy Jan 21, 2026
c72e19e
Chore: Removed unused logger parameter
erichugy Jan 21, 2026
5d11fb3
Fix: Shortened hub.md
erichugy Jan 21, 2026
f220021
Fix: Applied prettier formatting
erichugy Jan 21, 2026
b5bdd68
Fix: Unregister the customerIdMapping in unregistration
erichugy Jan 21, 2026
8947eee
Fix: removed unecessary comments. Removed `as` in helpdesk files and …
erichugy Jan 21, 2026
c139058
fix: Reverted integration definiition version and name for prodution …
erichugy Jan 21, 2026
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
112 changes: 112 additions & 0 deletions integrations/odoo-helpdesk/definitions/actions/customers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
import { z, ActionDefinition } from '@botpress/sdk'
import { customerSchema } from 'definitions/schemas'

export const createCustomer: ActionDefinition = {
title: 'Create Customer',
description: 'Create a new customer',
input: {
schema: z.object({
id: z.string().title('ID').describe('The id of the customer'),
email: z.string().title('Email').describe('The email of the customer'),
name: z.string().title('Name').describe('The name of the customer'),
phone: z.string().title('Phone').describe('The phone of the customer'),
}),
},
output: {
schema: z.object({
odooId: z.number().title('Odoo ID').describe('The odoo id of the created customer'),
}),
},
}

export const fetchCustomerById: ActionDefinition = {
title: 'Fetch Customer By ID',
description: 'Fetch a customer by id',
input: {
schema: z.object({
id: z.string().title('ID').describe('The id of the customer to fetch'),
}),
},
output: {
schema: z.object({
customer: customerSchema.title('Customer').describe('The fetched customer').optional(),
}),
},
}

export const fetchCustomerByOdooId: ActionDefinition = {
title: 'Fetch Customer By Odoo ID',
description: 'Fetch a customer by odoo id',
input: {
schema: z.object({
id: z.string().title('ID').describe('The id of the customer to fetch'),
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fetchCustomerByOdooId action requires both 'id' and 'odooId' parameters, but the 'id' (Botpress ID) might not always be known when you have an Odoo ID. This makes the API awkward to use. Consider making the 'id' parameter optional since the implementation can handle fetching by odooId alone.

Suggested change
id: z.string().title('ID').describe('The id of the customer to fetch'),
id: z.string().title('ID').describe('The id of the customer to fetch').optional(),

Copilot uses AI. Check for mistakes.
odooId: z.string().title('Odoo ID').describe('The odoo id of the customer to fetch'),
}),
},
output: {
schema: z.object({
customer: customerSchema.title('Customer').describe('The fetched customer').optional(),
}),
},
}

export const fetchCustomerByEmail: ActionDefinition = {
title: 'Fetch Customer By Email',
description: 'Fetch a customer by email',
input: {
schema: z.object({
email: z.string().title('Email').describe('The email of the customer to fetch'),
}),
},
output: {
schema: z.object({
customer: customerSchema.title('Customer').describe('The fetched customer').optional(),
}),
},
}

export const updateCustomerById: ActionDefinition = {
title: 'Update Customer',
description: 'Update a customer by id',
input: {
schema: z.object({
id: z.string().title('ID').describe('The id of the customer to update'),
email: z.string().title('Email').describe('The new email of the customer').optional(),
name: z.string().title('Name').describe('The new name of the customer').optional(),
phone: z.string().title('Phone').describe('The new phone of the customer').optional(),
}),
},
output: {
schema: z.object({
success: z.boolean().title('Success').describe('The success of the update'),
error: z.string().title('Error').describe('The error message if the update failed').optional(),
}),
Comment on lines 85 to 106
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The output schema includes an optional 'error' field but the implementation (in customers.ts) only returns success: boolean. Either the error field should be removed from the schema or the implementation should populate it with error messages when success is false.

Copilot uses AI. Check for mistakes.
},
}

export const updateCustomerByEmail: ActionDefinition = {
title: 'Update Customer By Email',
description: 'Update a customer by email',
input: {
schema: z.object({
email: z.string().title('Email').describe('The email of the customer to update'),
name: z.string().title('Name').describe('The new name of the customer').optional(),
phone: z.string().title('Phone').describe('The new phone of the customer').optional(),
}),
},
output: {
schema: z.object({
success: z.boolean().title('Success').describe('The success of the update'),
error: z.string().title('Error').describe('The error message if the update failed').optional(),
}),
},
}

export const actions = {
createCustomer,
fetchCustomerById,
fetchCustomerByEmail,
fetchCustomerByOdooId,
updateCustomerById,
updateCustomerByEmail,
} as const
35 changes: 35 additions & 0 deletions integrations/odoo-helpdesk/definitions/actions/helpdesk.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { z, ActionDefinition } from '@botpress/sdk'
import { helpdeskTeamSchema, stageSchema } from 'definitions/schemas'

export const getHelpdeskTeams: ActionDefinition = {
title: 'Get Helpdesk Teams',
description: 'Get all helpdesk teams',
input: {
schema: z.object({}),
},
output: {
schema: z.object({
helpdeskTeams: z.array(helpdeskTeamSchema).title('Helpdesk Teams').describe('The list of helpdesk teams'),
}),
},
}

export const getStages: ActionDefinition = {
title: 'Get Stages',
description: 'Get all stages',
input: {
schema: z.object({
teamId: z.number().title('Team ID').describe('The id of the team to get the stages for'),
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The input schema for getStages action defines teamId as required, but the implementation allows it to be optional (checking if it exists). This creates a mismatch between the API contract and implementation. Either make teamId optional in the schema or remove the conditional check.

Suggested change
teamId: z.number().title('Team ID').describe('The id of the team to get the stages for'),
teamId: z.number().optional().title('Team ID').describe('The id of the team to get the stages for'),

Copilot uses AI. Check for mistakes.
}),
},
output: {
schema: z.object({
stages: z.array(stageSchema).title('Stages').describe('The list of stages'),
}),
},
}

export const actions = {
getHelpdeskTeams,
getStages,
} as const
10 changes: 10 additions & 0 deletions integrations/odoo-helpdesk/definitions/actions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as sdk from '@botpress/sdk'
import {actions as customerActions} from './customers'
import {actions as ticketsActions} from './tickets'
import {actions as helpdeskActions} from './helpdesk'

export const actions = {
...customerActions,
...ticketsActions,
...helpdeskActions,
} as const satisfies sdk.IntegrationDefinitionProps['actions']
95 changes: 95 additions & 0 deletions integrations/odoo-helpdesk/definitions/actions/tickets.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { z, ActionDefinition } from '@botpress/sdk'
import { ticketSchema } from 'definitions/schemas'

export const createTicket: ActionDefinition = {
title: 'Create Ticket',
description: 'Create a new ticket',
input: {
schema: z.object({
name: z.string().title('Name').describe('The name of the ticket'),
description: z.string().title('Description').describe('The description of the ticket'),
teamId: z.number().min(1).title('Team ID').describe('The helpdesk team ID associated with the ticket'),
priority: z.enum(['0', '1', '2', '3']).title('Priority').describe('The priority of the ticket (0 is the lowest priority)').optional(),
customerOdooId: z.number().title('Customer Odoo ID').describe('The Odoo customer ID associated with the ticket'),
stageId: z.number().title('Stage ID').describe('The stage ID associated with the ticket'),
Copy link

Copilot AI Jan 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The stageId parameter in createTicket is marked as required in the action definition, but in the implementation it's handled as optional (using conditional spread). This creates an inconsistency. Either make it optional in the schema with .optional() or ensure it's always provided.

Suggested change
stageId: z.number().title('Stage ID').describe('The stage ID associated with the ticket'),
stageId: z.number().title('Stage ID').describe('The stage ID associated with the ticket').optional(),

Copilot uses AI. Check for mistakes.
}),
},
output: {
schema: z.object({
ticketId: z.number().title('Ticket ID').describe('The ID of the created ticket'),
}),
},
}

export const fetchTicketById: ActionDefinition = {
title: 'Fetch Ticket',
description: 'Fetch a ticket by id',
input: {
schema: z.object({
id: z.number().title('Ticket ID').describe('The id of the ticket to fetch'),
}),
},
output: {
schema: z.object({
ticket: ticketSchema.title('Ticket').describe('The fetched ticket').optional(),
}),
},
}

export const fetchTicketsByCustomerId: ActionDefinition = {
title: 'Fetch Tickets by Customer',
description: 'Fetch all tickets by customer',
input: {
schema: z.object({
customerOdooId: z.number().title('Customer Odoo ID').describe('The Odoo customer ID associated with the ticket'),
}),
},
output: {
schema: z.object({
tickets: z.array(ticketSchema).title('Tickets').describe('The list of tickets associated with the customer'),
}),
},
}

export const fetchTicketsByCustomerEmail: ActionDefinition = {
title: 'Fetch Tickets by Customer Email',
description: 'Fetch all tickets by customer email',
input: {
schema: z.object({
customerEmail: z.string().title('Customer Email').describe('The email of the customer'),
}),
},
output: {
schema: z.object({
tickets: z.array(ticketSchema).title('Tickets').describe('The list of tickets associated with the customer'),
}),
},
}

export const updateTicket: ActionDefinition = {
title: 'Update Ticket',
description: 'Update a ticket by id',
input: {
schema: z.object({
ticketId: z.number().title('Ticket ID').describe('The ID of the ticket to update'),
name: z.string().title('Name').describe('The name of the ticket').optional(),
description: z.string().title('Description').describe('The description of the ticket').optional(),
teamId: z.number().min(1).title('Team ID').describe('The helpdesk team ID associated with the ticket').optional(),
priority: z.enum(['0', '1', '2', '3']).title('Priority').describe('The priority of the ticket (0 is the lowest priority, 3 is the highest)').optional(),
stageId: z.number().title('Stage ID').describe('The stage ID associated with the ticket').optional(),
}),
},
output: {
schema: z.object({
success: z.boolean().title('Success').describe('The success of the update')
}),
},
}

export const actions = {
createTicket,
fetchTicketById,
fetchTicketsByCustomerId,
fetchTicketsByCustomerEmail,
updateTicket,
} as const
4 changes: 4 additions & 0 deletions integrations/odoo-helpdesk/definitions/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { actions } from './actions'
import { states } from './states'

export { actions, states }
19 changes: 19 additions & 0 deletions integrations/odoo-helpdesk/definitions/schemas/customer.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { z } from '@botpress/sdk'

export const customerSchema = z.object({
id: z.string().describe('The id of the customer').optional(),
odooId: z.number().describe('The Odoo ID of the customer').optional(),
email: z.string().describe('The email of the customer'),
name: z.string().describe('The name of the customer').optional(),
phone: z.string().describe('The phone of the customer').optional(),
})

export type Customer = z.infer<typeof customerSchema>

const customerPayloadSchema = z.object({
email: z.string().describe('The email of the customer'),
phone: z.string().describe('The phone of the customer').optional(),
name: z.string().describe('The name of the customer').optional(),
})

export type CustomerPayload = z.infer<typeof customerPayloadSchema>
14 changes: 14 additions & 0 deletions integrations/odoo-helpdesk/definitions/schemas/helpdesk-team.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { z } from '@botpress/sdk'

export const helpdeskTeamSchema = z.object({
name: z.string().describe('The name of the helpdesk team'),
id: z.number().describe('The id of the helpdesk team'),
})

export type HelpdeskTeam = z.infer<typeof helpdeskTeamSchema>

const helpdeskTeamPayloadSchema = z.object({
name: z.string().describe('The name of the helpdesk team'),
})

export type HelpdeskTeamPayload = z.infer<typeof helpdeskTeamPayloadSchema>
24 changes: 24 additions & 0 deletions integrations/odoo-helpdesk/definitions/schemas/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { customerSchema, Customer, CustomerPayload } from './customer'
import { helpdeskTeamSchema, HelpdeskTeam, HelpdeskTeamPayload } from './helpdesk-team'
import { prioritySchema, Priority, PriorityPayload } from './priority'
import { stageSchema, Stage, StagePayload } from './stage'
import { ticketSchema, Ticket, TicketPayload, TicketResponse } from './ticket'

export {
customerSchema,
helpdeskTeamSchema,
prioritySchema,
stageSchema,
ticketSchema,
Customer,
CustomerPayload,
HelpdeskTeam,
HelpdeskTeamPayload,
Priority,
PriorityPayload,
Stage,
StagePayload,
Ticket,
TicketPayload,
TicketResponse,
}
14 changes: 14 additions & 0 deletions integrations/odoo-helpdesk/definitions/schemas/priority.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { z } from '@botpress/sdk'

export const prioritySchema = z.object({
name: z.string().describe('The name of the priority'),
id: z.number().describe('The id of the priority'),
})

export type Priority = z.infer<typeof prioritySchema>

const priorityPayloadSchema = z.object({
id: z.number().describe('The id of the priority'),
})

export type PriorityPayload = z.infer<typeof priorityPayloadSchema>
16 changes: 16 additions & 0 deletions integrations/odoo-helpdesk/definitions/schemas/stage.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { z } from '@botpress/sdk'

export const stageSchema = z.object({
name: z.string().describe('The name of the stage'),
id: z.number().describe('The id of the stage'),
teamIds: z.array(z.number()).describe('The ids of the helpdesk teams that the stage belongs to'),
})

export type Stage = z.infer<typeof stageSchema>

const stagePayloadSchema = z.object({
name: z.string().describe('The name of the stage'),
team_ids: z.array(z.number()).describe('The ids of the helpdesk teams that the stage belongs to'),
})

export type StagePayload = z.infer<typeof stagePayloadSchema>
33 changes: 33 additions & 0 deletions integrations/odoo-helpdesk/definitions/schemas/ticket.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { z } from '@botpress/sdk'

export const ticketSchema = z.object({
customerOdooId: z.number().describe('The Odoo customer ID associated with the ticket'),
id: z.number().describe('The ticket ID'),
name: z.string().describe('The name of the ticket'),
description: z.string().describe('The description of the ticket'),
teamId: z.number().describe('The helpdesk team ID associated with the ticket'),
priority: z.string().describe('The priority of the ticket').optional(),
stageId: z.number().describe('The stage ID associated with the ticket').optional(),
})
export type Ticket = z.infer<typeof ticketSchema>

const ticketPayloadSchema = z.object({
name: z.string().describe('The name of the ticket'),
description: z.string().describe('The description of the ticket'),
team_id: z.number().describe('The helpdesk team ID associated with the ticket'),
priority: z.string().describe('The priority of the ticket as a string (e.g., "0", "1", "2", "3")').optional(),
partner_id: z.number().describe('The customer ID associated with the ticket'),
stage_id: z.number().describe('The stage ID associated with the ticket').optional(),
})
export type TicketPayload = z.infer<typeof ticketPayloadSchema>

export const ticketResponseSchema = z.object({
id: z.number().describe('The ticket ID'),
name: z.string().describe('The name of the ticket'),
description: z.string().describe('The description of the ticket'),
team_id: z.tuple([z.number(), z.string()]).describe('The helpdesk team ID and name as a tuple [id, name]'),
priority: z.string().describe('The priority of the ticket as a string (e.g., "0", "1", "2", "3")').optional().nullable(),
partner_id: z.tuple([z.number(), z.string()]).describe('The customer ID and name as a tuple [id, name]'),
stage_id: z.tuple([z.number(), z.string()]).describe('The stage ID and name as a tuple [id, name]').optional(),
})
export type TicketResponse = z.infer<typeof ticketResponseSchema>
Loading
Loading