Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@

---

## TL;DR
<!-- TLDR Guide
List any steps devs have to take after pulling this down
-->

---

## Gallery
<!-- Gallery Guide
Delete if irrelevant
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ The project follows a standard SvelteKit structure:

## Documentation

- [FUNCTIONAL.md](./HITL_Docs/FUNCTIONAL.md) - Functional requirements
- [ARCHITECTURE.md](./HITL_Docs/ARCHITECTURE.md) - Technical architecture
- [TESTING.md](./HITL_Docs/TESTING.md) - Testing guide
- [FUNCTIONAL.md](./docs/HITL_Docs/FUNCTIONAL.md) - Functional requirements
- [ARCHITECTURE.md](./docs/HITL_Docs/ARCHITECTURE.md) - Technical architecture
- [TESTING.md](./docs/HITL_Docs/TESTING.md) - Testing guide

Explore this codebase on [![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/foundersandcoders/LIFT02)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
12 changes: 11 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"dependencies": {
"@fontsource/metropolis": "^5.2.5",
"@supabase/supabase-js": "^2.49.8",
"dotenv": "^16.5.0"
"dotenv": "^16.5.0",
"zod": "^3.25.51"
}
}
63 changes: 63 additions & 0 deletions src/lib/types/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import type { User, Employer, Pronouns } from "./sub";

export type Input = Profile | Question | Response | Action | Share;

export interface Profile {
id?: string;
name: string;
user: User;
pronouns?: Pronouns;
jobTitle?: string;
employer: Employer
}

export interface Question {
id?: string,
category: string,
question_text: string,
order: number
}

export interface Response {
id?: string,
user_id: string,
question_id: string,
response_text: string,
status?: "answered" | "skipped",
visibility: "public" | "private",
version: number,
is_latest: boolean,
created_at?: string, // TODO: Temporal()
updated_at?: string, // TODO: Temporal()
shares?: Share[] // sharing_event_responses
}

export interface Action {
id?: string,
user_id: string,
response_id?: string,
type: string,
description?: string,
version: number,
is_latest: boolean,
status: "draft" | "active" | "archived",
created_at?: string, // TODO: Temporal()
updated_at?: string // TODO: Temporal(),
shares?: Share[] // sharing_event_actions
}

export interface Share {
id?: string,
user_id: string,
recipient_email?: string,
/* note: Recipient Email
This makes sense for now, as the manager email is just a prop on the Profile
However, there's a line manager id prop earmarked for later use

If a table is implemented for Line Managers, this prop should be replaced by a foreign key to it
*/
message?: string,
responses?: Response[], // sharing_event_responses
actions?: Action[], // sharing_event_actions
shared_at?: string // TODO: Temporal()
}
23 changes: 23 additions & 0 deletions src/lib/types/sub.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { z } from "zod";
import * as check from "./validate";

export type User = z.infer<typeof check.User>;

export interface Employer {
name?: string,
id?: string,
manager: Manager
}

export interface Manager {
id?: string,
name?: string,
pronouns?: Pronouns,
email?: string,
};

export type Pronouns = [
subject: string,
object: string,
possessive: string
];
6 changes: 6 additions & 0 deletions src/lib/types/validate.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { z } from "zod";

export const User = z.object({
userId: z.string().optional(),
email: z.string().email(),
});
File renamed without changes.
4 changes: 3 additions & 1 deletion supabase/migrations/20250528170555_schema_tweaks.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
-- Status
-- Add status column with active/archived options
alter table actions
add column status text not null default 'active' check (status in ('active', 'archived'));
add column status text not null default 'draft' check (
status in ('draft', 'active', 'archived')
);

-- Version
-- Create a sequence that increments by 1 when edited
Expand Down