From 579ae9bd96acece61104ab407a3ce0934603dbab Mon Sep 17 00:00:00 2001 From: Scott Idem Date: Thu, 20 Mar 2025 11:58:59 -0400 Subject: [PATCH] Updating the models related to Journals --- app/models/journal_entry_models.py | 36 +++++++++++++++--- app/models/journal_models.py | 60 +++++++++++++++++++++--------- 2 files changed, 72 insertions(+), 24 deletions(-) diff --git a/app/models/journal_entry_models.py b/app/models/journal_entry_models.py index 61b9e85..3c1fcaf 100644 --- a/app/models/journal_entry_models.py +++ b/app/models/journal_entry_models.py @@ -25,7 +25,7 @@ class Journal_Entry_Base(BaseModel): journal_id_random: Optional[str] journal_id: Optional[int] - external_id: Optional[str] # ID generated by external system (should be stable and not change) + external_id: Optional[str] # ID generated by or for external systems (should be stable and not change) import_id: Optional[str] # Used for import purposes to track the source of the data code: Optional[str] @@ -40,10 +40,25 @@ class Journal_Entry_Base(BaseModel): content: Optional[str] content_html: Optional[str] content_json: Optional[Union[Json, None]] + content_encrypted: Optional[str] + + type_code: Optional[str] # 'log', 'tracking', 'personal', 'professional', etc + topic_code: Optional[str] + category_code: Optional[str] + # keywords: Optional[str] + tags: Optional[str] start_datetime: Optional[datetime.datetime] end_datetime: Optional[datetime.datetime] timezone: Optional[str] # = 'UTC' # Default to UTC + seconds: Optional[int] + + location: Optional[str] + latitude: Optional[float] + longitude: Optional[float] + + billable: Optional[bool] + bill_to: Optional[str] alert: Optional[bool] = False alert_msg: Optional[str] = None @@ -53,17 +68,26 @@ class Journal_Entry_Base(BaseModel): personal: Optional[bool] = True professional: Optional[bool] = False - keywords: Optional[str] + parent_id_random: Optional[str] + parent_id: Optional[int] + related_entry_id_random: Optional[List[str]] + related_entry_id_li: Optional[List[int]] + due_datetime: Optional[datetime.datetime] + due_alert: Optional[bool] archive_on: Optional[datetime.datetime] archive: Optional[bool] - data_json: Optional[Union[Json, None]] # Used to store additional data for the journal - + passcode: Optional[str] # Used to read and write to the journal entry + passcode_timeout: Optional[int] # Number of seconds before asking for the passcode again passcode_read: Optional[str] # Used to read the journal entry passcode_read_expire: Optional[int] # Number of seconds to expire the read passcode - passcode_write: Optional[str] # Used to write to the journal entry - passcode_write_expire: Optional[int] # Number of seconds to expire the write passcode + # passcode_write: Optional[str] # Used to write to the journal entry + # passcode_write_expire: Optional[int] # Number of seconds to expire the write passcode + + url_kv_json: Optional[Union[Json, None]] + data_json: Optional[Union[Json, None]] # Used to store additional data for the journal + meta_json: Optional[Union[Json, None]] # Used to store additional data about the journal entry enable: Optional[bool] hide: Optional[bool] diff --git a/app/models/journal_models.py b/app/models/journal_models.py index 13ae287..5c1afa3 100644 --- a/app/models/journal_models.py +++ b/app/models/journal_models.py @@ -32,7 +32,7 @@ class Journal_Base(BaseModel): user_id_random: Optional[str] user_id: Optional[int] - external_id: Optional[str] # ID generated by external system (should be stable and not change) + external_id: Optional[str] # ID generated by or for external systems (should be stable and not change) import_id: Optional[str] # Used for import purposes to track the source of the data code: Optional[str] @@ -40,21 +40,6 @@ class Journal_Base(BaseModel): for_id: Optional[int] for_id_random: Optional[str] - type_code: Optional[str] # 'log', 'tracking', 'personal', 'professional', etc - - default_private: Optional[bool] - default_public: Optional[bool] - default_personal: Optional[bool] - default_professional: Optional[bool] - - private_passcode: Optional[str] - public_passcode: Optional[str] - - passcode_read: Optional[str] # Used to read the journal - passcode_read_expire: Optional[int] # Number of seconds to expire the read passcode - passcode_write: Optional[str] # Used to write to the journal - passcode_write_expire: Optional[int] # Number of seconds to expire the write passcode - name: Optional[str] summary: Optional[str] outline: Optional[str] @@ -63,21 +48,59 @@ class Journal_Base(BaseModel): description_html: Optional[str] description_json: Optional[str] + type_code: Optional[str] # 'log', 'tracking', 'personal', 'professional', etc + tags: Optional[str] + start_datetime: Optional[datetime.datetime] end_datetime: Optional[datetime.datetime] timezone: Optional[str] # = 'UTC' # Default to UTC + seconds: Optional[int] + + location: Optional[str] + latitude: Optional[float] + longitude: Optional[float] + + billable: Optional[bool] + bill_to: Optional[str] alert: Optional[bool] = False alert_msg: Optional[str] = None - meta_data: Optional[str] - access_key: Optional[str] + private: Optional[bool] = True + public: Optional[bool] = False + personal: Optional[bool] = True + professional: Optional[bool] = False + + # Default the Journal Entries to private, public, personal, and professional + default_private: Optional[bool] + default_public: Optional[bool] + default_personal: Optional[bool] + default_professional: Optional[bool] + + due_datetime: Optional[datetime.datetime] + due_alert: Optional[bool] + archive_on: Optional[datetime.datetime] + archive: Optional[bool] + + allow_auth: Optional[bool] + auth_key: Optional[str] + + passcode: Optional[str] # Used to read and write to the journal entry + passcode_timeout: Optional[int] # Number of seconds before asking for the passcode again + # private_passcode: Optional[str] + # public_passcode: Optional[str] + + passcode_read: Optional[str] # Used to read the journal + passcode_read_expire: Optional[int] # Number of seconds to expire the read passcode + # passcode_write: Optional[str] # Used to write to the journal + # passcode_write_expire: Optional[int] # Number of seconds to expire the write passcode sort_by: Optional[str] sort_by_desc: Optional[bool] cfg_json: Optional[Union[Json, None]] data_json: Optional[Union[Json, None]] # Used to store additional data for the journal + meta_json: Optional[Union[Json, None]] # Used to store additional data for about the journal enable: Optional[bool] hide: Optional[bool] @@ -95,6 +118,7 @@ class Journal_Base(BaseModel): file_count: Optional[int] # Only files directly under the journal file_count_all: Optional[int] # All files under a journal and entries + # This person is essentially the owner of the journal # person: Optional[Person_Base] person_external_id: Optional[str] person_given_name: Optional[str] = None