Skip to content

Commit

Permalink
add new user type reserved from social (#681)
Browse files Browse the repository at this point in the history
* add new user type reserved from social

* fix typo

---------

Co-authored-by: s3341458 <[email protected]>
  • Loading branch information
s3341458 and s3341458 authored Oct 31, 2023
1 parent 877015b commit d45003b
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 0 deletions.
2 changes: 2 additions & 0 deletions javascript/merchi.js
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ import { SupplyDomain, SupplyDomains } from './supply_domain.js';
import { SystemRole } from './system_role.js';
import { Theme, Themes } from './theme.js';
import { User, Users } from './user.js';
import { userTypes } from './user_types.js';
import { UserCompany } from './user_company.js';
import { Variation } from './variation.js';
import { VariationField } from './variation_field.js';
Expand Down Expand Up @@ -1058,6 +1059,7 @@ export function merchi(backendUri, websocketUri) {
'copyEntIfNotNullOrUndefined': copyEntIfNotNullOrUndefined,
'entAsBlank': entAsBlank,
'cleanEntities': cleanEntities,
'userTypes': userTypes,
'updateEntNonEmbeddableAttrbibutes': updateEntNonEmbeddableAttrbibutes,
'updateEntAttributes': updateEntAttributes,
'ignoreAttributesUpdateEnt': ignoreAttributesUpdateEnt,
Expand Down
19 changes: 19 additions & 0 deletions javascript/user_types.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Dictionary } from './dictionary.js';

export const userTypes = new Dictionary();

userTypes.add("PUBLIC", 0);
userTypes.add("CLIENT_GUEST", 1);
userTypes.add("CLIENT_DOMAIN", 2);
userTypes.add("CLIENT_MULTIPLE_DOMAINS", 3);
userTypes.add("CLIENT_MERCHI", 4);
userTypes.add("SELLER_FREE_MERCHI", 5);
userTypes.add("SELLER_FREE_DOMAIN", 6);
userTypes.add("SELLER_PAID", 7);
userTypes.add("SELLER_PAID_MULTIPLE_DOMAINS", 8);
userTypes.add("SUPPLIER_THIRD_PARTY", 9);
userTypes.add("SUPPLIER_RESTRICTED", 10);
userTypes.add("SUPPLIER_MERCHI", 11);
userTypes.add("UNRESTRICTED", 12);
userTypes.add("SHOPIFY_REFERENCE", 13);
userTypes.add("RESERVED_FROM_SOCIAL", 14);
3 changes: 3 additions & 0 deletions python/util/user_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
UNRESTRICTED = 12 # A user who has a domain which is unrestricted
# A user who makes order from shopify and linked to our system
SHOPIFY_REFERENCE = 13
# A user crawled from Social network
RESERVED_FROM_SOCIAL = 14

ALL_TYPES = [
(PUBLIC, "PUBLIC"),
Expand All @@ -32,6 +34,7 @@
(SUPPLIER_MERCHI, "SUPPLIER_MERCHI"),
(UNRESTRICTED, "UNRESTRICTED"),
(SHOPIFY_REFERENCE, "SHOPIFY_REFERENCE"),
(RESERVED_FROM_SOCIAL, "RESERVED_FROM_SOCIAL"),
]

TYPE_STRINGS = dict(ALL_TYPES)
Expand Down
2 changes: 2 additions & 0 deletions typescript/src/constants/user_types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,6 @@ export enum UserType {
SUPPLIER_RESTRICTED = 10, // A user who has a restricted supply domain
SUPPLIER_MERCHI = 11, // A user who has a supply domain which has been verified by Merchi
UNRESTRICTED = 12, // A user who has a domain which is unrestricted
SHOPIFY_REFERENCE = 13, // A user who makes order from shopify and linked to our system
RESERVED_FROM_SOCIAL = 14, // A user crawled from Social network
}

0 comments on commit d45003b

Please sign in to comment.