diff --git a/components/Layout/Toolbar.vue b/components/Layout/Toolbar.vue
index 9e2259a..bc7e319 100644
--- a/components/Layout/Toolbar.vue
+++ b/components/Layout/Toolbar.vue
@@ -5,6 +5,8 @@ const $q = useQuasar()
const { loggedIn, session } = useAuth()
+const isCompanyOrAdmin = computed(() => session.value?.data?.role && session.value.data.role !== RoleEnum.candidate)
+
async function onLogout() {
$q.dialog({
cancel: 'Não',
@@ -35,6 +37,9 @@ async function onLogout() {
+
+ Candidatos
+
Vagas
@@ -122,7 +127,3 @@ async function onLogout() {
-
-
diff --git a/components/LocationBadges.vue b/components/LocationBadges.vue
new file mode 100644
index 0000000..0fc56c7
--- /dev/null
+++ b/components/LocationBadges.vue
@@ -0,0 +1,49 @@
+
+
+
+
+
+ {{ label }}
+
+
+
+
diff --git a/components/OpeningCard.vue b/components/OpeningCard.vue
index 354c0f5..fd5e935 100644
--- a/components/OpeningCard.vue
+++ b/components/OpeningCard.vue
@@ -71,7 +71,3 @@ defineProps<{ process: GetProcessesResponse['data'][0] }>()
-
-
diff --git a/db/users.ts b/db/users.ts
index 9cfeb24..ed01e01 100644
--- a/db/users.ts
+++ b/db/users.ts
@@ -7,24 +7,16 @@ import { favorites } from './favorites'
import { profiles } from './profiles'
import { recommendations } from './recommendations'
import { roleEnum } from './role'
-import { files } from './files'
export const users = pgTable('users', {
- // Relations
companyId: uuid('company_id').references(() => companies.id),
confirmedEmail: boolean('confirmed_email').notNull().default(false),
- // Metadata
createdAt: timestamp('created_at').notNull().defaultNow(),
email: text('email').notNull().unique(),
- // Data
id: uuid('id').defaultRandom().primaryKey(),
-
- // Flags
invitePending: boolean('invite_pending').notNull().default(false),
name: text('name').notNull(),
-
password: text('password').notNull(),
-
role: roleEnum('role').notNull(),
updatedAt: timestamp('updated_at').notNull().defaultNow(),
})
diff --git a/lib/prisma.ts b/lib/prisma.ts
new file mode 100644
index 0000000..08a8751
--- /dev/null
+++ b/lib/prisma.ts
@@ -0,0 +1,15 @@
+import { PrismaClient } from '@prisma/client'
+
+const prismaClientSingleton = () => {
+ return new PrismaClient()
+}
+
+declare const globalThis: {
+ prismaGlobal: ReturnType;
+} & typeof global;
+
+const prisma = globalThis.prismaGlobal ?? prismaClientSingleton()
+
+export default prisma
+
+if (process.env.NODE_ENV !== 'production') globalThis.prismaGlobal = prisma
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 57bca43..acb3c85 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -24,6 +24,8 @@ export default defineNuxtConfig({
classSuffix: '',
},
+ compatibilityDate: '2024-07-03',
+
css: [
'@unocss/reset/tailwind.css',
'assets/main.sass',
@@ -70,6 +72,7 @@ export default defineNuxtConfig({
dirs: [
'./db/**/*',
'./composables/**/*',
+ './stores/**/*',
],
},
@@ -99,6 +102,7 @@ export default defineNuxtConfig({
'./db/**/*',
'./server/services/**/*',
'./server/utils/**/*',
+ './lib/*',
],
},
// prerender: {
@@ -158,6 +162,4 @@ export default defineNuxtConfig({
crossOriginResourcePolicy: 'cross-origin',
},
},
-
- compatibilityDate: '2024-07-03',
-})
\ No newline at end of file
+})
diff --git a/package.json b/package.json
index ffda0ab..dab65e5 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"type": "module",
"private": true,
- "packageManager": "pnpm@9.4.0",
+ "packageManager": "pnpm@9.5.0",
"scripts": {
"build": "nuxi build",
"dev": "nuxi dev",
@@ -16,12 +16,10 @@
"docs:build": "vitepress build docs",
"docs:preview": "vitepress preview docs"
},
- "peerDependencies": {
- "drizzle-orm": "^0.29.4"
- },
"dependencies": {
- "@quasar/extras": "^1.16.11",
- "drizzle-orm": "^0.31.2",
+ "@prisma/client": "^5.16.1",
+ "@quasar/extras": "^1.16.12",
+ "drizzle-orm": "^0.29.4",
"firebase": "^10.12.3",
"i18n-iso-countries": "^7.11.2",
"postgres": "^3.4.4",
@@ -42,15 +40,15 @@
"@pinia/nuxt": "^0.5.1",
"@types/nodemailer": "^6.4.15",
"@types/nodemailer-express-handlebars": "^4.0.5",
- "@unocss/eslint-config": "^0.61.2",
- "@unocss/eslint-plugin": "^0.61.2",
- "@unocss/nuxt": "^0.61.2",
+ "@unocss/eslint-config": "^0.61.3",
+ "@unocss/eslint-plugin": "^0.61.3",
+ "@unocss/nuxt": "^0.61.3",
"@vueuse/nuxt": "^10.11.0",
"consola": "^3.2.3",
"dayjs-nuxt": "^2.1.9",
"drizzle-kit": "^0.22.8",
- "eslint-plugin-format": "^0.1.2",
"eslint": "npm:eslint-ts-patch@^8.57.0-0",
+ "eslint-plugin-format": "^0.1.2",
"eslint-ts-patch": "^8.57.0-0",
"nodemailer": "^6.9.14",
"nodemailer-express-handlebars": "^6.1.2",
@@ -60,9 +58,10 @@
"nuxt-security": "^1.4.3",
"pg": "^8.12.0",
"pinia": "^2.1.7",
+ "prisma": "^5.16.1",
"sass": "^1.77.6",
"typescript": "^5.5.3",
- "vitepress": "^1.2.3",
+ "vitepress": "^1.3.0",
"vue-tsc": "^2.0.26"
}
}
diff --git a/pages/candidatos.vue b/pages/candidatos.vue
new file mode 100644
index 0000000..4163e1b
--- /dev/null
+++ b/pages/candidatos.vue
@@ -0,0 +1,97 @@
+
+
+
+
+ Candidatos
+
+
+
+
+
+
+
+
+ {{ props.row.user.name }}
+
+
+
+
+
+
+
+ Não definida
+
+
+
+
+
+
+
+
diff --git a/pages/empresas/[id].vue b/pages/empresas/[id].vue
index fa43406..5f7f55f 100644
--- a/pages/empresas/[id].vue
+++ b/pages/empresas/[id].vue
@@ -26,38 +26,6 @@ const contractTypes = computed(() => company.value?.processesTypes?.length
type => contractTypeOptions.find(op => op.value === type)?.label,
)
: undefined)
-
-const availableLocations = computed(() => company.value?.availableLocations?.length
- ? company.value?.availableLocations.map(
- location => ({
- label: [
- location.country,
- location.state,
- location.city,
- ].filter(Boolean).join(', '),
- value: {
- city: location.city ?? undefined,
- country: location.country,
- state: location.state ?? undefined,
- },
- }),
- ).reduce(
- (acc: {
- label: string
- value: {
- city: string | undefined
- country: string
- state: string | undefined
- }
- }[], curr) => {
- if (!curr?.label || acc.some(entry => entry.label === curr?.label))
- return acc
- acc.push(curr)
- return acc
- },
- [],
- )
- : undefined)
@@ -91,19 +59,11 @@ const availableLocations = computed(() => company.value?.availableLocations?.len
{{ t }}
-
+
Locais de Contratação
-
-
- {{ label }}
-
+
diff --git a/pages/minha-empresa/usuarios/index.vue b/pages/minha-empresa/usuarios/index.vue
index ee7cc17..242a285 100644
--- a/pages/minha-empresa/usuarios/index.vue
+++ b/pages/minha-empresa/usuarios/index.vue
@@ -1,5 +1,6 @@