From 73d7fe9411f4a9a0b849d9b42051e67ca19c25ec Mon Sep 17 00:00:00 2001 From: Vidhu Kant Sharma Date: Fri, 5 Apr 2024 19:09:07 +0530 Subject: validating username upon account creation --- errors/errors.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'errors/errors.go') diff --git a/errors/errors.go b/errors/errors.go index c16bd52..0d88490 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -1,5 +1,5 @@ /* openbills - Server for web based Libre Billing Software - * Copyright (C) 2023 Vidhu Kant Sharma + * Copyright (C) 2023-2024 Vidhu Kant Sharma * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,6 +31,9 @@ var ( ErrEmptyContactName = errors.New("Contact Name Cannot Be Empty") ErrInvalidGSTIN = errors.New("Invalid GSTIN") ErrInvalidEmail = errors.New("Invalid E-Mail Address") + ErrEmptyEmail = errors.New("E-Mail Address Cannot Be Empty") + ErrInvalidUsername = errors.New("Invalid Username") + ErrEmptyUsername = errors.New("Username Cannot Be Empty") ErrInvalidPhone = errors.New("Invalid Phone Number") ErrInvalidWebsite = errors.New("Invalid Website URL") ErrEmptyBrandName = errors.New("Brand Name Cannot Be Empty") @@ -38,6 +41,8 @@ var ( ErrInvalidGSTPercentage = errors.New("Invalid GST Percentage") ErrPasswordTooShort = errors.New("Password Is Too Short") ErrPasswordTooLong = errors.New("Password Is Too Long") + ErrUsernameTooShort = errors.New("Username Is Too Short") + ErrUsernameTooLong = errors.New("Username Is Too Long") ErrInvalidLoginMethod = errors.New("Login Method Can Only Be 'email' Or 'username'") // 401 -- cgit v1.2.3