Skip to content

Commit

Permalink
feat(type): UserAuth and user.permissions (#1120)
Browse files Browse the repository at this point in the history
  • Loading branch information
alimd authored May 7, 2023
2 parents d785e5f + a962366 commit 7e761cd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core/type/src/customer-order-management.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,11 @@ export interface OrderShippingInfo extends StringifyableRecord {
timePeriod: (typeof timePeriodCS)[number];
}

export const userPermissionsCS = ['*', 'user/patch'] as const;
export type UserPermission = typeof userPermissionsCS[number];

export interface ComUser extends User {
permissions?: Array<UserPermission>;
shopName?: string;
}

Expand Down
13 changes: 13 additions & 0 deletions core/type/src/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ export interface User extends AlwatrDocumentObject {
*/
lpe: number;

/**
* User authorization permissions list.
*/
permissions?: Array<string>;

fullName: string;

phoneNumber: number;
Expand Down Expand Up @@ -44,5 +49,13 @@ export interface User extends AlwatrDocumentObject {
*/
address?: string;

/**
* Postal code
*/
postalCode?: string;
}

export interface UserAuth {
id: string;
token: string;
}

0 comments on commit 7e761cd

Please sign in to comment.