This commit is contained in:
Mateusz Gruszczyński
2026-04-06 10:46:48 +02:00
parent 1ba1a26291
commit 0c7414101a
23 changed files with 962 additions and 355 deletions

View File

@@ -39,7 +39,7 @@ export const createUser = async (input: {
defaultCurrency?: string;
}) => {
const existing = await repo().findOne({ where: { email: input.email.toLowerCase() } });
if (existing) throw new Error('Email already exists');
if (existing) throw new Error('Email address is already in use');
const user = repo().create({
fullName: input.fullName,

View File

@@ -4,6 +4,8 @@ import { AppSetting } from '../entities/AppSetting.js';
import { Category } from '../entities/Category.js';
import { createUser, findUserByEmail } from './auth.service.js';
const DEFAULT_APP_NAME = 'Expense Control';
const systemCategories = [
{ name: 'Rachunki', color: '#b91c1c' },
{ name: 'Zakupy', color: '#2563eb' },
@@ -41,7 +43,7 @@ export const bootstrapData = async () => {
if (!settings) {
await settingsRepo.save(
settingsRepo.create({
appName: env.APP_NAME,
appName: DEFAULT_APP_NAME,
defaultCurrency: env.DEFAULT_CURRENCY,
registrationEnabled: true,
allowedProofTypes: ['RECEIPT', 'INVOICE', 'NOTE', 'BANK_STATEMENT', 'OTHER'],
@@ -52,7 +54,7 @@ export const bootstrapData = async () => {
smtpSecure: false,
smtpUser: null,
smtpPassword: null,
smtpFromName: env.APP_NAME,
smtpFromName: DEFAULT_APP_NAME,
smtpFromEmail: env.ADMIN_EMAIL
})
);