@wrcb/cb-common 1.0.405 → 1.0.407
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -11,21 +11,22 @@ const jsonwebtoken_1 = __importDefault(require("jsonwebtoken"));
|
|
|
11
11
|
const userRole_1 = require("../types/userRole");
|
|
12
12
|
const country_1 = require("../types/country");
|
|
13
13
|
const tenant_1 = require("../types/tenant");
|
|
14
|
+
const userCategory_1 = require("src/types/userCategory");
|
|
14
15
|
function signUpReturnCookie(id, overrides) {
|
|
15
16
|
// Build a JWT payload
|
|
16
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Consumer, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
17
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Consumer, language: country_1.Language.Português, country: country_1.Country.Brasil, isKycDone: true, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false, category: userCategory_1.UserCategory.Restaurant, profilePhoto: 'https://criptobet.com/logo.jpg' }, overrides // sobrescreve os valores padrão
|
|
17
18
|
);
|
|
18
19
|
return buildCookie(payload);
|
|
19
20
|
}
|
|
20
21
|
function signUpReturnCookieAdmin(id, overrides) {
|
|
21
22
|
// Build a JWT payload
|
|
22
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Admin, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false }, overrides // sobrescreve os valores padrão
|
|
23
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.PoliticaBet, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Admin, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false, category: userCategory_1.UserCategory.Restaurant, profilePhoto: 'https://criptobet.com/logo.jpg' }, overrides // sobrescreve os valores padrão
|
|
23
24
|
);
|
|
24
25
|
return buildCookie(payload);
|
|
25
26
|
}
|
|
26
27
|
function signUpReturnCookieSeller(id, overrides) {
|
|
27
28
|
// Build a JWT payload
|
|
28
|
-
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.
|
|
29
|
+
const payload = Object.assign({ id: id !== null && id !== void 0 ? id : new mongoose_1.default.Types.ObjectId().toHexString(), tenant: tenant_1.Tenant.TourismApp, email: 'test@test.com', nickName: 'apelido', role: userRole_1.UserRole.Seller, isKycDone: true, language: country_1.Language.Português, country: country_1.Country.Brasil, isEmailVerified: false, isWhatsappVerified: false, isPersonalDataProvided: false, isAddressDataProvided: false, isBusinessDataProvided: false, category: userCategory_1.UserCategory.Restaurant, profilePhoto: 'https://criptobet.com/logo.jpg' }, overrides // sobrescreve os valores padrão
|
|
29
30
|
);
|
|
30
31
|
return buildCookie(payload);
|
|
31
32
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Country, Language } from './country';
|
|
2
2
|
import { Tenant } from './tenant';
|
|
3
|
+
import { UserCategory } from './userCategory';
|
|
3
4
|
export interface UserPayload {
|
|
4
5
|
id: string;
|
|
5
6
|
tenant: Tenant;
|
|
@@ -12,6 +13,8 @@ export interface UserPayload {
|
|
|
12
13
|
isAddressDataProvided: boolean;
|
|
13
14
|
isBusinessDataProvided: boolean;
|
|
14
15
|
language: Language;
|
|
16
|
+
category: UserCategory;
|
|
17
|
+
profilePhoto: string;
|
|
15
18
|
country: Country;
|
|
16
19
|
role: string;
|
|
17
20
|
}
|