(billing) Add HU VAT option

This commit is contained in:
Baptiste Arnaud
2023-03-29 16:33:06 +02:00
parent 3ef4efab4e
commit 70416c0d14
3 changed files with 44 additions and 20 deletions

View File

@@ -340,7 +340,14 @@ export const taxIdTypes = [
code: 'HU TIN',
name: 'Hungary',
emoji: '🇭🇺',
placeholder: '12345678',
placeholder: '13804079-2-13',
},
{
type: 'hu_vat',
code: 'HU VAT',
name: 'Hungary',
emoji: '🇭🇺',
placeholder: 'HU12345678',
},
{
type: 'id_npwp',

View File

@@ -24,24 +24,27 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => {
if (!workspaceId) return badRequest(res)
const typebotIds = req.query.typebotIds as string[]
const typebots = await prisma.typebot.findMany({
where: {
OR: [
{
workspace: { members: { some: { userId: user.id } } },
id: { in: typebotIds },
isArchived: { not: true },
},
{
id: { in: typebotIds },
collaborators: {
some: {
userId: user.id,
},
where:
process.env.ADMIN_EMAIL === user.email
? undefined
: {
OR: [
{
workspace: { members: { some: { userId: user.id } } },
id: { in: typebotIds },
isArchived: { not: true },
},
{
id: { in: typebotIds },
collaborators: {
some: {
userId: user.id,
},
},
isArchived: { not: true },
},
],
},
isArchived: { not: true },
},
],
},
orderBy: { createdAt: 'desc' },
select: { name: true, id: true, groups: true, variables: true },
})