Adjusted Per seat billing and added example to the sample schema

This commit is contained in:
giancarlo
2024-04-22 22:48:02 +08:00
parent b96d4cf855
commit 70da6ef1fa
19 changed files with 2190 additions and 2066 deletions

View File

@@ -192,7 +192,7 @@ function useGetColumns(
permissions={permissions}
member={row.original}
currentUserId={params.currentUserId}
accountId={params.currentAccountId}
currentTeamAccountId={params.currentAccountId}
currentRoleHierarchy={params.currentRoleHierarchy}
/>
),
@@ -206,12 +206,13 @@ function ActionsDropdown({
permissions,
member,
currentUserId,
currentTeamAccountId,
currentRoleHierarchy,
}: {
permissions: Permissions;
member: Members[0];
currentUserId: string;
accountId: string;
currentTeamAccountId: string;
currentRoleHierarchy: number;
}) {
const [isRemoving, setIsRemoving] = useState(false);
@@ -275,7 +276,7 @@ function ActionsDropdown({
<RemoveMemberDialog
isOpen
setIsOpen={setIsRemoving}
accountId={member.id}
teamAccountId={currentTeamAccountId}
userId={member.user_id}
/>
</If>
@@ -286,7 +287,7 @@ function ActionsDropdown({
setIsOpen={setIsUpdatingRole}
userId={member.user_id}
userRole={member.role}
teamAccountId={member.account_id}
teamAccountId={currentTeamAccountId}
userRoleHierarchy={currentRoleHierarchy}
/>
</If>

View File

@@ -19,9 +19,9 @@ import { removeMemberFromAccountAction } from '../../server/actions/team-members
export const RemoveMemberDialog: React.FC<{
isOpen: boolean;
setIsOpen: (isOpen: boolean) => void;
accountId: string;
teamAccountId: string;
userId: string;
}> = ({ isOpen, setIsOpen, accountId, userId }) => {
}> = ({ isOpen, setIsOpen, teamAccountId, userId }) => {
return (
<AlertDialog open={isOpen} onOpenChange={setIsOpen}>
<AlertDialogContent>
@@ -37,7 +37,7 @@ export const RemoveMemberDialog: React.FC<{
<RemoveMemberForm
setIsOpen={setIsOpen}
accountId={accountId}
accountId={teamAccountId}
userId={userId}
/>
</AlertDialogContent>

View File

@@ -28,7 +28,7 @@ export class AccountPerSeatBillingService {
id,
subscription_items !inner (
quantity,
id: variant_id,
id,
type
)
`,