add [properties] - add isCompleted flag for documents#748
Conversation
94ed5e3 to
c49c0a2
Compare
c49c0a2 to
3d26677
Compare
whutchinson98
left a comment
There was a problem hiding this comment.
overall looks good, but I think we should avoid having a bunch of random uuids hard coded across lots of queries. I think this could get confusing and prone to error
instead, can you please inject as a parameter in the sql and use a const so it's more clear what these values are
rust/cloud-storage/macro_db_client/src/activity/get_recent_activities.rs
Outdated
Show resolved
Hide resolved
rust/cloud-storage/macro_db_client/src/activity/get_recent_activities.rs
Outdated
Show resolved
Hide resolved
rust/cloud-storage/soup/src/outbound/pg_soup_repo/unexpanded/by_cursor.rs
Outdated
Show resolved
Hide resolved
rust/cloud-storage/soup/src/outbound/pg_soup_repo/unexpanded/by_cursor.rs
Outdated
Show resolved
Hide resolved
rust/cloud-storage/soup/src/outbound/pg_soup_repo/unexpanded/by_cursor.rs
Outdated
Show resolved
Hide resolved
rust/cloud-storage/soup/src/outbound/pg_soup_repo/unexpanded/by_ids.rs
Outdated
Show resolved
Hide resolved
rust/cloud-storage/soup/src/outbound/pg_soup_repo/unexpanded/by_ids.rs
Outdated
Show resolved
Hide resolved
seanaye
left a comment
There was a problem hiding this comment.
This looks good but we should change the is_completed to exist inside the task subtype,
js/app/packages/service-clients/service-storage/generated/schemas/documentPreviewData.ts
Outdated
Show resolved
Hide resolved
3d26677 to
4b0d75f
Compare
4b0d75f to
5e81df9
Compare
…PreviewData Add is_completed bool field to document response structs to indicate whether a task's Status property is set to Completed. This field will be populated by SQL queries in subsequent commits.
Add LEFT JOIN to entity_properties table to check Status property. is_completed is true when: - sub_type is 'task' AND - Status property value contains Completed UUID Updated files: - unexpanded/by_cursor.rs (2 functions) - unexpanded/by_ids.rs - expanded/by_cursor.rs (2 functions) - expanded/by_ids.rs - expanded/dynamic.rs (static clauses and DocumentRow struct) - pg_soup_repo.rs (map_soup_type! macro)
Add is_completed field to batch_get_document_preview_v2 query. Uses same pattern as soup queries with task-only JOIN optimization.
Add is_completed: false to all places that construct BasicDocument manually. These surfaces (activity feeds, project items, etc.) will show tasks as incomplete by default. Can be enhanced later if needed.
Replace hardcoded UUIDs with SystemPropertyKey::STATUS_UUID and StatusOption::COMPLETED_UUID to improve code clarity and reduce error-prone magic values across queries.
- Remove @core/util/subType.ts utility file - Add NamedSubType and SubType types to @macro-entity/types/entity - Update all 18 files to use subType?.type directly instead of utility functions - Replace isTaskSubType(x) with x?.type === 'task' - Replace getSubTypeName(x) with x?.type - Replace normalizeSubType(x) with direct object creation where needed - Maintain type safety with NamedSubType for function parameters - All API boundaries properly handle string-to-object conversion
22f0ad9 to
25e3730
Compare
|
|
||
| if (data.type === 'document') { | ||
| return fileTypeToBlockName(data.subType ?? data.fileType, true); | ||
| return fileTypeToBlockName(data.subType?.type ?? data.fileType, true); |
There was a problem hiding this comment.
I feel like we may want to refactor fileTypeToBlockName into something more generic like documentToBlockName and pass in more of the document object to determine the block name inside of that method
There was a problem hiding this comment.
good idea - ill make a follow up task for this. this PR is already kinda big
seanaye
left a comment
There was a problem hiding this comment.
awesome, this looks great
add [properties] - add isCompleted flag