Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

Uncommitted changes from profile + notes (#13)

Brad Barbin7f7b992bf57d
diff --git a/apps/carbon/app/components/Layout/Background/Background.tsx b/apps/carbon/app/components/Layout/Background/Background.tsx
new file mode 100644
index 0000000000..4d62e0540a
--- /dev/null
+++ b/apps/carbon/app/components/Layout/Background/Background.tsx
@@ -0,0 +1,9 @@
+const Background = () => {
+ return (
+ <div className="background">
+ <div className="gradient" />
+ </div>
+ );
+};
+
+export default Background;
diff --git a/apps/carbon/app/components/Layout/Background/index.ts b/apps/carbon/app/components/Layout/Background/index.ts
new file mode 100644
index 0000000000..6c76274954
--- /dev/null
+++ b/apps/carbon/app/components/Layout/Background/index.ts
@@ -0,0 +1,3 @@
+import Background from "./Background";
+
+export default Background;
diff --git a/apps/carbon/app/components/Layout/index.ts b/apps/carbon/app/components/Layout/index.ts
index 05171b1b2c..9ebf82f12e 100644
--- a/apps/carbon/app/components/Layout/index.ts
+++ b/apps/carbon/app/components/Layout/index.ts
@@ -1,6 +1,14 @@
+import Background from "./Background";
import { ContentSidebar, IconSidebar } from "./Sidebar";
import PageTitle from "./PageTitle";
import SectionTitle from "./SectionTitle";
import Topbar from "./Topbar";
-export { ContentSidebar, IconSidebar, PageTitle, SectionTitle, Topbar };
+export {
+ Background,
+ ContentSidebar,
+ IconSidebar,
+ PageTitle,
+ SectionTitle,
+ Topbar,
+};
diff --git a/apps/carbon/app/components/Table/components/TableHeader/TableHeader.tsx b/apps/carbon/app/components/Table/components/TableHeader/TableHeader.tsx
index cf3c620f7d..16d896fba0 100644
--- a/apps/carbon/app/components/Table/components/TableHeader/TableHeader.tsx
+++ b/apps/carbon/app/components/Table/components/TableHeader/TableHeader.tsx
@@ -51,6 +51,7 @@ const TableHeader = <T extends object>({
px={4}
py={3}
justifyContent="space-between"
+ bg={useColor("white")}
borderBottomColor={borderColor}
borderBottomStyle="solid"
borderBottomWidth={1}
diff --git a/apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsx b/apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsx
index 93936198a5..2b29442180 100644
--- a/apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsx
+++ b/apps/carbon/app/interfaces/Resources/People/PeopleTable/PeopleTable.tsx
@@ -213,6 +213,15 @@ const PeopleTable = memo(
defaultColumnPinning={{
left: ["Select", "User"],
}}
+ onRowClick={(row) => {
+ // @ts-ignore
+ row?.user?.id
+ ? navigate(
+ // @ts-ignore
+ `/x/resources/person/${row?.user.id}?${params.toString()}`
+ )
+ : console.error("Expected user id to be defined");
+ }}
withColumnOrdering
// withInlineEditing
withFilters
diff --git a/apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsx b/apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsx
index 142a92ad5c..34770faacc 100644
--- a/apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsx
+++ b/apps/carbon/app/interfaces/Resources/Person/PersonNotes/PersonNotes.tsx
@@ -13,7 +13,7 @@ import {
Text,
VStack,
} from "@chakra-ui/react";
-import { useParams } from "@remix-run/react";
+import { Form, useParams } from "@remix-run/react";
import { Fragment } from "react";
import { ValidatedForm } from "remix-validated-form";
import { Avatar } from "~/components";
@@ -44,32 +44,46 @@ const PersonNotes = ({ notes }: PersonNoteProps) => {
</CardHeader>
<CardBody>
{notes.length > 0 ? (
- <VStack spacing={3} w="full">
- <Grid gridTemplateColumns="auto 1fr" gridColumnGap={4} w="full">
- {notes.map((note) => {
- if (Array.isArray(note.user)) throw new Error("Invalid user");
- return (
- <Fragment key={note.id}>
- <Avatar path={user.avatarUrl} />
- <VStack spacing={1} w="full" alignItems="start">
- <Text fontWeight="bold">{note.user?.fullName}</Text>
- <Text>{note.note}</Text>
- <HStack spacing={4}>
- <Text color="gray.500">
- {formatTimeAgo(note.createdAt)}
- </Text>
- {user.id === note.user?.id && (
- <Button variant="link" fontWeight="normal" size="md">
- Delete
- </Button>
+ <Grid
+ gridTemplateColumns="auto 1fr"
+ gridColumnGap={4}
+ gridRowGap={8}
+ w="full"
+ >
+ {notes.map((note) => {
+ if (Array.isArray(note.user)) throw new Error("Invalid user");
+ return (
+ <Fragment key={note.id}>
+ <Avatar path={user.avatarUrl} />
+ <VStack spacing={1} w="full" alignItems="start">
+ <Text fontWeight="bold">{note.user?.fullName}</Text>
+ <Text>{note.note}</Text>
+ <HStack spacing={4}>
+ <Text color="gray.500">
+ {formatTimeAgo(note.createdAt)}
+ </Text>
+ {(canDelete || canUpdate) &&
+ user.id === note.user?.id && (
+ <Form
+ method="post"
+ action={`/x/resources/person/${personId}/notes/delete/${note.id}`}
+ >
+ <Button
+ type="submit"
+ variant="link"
+ fontWeight="normal"
+ size="md"
+ >
+ Delete
+ </Button>
+ </Form>
)}
- </HStack>
- </VStack>
- </Fragment>
- );
- })}
- </Grid>
- </VStack>
+ </HStack>
+ </VStack>
+ </Fragment>
+ );
+ })}
+ </Grid>
) : (
<Box color="gray.500" p={4} w="full" textAlign="center">
No notes
diff --git a/apps/carbon/app/root.tsx b/apps/carbon/app/root.tsx
index be37793dd5..299b953e5a 100644
--- a/apps/carbon/app/root.tsx
+++ b/apps/carbon/app/root.tsx
@@ -16,6 +16,11 @@ import type { MetaFunction, LoaderArgs } from "@remix-run/node";
import { ThemeProvider } from "@carbon/react";
import { getBrowserEnv } from "~/config/env";
import { ServerStyleContext, ClientStyleContext } from "~/lib/emotion";
+import Background from "~/styles/background.css";
+
+export function links() {
+ return [{ rel: "stylesheet", href: Background }];
+}
export const meta: MetaFunction = () => ({
charset: "utf-8",
diff --git a/apps/carbon/app/routes/_public.tsx b/apps/carbon/app/routes/_public.tsx
index 2feb114340..3472f8da60 100644
--- a/apps/carbon/app/routes/_public.tsx
+++ b/apps/carbon/app/routes/_public.tsx
@@ -1,10 +1,6 @@
import { Flex, VStack } from "@chakra-ui/react";
import { Outlet } from "@remix-run/react";
-import background from "~/styles/background.css";
-
-export function links() {
- return [{ rel: "stylesheet", href: background }];
-}
+import { Background } from "~/components/Layout";
export default function PublicRoute() {
return (
@@ -16,11 +12,3 @@ export default function PublicRoute() {
</Flex>
);
}
-
-function Background() {
- return (
- <div className="background">
- <div className="gradient" />
- </div>
- );
-}
diff --git a/apps/carbon/app/routes/x+/account.tsx b/apps/carbon/app/routes/x+/account.tsx
index 3d39489126..6f274a18e7 100644
--- a/apps/carbon/app/routes/x+/account.tsx
+++ b/apps/carbon/app/routes/x+/account.tsx
@@ -1,3 +1,4 @@
+import { useColor } from "@carbon/react";
import { Grid, VStack } from "@chakra-ui/react";
import type { MetaFunction } from "@remix-run/node";
import { Outlet } from "@remix-run/react";
@@ -14,7 +15,7 @@ export default function AccountRoute() {
return (
<Grid w="full" h="full" templateColumns="auto 1fr">
<ContentSidebar links={links} />
- <VStack w="full" h="full" spacing={0} p={8}>
+ <VStack w="full" h="full" spacing={0} p={8} bg={useColor("white")}>
<Outlet />
</VStack>
</Grid>
diff --git a/apps/carbon/app/routes/x+/resources.person.$personId.notes.delete.$noteId.tsx b/apps/carbon/app/routes/x+/resources.person.$personId.notes.delete.$noteId.tsx
new file mode 100644
index 0000000000..92edbffd57
--- /dev/null
+++ b/apps/carbon/app/routes/x+/resources.person.$personId.notes.delete.$noteId.tsx
@@ -0,0 +1,39 @@
+import type { LoaderArgs } from "@remix-run/node";
+import { redirect } from "@remix-run/node";
+import { requirePermissions } from "~/services/auth";
+import { deleteNote } from "~/services/resources";
+import { flash } from "~/services/session";
+import { error, success } from "~/utils/result";
+
+export async function action({ request, params }: LoaderArgs) {
+ const { client } = await requirePermissions(request, {
+ update: "resources",
+ });
+
+ const { noteId, personId } = params;
+ if (!noteId) {
+ return redirect(
+ "/x/resources/people",
+ await flash(request, error(params, "Failed to get a note id"))
+ );
+ }
+ if (!personId) {
+ return redirect(
+ "/x/resources/people",
+ await flash(request, error(params, "Failed to get a person id"))
+ );
+ }
+
+ const removeNote = await deleteNote(client, noteId);
+ if (removeNote.error) {
+ return redirect(
+ `/x/resources/person/${personId}`,
+ await flash(request, error(removeNote.error, "Failed to delete note"))
+ );
+ }
+
+ return redirect(
+ `/x/resources/person/${personId}`,
+ await flash(request, success("Successfully deleted note"))
+ );
+}
diff --git a/apps/carbon/app/routes/x+/resources.person.$personId.notes.new.tsx b/apps/carbon/app/routes/x+/resources.person.$personId.notes.new.tsx
new file mode 100644
index 0000000000..a448dd7e0f
--- /dev/null
+++ b/apps/carbon/app/routes/x+/resources.person.$personId.notes.new.tsx
@@ -0,0 +1,45 @@
+import type { ActionArgs } from "@remix-run/node";
+import { json } from "@remix-run/node";
+import { redirect } from "react-router";
+import { validationError } from "remix-validated-form";
+import { requirePermissions } from "~/services/auth";
+import { insertNote, noteValidator } from "~/services/resources";
+import { flash } from "~/services/session";
+import { assertIsPost } from "~/utils/http";
+import { error, success } from "~/utils/result";
+
+export async function action({ request, params }: ActionArgs) {
+ assertIsPost(request);
+ const { client, userId: createdBy } = await requirePermissions(request, {
+ create: "resources",
+ });
+
+ const { personId: userId } = params;
+ if (!userId) throw new Error("Missing personId");
+
+ const validation = await noteValidator.validate(await request.formData());
+
+ if (validation.error) {
+ return validationError(validation.error);
+ }
+
+ const { note } = validation.data;
+
+ const createNote = await insertNote(client, {
+ userId,
+ note,
+ createdBy,
+ });
+
+ if (createNote.error) {
+ return json(
+ {},
+ await flash(request, error(createNote.error, "Failed to create note"))
+ );
+ }
+
+ return redirect(
+ `/x/resources/person/${userId}`,
+ await flash(request, success("Sucessfully created note"))
+ );
+}
diff --git a/apps/carbon/app/routes/x+/resources.person.$personId.tsx b/apps/carbon/app/routes/x+/resources.person.$personId.tsx
index 0d81030132..43f125ebd1 100644
--- a/apps/carbon/app/routes/x+/resources.person.$personId.tsx
+++ b/apps/carbon/app/routes/x+/resources.person.$personId.tsx
@@ -74,8 +74,8 @@ export default function PersonRoute() {
<PersonHeader user={user} />
<Grid
gridTemplateColumns="5fr 3fr"
- gridColumnGap={8}
- gridRowGap={8}
+ gridColumnGap={4}
+ gridRowGap={4}
w="full"
>
<PersonTabs
diff --git a/apps/carbon/app/routes/x.tsx b/apps/carbon/app/routes/x.tsx
index a998cc6500..20c28c570a 100644
--- a/apps/carbon/app/routes/x.tsx
+++ b/apps/carbon/app/routes/x.tsx
@@ -1,4 +1,4 @@
-import { useNotification } from "@carbon/react";
+import { useNotification, useColor } from "@carbon/react";
import { Flex, Grid, GridItem, VStack } from "@chakra-ui/react";
import { SkipNavContent } from "@chakra-ui/skip-nav";
import type { LoaderArgs } from "@remix-run/node";
@@ -74,7 +74,7 @@ export default function AuthenticatedRoute() {
<IconSidebar />
<Flex w="full" h="full">
<SkipNavContent />
- <VStack spacing={0} w="full">
+ <VStack spacing={0} w="full" bg={useColor("gray.50")}>
<Outlet />
</VStack>
</Flex>
diff --git a/apps/carbon/app/services/resources/resources.server.ts b/apps/carbon/app/services/resources/resources.server.ts
index d1df9a2c60..b2c2339e22 100644
--- a/apps/carbon/app/services/resources/resources.server.ts
+++ b/apps/carbon/app/services/resources/resources.server.ts
@@ -25,6 +25,13 @@ export async function deleteAttributeCategory(
.eq("id", attributeCategoryId);
}
+export async function deleteNote(
+ client: SupabaseClient<Database>,
+ noteId: string
+) {
+ return client.from("userNote").update({ active: false }).eq("id", noteId);
+}
+
export async function getAttribute(
client: SupabaseClient<Database>,
attributeId: string
@@ -123,7 +130,8 @@ export async function getNotes(
"id, note, createdAt, user!notes_createdBy_fkey(id, fullName, avatarUrl)"
)
.eq("userId", userId)
- .order("createdAt", { ascending: false });
+ .eq("active", true)
+ .order("createdAt");
}
type UserAttributeId = string;
diff --git a/packages/carbon-database/src/types.ts b/packages/carbon-database/src/types.ts
index ea0ac939ce..c260b29a51 100644
--- a/packages/carbon-database/src/types.ts
+++ b/packages/carbon-database/src/types.ts
@@ -4,941 +4,944 @@ export type Json =
| boolean
| null
| { [key: string]: Json }
- | Json[]
+ | Json[];
export interface Database {
public: {
Tables: {
address: {
Row: {
- addressLine1: string | null
- addressLine2: string | null
- city: string | null
- state: string | null
- postalCode: string | null
- countryId: number | null
- phone: string | null
- fax: string | null
- id: string
- }
+ addressLine1: string | null;
+ addressLine2: string | null;
+ city: string | null;
+ state: string | null;
+ postalCode: string | null;
+ countryId: number | null;
+ phone: string | null;
+ fax: string | null;
+ id: string;
+ };
Insert: {
- addressLine1?: string | null
- addressLine2?: string | null
- city?: string | null
- state?: string | null
- postalCode?: string | null
- countryId?: number | null
- phone?: string | null
- fax?: string | null
- id?: string
- }
+ addressLine1?: string | null;
+ addressLine2?: string | null;
+ city?: string | null;
+ state?: string | null;
+ postalCode?: string | null;
+ countryId?: number | null;
+ phone?: string | null;
+ fax?: string | null;
+ id?: string;
+ };
Update: {
- addressLine1?: string | null
- addressLine2?: string | null
- city?: string | null
- state?: string | null
- postalCode?: string | null
- countryId?: number | null
- phone?: string | null
- fax?: string | null
- id?: string
- }
- }
+ addressLine1?: string | null;
+ addressLine2?: string | null;
+ city?: string | null;
+ state?: string | null;
+ postalCode?: string | null;
+ countryId?: number | null;
+ phone?: string | null;
+ fax?: string | null;
+ id?: string;
+ };
+ };
attributeDataType: {
Row: {
- label: string
- id: number
- isBoolean: boolean
- isDate: boolean
- isList: boolean
- isNumeric: boolean
- isText: boolean
- isUser: boolean
- }
+ label: string;
+ id: number;
+ isBoolean: boolean;
+ isDate: boolean;
+ isList: boolean;
+ isNumeric: boolean;
+ isText: boolean;
+ isUser: boolean;
+ };
Insert: {
- label: string
- id?: number
- isBoolean?: boolean
- isDate?: boolean
- isList?: boolean
- isNumeric?: boolean
- isText?: boolean
- isUser?: boolean
- }
+ label: string;
+ id?: number;
+ isBoolean?: boolean;
+ isDate?: boolean;
+ isList?: boolean;
+ isNumeric?: boolean;
+ isText?: boolean;
+ isUser?: boolean;
+ };
Update: {
- label?: string
- id?: number
- isBoolean?: boolean
- isDate?: boolean
- isList?: boolean
- isNumeric?: boolean
- isText?: boolean
- isUser?: boolean
- }
- }
+ label?: string;
+ id?: number;
+ isBoolean?: boolean;
+ isDate?: boolean;
+ isList?: boolean;
+ isNumeric?: boolean;
+ isText?: boolean;
+ isUser?: boolean;
+ };
+ };
contact: {
Row: {
- firstName: string
- lastName: string
- email: string
- title: string | null
- mobilePhone: string | null
- homePhone: string | null
- workPhone: string | null
- fax: string | null
- addressLine1: string | null
- addressLine2: string | null
- city: string | null
- state: string | null
- postalCode: string | null
- countryId: number | null
- birthday: string | null
- notes: string | null
- id: string
- }
+ firstName: string;
+ lastName: string;
+ email: string;
+ title: string | null;
+ mobilePhone: string | null;
+ homePhone: string | null;
+ workPhone: string | null;
+ fax: string | null;
+ addressLine1: string | null;
+ addressLine2: string | null;
+ city: string | null;
+ state: string | null;
+ postalCode: string | null;
+ countryId: number | null;
+ birthday: string | null;
+ notes: string | null;
+ id: string;
+ };
Insert: {
- firstName: string
- lastName: string
- email: string
- title?: string | null
- mobilePhone?: string | null
- homePhone?: string | null
- workPhone?: string | null
- fax?: string | null
- addressLine1?: string | null
- addressLine2?: string | null
- city?: string | null
- state?: string | null
- postalCode?: string | null
- countryId?: number | null
- birthday?: string | null
- notes?: string | null
- id?: string
- }
+ firstName: string;
+ lastName: string;
+ email: string;
+ title?: string | null;
+ mobilePhone?: string | null;
+ homePhone?: string | null;
+ workPhone?: string | null;
+ fax?: string | null;
+ addressLine1?: string | null;
+ addressLine2?: string | null;
+ city?: string | null;
+ state?: string | null;
+ postalCode?: string | null;
+ countryId?: number | null;
+ birthday?: string | null;
+ notes?: string | null;
+ id?: string;
+ };
Update: {
- firstName?: string
- lastName?: string
- email?: string
- title?: string | null
- mobilePhone?: string | null
- homePhone?: string | null
- workPhone?: string | null
- fax?: string | null
- addressLine1?: string | null
- addressLine2?: string | null
- city?: string | null
- state?: string | null
- postalCode?: string | null
- countryId?: number | null
- birthday?: string | null
- notes?: string | null
- id?: string
- }
- }
+ firstName?: string;
+ lastName?: string;
+ email?: string;
+ title?: string | null;
+ mobilePhone?: string | null;
+ homePhone?: string | null;
+ workPhone?: string | null;
+ fax?: string | null;
+ addressLine1?: string | null;
+ addressLine2?: string | null;
+ city?: string | null;
+ state?: string | null;
+ postalCode?: string | null;
+ countryId?: number | null;
+ birthday?: string | null;
+ notes?: string | null;
+ id?: string;
+ };
+ };
country: {
Row: {
- name: string
- code: string
- id: number
- }
+ name: string;
+ code: string;
+ id: number;
+ };
Insert: {
- name: string
- code: string
- id?: number
- }
+ name: string;
+ code: string;
+ id?: number;
+ };
Update: {
- name?: string
- code?: string
- id?: number
- }
- }
+ name?: string;
+ code?: string;
+ id?: number;
+ };
+ };
customer: {
Row: {
- name: string
- description: string | null
- customerTypeId: string | null
- customerStatusId: string | null
- taxId: string | null
- accountManagerId: string | null
- logo: string | null
- createdBy: string | null
- updatedAt: string | null
- updatedBy: string | null
- id: string
- createdAt: string
- }
+ name: string;
+ description: string | null;
+ customerTypeId: string | null;
+ customerStatusId: string | null;
+ taxId: string | null;
+ accountManagerId: string | null;
+ logo: string | null;
+ createdBy: string | null;
+ updatedAt: string | null;
+ updatedBy: string | null;
+ id: string;
+ createdAt: string;
+ };
Insert: {
- name: string
- description?: string | null
- customerTypeId?: string | null
- customerStatusId?: string | null
- taxId?: string | null
- accountManagerId?: string | null
- logo?: string | null
- createdBy?: string | null
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- createdAt?: string
- }
+ name: string;
+ description?: string | null;
+ customerTypeId?: string | null;
+ customerStatusId?: string | null;
+ taxId?: string | null;
+ accountManagerId?: string | null;
+ logo?: string | null;
+ createdBy?: string | null;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
Update: {
- name?: string
- description?: string | null
- customerTypeId?: string | null
- customerStatusId?: string | null
- taxId?: string | null
- accountManagerId?: string | null
- logo?: string | null
- createdBy?: string | null
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- createdAt?: string
- }
- }
+ name?: string;
+ description?: string | null;
+ customerTypeId?: string | null;
+ customerStatusId?: string | null;
+ taxId?: string | null;
+ accountManagerId?: string | null;
+ logo?: string | null;
+ createdBy?: string | null;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
+ };
customerAccount: {
Row: {
- id: string
- customerId: string
- }
+ id: string;
+ customerId: string;
+ };
Insert: {
- id: string
- customerId: string
- }
+ id: string;
+ customerId: string;
+ };
Update: {
- id?: string
- customerId?: string
- }
- }
+ id?: string;
+ customerId?: string;
+ };
+ };
customerContact: {
Row: {
- customerId: string
- contactId: string
- customerLocationId: string | null
- userId: string | null
- id: string
- }
+ customerId: string;
+ contactId: string;
+ customerLocationId: string | null;
+ userId: string | null;
+ id: string;
+ };
Insert: {
- customerId: string
- contactId: string
- customerLocationId?: string | null
- userId?: string | null
- id?: string
- }
+ customerId: string;
+ contactId: string;
+ customerLocationId?: string | null;
+ userId?: string | null;
+ id?: string;
+ };
Update: {
- customerId?: string
- contactId?: string
- customerLocationId?: string | null
- userId?: string | null
- id?: string
- }
- }
+ customerId?: string;
+ contactId?: string;
+ customerLocationId?: string | null;
+ userId?: string | null;
+ id?: string;
+ };
+ };
customerLocation: {
Row: {
- customerId: string
- addressId: string
- id: string
- }
+ customerId: string;
+ addressId: string;
+ id: string;
+ };
Insert: {
- customerId: string
- addressId: string
- id?: string
- }
+ customerId: string;
+ addressId: string;
+ id?: string;
+ };
Update: {
- customerId?: string
- addressId?: string
- id?: string
- }
- }
+ customerId?: string;
+ addressId?: string;
+ id?: string;
+ };
+ };
customerStatus: {
Row: {
- name: string
- updatedAt: string | null
- id: string
- createdAt: string
- }
+ name: string;
+ updatedAt: string | null;
+ id: string;
+ createdAt: string;
+ };
Insert: {
- name: string
- updatedAt?: string | null
- id?: string
- createdAt?: string
- }
+ name: string;
+ updatedAt?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
Update: {
- name?: string
- updatedAt?: string | null
- id?: string
- createdAt?: string
- }
- }
+ name?: string;
+ updatedAt?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
+ };
customerType: {
Row: {
- name: string
- updatedAt: string | null
- id: string
- color: string | null
- protected: boolean
- createdAt: string
- }
+ name: string;
+ updatedAt: string | null;
+ id: string;
+ color: string | null;
+ protected: boolean;
+ createdAt: string;
+ };
Insert: {
- name: string
- updatedAt?: string | null
- id?: string
- color?: string | null
- protected?: boolean
- createdAt?: string
- }
+ name: string;
+ updatedAt?: string | null;
+ id?: string;
+ color?: string | null;
+ protected?: boolean;
+ createdAt?: string;
+ };
Update: {
- name?: string
- updatedAt?: string | null
- id?: string
- color?: string | null
- protected?: boolean
- createdAt?: string
- }
- }
+ name?: string;
+ updatedAt?: string | null;
+ id?: string;
+ color?: string | null;
+ protected?: boolean;
+ createdAt?: string;
+ };
+ };
employee: {
Row: {
- id: string
- employeeTypeId: string
- }
+ id: string;
+ employeeTypeId: string;
+ };
Insert: {
- id: string
- employeeTypeId: string
- }
+ id: string;
+ employeeTypeId: string;
+ };
Update: {
- id?: string
- employeeTypeId?: string
- }
- }
+ id?: string;
+ employeeTypeId?: string;
+ };
+ };
employeeType: {
Row: {
- name: string
- updatedAt: string | null
- id: string
- color: string | null
- protected: boolean
- createdAt: string
- }
+ name: string;
+ updatedAt: string | null;
+ id: string;
+ color: string | null;
+ protected: boolean;
+ createdAt: string;
+ };
Insert: {
- name: string
- updatedAt?: string | null
- id?: string
- color?: string | null
- protected?: boolean
- createdAt?: string
- }
+ name: string;
+ updatedAt?: string | null;
+ id?: string;
+ color?: string | null;
+ protected?: boolean;
+ createdAt?: string;
+ };
Update: {
- name?: string
- updatedAt?: string | null
- id?: string
- color?: string | null
- protected?: boolean
- createdAt?: string
- }
- }
+ name?: string;
+ updatedAt?: string | null;
+ id?: string;
+ color?: string | null;
+ protected?: boolean;
+ createdAt?: string;
+ };
+ };
employeeTypePermission: {
Row: {
- employeeTypeId: string
- featureId: string
- updatedAt: string | null
- create: boolean
- delete: boolean
- update: boolean
- view: boolean
- createdAt: string
- }
+ employeeTypeId: string;
+ featureId: string;
+ updatedAt: string | null;
+ create: boolean;
+ delete: boolean;
+ update: boolean;
+ view: boolean;
+ createdAt: string;
+ };
Insert: {
- employeeTypeId: string
- featureId: string
- updatedAt?: string | null
- create?: boolean
- delete?: boolean
- update?: boolean
- view?: boolean
- createdAt?: string
- }
+ employeeTypeId: string;
+ featureId: string;
+ updatedAt?: string | null;
+ create?: boolean;
+ delete?: boolean;
+ update?: boolean;
+ view?: boolean;
+ createdAt?: string;
+ };
Update: {
- employeeTypeId?: string
- featureId?: string
- updatedAt?: string | null
- create?: boolean
- delete?: boolean
- update?: boolean
- view?: boolean
- createdAt?: string
- }
- }
+ employeeTypeId?: string;
+ featureId?: string;
+ updatedAt?: string | null;
+ create?: boolean;
+ delete?: boolean;
+ update?: boolean;
+ view?: boolean;
+ createdAt?: string;
+ };
+ };
feature: {
Row: {
- name: string
- updatedAt: string | null
- id: string
- createdAt: string
- }
+ name: string;
+ updatedAt: string | null;
+ id: string;
+ createdAt: string;
+ };
Insert: {
- name: string
- updatedAt?: string | null
- id?: string
- createdAt?: string
- }
+ name: string;
+ updatedAt?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
Update: {
- name?: string
- updatedAt?: string | null
- id?: string
- createdAt?: string
- }
- }
+ name?: string;
+ updatedAt?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
+ };
group: {
Row: {
- name: string
- id: string
- updatedAt: string | null
- isIdentityGroup: boolean
- isEmployeeTypeGroup: boolean
- isCustomerOrgGroup: boolean
- isCustomerTypeGroup: boolean
- isSupplierTypeGroup: boolean
- isSupplierOrgGroup: boolean
- createdAt: string
- }
+ name: string;
+ id: string;
+ updatedAt: string | null;
+ isIdentityGroup: boolean;
+ isEmployeeTypeGroup: boolean;
+ isCustomerOrgGroup: boolean;
+ isCustomerTypeGroup: boolean;
+ isSupplierTypeGroup: boolean;
+ isSupplierOrgGroup: boolean;
+ createdAt: string;
+ };
Insert: {
- name: string
- id?: string
- updatedAt?: string | null
- isIdentityGroup?: boolean
- isEmployeeTypeGroup?: boolean
- isCustomerOrgGroup?: boolean
- isCustomerTypeGroup?: boolean
- isSupplierTypeGroup?: boolean
- isSupplierOrgGroup?: boolean
- createdAt?: string
- }
+ name: string;
+ id?: string;
+ updatedAt?: string | null;
+ isIdentityGroup?: boolean;
+ isEmployeeTypeGroup?: boolean;
+ isCustomerOrgGroup?: boolean;
+ isCustomerTypeGroup?: boolean;
+ isSupplierTypeGroup?: boolean;
+ isSupplierOrgGroup?: boolean;
+ createdAt?: string;
+ };
Update: {
- name?: string
- id?: string
- updatedAt?: string | null
- isIdentityGroup?: boolean
- isEmployeeTypeGroup?: boolean
- isCustomerOrgGroup?: boolean
- isCustomerTypeGroup?: boolean
- isSupplierTypeGroup?: boolean
- isSupplierOrgGroup?: boolean
- createdAt?: string
- }
- }
+ name?: string;
+ id?: string;
+ updatedAt?: string | null;
+ isIdentityGroup?: boolean;
+ isEmployeeTypeGroup?: boolean;
+ isCustomerOrgGroup?: boolean;
+ isCustomerTypeGroup?: boolean;
+ isSupplierTypeGroup?: boolean;
+ isSupplierOrgGroup?: boolean;
+ createdAt?: string;
+ };
+ };
membership: {
Row: {
- groupId: string
- memberGroupId: string | null
- memberUserId: string | null
- id: number
- }
+ groupId: string;
+ memberGroupId: string | null;
+ memberUserId: string | null;
+ id: number;
+ };
Insert: {
- groupId: string
- memberGroupId?: string | null
- memberUserId?: string | null
- id?: number
- }
+ groupId: string;
+ memberGroupId?: string | null;
+ memberUserId?: string | null;
+ id?: number;
+ };
Update: {
- groupId?: string
- memberGroupId?: string | null
- memberUserId?: string | null
- id?: number
- }
- }
+ groupId?: string;
+ memberGroupId?: string | null;
+ memberUserId?: string | null;
+ id?: number;
+ };
+ };
search: {
Row: {
- id: number
- name: string
- entity: Database["public"]["Enums"]["search_entity"] | null
- uuid: string | null
- link: string
- description: string | null
- fts: unknown | null
- }
+ id: number;
+ name: string;
+ entity: Database["public"]["Enums"]["search_entity"] | null;
+ uuid: string | null;
+ link: string;
+ description: string | null;
+ fts: unknown | null;
+ };
Insert: {
- id?: number
- name: string
- entity?: Database["public"]["Enums"]["search_entity"] | null
- uuid?: string | null
- link: string
- description?: string | null
- fts?: unknown | null
- }
+ id?: number;
+ name: string;
+ entity?: Database["public"]["Enums"]["search_entity"] | null;
+ uuid?: string | null;
+ link: string;
+ description?: string | null;
+ fts?: unknown | null;
+ };
Update: {
- id?: number
- name?: string
- entity?: Database["public"]["Enums"]["search_entity"] | null
- uuid?: string | null
- link?: string
- description?: string | null
- fts?: unknown | null
- }
- }
+ id?: number;
+ name?: string;
+ entity?: Database["public"]["Enums"]["search_entity"] | null;
+ uuid?: string | null;
+ link?: string;
+ description?: string | null;
+ fts?: unknown | null;
+ };
+ };
supplier: {
Row: {
- name: string
- description: string | null
- supplierTypeId: string | null
- supplierStatusId: string | null
- taxId: string | null
- accountManagerId: string | null
- logo: string | null
- createdBy: string | null
- updatedAt: string | null
- updatedBy: string | null
- id: string
- createdAt: string
- }
+ name: string;
+ description: string | null;
+ supplierTypeId: string | null;
+ supplierStatusId: string | null;
+ taxId: string | null;
+ accountManagerId: string | null;
+ logo: string | null;
+ createdBy: string | null;
+ updatedAt: string | null;
+ updatedBy: string | null;
+ id: string;
+ createdAt: string;
+ };
Insert: {
- name: string
- description?: string | null
- supplierTypeId?: string | null
- supplierStatusId?: string | null
- taxId?: string | null
- accountManagerId?: string | null
- logo?: string | null
- createdBy?: string | null
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- createdAt?: string
- }
+ name: string;
+ description?: string | null;
+ supplierTypeId?: string | null;
+ supplierStatusId?: string | null;
+ taxId?: string | null;
+ accountManagerId?: string | null;
+ logo?: string | null;
+ createdBy?: string | null;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
Update: {
- name?: string
- description?: string | null
- supplierTypeId?: string | null
- supplierStatusId?: string | null
- taxId?: string | null
- accountManagerId?: string | null
- logo?: string | null
- createdBy?: string | null
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- createdAt?: string
- }
- }
+ name?: string;
+ description?: string | null;
+ supplierTypeId?: string | null;
+ supplierStatusId?: string | null;
+ taxId?: string | null;
+ accountManagerId?: string | null;
+ logo?: string | null;
+ createdBy?: string | null;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
+ };
supplierAccount: {
Row: {
- id: string
- supplierId: string
- }
+ id: string;
+ supplierId: string;
+ };
Insert: {
- id: string
- supplierId: string
- }
+ id: string;
+ supplierId: string;
+ };
Update: {
- id?: string
- supplierId?: string
- }
- }
+ id?: string;
+ supplierId?: string;
+ };
+ };
supplierContact: {
Row: {
- supplierId: string
- contactId: string
- supplierLocationId: string | null
- userId: string | null
- id: string
- }
+ supplierId: string;
+ contactId: string;
+ supplierLocationId: string | null;
+ userId: string | null;
+ id: string;
+ };
Insert: {
- supplierId: string
- contactId: string
- supplierLocationId?: string | null
- userId?: string | null
- id?: string
- }
+ supplierId: string;
+ contactId: string;
+ supplierLocationId?: string | null;
+ userId?: string | null;
+ id?: string;
+ };
Update: {
- supplierId?: string
- contactId?: string
- supplierLocationId?: string | null
- userId?: string | null
- id?: string
- }
- }
+ supplierId?: string;
+ contactId?: string;
+ supplierLocationId?: string | null;
+ userId?: string | null;
+ id?: string;
+ };
+ };
supplierLocation: {
Row: {
- supplierId: string
- addressId: string
- id: string
- }
+ supplierId: string;
+ addressId: string;
+ id: string;
+ };
Insert: {
- supplierId: string
- addressId: string
- id?: string
- }
+ supplierId: string;
+ addressId: string;
+ id?: string;
+ };
Update: {
- supplierId?: string
- addressId?: string
- id?: string
- }
- }
+ supplierId?: string;
+ addressId?: string;
+ id?: string;
+ };
+ };
supplierStatus: {
Row: {
- name: string
- updatedAt: string | null
- id: string
- createdAt: string
- }
+ name: string;
+ updatedAt: string | null;
+ id: string;
+ createdAt: string;
+ };
Insert: {
- name: string
- updatedAt?: string | null
- id?: string
- createdAt?: string
- }
+ name: string;
+ updatedAt?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
Update: {
- name?: string
- updatedAt?: string | null
- id?: string
- createdAt?: string
- }
- }
+ name?: string;
+ updatedAt?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
+ };
supplierType: {
Row: {
- name: string
- updatedAt: string | null
- id: string
- color: string | null
- protected: boolean
- createdAt: string
- }
+ name: string;
+ updatedAt: string | null;
+ id: string;
+ color: string | null;
+ protected: boolean;
+ createdAt: string;
+ };
Insert: {
- name: string
- updatedAt?: string | null
- id?: string
- color?: string | null
- protected?: boolean
- createdAt?: string
- }
+ name: string;
+ updatedAt?: string | null;
+ id?: string;
+ color?: string | null;
+ protected?: boolean;
+ createdAt?: string;
+ };
Update: {
- name?: string
- updatedAt?: string | null
- id?: string
- color?: string | null
- protected?: boolean
- createdAt?: string
- }
- }
+ name?: string;
+ updatedAt?: string | null;
+ id?: string;
+ color?: string | null;
+ protected?: boolean;
+ createdAt?: string;
+ };
+ };
user: {
Row: {
- id: string
- email: string
- firstName: string
- lastName: string
- avatarUrl: string | null
- emailVerified: string | null
- updatedAt: string | null
- fullName: string | null
- about: string
- active: boolean | null
- createdAt: string
- }
+ id: string;
+ email: string;
+ firstName: string;
+ lastName: string;
+ avatarUrl: string | null;
+ emailVerified: string | null;
+ updatedAt: string | null;
+ fullName: string | null;
+ about: string;
+ active: boolean | null;
+ createdAt: string;
+ };
Insert: {
- id: string
- email: string
- firstName: string
- lastName: string
- avatarUrl?: string | null
- emailVerified?: string | null
- updatedAt?: string | null
- fullName?: string | null
- about?: string
- active?: boolean | null
- createdAt?: string
- }
+ id: string;
+ email: string;
+ firstName: string;
+ lastName: string;
+ avatarUrl?: string | null;
+ emailVerified?: string | null;
+ updatedAt?: string | null;
+ fullName?: string | null;
+ about?: string;
+ active?: boolean | null;
+ createdAt?: string;
+ };
Update: {
- id?: string
- email?: string
- firstName?: string
- lastName?: string
- avatarUrl?: string | null
- emailVerified?: string | null
- updatedAt?: string | null
- fullName?: string | null
- about?: string
- active?: boolean | null
- createdAt?: string
- }
- }
+ id?: string;
+ email?: string;
+ firstName?: string;
+ lastName?: string;
+ avatarUrl?: string | null;
+ emailVerified?: string | null;
+ updatedAt?: string | null;
+ fullName?: string | null;
+ about?: string;
+ active?: boolean | null;
+ createdAt?: string;
+ };
+ };
userAttribute: {
Row: {
- name: string
- userAttributeCategoryId: string
- attributeDataTypeId: number
- listOptions: string[] | null
- createdBy: string
- updatedAt: string | null
- updatedBy: string | null
- id: string
- sortOrder: number
- canSelfManage: boolean | null
- active: boolean | null
- createdAt: string
- }
+ name: string;
+ userAttributeCategoryId: string;
+ attributeDataTypeId: number;
+ listOptions: string[] | null;
+ createdBy: string;
+ updatedAt: string | null;
+ updatedBy: string | null;
+ id: string;
+ sortOrder: number;
+ canSelfManage: boolean | null;
+ active: boolean | null;
+ createdAt: string;
+ };
Insert: {
- name: string
- userAttributeCategoryId: string
- attributeDataTypeId: number
- listOptions?: string[] | null
- createdBy: string
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- sortOrder?: number
- canSelfManage?: boolean | null
- active?: boolean | null
- createdAt?: string
- }
+ name: string;
+ userAttributeCategoryId: string;
+ attributeDataTypeId: number;
+ listOptions?: string[] | null;
+ createdBy: string;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ sortOrder?: number;
+ canSelfManage?: boolean | null;
+ active?: boolean | null;
+ createdAt?: string;
+ };
Update: {
- name?: string
- userAttributeCategoryId?: string
- attributeDataTypeId?: number
- listOptions?: string[] | null
- createdBy?: string
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- sortOrder?: number
- canSelfManage?: boolean | null
- active?: boolean | null
- createdAt?: string
- }
- }
+ name?: string;
+ userAttributeCategoryId?: string;
+ attributeDataTypeId?: number;
+ listOptions?: string[] | null;
+ createdBy?: string;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ sortOrder?: number;
+ canSelfManage?: boolean | null;
+ active?: boolean | null;
+ createdAt?: string;
+ };
+ };
userAttributeCategory: {
Row: {
- name: string
- createdBy: string
- updatedAt: string | null
- updatedBy: string | null
- id: string
- public: boolean | null
- protected: boolean | null
- active: boolean | null
- createdAt: string
- }
+ name: string;
+ createdBy: string;
+ updatedAt: string | null;
+ updatedBy: string | null;
+ id: string;
+ public: boolean | null;
+ protected: boolean | null;
+ active: boolean | null;
+ createdAt: string;
+ };
Insert: {
- name: string
- createdBy: string
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- public?: boolean | null
- protected?: boolean | null
- active?: boolean | null
- createdAt?: string
- }
+ name: string;
+ createdBy: string;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ public?: boolean | null;
+ protected?: boolean | null;
+ active?: boolean | null;
+ createdAt?: string;
+ };
Update: {
- name?: string
- createdBy?: string
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- public?: boolean | null
- protected?: boolean | null
- active?: boolean | null
- createdAt?: string
- }
- }
+ name?: string;
+ createdBy?: string;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ public?: boolean | null;
+ protected?: boolean | null;
+ active?: boolean | null;
+ createdAt?: string;
+ };
+ };
userAttributeValue: {
Row: {
- userAttributeId: string
- userId: string
- valueBoolean: boolean | null
- valueDate: string | null
- valueNumeric: number | null
- valueText: string | null
- valueUser: string | null
- createdBy: string
- updatedAt: string | null
- updatedBy: string | null
- id: string
- createdAt: string
- }
+ userAttributeId: string;
+ userId: string;
+ valueBoolean: boolean | null;
+ valueDate: string | null;
+ valueNumeric: number | null;
+ valueText: string | null;
+ valueUser: string | null;
+ createdBy: string;
+ updatedAt: string | null;
+ updatedBy: string | null;
+ id: string;
+ createdAt: string;
+ };
Insert: {
- userAttributeId: string
- userId: string
- valueBoolean?: boolean | null
- valueDate?: string | null
- valueNumeric?: number | null
- valueText?: string | null
- valueUser?: string | null
- createdBy: string
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- createdAt?: string
- }
+ userAttributeId: string;
+ userId: string;
+ valueBoolean?: boolean | null;
+ valueDate?: string | null;
+ valueNumeric?: number | null;
+ valueText?: string | null;
+ valueUser?: string | null;
+ createdBy: string;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
Update: {
- userAttributeId?: string
- userId?: string
- valueBoolean?: boolean | null
- valueDate?: string | null
- valueNumeric?: number | null
- valueText?: string | null
- valueUser?: string | null
- createdBy?: string
- updatedAt?: string | null
- updatedBy?: string | null
- id?: string
- createdAt?: string
- }
- }
+ userAttributeId?: string;
+ userId?: string;
+ valueBoolean?: boolean | null;
+ valueDate?: string | null;
+ valueNumeric?: number | null;
+ valueText?: string | null;
+ valueUser?: string | null;
+ createdBy?: string;
+ updatedAt?: string | null;
+ updatedBy?: string | null;
+ id?: string;
+ createdAt?: string;
+ };
+ };
userNote: {
Row: {
- userId: string
- note: string
- createdBy: string
- id: string
- createdAt: string
- updatedAt: string | null
- }
+ userId: string;
+ note: string;
+ id: string;
+ active: boolean;
+ createdAt: string;
+ createdBy: string;
+ updatedAt: string | null;
+ };
Insert: {
- userId: string
- note: string
- createdBy: string
- id?: string
- createdAt?: string
- updatedAt?: string | null
- }
+ userId: string;
+ note: string;
+ id?: string;
+ active?: boolean;
+ createdAt?: string;
+ createdBy: string;
+ updatedAt?: string | null;
+ };
Update: {
- userId?: string
- note?: string
- createdBy?: string
- id?: string
- createdAt?: string
- updatedAt?: string | null
- }
- }
- }
+ userId?: string;
+ note?: string;
+ id?: string;
+ active?: boolean;
+ createdAt?: string;
+ createdBy?: string;
+ updatedAt?: string | null;
+ };
+ };
+ };
Views: {
group_member: {
Row: {
- id: number | null
- name: string | null
- isIdentityGroup: boolean | null
- isEmployeeTypeGroup: boolean | null
- isCustomerOrgGroup: boolean | null
- isCustomerTypeGroup: boolean | null
- isSupplierOrgGroup: boolean | null
- isSupplierTypeGroup: boolean | null
- groupId: string | null
- memberGroupId: string | null
- memberUserId: string | null
- user: Json | null
- }
- }
+ id: number | null;
+ name: string | null;
+ isIdentityGroup: boolean | null;
+ isEmployeeTypeGroup: boolean | null;
+ isCustomerOrgGroup: boolean | null;
+ isCustomerTypeGroup: boolean | null;
+ isSupplierOrgGroup: boolean | null;
+ isSupplierTypeGroup: boolean | null;
+ groupId: string | null;
+ memberGroupId: string | null;
+ memberUserId: string | null;
+ user: Json | null;
+ };
+ };
groups_recursive: {
Row: {
- groupId: string | null
- name: string | null
- parentId: string | null
- isIdentityGroup: boolean | null
- isEmployeeTypeGroup: boolean | null
- isCustomerOrgGroup: boolean | null
- isCustomerTypeGroup: boolean | null
- isSupplierOrgGroup: boolean | null
- isSupplierTypeGroup: boolean | null
- user: Json | null
- }
- }
+ groupId: string | null;
+ name: string | null;
+ parentId: string | null;
+ isIdentityGroup: boolean | null;
+ isEmployeeTypeGroup: boolean | null;
+ isCustomerOrgGroup: boolean | null;
+ isCustomerTypeGroup: boolean | null;
+ isSupplierOrgGroup: boolean | null;
+ isSupplierTypeGroup: boolean | null;
+ user: Json | null;
+ };
+ };
groups_view: {
Row: {
- id: string | null
- isEmployeeTypeGroup: boolean | null
- isCustomerOrgGroup: boolean | null
- isCustomerTypeGroup: boolean | null
- isSupplierOrgGroup: boolean | null
- isSupplierTypeGroup: boolean | null
- name: string | null
- parentId: string | null
- users: Json | null
- }
- }
- }
+ id: string | null;
+ isEmployeeTypeGroup: boolean | null;
+ isCustomerOrgGroup: boolean | null;
+ isCustomerTypeGroup: boolean | null;
+ isSupplierOrgGroup: boolean | null;
+ isSupplierTypeGroup: boolean | null;
+ name: string | null;
+ parentId: string | null;
+ users: Json | null;
+ };
+ };
+ };
Functions: {
_xid_machine_id: {
- Args: Record<PropertyKey, never>
- Returns: number
- }
+ Args: Record<PropertyKey, never>;
+ Returns: number;
+ };
delete_claim: {
- Args: { uid: string; claim: string }
- Returns: string
- }
+ Args: { uid: string; claim: string };
+ Returns: string;
+ };
get_claim: {
- Args: { uid: string; claim: string }
- Returns: Json
- }
+ Args: { uid: string; claim: string };
+ Returns: Json;
+ };
get_claims: {
- Args: { uid: string }
- Returns: Json
- }
+ Args: { uid: string };
+ Returns: Json;
+ };
get_my_claim: {
- Args: { claim: string }
- Returns: Json
- }
+ Args: { claim: string };
+ Returns: Json;
+ };
get_my_claims: {
- Args: Record<PropertyKey, never>
- Returns: Json
- }
+ Args: Record<PropertyKey, never>;
+ Returns: Json;
+ };
groups_for_user: {
- Args: { uid: string }
- Returns: Json
- }
+ Args: { uid: string };
+ Returns: Json;
+ };
groups_query: {
- Args: { _name: string; _uid: string }
+ Args: { _name: string; _uid: string };
Returns: {
- id: string
- name: string
- parentId: string
- isEmployeeTypeGroup: boolean
- isCustomerOrgGroup: boolean
- isCustomerTypeGroup: boolean
- isSupplierOrgGroup: boolean
- isSupplierTypeGroup: boolean
- users: Json
- }[]
- }
+ id: string;
+ name: string;
+ parentId: string;
+ isEmployeeTypeGroup: boolean;
+ isCustomerOrgGroup: boolean;
+ isCustomerTypeGroup: boolean;
+ isSupplierOrgGroup: boolean;
+ isSupplierTypeGroup: boolean;
+ users: Json;
+ }[];
+ };
is_claims_admin: {
- Args: Record<PropertyKey, never>
- Returns: boolean
- }
+ Args: Record<PropertyKey, never>;
+ Returns: boolean;
+ };
set_claim: {
- Args: { uid: string; claim: string; value: Json }
- Returns: string
- }
+ Args: { uid: string; claim: string; value: Json };
+ Returns: string;
+ };
users_for_groups: {
- Args: { groups: string[] }
- Returns: Json
- }
+ Args: { groups: string[] };
+ Returns: Json;
+ };
xid: {
- Args: { _at: string }
- Returns: unknown
- }
+ Args: { _at: string };
+ Returns: unknown;
+ };
xid_counter: {
- Args: { _xid: unknown }
- Returns: number
- }
+ Args: { _xid: unknown };
+ Returns: number;
+ };
xid_decode: {
- Args: { _xid: unknown }
- Returns: number[]
- }
+ Args: { _xid: unknown };
+ Returns: number[];
+ };
xid_encode: {
- Args: { _id: number[] }
- Returns: unknown
- }
+ Args: { _id: number[] };
+ Returns: unknown;
+ };
xid_machine: {
- Args: { _xid: unknown }
- Returns: number[]
- }
+ Args: { _xid: unknown };
+ Returns: number[];
+ };
xid_pid: {
- Args: { _xid: unknown }
- Returns: number
- }
+ Args: { _xid: unknown };
+ Returns: number;
+ };
xid_time: {
- Args: { _xid: unknown }
- Returns: string
- }
- }
+ Args: { _xid: unknown };
+ Returns: string;
+ };
+ };
Enums: {
search_entity:
| "Resource"
@@ -949,8 +952,7 @@ export interface Database {
| "Part"
| "Purchase Order"
| "Sales Order"
- | "Document"
- }
- }
+ | "Document";
+ };
+ };
}
-
diff --git a/packages/carbon-database/supabase/migrations/20230209041302_notes.sql b/packages/carbon-database/supabase/migrations/20230209041302_notes.sql
index 7ed87e69c3..9c92be0f59 100644
--- a/packages/carbon-database/supabase/migrations/20230209041302_notes.sql
+++ b/packages/carbon-database/supabase/migrations/20230209041302_notes.sql
@@ -2,6 +2,7 @@ CREATE TABLE "userNote" (
"id" TEXT NOT NULL DEFAULT xid(),
"userId" TEXT NOT NULL,
"note" TEXT NOT NULL,
+ "active" BOOLEAN NOT NULL DEFAULT true,
"createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(),
"createdBy" TEXT NOT NULL,
"updatedAt" TIMESTAMP WITH TIME ZONE,
diff --git a/packages/carbon-react/src/Theme/theme.ts b/packages/carbon-react/src/Theme/theme.ts
index 33445e1b1a..a4272cc07d 100644
--- a/packages/carbon-react/src/Theme/theme.ts
+++ b/packages/carbon-react/src/Theme/theme.ts
@@ -80,6 +80,11 @@ export const theme = {
defaultProps: {},
},
Input: {
+ baseStyle: {
+ field: {
+ background: "white",
+ },
+ },
defaultProps: {
borderRadius: "md",
},