@trycompai/db 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +9 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.js +39 -0
- package/dist/index.mjs +14 -0
- package/dist/prisma/functionDefinition.sql +18 -0
- package/dist/prisma/migrations/20250403163138_init/migration.sql +611 -0
- package/dist/prisma/migrations/20250403165218_archived_on_its_own/migration.sql +29 -0
- package/dist/prisma/migrations/20250403194504_risk_assignee/migration.sql +18 -0
- package/dist/prisma/migrations/20250403201319_tasks_use_asignee/migration.sql +16 -0
- package/dist/prisma/migrations/20250403205655_vendor_assignee/migration.sql +22 -0
- package/dist/prisma/migrations/20250403205840_oops_optional/migration.sql +2 -0
- package/dist/prisma/migrations/20250403210049_task_assignee_optional_too/migration.sql +8 -0
- package/dist/prisma/migrations/20250404004853_stripecustomerid/migration.sql +2 -0
- package/dist/prisma/migrations/20250406004306_added_common_comment_table/migration.sql +20 -0
- package/dist/prisma/migrations/20250410193847_add_unique_constraint_to_artifact_t_table/migration.sql +30 -0
- package/dist/prisma/migrations/20250410193857_remove_published_field_from_evidence/migration.sql +12 -0
- package/dist/prisma/migrations/20250414191353_onboarding_experience/migration.sql +25 -0
- package/dist/prisma/migrations/20250414203443_added_evidence_to_onboarding/migration.sql +2 -0
- package/dist/prisma/migrations/20250417205622_add_global_vendors/migration.sql +26 -0
- package/dist/prisma/migrations/20250417205625_update_task_table_and_comments_and_attachments/migration.sql +86 -0
- package/dist/prisma/migrations/20250417205627_remove_evidence_table/migration.sql +109 -0
- package/dist/prisma/migrations/20250417205629_frequency_task_is_optional/migration.sql +2 -0
- package/dist/prisma/migrations/20250418151856_add_comment_relationship_to_attachment_and_vice_versa/migration.sql +8 -0
- package/dist/prisma/migrations/20250423154259_make_role_string/migration.sql +9 -0
- package/dist/prisma/migrations/20250424165055_update_onboarding_to_use_tasks/migration.sql +9 -0
- package/dist/prisma/migrations/20250424170518_remove_evidence_artifact_type/migration.sql +14 -0
- package/dist/prisma/migrations/20250428202144_add_website_to_organization/migration.sql +2 -0
- package/dist/prisma/migrations/20250429155419_add_company_details_to_onboarding/migration.sql +2 -0
- package/dist/prisma/migrations/20250509160401_added_framework_editor/migration.sql +8 -0
- package/dist/prisma/migrations/20250509162708_init_framework_editor_tables/migration.sql +122 -0
- package/dist/prisma/migrations/20250509172401_drop_slug/migration.sql +11 -0
- package/dist/prisma/migrations/20250509232122_trust_portal/migration.sql +24 -0
- package/dist/prisma/migrations/20250511040043_add_custom_domain_to_trust_portal/migration.sql +2 -0
- package/dist/prisma/migrations/20250511042943_trust_portal_domain_verified/migration.sql +2 -0
- package/dist/prisma/migrations/20250512004633_added_identifier/migration.sql +5 -0
- package/dist/prisma/migrations/20250512115717_added_framework_status/migration.sql +7 -0
- package/dist/prisma/migrations/20250512163351_add_contact_details_trust_portal/migration.sql +2 -0
- package/dist/prisma/migrations/20250514143147_remove_unique_constraint_on_integration_name/migration.sql +2 -0
- package/dist/prisma/migrations/20250514144228_add_vercel_check/migration.sql +2 -0
- package/dist/prisma/migrations/20250514150021_add_vercel_verification/migration.sql +2 -0
- package/dist/prisma/migrations/20250514161440_add_dates_to_framework_editor_tables/migration.sql +23 -0
- package/dist/prisma/migrations/20250515123635_trust_portal_friendly_url/migration.sql +21 -0
- package/dist/prisma/migrations/20250515124040_fix_trust_constraints/migration.sql +11 -0
- package/dist/prisma/migrations/20250516125758_patch_framework_id_in_editor/migration.sql +6 -0
- package/dist/prisma/migrations/20250516132431_add_many_to_many_support_to_tasks/migration.sql +69 -0
- package/dist/prisma/migrations/20250516142234_make_entity_optional/migration.sql +3 -0
- package/dist/prisma/migrations/20250516145149_drop_entity_and_entity_type/migration.sql +16 -0
- package/dist/prisma/migrations/20250516150558_drop_task_type/migration.sql +2 -0
- package/dist/prisma/migrations/20250516160714_insert_hardcoded_framework_to_db/migration.sql +37 -0
- package/dist/prisma/migrations/20250516161852_cast_framework_id_and_requirement_id_to_string/migration.sql +5 -0
- package/dist/prisma/migrations/20250516162324_convert_ids_to_new_format/migration.sql +31 -0
- package/dist/prisma/migrations/20250516162730_convert_framework_id/migration.sql +5 -0
- package/dist/prisma/migrations/20250516163156_added_relation_to_framework_and_requirement_maps/migration.sql +5 -0
- package/dist/prisma/migrations/20250516164307_drop_enums/migration.sql +5 -0
- package/dist/prisma/migrations/20250516194123_add_cal_option/migration.sql +2 -0
- package/dist/prisma/migrations/20250518133218_add_booking_details/migration.sql +2 -0
- package/dist/prisma/migrations/20250519141733_change_framework_id_to_string/migration.sql +3 -0
- package/dist/prisma/migrations/20250519141735_drop_enum_on_requirements_map/migration.sql +2 -0
- package/dist/prisma/migrations/20250519142913_add_template_references_to_instances/migration.sql +17 -0
- package/dist/prisma/migrations/20250519172353_drop_artifacts/migration.sql +56 -0
- package/dist/prisma/migrations/20250519204449_drop_relation_between_controls_and_framewrok_instance/migration.sql +14 -0
- package/dist/prisma/migrations/20250519212347_add_visibility_toggle_to_framework_editor/migration.sql +2 -0
- package/dist/prisma/migrations/20250520152548_add_approver_to_policy/migration.sql +5 -0
- package/dist/prisma/migrations/20250520175109_add_description_to_audit_log_for_convenience/migration.sql +2 -0
- package/dist/prisma/migrations/20250520175523_add_member_id_to_log_table/migration.sql +8 -0
- package/dist/prisma/migrations/20250521140239_add_entity_type_and_id_for_audit_logs_for_easy_filtering/migration.sql +9 -0
- package/dist/prisma/migrations/20250603135046_add_v2_onboarding_requirements/migration.sql +36 -0
- package/dist/prisma/migrations/20250604155610_add_job_id_column_to_onboarding/migration.sql +2 -0
- package/dist/prisma/migrations/20250605151521_make_framework_visibility_false/migration.sql +2 -0
- package/dist/prisma/migrations/20250605184738_add_cascade_to_entities_owned_by_org/migration.sql +29 -0
- package/dist/prisma/migrations/20250605184740_add_device_agent_details_to_org/migration.sql +18 -0
- package/dist/prisma/migrations/20250609130129_add_not_relevant/migration.sql +2 -0
- package/dist/prisma/migrations/20250610215328_add_fleet_label_to_employees/migration.sql +2 -0
- package/dist/prisma/migrations/20250611144654_add_is_fleet_setup_flag/migration.sql +2 -0
- package/dist/prisma/migrations/20250612160731_remove_unused_cols/migration.sql +10 -0
- package/dist/prisma/migrations/20250618001304_add_default_slug/migration.sql +3 -0
- package/dist/prisma/migrations/20250623184529_add_subscription_type/migration.sql +12 -0
- package/dist/prisma/migrations/20250626021946_add_starter_subscription_type/migration.sql +27 -0
- package/dist/prisma/migrations/20250626030206_added_new_subscription_type/migration.sql +2 -0
- package/dist/prisma/migrations/20250627180331_add_onboaridng_field/migration.sql +5 -0
- package/dist/prisma/migrations/20250627180828_rename_completed_col/migration.sql +15 -0
- package/dist/prisma/migrations/20250708152414_add_had_call_col/migration.sql +2 -0
- package/dist/prisma/migrations/20250711201749_update_retool_role_to_edit_had_call_column_in_organization_table/migration.sql +7 -0
- package/dist/prisma/migrations/20250711204234_add_read_permission_for_where_clause_on_retool_role/migration.sql +8 -0
- package/dist/prisma/migrations/20250714153009_remove_stripe_and_add_has_access/migration.sql +31 -0
- package/dist/prisma/migrations/20250715200054_add_perms_for_has_access_for_retool/migration.sql +7 -0
- package/dist/prisma/migrations/migration_lock.toml +3 -0
- package/dist/prisma/randomSecret.sql +12 -0
- package/dist/prisma/schema/attachments.prisma +35 -0
- package/dist/prisma/schema/auth.prisma +122 -0
- package/dist/prisma/schema/comment.prisma +27 -0
- package/dist/prisma/schema/context.prisma +18 -0
- package/dist/prisma/schema/control.prisma +21 -0
- package/dist/prisma/schema/framework-editor.prisma +96 -0
- package/dist/prisma/schema/framework.prisma +14 -0
- package/dist/prisma/schema/integration.prisma +32 -0
- package/dist/prisma/schema/onboarding.prisma +18 -0
- package/dist/prisma/schema/organization.prisma +34 -0
- package/dist/prisma/schema/policy.prisma +32 -0
- package/dist/prisma/schema/requirement.prisma +15 -0
- package/dist/prisma/schema/risk.prisma +57 -0
- package/dist/prisma/schema/shared.prisma +104 -0
- package/dist/prisma/schema/task.prisma +41 -0
- package/dist/prisma/schema/trust.prisma +37 -0
- package/dist/prisma/schema/vendor.prisma +56 -0
- package/dist/prisma/schema.prisma +12 -0
- package/dist/prisma/seed/frameworkEditorSchemas.js +136 -0
- package/dist/prisma/seed/frameworkEditorSchemas.ts +178 -0
- package/dist/prisma/seed/primitives/FrameworkEditorControlTemplate.json +296 -0
- package/dist/prisma/seed/primitives/FrameworkEditorFramework.json +101 -0
- package/dist/prisma/seed/primitives/FrameworkEditorPolicyTemplate.json +6057 -0
- package/dist/prisma/seed/primitives/FrameworkEditorRequirement.json +7841 -0
- package/dist/prisma/seed/primitives/FrameworkEditorTaskTemplate.json +308 -0
- package/dist/prisma/seed/primitives/FrameworkEditorVideo.json +47 -0
- package/dist/prisma/seed/relations/_FrameworkEditorControlTemplateToFrameworkEditorPolicyTemplate.json +178 -0
- package/dist/prisma/seed/relations/_FrameworkEditorControlTemplateToFrameworkEditorRequirement.json +470 -0
- package/dist/prisma/seed/relations/_FrameworkEditorControlTemplateToFrameworkEditorTaskTemplate.json +142 -0
- package/dist/prisma/seed/seed.js +160 -0
- package/dist/prisma/seed/seed.ts +192 -0
- package/dist/types.d.mts +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/types.js +24 -0
- package/dist/types.mjs +2 -0
- package/package.json +75 -0
- package/prisma/functionDefinition.sql +18 -0
- package/prisma/migrations/20250403163138_init/migration.sql +611 -0
- package/prisma/migrations/20250403165218_archived_on_its_own/migration.sql +29 -0
- package/prisma/migrations/20250403194504_risk_assignee/migration.sql +18 -0
- package/prisma/migrations/20250403201319_tasks_use_asignee/migration.sql +16 -0
- package/prisma/migrations/20250403205655_vendor_assignee/migration.sql +22 -0
- package/prisma/migrations/20250403205840_oops_optional/migration.sql +2 -0
- package/prisma/migrations/20250403210049_task_assignee_optional_too/migration.sql +8 -0
- package/prisma/migrations/20250404004853_stripecustomerid/migration.sql +2 -0
- package/prisma/migrations/20250406004306_added_common_comment_table/migration.sql +20 -0
- package/prisma/migrations/20250410193847_add_unique_constraint_to_artifact_t_table/migration.sql +30 -0
- package/prisma/migrations/20250410193857_remove_published_field_from_evidence/migration.sql +12 -0
- package/prisma/migrations/20250414191353_onboarding_experience/migration.sql +25 -0
- package/prisma/migrations/20250414203443_added_evidence_to_onboarding/migration.sql +2 -0
- package/prisma/migrations/20250417205622_add_global_vendors/migration.sql +26 -0
- package/prisma/migrations/20250417205625_update_task_table_and_comments_and_attachments/migration.sql +86 -0
- package/prisma/migrations/20250417205627_remove_evidence_table/migration.sql +109 -0
- package/prisma/migrations/20250417205629_frequency_task_is_optional/migration.sql +2 -0
- package/prisma/migrations/20250418151856_add_comment_relationship_to_attachment_and_vice_versa/migration.sql +8 -0
- package/prisma/migrations/20250423154259_make_role_string/migration.sql +9 -0
- package/prisma/migrations/20250424165055_update_onboarding_to_use_tasks/migration.sql +9 -0
- package/prisma/migrations/20250424170518_remove_evidence_artifact_type/migration.sql +14 -0
- package/prisma/migrations/20250428202144_add_website_to_organization/migration.sql +2 -0
- package/prisma/migrations/20250429155419_add_company_details_to_onboarding/migration.sql +2 -0
- package/prisma/migrations/20250509160401_added_framework_editor/migration.sql +8 -0
- package/prisma/migrations/20250509162708_init_framework_editor_tables/migration.sql +122 -0
- package/prisma/migrations/20250509172401_drop_slug/migration.sql +11 -0
- package/prisma/migrations/20250509232122_trust_portal/migration.sql +24 -0
- package/prisma/migrations/20250511040043_add_custom_domain_to_trust_portal/migration.sql +2 -0
- package/prisma/migrations/20250511042943_trust_portal_domain_verified/migration.sql +2 -0
- package/prisma/migrations/20250512004633_added_identifier/migration.sql +5 -0
- package/prisma/migrations/20250512115717_added_framework_status/migration.sql +7 -0
- package/prisma/migrations/20250512163351_add_contact_details_trust_portal/migration.sql +2 -0
- package/prisma/migrations/20250514143147_remove_unique_constraint_on_integration_name/migration.sql +2 -0
- package/prisma/migrations/20250514144228_add_vercel_check/migration.sql +2 -0
- package/prisma/migrations/20250514150021_add_vercel_verification/migration.sql +2 -0
- package/prisma/migrations/20250514161440_add_dates_to_framework_editor_tables/migration.sql +23 -0
- package/prisma/migrations/20250515123635_trust_portal_friendly_url/migration.sql +21 -0
- package/prisma/migrations/20250515124040_fix_trust_constraints/migration.sql +11 -0
- package/prisma/migrations/20250516125758_patch_framework_id_in_editor/migration.sql +6 -0
- package/prisma/migrations/20250516132431_add_many_to_many_support_to_tasks/migration.sql +69 -0
- package/prisma/migrations/20250516142234_make_entity_optional/migration.sql +3 -0
- package/prisma/migrations/20250516145149_drop_entity_and_entity_type/migration.sql +16 -0
- package/prisma/migrations/20250516150558_drop_task_type/migration.sql +2 -0
- package/prisma/migrations/20250516160714_insert_hardcoded_framework_to_db/migration.sql +37 -0
- package/prisma/migrations/20250516161852_cast_framework_id_and_requirement_id_to_string/migration.sql +5 -0
- package/prisma/migrations/20250516162324_convert_ids_to_new_format/migration.sql +31 -0
- package/prisma/migrations/20250516162730_convert_framework_id/migration.sql +5 -0
- package/prisma/migrations/20250516163156_added_relation_to_framework_and_requirement_maps/migration.sql +5 -0
- package/prisma/migrations/20250516164307_drop_enums/migration.sql +5 -0
- package/prisma/migrations/20250516194123_add_cal_option/migration.sql +2 -0
- package/prisma/migrations/20250518133218_add_booking_details/migration.sql +2 -0
- package/prisma/migrations/20250519141733_change_framework_id_to_string/migration.sql +3 -0
- package/prisma/migrations/20250519141735_drop_enum_on_requirements_map/migration.sql +2 -0
- package/prisma/migrations/20250519142913_add_template_references_to_instances/migration.sql +17 -0
- package/prisma/migrations/20250519172353_drop_artifacts/migration.sql +56 -0
- package/prisma/migrations/20250519204449_drop_relation_between_controls_and_framewrok_instance/migration.sql +14 -0
- package/prisma/migrations/20250519212347_add_visibility_toggle_to_framework_editor/migration.sql +2 -0
- package/prisma/migrations/20250520152548_add_approver_to_policy/migration.sql +5 -0
- package/prisma/migrations/20250520175109_add_description_to_audit_log_for_convenience/migration.sql +2 -0
- package/prisma/migrations/20250520175523_add_member_id_to_log_table/migration.sql +8 -0
- package/prisma/migrations/20250521140239_add_entity_type_and_id_for_audit_logs_for_easy_filtering/migration.sql +9 -0
- package/prisma/migrations/20250603135046_add_v2_onboarding_requirements/migration.sql +36 -0
- package/prisma/migrations/20250604155610_add_job_id_column_to_onboarding/migration.sql +2 -0
- package/prisma/migrations/20250605151521_make_framework_visibility_false/migration.sql +2 -0
- package/prisma/migrations/20250605184738_add_cascade_to_entities_owned_by_org/migration.sql +29 -0
- package/prisma/migrations/20250605184740_add_device_agent_details_to_org/migration.sql +18 -0
- package/prisma/migrations/20250609130129_add_not_relevant/migration.sql +2 -0
- package/prisma/migrations/20250610215328_add_fleet_label_to_employees/migration.sql +2 -0
- package/prisma/migrations/20250611144654_add_is_fleet_setup_flag/migration.sql +2 -0
- package/prisma/migrations/20250612160731_remove_unused_cols/migration.sql +10 -0
- package/prisma/migrations/20250618001304_add_default_slug/migration.sql +3 -0
- package/prisma/migrations/20250623184529_add_subscription_type/migration.sql +12 -0
- package/prisma/migrations/20250626021946_add_starter_subscription_type/migration.sql +27 -0
- package/prisma/migrations/20250626030206_added_new_subscription_type/migration.sql +2 -0
- package/prisma/migrations/20250627180331_add_onboaridng_field/migration.sql +5 -0
- package/prisma/migrations/20250627180828_rename_completed_col/migration.sql +15 -0
- package/prisma/migrations/20250708152414_add_had_call_col/migration.sql +2 -0
- package/prisma/migrations/20250711201749_update_retool_role_to_edit_had_call_column_in_organization_table/migration.sql +7 -0
- package/prisma/migrations/20250711204234_add_read_permission_for_where_clause_on_retool_role/migration.sql +8 -0
- package/prisma/migrations/20250714153009_remove_stripe_and_add_has_access/migration.sql +31 -0
- package/prisma/migrations/20250715200054_add_perms_for_has_access_for_retool/migration.sql +7 -0
- package/prisma/migrations/migration_lock.toml +3 -0
- package/prisma/randomSecret.sql +12 -0
- package/prisma/schema/attachments.prisma +35 -0
- package/prisma/schema/auth.prisma +122 -0
- package/prisma/schema/comment.prisma +27 -0
- package/prisma/schema/context.prisma +18 -0
- package/prisma/schema/control.prisma +21 -0
- package/prisma/schema/framework-editor.prisma +96 -0
- package/prisma/schema/framework.prisma +14 -0
- package/prisma/schema/integration.prisma +32 -0
- package/prisma/schema/onboarding.prisma +18 -0
- package/prisma/schema/organization.prisma +34 -0
- package/prisma/schema/policy.prisma +32 -0
- package/prisma/schema/requirement.prisma +15 -0
- package/prisma/schema/risk.prisma +57 -0
- package/prisma/schema/shared.prisma +104 -0
- package/prisma/schema/task.prisma +41 -0
- package/prisma/schema/trust.prisma +37 -0
- package/prisma/schema/vendor.prisma +56 -0
- package/prisma/schema.prisma +12 -0
- package/prisma/seed/frameworkEditorSchemas.js +136 -0
- package/prisma/seed/frameworkEditorSchemas.ts +178 -0
- package/prisma/seed/primitives/FrameworkEditorControlTemplate.json +296 -0
- package/prisma/seed/primitives/FrameworkEditorFramework.json +101 -0
- package/prisma/seed/primitives/FrameworkEditorPolicyTemplate.json +6057 -0
- package/prisma/seed/primitives/FrameworkEditorRequirement.json +7841 -0
- package/prisma/seed/primitives/FrameworkEditorTaskTemplate.json +308 -0
- package/prisma/seed/primitives/FrameworkEditorVideo.json +47 -0
- package/prisma/seed/relations/_FrameworkEditorControlTemplateToFrameworkEditorPolicyTemplate.json +178 -0
- package/prisma/seed/relations/_FrameworkEditorControlTemplateToFrameworkEditorRequirement.json +470 -0
- package/prisma/seed/relations/_FrameworkEditorControlTemplateToFrameworkEditorTaskTemplate.json +142 -0
- package/prisma/seed/seed.js +160 -0
- package/prisma/seed/seed.ts +192 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Warnings:
|
|
3
|
+
|
|
4
|
+
- You are about to drop the column `hadCall` on the `Organization` table. All the data in the column will be lost.
|
|
5
|
+
- You are about to drop the column `stripeCustomerId` on the `Organization` table. All the data in the column will be lost.
|
|
6
|
+
- You are about to drop the column `stripeSubscriptionData` on the `Organization` table. All the data in the column will be lost.
|
|
7
|
+
- You are about to drop the column `subscriptionType` on the `Organization` table. All the data in the column will be lost.
|
|
8
|
+
|
|
9
|
+
*/
|
|
10
|
+
-- DropIndex
|
|
11
|
+
DROP INDEX "Organization_stripeCustomerId_idx";
|
|
12
|
+
|
|
13
|
+
-- DropIndex
|
|
14
|
+
DROP INDEX "Organization_subscriptionType_idx";
|
|
15
|
+
|
|
16
|
+
-- Add hasAccess column
|
|
17
|
+
ALTER TABLE "Organization" ADD COLUMN "hasAccess" BOOLEAN NOT NULL DEFAULT false;
|
|
18
|
+
|
|
19
|
+
-- Update all organizations to have access depending on subscription type
|
|
20
|
+
UPDATE "Organization" SET "hasAccess" = true WHERE "subscriptionType" = 'FREE';
|
|
21
|
+
UPDATE "Organization" SET "hasAccess" = true WHERE "subscriptionType" = 'STARTER';
|
|
22
|
+
UPDATE "Organization" SET "hasAccess" = true WHERE "subscriptionType" = 'MANAGED';
|
|
23
|
+
|
|
24
|
+
-- Drop columns
|
|
25
|
+
ALTER TABLE "Organization" DROP COLUMN "hadCall";
|
|
26
|
+
ALTER TABLE "Organization" DROP COLUMN "stripeCustomerId";
|
|
27
|
+
ALTER TABLE "Organization" DROP COLUMN "stripeSubscriptionData";
|
|
28
|
+
ALTER TABLE "Organization" DROP COLUMN "subscriptionType";
|
|
29
|
+
|
|
30
|
+
-- Drop subscription type enum
|
|
31
|
+
DROP TYPE "SubscriptionType";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
-- Create function to generate a random secret
|
|
2
|
+
CREATE OR REPLACE FUNCTION generate_random_secret(length integer DEFAULT 32)
|
|
3
|
+
RETURNS text AS $$
|
|
4
|
+
DECLARE
|
|
5
|
+
result text;
|
|
6
|
+
BEGIN
|
|
7
|
+
-- Generate random bytes and encode as hex
|
|
8
|
+
-- Using gen_random_bytes from pgcrypto extension
|
|
9
|
+
result = encode(gen_random_bytes(length), 'hex');
|
|
10
|
+
RETURN result;
|
|
11
|
+
END;
|
|
12
|
+
$$ LANGUAGE plpgsql;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
model Attachment {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('att'::text)"))
|
|
3
|
+
name String
|
|
4
|
+
url String
|
|
5
|
+
type AttachmentType
|
|
6
|
+
entityId String
|
|
7
|
+
entityType AttachmentEntityType
|
|
8
|
+
|
|
9
|
+
// Dates
|
|
10
|
+
createdAt DateTime @default(now())
|
|
11
|
+
updatedAt DateTime @updatedAt
|
|
12
|
+
|
|
13
|
+
// Relationships
|
|
14
|
+
organizationId String
|
|
15
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
16
|
+
comment Comment? @relation(fields: [commentId], references: [id])
|
|
17
|
+
commentId String?
|
|
18
|
+
|
|
19
|
+
@@index([entityId, entityType])
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum AttachmentEntityType {
|
|
23
|
+
task
|
|
24
|
+
vendor
|
|
25
|
+
risk
|
|
26
|
+
comment
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
enum AttachmentType {
|
|
30
|
+
image
|
|
31
|
+
video
|
|
32
|
+
audio
|
|
33
|
+
document
|
|
34
|
+
other
|
|
35
|
+
}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
model User {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('usr'::text)"))
|
|
3
|
+
name String
|
|
4
|
+
email String
|
|
5
|
+
emailVerified Boolean
|
|
6
|
+
image String?
|
|
7
|
+
createdAt DateTime @default(now())
|
|
8
|
+
updatedAt DateTime @updatedAt
|
|
9
|
+
lastLogin DateTime?
|
|
10
|
+
|
|
11
|
+
accounts Account[]
|
|
12
|
+
auditLog AuditLog[]
|
|
13
|
+
integrationResults IntegrationResult[]
|
|
14
|
+
invitations Invitation[]
|
|
15
|
+
members Member[]
|
|
16
|
+
sessions Session[]
|
|
17
|
+
|
|
18
|
+
@@unique([email])
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
model EmployeeTrainingVideoCompletion {
|
|
22
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('evc'::text)"))
|
|
23
|
+
completedAt DateTime?
|
|
24
|
+
videoId String
|
|
25
|
+
|
|
26
|
+
memberId String
|
|
27
|
+
member Member @relation(fields: [memberId], references: [id], onDelete: Cascade)
|
|
28
|
+
|
|
29
|
+
@@unique([memberId, videoId])
|
|
30
|
+
@@index([memberId])
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
model Session {
|
|
34
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ses'::text)"))
|
|
35
|
+
expiresAt DateTime
|
|
36
|
+
token String
|
|
37
|
+
createdAt DateTime @default(now())
|
|
38
|
+
updatedAt DateTime @updatedAt
|
|
39
|
+
ipAddress String?
|
|
40
|
+
userAgent String?
|
|
41
|
+
userId String
|
|
42
|
+
activeOrganizationId String?
|
|
43
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
44
|
+
|
|
45
|
+
@@unique([token])
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
model Account {
|
|
49
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('acc'::text)"))
|
|
50
|
+
accountId String
|
|
51
|
+
providerId String
|
|
52
|
+
userId String
|
|
53
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
54
|
+
accessToken String?
|
|
55
|
+
refreshToken String?
|
|
56
|
+
idToken String?
|
|
57
|
+
accessTokenExpiresAt DateTime?
|
|
58
|
+
refreshTokenExpiresAt DateTime?
|
|
59
|
+
scope String?
|
|
60
|
+
password String?
|
|
61
|
+
createdAt DateTime
|
|
62
|
+
updatedAt DateTime
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
model Verification {
|
|
66
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ver'::text)"))
|
|
67
|
+
identifier String
|
|
68
|
+
value String
|
|
69
|
+
expiresAt DateTime
|
|
70
|
+
createdAt DateTime @default(now())
|
|
71
|
+
updatedAt DateTime @updatedAt
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
model Member {
|
|
75
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('mem'::text)"))
|
|
76
|
+
organizationId String
|
|
77
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
78
|
+
userId String
|
|
79
|
+
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
|
80
|
+
role String // Purposefully a string, since BetterAuth doesn't support enums this way
|
|
81
|
+
createdAt DateTime @default(now())
|
|
82
|
+
|
|
83
|
+
department Departments @default(none)
|
|
84
|
+
isActive Boolean @default(true)
|
|
85
|
+
employeeTrainingVideoCompletion EmployeeTrainingVideoCompletion[]
|
|
86
|
+
fleetDmLabelId Int?
|
|
87
|
+
|
|
88
|
+
assignedPolicies Policy[] @relation("PolicyAssignee") // Policies where this member is an assignee
|
|
89
|
+
approvedPolicies Policy[] @relation("PolicyApprover") // Policies where this member is an approver
|
|
90
|
+
risks Risk[]
|
|
91
|
+
tasks Task[]
|
|
92
|
+
vendors Vendor[]
|
|
93
|
+
comments Comment[]
|
|
94
|
+
auditLogs AuditLog[]
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
model Invitation {
|
|
98
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('inv'::text)"))
|
|
99
|
+
organizationId String
|
|
100
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
101
|
+
email String
|
|
102
|
+
role String // Purposefully a string, since BetterAuth doesn't support enums this way
|
|
103
|
+
status String
|
|
104
|
+
expiresAt DateTime
|
|
105
|
+
inviterId String
|
|
106
|
+
user User @relation(fields: [inviterId], references: [id], onDelete: Cascade)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// This is only for the app to consume, shouldn't be enforced by DB
|
|
110
|
+
// Otherwise it won't work with Better Auth, as per https://www.better-auth.com/docs/plugins/organization#access-control
|
|
111
|
+
enum Role {
|
|
112
|
+
owner
|
|
113
|
+
admin
|
|
114
|
+
auditor
|
|
115
|
+
employee
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
enum PolicyStatus {
|
|
119
|
+
draft
|
|
120
|
+
published
|
|
121
|
+
needs_review
|
|
122
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
model Comment {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('cmt'::text)"))
|
|
3
|
+
content String
|
|
4
|
+
entityId String
|
|
5
|
+
entityType CommentEntityType
|
|
6
|
+
|
|
7
|
+
// Dates
|
|
8
|
+
createdAt DateTime @default(now())
|
|
9
|
+
|
|
10
|
+
// Relationships
|
|
11
|
+
authorId String
|
|
12
|
+
author Member @relation(fields: [authorId], references: [id])
|
|
13
|
+
organizationId String
|
|
14
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
15
|
+
|
|
16
|
+
// Relation to Attachments
|
|
17
|
+
attachments Attachment[]
|
|
18
|
+
|
|
19
|
+
@@index([entityId])
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
enum CommentEntityType {
|
|
23
|
+
task
|
|
24
|
+
vendor
|
|
25
|
+
risk
|
|
26
|
+
policy
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
model Context {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ctx'::text)"))
|
|
3
|
+
organizationId String
|
|
4
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
5
|
+
|
|
6
|
+
question String
|
|
7
|
+
answer String
|
|
8
|
+
|
|
9
|
+
tags String[]
|
|
10
|
+
|
|
11
|
+
createdAt DateTime @default(now())
|
|
12
|
+
updatedAt DateTime @updatedAt
|
|
13
|
+
|
|
14
|
+
@@index([organizationId])
|
|
15
|
+
@@index([question])
|
|
16
|
+
@@index([answer])
|
|
17
|
+
@@index([tags])
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
model Control {
|
|
2
|
+
// Metadata
|
|
3
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('ctl'::text)"))
|
|
4
|
+
name String
|
|
5
|
+
description String
|
|
6
|
+
|
|
7
|
+
// Review dates
|
|
8
|
+
lastReviewDate DateTime?
|
|
9
|
+
nextReviewDate DateTime?
|
|
10
|
+
|
|
11
|
+
// Relationships
|
|
12
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
13
|
+
organizationId String
|
|
14
|
+
requirementsMapped RequirementMap[]
|
|
15
|
+
tasks Task[]
|
|
16
|
+
policies Policy[]
|
|
17
|
+
controlTemplateId String?
|
|
18
|
+
controlTemplate FrameworkEditorControlTemplate? @relation(fields: [controlTemplateId], references: [id])
|
|
19
|
+
|
|
20
|
+
@@index([organizationId])
|
|
21
|
+
}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
// --- Data for Framework Editor ---
|
|
2
|
+
model FrameworkEditorVideo {
|
|
3
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_vi'::text)"))
|
|
4
|
+
title String
|
|
5
|
+
description String
|
|
6
|
+
youtubeId String
|
|
7
|
+
url String
|
|
8
|
+
|
|
9
|
+
// Dates
|
|
10
|
+
createdAt DateTime @default(now())
|
|
11
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
model FrameworkEditorFramework {
|
|
15
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk'::text)"))
|
|
16
|
+
name String // e.g., "soc2", "iso27001"
|
|
17
|
+
version String
|
|
18
|
+
description String
|
|
19
|
+
visible Boolean @default(false)
|
|
20
|
+
|
|
21
|
+
requirements FrameworkEditorRequirement[]
|
|
22
|
+
frameworkInstances FrameworkInstance[]
|
|
23
|
+
|
|
24
|
+
// Dates
|
|
25
|
+
createdAt DateTime @default(now())
|
|
26
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
model FrameworkEditorRequirement {
|
|
30
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_rq'::text)"))
|
|
31
|
+
frameworkId String
|
|
32
|
+
framework FrameworkEditorFramework @relation(fields: [frameworkId], references: [id])
|
|
33
|
+
|
|
34
|
+
name String // Original requirement ID within that framework, e.g., "Privacy"
|
|
35
|
+
identifier String @default("") // Unique identifier for the requirement, e.g., "cc1-1"
|
|
36
|
+
description String
|
|
37
|
+
|
|
38
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
39
|
+
requirementMaps RequirementMap[]
|
|
40
|
+
|
|
41
|
+
// Dates
|
|
42
|
+
createdAt DateTime @default(now())
|
|
43
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
model FrameworkEditorPolicyTemplate {
|
|
47
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_pt'::text)"))
|
|
48
|
+
name String
|
|
49
|
+
description String
|
|
50
|
+
frequency Frequency // Using the enum from shared.prisma
|
|
51
|
+
department Departments // Using the enum from shared.prisma
|
|
52
|
+
content Json
|
|
53
|
+
|
|
54
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
55
|
+
|
|
56
|
+
// Dates
|
|
57
|
+
createdAt DateTime @default(now())
|
|
58
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
59
|
+
|
|
60
|
+
// Instances
|
|
61
|
+
policies Policy[]
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
model FrameworkEditorTaskTemplate {
|
|
65
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_tt'::text)"))
|
|
66
|
+
name String
|
|
67
|
+
description String
|
|
68
|
+
frequency Frequency // Using the enum from shared.prisma
|
|
69
|
+
department Departments // Using the enum from shared.prisma
|
|
70
|
+
|
|
71
|
+
controlTemplates FrameworkEditorControlTemplate[]
|
|
72
|
+
|
|
73
|
+
// Dates
|
|
74
|
+
createdAt DateTime @default(now())
|
|
75
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
76
|
+
|
|
77
|
+
// Instances
|
|
78
|
+
tasks Task[]
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
model FrameworkEditorControlTemplate {
|
|
82
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frk_ct'::text)"))
|
|
83
|
+
name String
|
|
84
|
+
description String
|
|
85
|
+
|
|
86
|
+
policyTemplates FrameworkEditorPolicyTemplate[]
|
|
87
|
+
requirements FrameworkEditorRequirement[]
|
|
88
|
+
taskTemplates FrameworkEditorTaskTemplate[]
|
|
89
|
+
|
|
90
|
+
// Dates
|
|
91
|
+
createdAt DateTime @default(now())
|
|
92
|
+
updatedAt DateTime @default(now()) @updatedAt
|
|
93
|
+
|
|
94
|
+
// Instances
|
|
95
|
+
controls Control[]
|
|
96
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
model FrameworkInstance {
|
|
2
|
+
// Metadata
|
|
3
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('frm'::text)"))
|
|
4
|
+
organizationId String
|
|
5
|
+
|
|
6
|
+
frameworkId String
|
|
7
|
+
framework FrameworkEditorFramework @relation(fields: [frameworkId], references: [id], onDelete: Cascade)
|
|
8
|
+
|
|
9
|
+
// Relationships
|
|
10
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
11
|
+
requirementsMapped RequirementMap[]
|
|
12
|
+
|
|
13
|
+
@@unique([organizationId, frameworkId])
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
model Integration {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('int'::text)"))
|
|
3
|
+
name String
|
|
4
|
+
integrationId String
|
|
5
|
+
settings Json
|
|
6
|
+
userSettings Json
|
|
7
|
+
organizationId String
|
|
8
|
+
lastRunAt DateTime?
|
|
9
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
10
|
+
results IntegrationResult[]
|
|
11
|
+
|
|
12
|
+
@@index([organizationId])
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
model IntegrationResult {
|
|
16
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('itr'::text)"))
|
|
17
|
+
title String?
|
|
18
|
+
description String?
|
|
19
|
+
remediation String?
|
|
20
|
+
status String?
|
|
21
|
+
severity String?
|
|
22
|
+
resultDetails Json?
|
|
23
|
+
completedAt DateTime? @default(now())
|
|
24
|
+
integrationId String
|
|
25
|
+
organizationId String
|
|
26
|
+
assignedUserId String?
|
|
27
|
+
|
|
28
|
+
assignedUser User? @relation(fields: [assignedUserId], references: [id], onDelete: Cascade)
|
|
29
|
+
integration Integration @relation(fields: [integrationId], references: [id], onDelete: Cascade)
|
|
30
|
+
|
|
31
|
+
@@index([integrationId])
|
|
32
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
model Onboarding {
|
|
2
|
+
organizationId String @id
|
|
3
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
4
|
+
policies Boolean @default(false)
|
|
5
|
+
employees Boolean @default(false)
|
|
6
|
+
vendors Boolean @default(false)
|
|
7
|
+
integrations Boolean @default(false)
|
|
8
|
+
risk Boolean @default(false)
|
|
9
|
+
team Boolean @default(false)
|
|
10
|
+
tasks Boolean @default(false)
|
|
11
|
+
callBooked Boolean @default(false)
|
|
12
|
+
companyBookingDetails Json?
|
|
13
|
+
companyDetails Json?
|
|
14
|
+
triggerJobId String?
|
|
15
|
+
triggerJobCompleted Boolean @default(false)
|
|
16
|
+
|
|
17
|
+
@@index([organizationId])
|
|
18
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
model Organization {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('org'::text)"))
|
|
3
|
+
name String
|
|
4
|
+
slug String @unique @default(dbgenerated("generate_prefixed_cuid('slug'::text)"))
|
|
5
|
+
logo String?
|
|
6
|
+
createdAt DateTime @default(now())
|
|
7
|
+
metadata String?
|
|
8
|
+
onboarding Onboarding?
|
|
9
|
+
website String?
|
|
10
|
+
onboardingCompleted Boolean @default(false)
|
|
11
|
+
hasAccess Boolean @default(false)
|
|
12
|
+
|
|
13
|
+
// FleetDM
|
|
14
|
+
fleetDmLabelId Int?
|
|
15
|
+
isFleetSetupCompleted Boolean @default(false)
|
|
16
|
+
|
|
17
|
+
apiKeys ApiKey[]
|
|
18
|
+
auditLog AuditLog[]
|
|
19
|
+
controls Control[]
|
|
20
|
+
frameworkInstances FrameworkInstance[]
|
|
21
|
+
integrations Integration[]
|
|
22
|
+
invitations Invitation[]
|
|
23
|
+
members Member[]
|
|
24
|
+
policy Policy[]
|
|
25
|
+
risk Risk[]
|
|
26
|
+
vendors Vendor[]
|
|
27
|
+
tasks Task[]
|
|
28
|
+
comments Comment[]
|
|
29
|
+
attachments Attachment[]
|
|
30
|
+
trust Trust[]
|
|
31
|
+
context Context[]
|
|
32
|
+
|
|
33
|
+
@@index([slug])
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
model Policy {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('pol'::text)"))
|
|
3
|
+
name String
|
|
4
|
+
description String?
|
|
5
|
+
status PolicyStatus @default(draft)
|
|
6
|
+
content Json[]
|
|
7
|
+
frequency Frequency?
|
|
8
|
+
department Departments?
|
|
9
|
+
isRequiredToSign Boolean @default(false)
|
|
10
|
+
signedBy String[] @default([])
|
|
11
|
+
reviewDate DateTime?
|
|
12
|
+
isArchived Boolean @default(false)
|
|
13
|
+
|
|
14
|
+
// Dates
|
|
15
|
+
createdAt DateTime @default(now())
|
|
16
|
+
updatedAt DateTime @updatedAt
|
|
17
|
+
lastArchivedAt DateTime?
|
|
18
|
+
lastPublishedAt DateTime?
|
|
19
|
+
|
|
20
|
+
// Relationships
|
|
21
|
+
organizationId String
|
|
22
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
23
|
+
assigneeId String?
|
|
24
|
+
assignee Member? @relation("PolicyAssignee", fields: [assigneeId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
25
|
+
approverId String?
|
|
26
|
+
approver Member? @relation("PolicyApprover", fields: [approverId], references: [id], onDelete: SetNull, onUpdate: Cascade)
|
|
27
|
+
policyTemplateId String?
|
|
28
|
+
policyTemplate FrameworkEditorPolicyTemplate? @relation(fields: [policyTemplateId], references: [id])
|
|
29
|
+
controls Control[]
|
|
30
|
+
|
|
31
|
+
@@index([organizationId])
|
|
32
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
model RequirementMap {
|
|
2
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('req'::text)"))
|
|
3
|
+
|
|
4
|
+
requirementId String
|
|
5
|
+
requirement FrameworkEditorRequirement @relation(fields: [requirementId], references: [id], onDelete: Cascade)
|
|
6
|
+
|
|
7
|
+
controlId String
|
|
8
|
+
control Control @relation(fields: [controlId], references: [id], onDelete: Cascade)
|
|
9
|
+
|
|
10
|
+
frameworkInstanceId String
|
|
11
|
+
frameworkInstance FrameworkInstance @relation(fields: [frameworkInstanceId], references: [id], onDelete: Cascade)
|
|
12
|
+
|
|
13
|
+
@@unique([controlId, frameworkInstanceId, requirementId])
|
|
14
|
+
@@index([requirementId, frameworkInstanceId])
|
|
15
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
model Risk {
|
|
2
|
+
// Metadata
|
|
3
|
+
id String @id @default(dbgenerated("generate_prefixed_cuid('rsk'::text)"))
|
|
4
|
+
title String
|
|
5
|
+
description String
|
|
6
|
+
category RiskCategory
|
|
7
|
+
department Departments?
|
|
8
|
+
status RiskStatus @default(open)
|
|
9
|
+
likelihood Likelihood @default(very_unlikely)
|
|
10
|
+
impact Impact @default(insignificant)
|
|
11
|
+
residualLikelihood Likelihood @default(very_unlikely)
|
|
12
|
+
residualImpact Impact @default(insignificant)
|
|
13
|
+
treatmentStrategyDescription String?
|
|
14
|
+
treatmentStrategy RiskTreatmentType @default(accept)
|
|
15
|
+
|
|
16
|
+
// Dates
|
|
17
|
+
createdAt DateTime @default(now())
|
|
18
|
+
updatedAt DateTime @updatedAt
|
|
19
|
+
|
|
20
|
+
// Relationships
|
|
21
|
+
organizationId String
|
|
22
|
+
organization Organization @relation(fields: [organizationId], references: [id], onDelete: Cascade)
|
|
23
|
+
assigneeId String?
|
|
24
|
+
assignee Member? @relation(fields: [assigneeId], references: [id])
|
|
25
|
+
tasks Task[]
|
|
26
|
+
|
|
27
|
+
@@index([organizationId])
|
|
28
|
+
@@index([category])
|
|
29
|
+
@@index([status])
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
enum RiskTreatmentType {
|
|
33
|
+
accept
|
|
34
|
+
avoid
|
|
35
|
+
mitigate
|
|
36
|
+
transfer
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
enum RiskCategory {
|
|
40
|
+
customer
|
|
41
|
+
governance
|
|
42
|
+
operations
|
|
43
|
+
other
|
|
44
|
+
people
|
|
45
|
+
regulatory
|
|
46
|
+
reporting
|
|
47
|
+
resilience
|
|
48
|
+
technology
|
|
49
|
+
vendor_management
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
enum RiskStatus {
|
|
53
|
+
open
|
|
54
|
+
pending
|
|
55
|
+
closed
|
|
56
|
+
archived
|
|
57
|
+
}
|