Skip to content

Commit 7d02b6c

Browse files
committed
Merge branch 'main' into chore/user-exist-checking
2 parents 27cea25 + 16c7022 commit 7d02b6c

15 files changed

Lines changed: 4715 additions & 13 deletions

File tree

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
create table "public"."qr_code" (
2+
"id" uuid not null default gen_random_uuid(),
3+
"short_code" text not null,
4+
"target_url" text,
5+
"qr_type" character varying,
6+
"design_settings" json,
7+
"created_at" timestamp without time zone,
8+
"scan_count" bigint,
9+
"user_id" uuid default gen_random_uuid()
10+
);
11+
12+
13+
alter table "public"."qr_code" enable row level security;
14+
15+
16+
create table "public"."scans" (
17+
"id" uuid not null default gen_random_uuid(),
18+
"qr_id" uuid not null default auth.uid(),
19+
"scanned_at" timestamp without time zone,
20+
"device_type" character varying,
21+
"country" character varying,
22+
"ip_address" text
23+
);
24+
25+
26+
alter table "public"."scans" enable row level security;
27+
28+
CREATE UNIQUE INDEX qr_code_pkey ON public.qr_code USING btree (id);
29+
30+
CREATE UNIQUE INDEX scans_pkey ON public.scans USING btree (id);
31+
32+
alter table "public"."qr_code" add constraint "qr_code_pkey" PRIMARY KEY using index "qr_code_pkey";
33+
34+
alter table "public"."scans" add constraint "scans_pkey" PRIMARY KEY using index "scans_pkey";
35+
36+
alter table "public"."qr_code" add constraint "qr_code_user_id_fkey" FOREIGN KEY (user_id) REFERENCES public.users(id) ON UPDATE CASCADE ON DELETE CASCADE not valid;
37+
38+
alter table "public"."qr_code" validate constraint "qr_code_user_id_fkey";
39+
40+
alter table "public"."scans" add constraint "scans_qr_id_fkey" FOREIGN KEY (qr_id) REFERENCES public.qr_code(id) ON UPDATE CASCADE ON DELETE CASCADE not valid;
41+
42+
alter table "public"."scans" validate constraint "scans_qr_id_fkey";
43+
44+
grant delete on table "public"."qr_code" to "anon";
45+
46+
grant insert on table "public"."qr_code" to "anon";
47+
48+
grant references on table "public"."qr_code" to "anon";
49+
50+
grant select on table "public"."qr_code" to "anon";
51+
52+
grant trigger on table "public"."qr_code" to "anon";
53+
54+
grant truncate on table "public"."qr_code" to "anon";
55+
56+
grant update on table "public"."qr_code" to "anon";
57+
58+
grant delete on table "public"."qr_code" to "authenticated";
59+
60+
grant insert on table "public"."qr_code" to "authenticated";
61+
62+
grant references on table "public"."qr_code" to "authenticated";
63+
64+
grant select on table "public"."qr_code" to "authenticated";
65+
66+
grant trigger on table "public"."qr_code" to "authenticated";
67+
68+
grant truncate on table "public"."qr_code" to "authenticated";
69+
70+
grant update on table "public"."qr_code" to "authenticated";
71+
72+
grant delete on table "public"."qr_code" to "service_role";
73+
74+
grant insert on table "public"."qr_code" to "service_role";
75+
76+
grant references on table "public"."qr_code" to "service_role";
77+
78+
grant select on table "public"."qr_code" to "service_role";
79+
80+
grant trigger on table "public"."qr_code" to "service_role";
81+
82+
grant truncate on table "public"."qr_code" to "service_role";
83+
84+
grant update on table "public"."qr_code" to "service_role";
85+
86+
grant delete on table "public"."scans" to "anon";
87+
88+
grant insert on table "public"."scans" to "anon";
89+
90+
grant references on table "public"."scans" to "anon";
91+
92+
grant select on table "public"."scans" to "anon";
93+
94+
grant trigger on table "public"."scans" to "anon";
95+
96+
grant truncate on table "public"."scans" to "anon";
97+
98+
grant update on table "public"."scans" to "anon";
99+
100+
grant delete on table "public"."scans" to "authenticated";
101+
102+
grant insert on table "public"."scans" to "authenticated";
103+
104+
grant references on table "public"."scans" to "authenticated";
105+
106+
grant select on table "public"."scans" to "authenticated";
107+
108+
grant trigger on table "public"."scans" to "authenticated";
109+
110+
grant truncate on table "public"."scans" to "authenticated";
111+
112+
grant update on table "public"."scans" to "authenticated";
113+
114+
grant delete on table "public"."scans" to "service_role";
115+
116+
grant insert on table "public"."scans" to "service_role";
117+
118+
grant references on table "public"."scans" to "service_role";
119+
120+
grant select on table "public"."scans" to "service_role";
121+
122+
grant trigger on table "public"."scans" to "service_role";
123+
124+
grant truncate on table "public"."scans" to "service_role";
125+
126+
grant update on table "public"."scans" to "service_role";
127+
128+

apps/web/package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,10 @@
8080
"octokit": "^5.0.5",
8181
"papaparse": "^5.5.3",
8282
"phaser": "^3.90.0",
83+
"qr-code-styling": "^1.9.2",
8384
"qrcode.react": "^4.2.0",
8485
"react": "^19.2.6",
86+
"react-color-pikr": "^1.1.2",
8587
"react-confetti": "^6.4.0",
8688
"react-dom": "^19.2.6",
8789
"react-intersection-observer": "^10.0.3",

apps/web/src/app/[locale]/(dashboard)/[wsId]/finance/transactions/[transactionId]/objects.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
'use client';
22

3-
import { TransactionObjectRowActions } from './row-actions';
4-
import { joinPath } from '@/utils/path-helper';
5-
import { StorageObject } from '@ncthub/types/primitives/StorageObject';
3+
import type { StorageObject } from '@ncthub/types/primitives/StorageObject';
64
import { Button } from '@ncthub/ui/button';
75
import { FileText, LayoutGrid, LayoutList } from '@ncthub/ui/icons';
86
import { Separator } from '@ncthub/ui/separator';
9-
import { useTranslations } from 'next-intl';
107
import Image from 'next/image';
118
import Link from 'next/link';
9+
import { useTranslations } from 'next-intl';
1210
import { useState } from 'react';
11+
import { joinPath } from '@/utils/path-helper';
12+
import { TransactionObjectRowActions } from './row-actions';
1313

1414
export function DetailObjects({
1515
wsId,
@@ -25,7 +25,7 @@ export function DetailObjects({
2525

2626
return (
2727
<div className="h-fit space-y-2 rounded-lg border p-4">
28-
<div className="flex justify-between text-lg font-semibold">
28+
<div className="flex justify-between font-semibold text-lg">
2929
{t('invoices.files')}
3030
<div className="flex gap-2">
3131
<Button variant="ghost" size="xs" asChild>

0 commit comments

Comments
 (0)