Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(server): refactoring id scene [VIZ-BE-574] #1516

Merged
merged 3 commits into from
Mar 21, 2025

Conversation

hexaforce
Copy link
Contributor

@hexaforce hexaforce commented Mar 19, 2025

Overview

Refactoring ids

What I've done

This pull request unifies the scene IDs to the ones in ./server/pkg/id/id.go.

I removed the parts that were redefining the ID from id.go.

  • type SceneID

What I haven't done

How I tested

Which point I want you to review particularly

Since each id.go declares different ID types, they are not unified.

Example: SceneID
Each package defines SceneID separately:

server/pkg/dataset/id.go:
  8: type SceneID = id.SceneID
server/pkg/layer/id.go:
  12: type SceneID = id.SceneID
server/pkg/nlslayer/id.go:
  10: type SceneID = id.SceneID
server/pkg/plugin/id.go:
  9: type SceneID = id.SceneID
server/pkg/project/id.go:
  10: type SceneID = id.SceneID
server/pkg/property/id.go:
  15: type SceneID = id.SceneID
server/pkg/storytelling/id.go:
  8: type SceneID = id.SceneID
server/pkg/tag/id.go:
  6: type SceneID = id.SceneID

These all end up being different SceneID types.

Memo

Summary by CodeRabbit

  • Refactor

    • Unified identifier management across scenes, widgets, plugins, and properties to enhance consistency and maintainability.
  • Chore

    • Removed deprecated type aliases and updated import references.
    • Revised integration tests for updated ID generation methods.

Note: These internal improvements enhance overall system stability and robustness without altering end-user functionality.

Copy link

coderabbitai bot commented Mar 19, 2025

Walkthrough

This pull request refactors the codebase by replacing legacy scene identifier types from the scene package with new types from the id package. Function signatures, struct fields, and test cases have been updated accordingly across multiple modules including end-to-end tests, internal infrastructure, use cases, and various packages (nlslayer, plugin, property, scene, storytelling, etc.). Legacy type aliases and related helper variables have been removed while preserving the original logic and control flow.

Changes

File(s) Change Summary
server/e2e/seeder.go Updated addLayerStyle signature: parameter type for SceneID changed from scene.ID to id.SceneID.
server/internal/infrastructure/mongo/{container.go, nlslayer.go, property.go, property_schema.go, style.go} Replaced scene.ID/List types with id.SceneID/List in function signatures and removed unused scene imports.
server/internal/usecase/{scene.go, scene_plugin_test.go, storytelling.go, operator.go, repo/container(.test).go} Updated filter functions and test cases to use id.SceneID/List types instead of scene.ID/List.
server/pkg/nlslayer/{builder.go, group.go, group_builder.go, id.go (removed), loader.go, nlslayer.go, simple.go, simple_builder.go} Removed legacy type aliases and refactored all scene identifier function signatures to use id.SceneID.
server/pkg/plugin/{id.go (removed aliases), manifest/convert.go, manifest/convert_test.go, parser.go, plugin.go, pluginpack/package.go} Changed function parameters from plugin.SceneID to id.SceneID and removed obsolete SceneID aliases.
server/pkg/property/{builder.go, builder_test.go, id.go (removed), initializer.go, initializer_test.go, item_test.go, list_test.go, loader_test.go, merged_test.go, property.go, property_test.go, schema.go, sealed_test.go} Transitioned property and scene identifier types to id.SceneID and updated corresponding ID creation calls (e.g. NewSceneID()), eliminating legacy aliases.
server/pkg/scene/{...} Comprehensive refactoring: All widget, plugin, scene, and style related functions, structs, and tests now use id.* types; removed legacy ID aliases and updated error handling to reference errors like id.ErrInvalidID.
server/pkg/storytelling/{id.go, story.go, story_bulider.go, story_bulider_test.go, story_test.go} Updated the Story struct’s scene field and Scene() method to use id.SceneID; removed the SceneID alias and adjusted test cases to call id.NewSceneID().

Possibly related PRs

Poem

I'm a rabbit hopping in the code so bright,
Leaving behind old IDs in the night.
New id.SceneID makes my software sing,
As I nibble bugs with a joyful spring.
Carrots and refactors—the future is light!
Happy hops to a refactored delight!

✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

netlify bot commented Mar 19, 2025

Deploy Preview for reearth-web ready!

Name Link
🔨 Latest commit ac6a1a3
🔍 Latest deploy log https://app.netlify.com/sites/reearth-web/deploys/67dcb7dc969d9700080acdfc
😎 Deploy Preview https://deploy-preview-1516--reearth-web.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca9cce2 and 12f36de.

📒 Files selected for processing (92)
  • server/e2e/gql_project_test.go (3 hunks)
  • server/e2e/seeder.go (2 hunks)
  • server/internal/adapter/gql/gqlmodel/convert_project_test.go (2 hunks)
  • server/internal/app/web_test.go (2 hunks)
  • server/internal/infrastructure/memory/asset.go (3 hunks)
  • server/internal/infrastructure/memory/project.go (1 hunks)
  • server/internal/infrastructure/mongo/container.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/nlslayer.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/property.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/property_schema.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/style.go (1 hunks)
  • server/internal/usecase/interactor/asset_test.go (4 hunks)
  • server/internal/usecase/interactor/project_test.go (2 hunks)
  • server/internal/usecase/interactor/scene.go (1 hunks)
  • server/internal/usecase/interactor/scene_plugin_test.go (4 hunks)
  • server/internal/usecase/interactor/storytelling.go (1 hunks)
  • server/internal/usecase/operator.go (2 hunks)
  • server/internal/usecase/repo/container.go (4 hunks)
  • server/internal/usecase/repo/container_test.go (2 hunks)
  • server/pkg/asset/asset.go (2 hunks)
  • server/pkg/asset/asset_test.go (2 hunks)
  • server/pkg/asset/builder.go (3 hunks)
  • server/pkg/asset/builder_test.go (10 hunks)
  • server/pkg/asset/id.go (0 hunks)
  • server/pkg/id/id.go (0 hunks)
  • server/pkg/nlslayer/builder.go (1 hunks)
  • server/pkg/nlslayer/group.go (1 hunks)
  • server/pkg/nlslayer/group_builder.go (1 hunks)
  • server/pkg/nlslayer/id.go (0 hunks)
  • server/pkg/nlslayer/loader.go (2 hunks)
  • server/pkg/nlslayer/nlslayer.go (3 hunks)
  • server/pkg/nlslayer/simple.go (1 hunks)
  • server/pkg/nlslayer/simple_builder.go (1 hunks)
  • server/pkg/plugin/id.go (0 hunks)
  • server/pkg/plugin/manifest/convert.go (2 hunks)
  • server/pkg/plugin/manifest/convert_test.go (2 hunks)
  • server/pkg/plugin/manifest/parser.go (4 hunks)
  • server/pkg/plugin/plugin.go (2 hunks)
  • server/pkg/plugin/pluginpack/package.go (2 hunks)
  • server/pkg/project/builder.go (5 hunks)
  • server/pkg/project/builder_test.go (6 hunks)
  • server/pkg/project/id.go (0 hunks)
  • server/pkg/project/project.go (6 hunks)
  • server/pkg/property/builder.go (2 hunks)
  • server/pkg/property/builder_test.go (4 hunks)
  • server/pkg/property/id.go (0 hunks)
  • server/pkg/property/initializer.go (4 hunks)
  • server/pkg/property/initializer_test.go (3 hunks)
  • server/pkg/property/item_test.go (3 hunks)
  • server/pkg/property/list_test.go (1 hunks)
  • server/pkg/property/loader_test.go (2 hunks)
  • server/pkg/property/merged_test.go (2 hunks)
  • server/pkg/property/property.go (2 hunks)
  • server/pkg/property/property_test.go (6 hunks)
  • server/pkg/property/schema.go (2 hunks)
  • server/pkg/property/sealed_test.go (2 hunks)
  • server/pkg/scene/builder.go (4 hunks)
  • server/pkg/scene/builder/decoder.go (1 hunks)
  • server/pkg/scene/builder/scene.go (2 hunks)
  • server/pkg/scene/builder/scene_test.go (3 hunks)
  • server/pkg/scene/builder_test.go (7 hunks)
  • server/pkg/scene/id.go (0 hunks)
  • server/pkg/scene/list.go (2 hunks)
  • server/pkg/scene/list_test.go (2 hunks)
  • server/pkg/scene/plugin.go (1 hunks)
  • server/pkg/scene/plugin_test.go (1 hunks)
  • server/pkg/scene/plugins.go (8 hunks)
  • server/pkg/scene/plugins_test.go (19 hunks)
  • server/pkg/scene/scene.go (3 hunks)
  • server/pkg/scene/scene_test.go (2 hunks)
  • server/pkg/scene/sceneops/plugin_installer.go (2 hunks)
  • server/pkg/scene/sceneops/plugin_migrator_test.go (1 hunks)
  • server/pkg/scene/style.go (2 hunks)
  • server/pkg/scene/style_builder.go (3 hunks)
  • server/pkg/scene/style_test.go (2 hunks)
  • server/pkg/scene/widget.go (3 hunks)
  • server/pkg/scene/widget_align_system.go (4 hunks)
  • server/pkg/scene/widget_align_system_test.go (11 hunks)
  • server/pkg/scene/widget_area.go (6 hunks)
  • server/pkg/scene/widget_area_test.go (12 hunks)
  • server/pkg/scene/widget_section.go (3 hunks)
  • server/pkg/scene/widget_section_test.go (5 hunks)
  • server/pkg/scene/widget_test.go (5 hunks)
  • server/pkg/scene/widget_zone.go (3 hunks)
  • server/pkg/scene/widget_zone_test.go (5 hunks)
  • server/pkg/scene/widgets.go (7 hunks)
  • server/pkg/scene/widgets_test.go (9 hunks)
  • server/pkg/storytelling/id.go (0 hunks)
  • server/pkg/storytelling/story.go (3 hunks)
  • server/pkg/storytelling/story_bulider.go (2 hunks)
  • server/pkg/storytelling/story_bulider_test.go (2 hunks)
  • server/pkg/storytelling/story_test.go (2 hunks)
💤 Files with no reviewable changes (8)
  • server/pkg/nlslayer/id.go
  • server/pkg/storytelling/id.go
  • server/pkg/property/id.go
  • server/pkg/plugin/id.go
  • server/pkg/project/id.go
  • server/pkg/asset/id.go
  • server/pkg/id/id.go
  • server/pkg/scene/id.go
🧰 Additional context used
🧬 Code Definitions (42)
server/internal/adapter/gql/gqlmodel/convert_project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/pkg/property/builder.go (3)
server/pkg/nlslayer/builder.go (9) (9)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
  • Builder (5-7)
server/pkg/scene/builder.go (1) (1)
  • Builder (10-12)
server/pkg/scene/scene.go (11) (11)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
server/pkg/property/sealed_test.go (5)
server/pkg/property/builder.go (1) (1)
  • New (9-11)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/usecase/interfaces/scene.go (1) (1)
  • Scene (20-33)
server/pkg/property/schema.go (2)
server/pkg/plugin/plugin.go (12) (12)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/infrastructure/mongo/mongodoc/property.go (2)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/internal/usecase/repo/container.go (8) (8)
  • f (90-95)
  • f (97-119)
  • f (121-123)
  • f (125-127)
  • f (141-164)
  • f (166-171)
  • f (173-175)
  • f (177-179)
server/e2e/gql_project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/e2e/seeder.go (1)
server/pkg/id/id.go (2) (2)
  • NewAssetID (62-62)
  • SceneID (50-50)
server/internal/usecase/interactor/project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/pkg/nlslayer/simple_builder.go (2)
server/pkg/nlslayer/builder.go (8) (8)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
server/pkg/nlslayer/group_builder.go (8) (8)
  • b (32-37)
  • b (39-45)
  • b (47-50)
  • b (52-55)
  • b (57-60)
  • b (62-65)
  • b (67-70)
  • b (72-75)
server/internal/infrastructure/memory/asset.go (4)
server/internal/infrastructure/mongo/mongodoc/asset.go (1) (1)
  • d (55-85)
server/internal/infrastructure/mongo/mongodoc/scene.go (2) (2)
  • d (111-176)
  • d (211-221)
server/internal/infrastructure/mongo/mongodoc/storytelling.go (3) (3)
  • d (154-205)
  • d (207-251)
  • d (253-282)
server/pkg/asset/asset.go (10) (10)
  • a (29-31)
  • a (33-35)
  • a (37-39)
  • a (41-43)
  • a (45-47)
  • a (49-51)
  • a (53-55)
  • a (57-59)
  • a (61-63)
  • a (65-70)
server/internal/infrastructure/mongo/mongodoc/property_schema.go (2)
server/pkg/property/schema.go (1) (1)
  • Schema (5-10)
server/internal/usecase/repo/container.go (8) (8)
  • f (90-95)
  • f (97-119)
  • f (121-123)
  • f (125-127)
  • f (141-164)
  • f (166-171)
  • f (173-175)
  • f (177-179)
server/internal/infrastructure/memory/project.go (4)
server/internal/infrastructure/mongo/project.go (17) (17)
  • r (39-41)
  • r (43-48)
  • r (50-63)
  • r (65-72)
  • r (74-89)
  • r (91-118)
  • r (120-136)
  • r (138-150)
  • r (152-168)
  • r (170-179)
  • r (181-193)
  • r (195-201)
  • r (203-205)
  • r (207-213)
  • r (215-225)
  • r (227-251)
  • Project (27-31)
server/internal/usecase/interfaces/project.go (1) (1)
  • Project (63-76)
server/internal/usecase/repo/project.go (1) (1)
  • Project (19-32)
server/pkg/id/id.go (3) (3)
  • Project (10-10)
  • Project (29-29)
  • ProjectID (47-47)
server/pkg/scene/list.go (2)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/id/id.go (3) (3)
  • Scene (15-15)
  • Scene (34-34)
  • SceneID (50-50)
server/pkg/nlslayer/builder.go (3)
server/pkg/nlslayer/group_builder.go (16) (16)
  • b (32-37)
  • b (39-45)
  • b (47-50)
  • b (52-55)
  • b (57-60)
  • b (62-65)
  • b (67-70)
  • b (72-75)
  • b (77-80)
  • b (82-85)
  • b (87-90)
  • b (92-95)
  • b (97-100)
  • b (102-105)
  • b (107-110)
  • b (112-115)
server/pkg/scene/builder.go (1) (1)
  • Builder (10-12)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/scene/widget_zone_test.go (2)
server/pkg/scene/widget_zone.go (4) (4)
  • WidgetSectionLeft (15-15)
  • WidgetSectionCenter (16-16)
  • WidgetSectionRight (17-17)
  • WidgetSectionType (12-12)
server/pkg/scene/widget_section.go (1) (1)
  • WidgetAreaTop (15-15)
server/internal/usecase/interactor/asset_test.go (6)
server/pkg/id/id.go (8) (8)
  • NewProjectID (66-66)
  • Asset (5-5)
  • Asset (24-24)
  • Workspace (16-16)
  • Workspace (35-35)
  • ProjectID (47-47)
  • Project (10-10)
  • Project (29-29)
server/internal/infrastructure/memory/asset.go (1) (1)
  • Asset (18-21)
server/pkg/asset/asset.go (1) (1)
  • Asset (17-27)
server/internal/usecase/interactor/asset.go (1) (1)
  • Asset (25-28)
server/internal/usecase/interfaces/asset.go (2) (2)
  • Asset (36-43)
  • CreateAssetParam (25-30)
server/internal/infrastructure/memory/project.go (1) (1)
  • Project (18-22)
server/pkg/storytelling/story.go (1)
server/pkg/scene/scene.go (11) (11)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • Scene (13-22)
server/pkg/nlslayer/group_builder.go (3)
server/pkg/nlslayer/builder.go (8) (8)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
server/pkg/nlslayer/simple_builder.go (8) (8)
  • b (32-37)
  • b (39-45)
  • b (47-50)
  • b (52-55)
  • b (57-60)
  • b (62-65)
  • b (67-70)
  • b (72-75)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/nlslayer/loader.go (1)
server/pkg/nlslayer/nlslayer_list.go (1) (1)
  • NLSLayerList (9-9)
server/pkg/plugin/pluginpack/package.go (1)
server/internal/usecase/repo/container.go (2) (2)
  • r (98-98)
  • r (142-142)
server/pkg/scene/scene_test.go (4)
server/pkg/scene/scene.go (12) (12)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/scene/plugin.go (2) (2)
  • s (17-22)
  • s (24-29)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/scene/widget.go (1) (1)
  • Widget (5-12)
server/pkg/property/list_test.go (4)
server/pkg/property/id.go (2) (2)
  • ID (7-7)
  • NewID (13-13)
server/pkg/property/builder.go (1) (1)
  • New (9-11)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/property/item_test.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • NewID (16-16)
server/pkg/plugin/id.go (1) (1)
  • NewID (10-10)
server/pkg/property/id.go (1) (1)
  • NewID (13-13)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/property/initializer.go (3)
server/pkg/plugin/plugin.go (12) (12)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/property/id.go (1) (1)
  • SchemaID (10-10)
server/pkg/nlslayer/nlslayer.go (3)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/usecase/interactor/scene.go (1) (1)
  • Scene (28-43)
server/pkg/nlslayer/simple.go (16) (16)
  • l (9-11)
  • l (13-15)
  • l (17-22)
  • l (24-26)
  • l (28-30)
  • l (32-34)
  • l (36-41)
  • l (43-48)
  • l (50-55)
  • l (57-62)
  • l (64-69)
  • l (71-77)
  • l (79-84)
  • l (86-96)
  • l (98-103)
  • l (105-110)
server/pkg/property/builder_test.go (2)
server/pkg/property/id.go (6) (6)
  • ID (7-7)
  • MustSchemaID (19-19)
  • NewID (13-13)
  • NewItemID (14-14)
  • FieldID (9-9)
  • SchemaGroupID (11-11)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/scene/style.go (1)
server/pkg/scene/scene.go (11) (11)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • Scene (13-22)
server/pkg/asset/asset.go (5)
server/pkg/id/id.go (8) (8)
  • AssetID (43-43)
  • ProjectID (47-47)
  • Asset (5-5)
  • Asset (24-24)
  • Workspace (16-16)
  • Workspace (35-35)
  • Project (10-10)
  • Project (29-29)
server/internal/usecase/interactor/asset.go (1) (1)
  • Asset (25-28)
server/internal/usecase/interfaces/asset.go (1) (1)
  • Asset (36-43)
server/internal/usecase/repo/asset.go (1) (1)
  • Asset (18-27)
server/internal/usecase/interactor/project.go (1) (1)
  • Project (34-50)
server/pkg/scene/widgets_test.go (4)
server/pkg/scene/widget.go (2) (2)
  • MustWidget (29-35)
  • Widget (5-12)
server/pkg/scene/widgets.go (2) (2)
  • Widgets (13-16)
  • NewWidgets (18-42)
server/pkg/plugin/id.go (2) (2)
  • NewID (10-10)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • NewID (13-13)
  • ID (7-7)
server/pkg/scene/style_builder.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • ErrInvalidID (21-21)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
server/pkg/storytelling/id.go (1) (1)
  • ErrInvalidID (19-19)
server/pkg/scene/plugins_test.go (4)
server/pkg/storytelling/id.go (3) (3)
  • NewPropertyID (15-15)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/scene/plugins.go (2) (2)
  • Plugins (5-7)
  • NewPlugins (9-30)
server/pkg/scene/plugin.go (2) (2)
  • Plugin (5-8)
  • NewPlugin (10-15)
server/pkg/plugin/id.go (1) (1)
  • OfficialPluginID (22-22)
server/pkg/asset/builder.go (3)
server/pkg/id/id.go (7) (7)
  • AssetID (43-43)
  • NewAssetID (62-62)
  • Workspace (16-16)
  • Workspace (35-35)
  • Project (10-10)
  • Project (29-29)
  • ProjectID (47-47)
server/pkg/asset/asset.go (10) (10)
  • a (29-31)
  • a (33-35)
  • a (37-39)
  • a (41-43)
  • a (45-47)
  • a (49-51)
  • a (53-55)
  • a (57-59)
  • a (61-63)
  • a (65-70)
server/pkg/project/project.go (1) (1)
  • Project (32-57)
server/pkg/scene/plugin.go (2)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/scene/widgets.go (1)
server/pkg/scene/widget.go (11) (11)
  • w (37-39)
  • w (41-43)
  • w (45-47)
  • w (49-51)
  • w (53-58)
  • w (60-65)
  • w (67-72)
  • w (74-79)
  • w (81-93)
  • w (95-100)
  • Widget (5-12)
server/pkg/scene/widget_test.go (5)
server/pkg/storytelling/id.go (5) (5)
  • NewPropertyID (15-15)
  • PluginID (9-9)
  • PluginExtensionID (10-10)
  • PropertyID (8-8)
  • ErrInvalidID (19-19)
server/pkg/plugin/id.go (2) (2)
  • ID (5-5)
  • ErrInvalidID (23-23)
server/pkg/property/id.go (2) (2)
  • ID (7-7)
  • ErrInvalidID (36-36)
server/pkg/nlslayer/id.go (4) (4)
  • PluginID (12-12)
  • PluginExtensionID (13-13)
  • PropertyID (9-9)
  • ErrInvalidID (21-21)
server/pkg/scene/widget.go (1) (1)
  • MustWidget (29-35)
server/pkg/scene/plugins.go (6)
server/pkg/plugin/plugin.go (13) (13)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
  • Plugin (9-18)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/plugin/id.go (1) (1)
  • OfficialPluginID (22-22)
server/pkg/scene/plugin.go (1) (1)
  • Plugin (5-8)
server/pkg/scene/builder.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • ErrInvalidID (21-21)
server/pkg/storytelling/id.go (1) (1)
  • ErrInvalidID (19-19)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
server/internal/usecase/interactor/storytelling.go (1)
server/internal/usecase/repo/container.go (1) (1)
  • SceneFilter (129-132)
server/pkg/scene/scene.go (9)
server/pkg/id/id.go (11) (11)
  • SceneID (50-50)
  • ProjectID (47-47)
  • PropertyID (48-48)
  • Scene (15-15)
  • Scene (34-34)
  • Project (10-10)
  • Project (29-29)
  • Workspace (16-16)
  • Workspace (35-35)
  • Property (11-11)
  • Property (30-30)
server/pkg/scene/widgets.go (1) (1)
  • Widgets (13-16)
server/pkg/scene/plugins.go (1) (1)
  • Plugins (5-7)
server/internal/usecase/interactor/scene.go (1) (1)
  • Scene (28-43)
server/internal/usecase/interfaces/scene.go (1) (1)
  • Scene (20-33)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/internal/usecase/interactor/project.go (1) (1)
  • Project (34-50)
server/internal/usecase/interfaces/project.go (1) (1)
  • Project (63-76)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/project/builder.go (4)
server/pkg/scene/builder.go (12) (12)
  • b (18-35)
  • b (37-43)
  • b (45-48)
  • b (50-53)
  • b (55-58)
  • b (60-63)
  • b (65-68)
  • b (70-73)
  • b (75-78)
  • b (80-83)
  • b (85-88)
  • Builder (10-12)
server/pkg/id/id.go (7) (7)
  • ProjectID (47-47)
  • NewProjectID (66-66)
  • Workspace (16-16)
  • Workspace (35-35)
  • Scene (15-15)
  • Scene (34-34)
  • SceneID (50-50)
server/pkg/project/project.go (16) (16)
  • p (59-61)
  • p (63-65)
  • p (67-69)
  • p (71-73)
  • p (75-77)
  • p (79-81)
  • p (83-85)
  • p (87-89)
  • p (91-93)
  • p (95-97)
  • p (99-106)
  • p (108-110)
  • p (112-114)
  • p (116-118)
  • p (120-122)
  • p (124-126)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/scene/builder_test.go (3)
server/pkg/id/id.go (11) (11)
  • Property (11-11)
  • Property (30-30)
  • NewProjectID (66-66)
  • Project (10-10)
  • Project (29-29)
  • Widget (18-18)
  • Widget (37-37)
  • NewWidgetID (70-70)
  • SceneID (50-50)
  • ProjectID (47-47)
  • PropertyID (48-48)
server/pkg/scene/builder.go (12) (12)
  • b (18-35)
  • b (37-43)
  • b (45-48)
  • b (50-53)
  • b (55-58)
  • b (60-63)
  • b (65-68)
  • b (70-73)
  • b (75-78)
  • b (80-83)
  • b (85-88)
  • New (14-16)
server/pkg/scene/widgets.go (2) (2)
  • NewWidgets (18-42)
  • Widgets (13-16)
server/pkg/scene/widget.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • ErrInvalidID (21-21)
server/pkg/storytelling/id.go (1) (1)
  • ErrInvalidID (19-19)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
🔇 Additional comments (297)
server/internal/infrastructure/mongo/mongodoc/nlslayer.go (1)

134-134: Approve the type refactoring for scene IDs.

The change from scene.IDList to id.SceneIDList aligns with the PR objective of consolidating scene IDs into the central id package. This refactoring reduces code duplication and improves type consistency across the codebase.

server/internal/infrastructure/mongo/mongodoc/property.go (1)

150-150: Approve the parameter type update for centralized ID management.

Changing the parameter type from scene.IDList to id.SceneIDList is consistent with the overall refactoring goal. The function implementation remains unchanged, indicating that the behavior of id.SceneIDList.Has() matches the previous implementation.

server/internal/infrastructure/mongo/mongodoc/property_schema.go (1)

124-124: Approve the parameter type update for consistent ID handling.

The change from scene.IDList to id.SceneIDList follows the same pattern of ID centralization. This standardization helps maintain type safety and reduces the risk of type conflicts or confusion when working with different scene ID types.

server/pkg/plugin/pluginpack/package.go (2)

13-13: Approve the import replacement.

Replacing the plugin package import with the id package is appropriate since we're now using the centralized ID types rather than package-specific ones.


27-27: Approve the parameter type update for consistent scene ID handling.

Changing the parameter type from *plugin.SceneID to *id.SceneID aligns with the centralization of ID types. The function implementation doesn't change, indicating that both types are functionally compatible in this context.

server/internal/infrastructure/mongo/container.go (2)

129-134: ID type successfully updated to use centralized definition.

The parameter type for applySceneFilter has been correctly updated from scene.IDList to id.SceneIDList as part of the ID unification effort. The function's internal logic remains unchanged, which is appropriate since only the type source has changed, not the behavior.


136-145: Consistent type update applied.

The applyOptionalSceneFilter function parameter has been properly updated from scene.IDList to id.SceneIDList, maintaining consistency with the other changes in this PR. The implementation logic continues to work as before since only the type definition source has changed.

server/pkg/scene/widget_zone_test.go (10)

6-6: Appropriate import added.

The import of the id package has been correctly added to support the ID type changes throughout this file.


25-31: Widget ID creation updated to use centralized ID package.

Widget ID creation has been properly migrated from local package-specific NewWidgetID() to the centralized id.NewWidgetID() function, aligning with the PR's goal of unifying ID handling.


35-35: Input type correctly updated.

The test struct's Input field type has been updated from WidgetID to id.WidgetID, maintaining type consistency with the other changes.


64-64: Widget ID creation properly updated.

The ID creation in the "invalid id" test case has been correctly updated to use the centralized ID package.


93-95: Widget ID list type properly updated.

The widget ID list type has been correctly updated from WidgetIDList to id.WidgetIDList in the test setup, maintaining consistency with the unified ID approach.


106-106: Widget ID creation correctly updated.

Widget ID creation has been properly updated to use the centralized id.NewWidgetID() function.


112-112: Input parameter type successfully updated.

The test struct's Input field type has been updated to use the centralized ID package.


119-125: Expected list type properly updated.

The Expected field type has been correctly updated to use id.WidgetIDList instead of local package-specific types. All test cases maintain their logical expectations.


124-137: Widget ID creation and list types consistently updated.

All instances of widget ID creation and list types have been properly updated to use the centralized ID package in these test cases.


143-149: Remaining widget ID list types properly updated.

The remaining test cases have been correctly updated to use id.WidgetIDList, completing the consistent implementation of the unified ID approach throughout the test file.

server/pkg/scene/list.go (4)

3-6: Necessary imports added.

The imports for the id and accountdomain packages have been correctly added to support the type changes in this file.


10-20: IDs method return type successfully updated.

The return type of the IDs method has been properly updated from []ID to []id.SceneID, aligning with the unified ID model. The internal implementation remains logically unchanged.


22-38: FilterByID parameter type correctly updated.

The parameter type for the FilterByID method has been updated from package-specific IDs to id.SceneID, maintaining consistent type usage throughout the codebase. The filtering logic remains intact.


40-56: FilterByWorkspace parameter type properly updated.

The parameter type for the FilterByWorkspace method has been updated from WorkspaceID to accountdomain.WorkspaceID, completing the unified ID approach. The filtering logic remains unchanged.

server/internal/usecase/operator.go (5)

15-18: Operator struct fields properly updated.

The scene-related fields in the Operator struct have been correctly updated to use id.SceneIDList instead of scene.IDList, maintaining consistent type usage across the codebase.


73-75: AllReadableScenes return type successfully updated.

The return type of the AllReadableScenes method has been properly updated from scene.IDList to id.SceneIDList. The implementation logic remains appropriate, preserving the original behavior.


77-79: AllWritableScenes return type correctly updated.

The return type of the AllWritableScenes method has been properly updated to use the centralized ID type. The implementation continues to function as before.


81-83: AllMaintainingScenes return type properly updated.

The return type of the AllMaintainingScenes method has been correctly updated to use id.SceneIDList, maintaining consistency with the other methods.


85-87: AllOwningScenes return type successfully updated.

The return type of the AllOwningScenes method has been properly updated to use the centralized ID type, completing the consistent implementation across all scene-related methods.

server/pkg/scene/plugins.go (10)

3-4: Added import for the central ID package.

The addition of the id package import is consistent with the PR objective of refactoring scene IDs and centralizing ID management.


36-43: Updated method signature to use the central ID package.

Changed the parameter and return types from local PluginID and PropertyID types to id.PluginID and id.PropertyID. This change aligns with the PR objective of consolidating ID types.


45-52: Updated method signature to use the central ID package.

Changed the parameter type from local PluginID to id.PluginID. This change is consistent with the overall refactoring approach.


54-61: Updated method signature to use the central ID package.

Changed the parameter type from local PluginID to id.PluginID. This change is consistent with the overall refactoring approach.


73-73: Updated reference to use the central ID package.

Changed the reference from local OfficialPluginID to id.OfficialPluginID. This ensures consistency in how plugin identifiers are referenced throughout the codebase.


80-81: Updated method signature and reference to use the central ID package.

Changed the parameter type from local PluginID to id.PluginID and updated the reference to OfficialPluginID. This ensures consistency in the ID type usage.


92-93: Updated method signature and reference to use the central ID package.

Changed the parameter types from local ID types to centralized id package types and updated the condition to use id.OfficialPluginID. This maintains consistency with the refactoring objective.


101-101: Updated variable type to use the central ID package.

Changed the variable type from local PropertyID to id.PropertyID. This ensures type consistency throughout the method.


113-117: Updated method signature and return type to use the central ID package.

Changed the return type from local PropertyID to id.PropertyID. This maintains consistency with the refactoring objective.


126-133: Updated method signature to use the central ID package.

Changed the parameter type from local PluginID to id.PluginID. This change is consistent with the overall refactoring approach.

server/pkg/plugin/manifest/convert_test.go (2)

7-7: Added import for the central ID package.

The addition of the id package import supports the changes to use centralized ID types in the test code.


62-62: Updated field type to use the central ID package.

Changed the type of the scene field from *plugin.SceneID to *id.SceneID. This is consistent with the PR objective of consolidating ID types to a central package.

server/pkg/nlslayer/simple.go (1)

28-30: Updated method return type to use the central ID package.

Changed the return type from local SceneID to id.SceneID. This change is consistent with the PR objective of consolidating scene ID types across the codebase.

server/pkg/scene/style_test.go (1)

6-6: Correct import and SceneID usage.

The changes properly implement the centralized ID approach by importing the id package and using id.NewSceneID() instead of the local implementation. This aligns with the PR's objective to unify scene IDs across packages.

Also applies to: 16-16

server/pkg/storytelling/story_bulider_test.go (1)

6-6: Properly migrated to centralized ID generation.

The changes correctly implement the centralized ID approach by importing the id package and using id.NewSceneID() instead of the local implementation. This is consistent with the unification of scene IDs across the codebase.

Also applies to: 28-28

server/pkg/nlslayer/group.go (1)

26-26: Updated return type to use centralized ID type.

The Scene() method's return type has been properly updated to use id.SceneID from the centralized id package. This is consistent with the PR's objective to unify scene IDs across the codebase.

server/pkg/nlslayer/builder.go (1)

36-36: Updated parameter type to use centralized ID type.

The Scene() method's parameter type has been properly updated to use id.SceneID from the centralized id package. This is consistent with the PR's objective to unify scene IDs and with similar changes in other parts of the codebase, such as the NLSLayerGroupBuilder implementation.

server/internal/infrastructure/mongo/mongodoc/style.go (1)

34-34: Parameter type updated correctly

The parameter type has been correctly changed from scene.IDList to id.SceneIDList, which aligns with the PR's objective to unify scene IDs across the codebase. This change maintains API compatibility since both types appear to have compatible interfaces, as evidenced by the use of the Has method in the function body.

server/internal/adapter/gql/gqlmodel/convert_project_test.go (2)

8-8: Added needed import for id package

The import of the id package is appropriately added to support the use of id.NewProjectID() function later in the code.


48-48: ID creation standardized to use central id package

Changed from using project.NewID() to id.NewProjectID() which aligns with the PR's objective to standardize ID management through the central id package. The test will continue to work as expected since both functions generate valid project IDs.

server/e2e/gql_project_test.go (3)

11-11: Added needed import for id package

The import of the id package is appropriately added to support the use of id.NewProjectID() function later in the code.


527-527: ID creation standardized to use central id package

Correctly changed from using project.NewID() to id.NewProjectID() which aligns with the PR's objective to standardize ID management through the central id package.


545-545: ID creation standardized to use central id package

Correctly changed from using project.NewID() to id.NewProjectID() which aligns with the PR's objective to standardize ID management through the central id package.

server/pkg/property/schema.go (2)

3-3: Added needed import for id package

The import of the id package is appropriately added to support the use of id.SceneID type later in the code.


28-28: Return type updated to use centralized ID type

The return type has been correctly changed from *SceneID to *id.SceneID, which aligns with the PR's objective to unify scene IDs across the codebase. This change ensures that the Schema type now returns the standardized scene ID type, increasing consistency and type safety across the application.

Looking at the implementation (return p.id.Plugin().Scene()), this still works correctly because the Plugin's Scene() method would also need to return the updated type.

server/pkg/plugin/manifest/convert.go (2)

7-8: Import updated to use centralized id package

This change aligns with the PR objective of consolidating scene IDs to a single package.


17-17: Method signature updated to use centralized id.SceneID type

The parameter type has been changed from *plugin.SceneID to *id.SceneID, which aligns with the PR objective of reducing redundant SceneID types across packages.

server/pkg/property/sealed_test.go (2)

7-7: Added import for the centralized id package

This import is necessary to use the centralized SceneID type from the id package.


172-172: Updated SceneID instantiation to use centralized method

Changed from package-specific NewSceneID() to the centralized id.NewSceneID(), which is consistent with the overall ID refactoring approach.

server/pkg/property/builder.go (2)

3-4: Added import for centralized id package

This import enables the use of types from the central ID management package.


44-47: Updated Scene method to use centralized id.SceneID type

The parameter type has been changed to use the consolidated SceneID type from the id package, maintaining builder method consistency while aligning with the refactoring goals.

server/internal/usecase/interactor/storytelling.go (1)

1092-1092: Updated filter to use id.SceneIDList instead of scene-specific list

Changed from package-specific scene.IDList to the centralized id.SceneIDList, maintaining consistent usage of the id package throughout the codebase.

server/pkg/nlslayer/simple_builder.go (1)

72-72: Consistent refactoring to use centralized ID type.

This change updates the parameter type from a package-specific SceneID to the centralized id.SceneID, aligning with the PR objective to unify scene IDs across the codebase.

server/pkg/plugin/plugin.go (2)

6-6: Added import for the id package.

Appropriately adding the import for the centralized ID package to support the scene ID refactoring.


34-34: Updated method return type to use centralized ID.

This change updates the return type from a package-specific *SceneID to the centralized *id.SceneID, maintaining the function's behavior while aligning with the ID unification objective.

server/pkg/scene/sceneops/plugin_migrator_test.go (1)

19-19: Updated scene ID creation to use centralized function.

Replaced what was likely scene.NewID() with id.NewSceneID(), correctly transitioning to the centralized ID creation method.

server/pkg/storytelling/story_test.go (2)

7-7: Added import for centralized ID package.

Correctly added the import for the id package to support the scene ID refactoring.


17-17: Updated scene ID creation to use centralized function.

Changed from a package-specific scene ID creation to the centralized id.NewSceneID() function, correctly implementing the ID unification strategy.

server/pkg/scene/sceneops/plugin_installer.go (2)

6-6: Import updated to use centralized id package.

The import statement has been updated to use the centralized id package instead of a package-specific import. This aligns with the PR's objective to unify ID management across the codebase.


15-15: Method signature updated to use id.PluginID.

The parameter type in the InstallPluginFromRepository method has been changed from scene.PluginID to id.PluginID, which is consistent with the PR's goal to consolidate ID types to a central location.

server/pkg/nlslayer/group_builder.go (1)

72-72: Method signature updated to use id.SceneID.

The parameter type in the Scene method has been changed from SceneID to id.SceneID. This change is consistent with the same pattern applied to other builder methods across the codebase, such as those in builder.go and simple_builder.go.

server/pkg/property/loader_test.go (3)

7-7: Import added for centralized id package.

The import statement for the id package has been added, which is necessary for the updated ID instantiation calls.


12-12: Updated to use id.NewSceneID().

The instantiation of the scene variable has been updated to use id.NewSceneID() instead of a local or package-specific function. This change aligns with the PR's goal to consolidate ID types and creation methods to a central package.


30-30: Updated to use id.NewSceneID().

Similar to the change in TestLoaderFrom, the instantiation of the scene variable in TestLoaderFromMap has been updated to use id.NewSceneID(), maintaining consistency in how scene IDs are created across the codebase.

server/pkg/scene/plugin_test.go (2)

6-6: Import added for centralized id package.

The import statement for the id package has been added, which is necessary for the updated ID instantiation calls.


11-12: Updated to use centralized id methods.

The instantiation of plugin and property IDs has been updated to use methods from the id package (id.MustPluginID and id.NewPropertyID). This change aligns with the PR's goal to consolidate ID types and creation methods.

server/internal/app/web_test.go (2)

20-20: Import added for accountdomain package

This import is now needed since the code uses accountdomain.NewWorkspaceID() instead of project.NewWorkspaceID().


38-38: Workspace ID generation moved to accountdomain package

The change replaces project.NewWorkspaceID() with accountdomain.NewWorkspaceID(), which aligns with centralizing the ID management in appropriate packages.

server/internal/usecase/interactor/project_test.go (2)

11-11: Import added for id package

This import is necessary for using the centralized ID generation functions.


42-42: Project ID generation moved to id package

The change replaces project.NewID() with id.NewProjectID(), which aligns with the PR objective of consolidating ID declarations in the central id package. The code also removes the mocking functions that were previously needed for project IDs.

server/pkg/scene/builder/decoder.go (1)

128-128: Scene ID list type updated to use the centralized id package

The change replaces scene.IDList{s} with id.SceneIDList{s} for both the Readable and Writable fields, aligning with the PR objective of using a unified SceneID type from the id package.

server/internal/usecase/interactor/scene.go (1)

555-555: Scene ID list type updated to use the centralized id package

The change replaces scene.IDList{s} with id.SceneIDList{s} for both the Readable and Writable fields, consistent with the changes made throughout the codebase to unify SceneID types.

server/pkg/scene/widgets_test.go (7)

6-6: Clean import of the ID package.

The code now correctly imports the centralized id package to align with the refactoring goals.


11-13: Properly migrated to centralized ID functions.

The code now uses the id package for ID generation functions, which improves consistency across the codebase.


119-119: Properly updated type for widget ID parameter.

The WidgetID type has been correctly updated to use id.WidgetID for consistency.


161-162: Consistently updated plugin and property ID types.

All plugin and property ID references have been properly migrated to use the centralized id package.

Also applies to: 153-156


243-246: Properly refactored widget and property IDs.

Widget and property ID generation consistently uses the id package, maintaining type safety throughout the test cases.


324-325: Type correctly updated in function parameters.

The WidgetID parameter type is consistently updated in the function signature.


365-366: Consistently refactored Widget ID type.

The id.WidgetID type is consistently used throughout the test structure.

server/pkg/scene/builder/scene.go (2)

7-7: Added import for centralized ID package.

The code now correctly imports the id package to support the refactored ID types.


90-90: Updated function signature to use centralized ID type.

The toString function now accepts []id.WidgetID instead of the package-specific type, enhancing consistency across the codebase.

server/pkg/asset/asset_test.go (3)

7-7: Added import for centralized ID package.

The code now correctly imports the id package for asset ID generation.


13-13: Updated asset ID creation to use the centralized function.

Using id.NewAssetID() instead of NewID() enhances consistency with the rest of the codebase.


20-22: Updated struct field types to use centralized ID types.

The test struct now properly uses id.AssetID and accountdomain.WorkspaceID instead of package-specific types, ensuring type consistency across the application.

server/pkg/property/property_test.go (2)

17-17: Updated scene ID initialization to use centralized package.

The code now uses id.NewSceneID() for consistent ID generation across the codebase.


100-100: Consistently refactored scene ID creation across test functions.

All instances of scene ID creation have been updated to use id.NewSceneID(), maintaining consistency throughout the test file.

Also applies to: 152-152, 203-203, 225-225, 240-240

server/internal/infrastructure/memory/project.go (1)

130-144: Centralized ID type implementation is correct.

The method signature has been updated to use id.ProjectID from the central ID package instead of a package-specific project.ID type. This change aligns with the PR objective of unifying ID types across packages.

server/pkg/property/merged_test.go (2)

6-6: Import of centralized ID package added correctly.

The import statement for the ID package has been added to support the revised scene ID implementation.


78-78: Scene ID creation updated to use centralized implementation.

Properly updated to use id.NewSceneID() instead of the package-specific NewSceneID() function, maintaining the same functionality while adopting the unified ID approach.

server/pkg/property/initializer_test.go (3)

6-6: Import of centralized ID package added correctly.

The import statement for the ID package has been added to support the revised scene ID implementation.


29-29: Scene ID creation updated to use centralized implementation.

Test has been updated to use id.NewSceneID() instead of the package-specific NewSceneID() function, maintaining test functionality while adopting the unified ID approach.


55-55: Scene ID creation updated to use centralized implementation.

Test has been updated to use id.NewSceneID() instead of the package-specific NewSceneID() function, maintaining test functionality while adopting the unified ID approach.

server/pkg/storytelling/story_bulider.go (2)

6-6: Import of centralized ID package added correctly.

The import statement for the ID package has been added to support the revised scene ID implementation.


54-54: Method signature updated to use centralized SceneID type.

The Scene method parameter has been correctly updated to use id.SceneID instead of a package-specific SceneID type, maintaining the same functionality while adopting the unified ID approach.

server/pkg/nlslayer/loader.go (2)

12-12: Type signature change to use centralized ID package.

The function type signature has been updated to use id.SceneID instead of a local SceneID type, which aligns with the ID unification effort described in the PR objectives.


78-78: Updated parameter type to match function signature.

The implementation correctly uses the id.SceneID type, maintaining consistency with the function type declaration on line 12.

server/e2e/seeder.go (2)

149-149: Using centralized asset ID generation.

The code now uses id.NewAssetID() instead of asset.NewID(), which aligns with the PR objective to consolidate ID generation in the id package.


354-354: Updated function parameter type to use centralized ID type.

The parameter type for SceneID has been changed from scene.ID to id.SceneID, maintaining consistency with other ID type changes in the codebase.

server/pkg/property/list_test.go (2)

6-6: Added import for the id package.

The import has been added to support using id.NewSceneID() in the test variables.


13-14: Updated scene ID generation in test variables.

Both test variables now use id.NewSceneID() instead of NewSceneID(), aligning with the centralized ID generation approach.

server/pkg/property/property.go (3)

8-8: Added import for the id package.

The import has been added to support using the id.SceneID type in the Property struct.


13-13: Updated struct field type to use centralized ID type.

The scene field type has been changed from a local SceneID type to id.SceneID, aligning with the ID unification effort.


29-29: Updated method return type to match field type.

The Scene() method's return type has been updated to id.SceneID to match the field type, maintaining type consistency.

server/pkg/project/builder_test.go (10)

9-9: Correctly adds import for the id package.

The import for the id package has been correctly added, which supports the centralized ID management pattern being implemented in this PR.


22-22: Project ID creation updated to use centralized id package.

The change from local NewID() to id.NewProjectID() correctly implements the ID unification pattern outlined in the PR objectives.


166-167: ProjectID creation correctly migrated to id package.

The project ID variable initialization has been properly updated to use the centralized ID generator from the id package.


174-175: Type declaration properly updated to use id.ProjectID.

The args struct field has been correctly updated to use the centralized ID type, enhancing type safety and consistency across the codebase.


180-181: Workspace type updated to accountdomain.WorkspaceID.

The workspace field type has been appropriately changed to use the standardized WorkspaceID from the accountdomain package.


240-241: Error reference correctly updated to use id.ErrInvalidID.

The error reference has been properly updated to use the centralized error definition from the id package.


287-288: ProjectID initialization updated for MustBuild test.

The project ID variable has been correctly updated to use the centralized ID generator from the id package.


295-296: Type declaration in MustBuild test properly updated.

The args struct field type has been correctly updated to use id.ProjectID, maintaining consistency with the rest of the codebase.


301-302: Workspace type in MustBuild test correctly updated.

The workspace field type has been appropriately changed to accountdomain.WorkspaceID, consistent with the earlier type change.


370-371: Error reference in MustBuild test updated to id.ErrInvalidID.

The error reference has been correctly updated to use the centralized error definition, maintaining consistency across the codebase.

server/pkg/scene/widget_section.go (3)

3-4: Import for id package correctly added.

The id package import has been properly added to support the usage of centralized ID types.


49-49: Find method signature updated to use centralized id.WidgetID type.

The method signature has been correctly updated to use id.WidgetID instead of the local WidgetID type, aligning with the ID unification goal.


66-66: Remove method signature updated to use centralized id.WidgetID type.

The method signature has been properly updated to use id.WidgetID, consistent with the earlier method signature change.

server/pkg/storytelling/story.go (3)

10-11: Import for id package correctly added.

The id package import has been properly added to support the usage of centralized ID types in the Story struct.


24-24: Story struct field type updated to use centralized id.SceneID.

The scene field type in the Story struct has been correctly updated to use id.SceneID, aligning with the project's ID unification goal.


54-54: Scene method return type updated to id.SceneID.

The Scene method signature has been properly updated to return id.SceneID instead of the local SceneID type, maintaining consistency with the struct field change.

server/pkg/property/item_test.go (3)

6-7: Import for id package correctly added.

The id package import has been properly added to support the usage of centralized ID creation functions in the tests.


64-64: Test updated to use centralized id.NewSceneID function.

The test code has been correctly updated to create scene IDs using the centralized id.NewSceneID() function instead of the package-specific version.


77-77: Second test updated to use centralized id.NewSceneID function.

This test has also been properly updated to use id.NewSceneID(), ensuring consistent usage of the centralized ID creation functions throughout the tests.

server/pkg/property/builder_test.go (3)

6-6: Great addition of the id package import.

This properly supports the ID refactoring effort by importing the central ID package.


17-17: Successful migration to centralized ID package.

All instances of NewSceneID() have been properly replaced with id.NewSceneID(), maintaining consistent behavior while centralizing ID generation.

Also applies to: 22-22, 27-27, 32-32, 81-81, 92-92


100-100: Correct type update for Scene field.

The type update from SceneID to id.SceneID correctly aligns with the centralized ID type definitions.

server/pkg/scene/widget_section_test.go (4)

6-6: Appropriate addition of id package import.

The import of the id package properly supports the ID refactoring effort.


25-32: Successful migration of widget ID generation.

All widget ID creation calls have been properly updated to use the centralized id.NewWidgetID() function.


35-35: Correct type updates for widget IDs.

The type signatures have been properly updated from local ID types to the centralized id.WidgetID and id.WidgetIDList types.

Also applies to: 103-104


86-88: Consistent migration of WidgetIDList usage.

All instances of WidgetIDList have been properly updated to use id.WidgetIDList, ensuring type consistency throughout the test.

Also applies to: 111-111, 117-118, 123-123, 129-130, 135-135, 141-142

server/pkg/scene/scene_test.go (4)

7-7: Appropriate addition of id package import.

The import of the id package properly supports the ID refactoring effort.


22-23: Successful migration of property ID generation.

Property ID creation calls have been properly updated to use the centralized id.NewPropertyID() function.


30-30: Correct migration of widget and plugin ID references.

The widget creation function now properly uses id.NewWidgetID() and id.MustPluginID(), consistent with the ID refactoring initiative.


35-35: Proper assertion type update.

The assertion has been updated to correctly expect []id.PropertyID instead of the previous local type, ensuring test consistency with the refactored types.

server/internal/usecase/interactor/asset_test.go (6)

17-17: Appropriate addition of id package import.

The import supports the ID refactoring effort by importing the central ID package.


30-30: Correct migration to project ID generation.

Project ID creation now uses the centralized id.NewProjectID() function, consistent with the ID refactoring initiative.


32-34: Improved file system handling in tests.

The test now uses a memory-mapped file system implementation via afero.NewMemMapFs(), which provides better isolation and consistency for tests.

Also applies to: 41-41


48-52: Enhanced asset creation with project ID association.

The asset creation parameters now include a project ID reference, properly linking assets to projects.


66-71: Correct asset validation with dynamic IDs.

The test now correctly validates the created asset using the ID returned from the creation function, rather than a predetermined ID, and includes the project reference.


79-81: Proper repository validation logic.

The repository lookup now correctly uses the result ID from the asset creation, ensuring the test validates that the asset was properly stored.

server/pkg/asset/builder_test.go (5)

7-7: Import changes look good

Added import for the centralized ID package to support the refactored ID usage.


13-14: Refactored ID creation looks correct

Properly replaced NewID() with id.NewAssetID() for consistent ID creation from the centralized package.


18-22: ID type changes look good

Updated struct fields to use proper types from the centralized ID package (id.AssetID and accountdomain.WorkspaceID).


57-60: Test case ID changes properly implemented

All test cases have been properly updated to use the centralized ID types and creation methods.

Also applies to: 69-72, 81-84, 93-100


129-131: Second test method properly updated

ID creation and error handling in TestBuilder_MustBuild have been properly refactored to use the centralized ID package.

Also applies to: 173-216

server/pkg/scene/style.go (4)

3-4: Import added correctly

The import for the centralized ID package has been properly added.


5-10: Style struct fields updated correctly

The struct fields have been properly updated to use id.StyleID and id.SceneID from the centralized package.


12-17: ID() method signature updated correctly

Method signature and return value have been properly updated to use id.StyleID.


47-49: Scene() method updated correctly

Method signature has been properly updated to return id.SceneID.

server/pkg/scene/list_test.go (4)

6-7: Import added correctly

The import for the centralized ID package has been properly added.


11-21: FilterByID test updated correctly

All scene ID creation calls have been properly updated to use id.NewSceneID().


24-35: FilterByWorkspace test updated correctly

Scene creation has been properly updated to use id.NewSceneID().


37-46: IDs() test updated correctly

ID creation and assertions have been properly updated to use id.SceneID types.

server/pkg/property/initializer.go (4)

5-9: Import added correctly

The import for the centralized ID package has been properly added with appropriate spacing.


39-62: Property method updated correctly

Method signature has been properly updated to accept id.SceneID while preserving all functionality.


64-83: PropertyIncludingEmpty method updated correctly

Method signature has been properly updated to accept id.SceneID while preserving all functionality.


85-91: MustBeProperty method updated correctly

Method signature has been properly updated to accept id.SceneID while preserving all functionality.

server/pkg/scene/widget_zone.go (3)

3-3: Appropriate import added for centralized ID types.

The import of the id package aligns with the PR objective to unify scene IDs across packages.


45-45: Parameter type correctly updated to use centralized ID.

Changing the parameter type from WidgetID to id.WidgetID helps standardize ID types across the codebase.


55-55: Parameter type correctly updated to use centralized ID.

Changing the parameter type from WidgetID to id.WidgetID helps standardize ID types across the codebase.

server/pkg/scene/widget_align_system.go (4)

3-3: Appropriate import added for centralized ID types.

The import of the id package aligns with the PR objective to unify scene IDs across packages.


58-58: Parameter type correctly updated to use centralized ID.

Changing the parameter type from WidgetID to id.WidgetID helps standardize ID types across the codebase.


71-71: Parameter type correctly updated to use centralized ID.

Changing the parameter type from WidgetID to id.WidgetID helps standardize ID types across the codebase.


94-94: Parameter type correctly updated to use centralized ID.

Changing the parameter type from WidgetID to id.WidgetID helps standardize ID types across the codebase.

server/pkg/nlslayer/nlslayer.go (3)

10-10: Interface method return type updated to use centralized ID.

Changing the return type from SceneID to id.SceneID in the NLSLayer interface helps unify scene ID types across packages.


69-69: Struct field type updated to use centralized ID.

Changing the struct field type from SceneID to id.SceneID in the layerBase struct helps standardize ID types.


103-103: Method return type updated to use centralized ID.

Changing the return type from SceneID to id.SceneID in the Scene() method ensures consistency with the interface definition.

server/internal/usecase/repo/container.go (5)

8-8: Appropriate import added for centralized ID types.

The import of the id package aligns with the PR objective to unify scene IDs across packages.


130-131: Struct field types updated to use centralized ID list.

Changing the Readable and Writable field types from scene.IDList to id.SceneIDList helps standardize ID types across the codebase.


142-142: Variable types updated to use centralized ID list.

Changing the type of variables r and w from scene.IDList to id.SceneIDList ensures consistency with the updated struct field types.


173-173: Method parameter type updated to use centralized ID.

Changing the parameter type from scene.ID to id.SceneID in the CanRead method helps standardize ID types.


177-177: Method parameter type updated to use centralized ID.

Changing the parameter type from scene.ID to id.SceneID in the CanWrite method helps standardize ID types.

server/pkg/scene/widget_area_test.go (10)

6-6: Added import for centralized ID package.

Good addition - importing the id package is necessary for the ID type unification effort.


12-14: Successfully migrated WidgetID creation to id package.

Widget ID creation now uses the centralized id.NewWidgetID() method, which aligns with the PR objective of unifying scene IDs.


15-15: Successfully updated WidgetIds type to id.WidgetIDList.

The struct field type has been properly updated to use the centralized ID type, maintaining type safety.


30-33: Successfully migrated to id.WidgetIDList in test case.

The test input and expected values now correctly use the centralized id.WidgetIDList type.


93-95: Properly migrated WidgetID creation in TestWidgetArea_WidgetIDs.

Widget ID creation and usage consistently updated to use the centralized id package.


106-108: Updated WidgetID types and creation in TestWidgetArea_Find.

Both the creation of widget IDs and the function parameter type have been properly updated to use the centralized id package.

Also applies to: 111-111


147-150: Properly migrated WidgetID types in TestWidgetArea_Add.

Widget ID creation and parameter types now correctly use the centralized id package.

Also applies to: 154-155


200-202: Successfully updated WidgetID types in TestWidgetArea_AddAll.

Both widget ID creation and list types now use the centralized id package.

Also applies to: 206-207


284-285: Successfully migrated to centralized WidgetID in TestWidgetArea_Remove.

Function parameter types and creation of widget IDs now use the centralized id package.

Also applies to: 288-289


327-330: Successfully migrated widget ID types in TestWidgetArea_Move.

Widget ID creation now consistently uses the centralized id package.

server/pkg/plugin/manifest/parser.go (4)

13-13: Updated import to use centralized id package.

Good change - replaced plugin package import with the centralized id package.


23-23: Updated Parse function signature to use id.SceneID.

The function signature now correctly uses the centralized id.SceneID type instead of plugin.SceneID.


41-41: Updated ParseSystemFromBytes function signature to use id.SceneID.

The function signature now correctly uses the centralized id.SceneID type instead of plugin.SceneID.


56-56: Updated MustParseSystemFromBytes function signature to use id.SceneID.

The function signature now correctly uses the centralized id.SceneID type instead of plugin.SceneID.

server/pkg/scene/style_builder.go (5)

3-3: Added import for centralized id package.

Good addition - importing the id package is necessary for the ID type unification effort.


15-15: Updated error reference to use id.ErrInvalidID.

Error handling now correctly references the centralized error definition from the id package.


28-28: Updated ID method signature to use id.StyleID.

Method signature now correctly uses the centralized id.StyleID type instead of a local definition.


34-34: Updated NewID implementation to use id.NewStyleID.

ID creation now uses the centralized function from the id package.


38-38: Updated Scene method signature to use id.SceneID.

Method signature now correctly uses the centralized id.SceneID type instead of a local definition.

server/pkg/project/project.go (7)

11-12: Updated imports to use centralized id and accountdomain packages.

Good change - importing the necessary packages for ID and workspace type unification.

Also applies to: 14-14


33-33: Successfully migrated Project struct field types.

Field types now correctly use the centralized ID types:

  • id field uses id.ProjectID
  • workspace field uses accountdomain.WorkspaceID
  • sceneId field uses id.SceneID

Also applies to: 48-48, 54-54


59-59: Updated ID method return type to id.ProjectID.

Method now correctly returns the centralized ID type instead of a local definition.


136-136: Updated Scene method return type to id.SceneID.

Method now correctly returns the centralized ID type instead of a local definition.


144-144: Updated Workspace method return type to accountdomain.WorkspaceID.

Method now correctly returns the centralized workspace ID type.


239-239: Updated UpdateWorkspace method parameter type.

Method parameter now correctly uses the centralized accountdomain.WorkspaceID type.


259-259: Updated UpdateSceneID method parameter type.

Method parameter now correctly uses the centralized id.SceneID type.

server/pkg/scene/widget_align_system_test.go (7)

6-6: LGTM: Adding id package import for centralized ID management.

This import aligns with the PR's objective of consolidating scene IDs.


32-36: Updated widget ID generation to use centralized package.

Changed from using local NewWidgetID() to id.NewWidgetID() for consistent ID management across the codebase.


40-40: Updated type from WidgetID to id.WidgetID.

This change is part of the refactoring to unify ID types across packages.


59-59: Switched to centralized ID generation.

Using id.NewWidgetID() ensures consistent ID generation throughout the application.


85-86: Updated WidgetIDList type references.

Changed from using local WidgetIDList to id.WidgetIDList for type consistency.


101-102: Consistent ID type updates in test struct.

Updated struct field types to use the centralized ID types from the id package.


156-160: Updated widget ID creation in TestWidgetAlignSystem_Move.

Switched from scene package's widget ID generation to id package's implementation.

server/pkg/scene/builder/scene_test.go (5)

6-6: LGTM: Added import for centralized ID package.

This change aligns with the PR objective of using a single source for ID types.


14-14: Updated scene ID generation.

Changed from scene.NewID() to id.NewSceneID() for consistent ID generation.


52-58: Refactored widget ID creation and type.

Updated widget ID creation to use the centralized id package and changed the slice type from []scene.WidgetID to []id.WidgetID.


63-63: Updated input type in test struct.

Changed input type from []scene.WidgetID to []id.WidgetID for consistency.


89-89: Updated widget ID creation in TestBuildWidgetAlignSystem.

Switched from using scene.NewWidgetID() to id.NewWidgetID() for widget ID generation.

server/pkg/scene/widget_test.go (5)

6-6: LGTM: Added id package import.

This change is consistent with the PR's goal of centralizing ID management.


11-13: Updated ID creation functions.

Changed from using package-specific ID creation functions to centralized ones in the id package.


17-20: Updated ID types in test struct.

Changed field types from package-specific ID types to centralized ones from the id package.


43-43: Updated error reference.

Changed from using local ErrInvalidID to id.ErrInvalidID for consistency with the id package.


125-125: Updated widget creation in TestWidget_SetEnabled.

Modified to use centralized ID functions for plugin, widget, and property IDs.

server/internal/usecase/interactor/scene_plugin_test.go (5)

38-38: LGTM: Updated scene ID creation.

Changed from scene.NewID() to id.NewSceneID() for consistent ID generation.


42-42: Updated scene ID reference creation.

Changed to use the centralized ID type reference creation method.


162-162: Updated scene ID creation in TestScene_UninstallPlugin.

Using id.NewSceneID() consistently across all test cases.


229-229: Updated widget creation.

Changed from scene.NewWidget with scene.NewWidgetID() to use id.NewWidgetID() for consistent ID management.


300-300: Updated scene ID creation in TestScene_UpgradePlugin.

Switched to using id.NewSceneID() consistently with other test functions.

server/pkg/scene/builder.go (8)

5-7: Imports adjusted to use centralized ID definitions

The imports have been updated to use the centralized id package and the accountdomain package from reearthx, which aligns with the PR objective of unifying scene IDs across the codebase.


20-20: Error handling consolidated using centralized error definitions

Changed from using a local ErrInvalidID to the centralized id.ErrInvalidID, ensuring consistent error handling across the codebase.


23-23: Error handling consolidated using centralized error definitions

Changed from using a local ErrInvalidID to the centralized id.ErrInvalidID, ensuring consistent error handling across the codebase.


45-45: Method signature updated to use centralized ID type

Updated the ID method to accept id.SceneID instead of a local ID type, aligning with the unified ID approach.


51-51: ID creation consolidated through centralized ID package

Updated to use id.NewSceneID() instead of a local NewID() function, ensuring consistent ID creation across the codebase.


55-55: Method signature updated to use centralized ID type

Updated the Project method to use id.ProjectID instead of a local ProjectID type, aligning with the unified ID approach.


60-60: Method signature updated to use accountdomain package

Updated the Workspace method to use accountdomain.WorkspaceID instead of a local WorkspaceID type, improving cross-package type consistency.


80-80: Method signature updated to use centralized ID type

Updated the Property method to use id.PropertyID instead of a local PropertyID type, aligning with the unified ID approach.

server/pkg/asset/asset.go (7)

6-8: Imports adjusted to use centralized ID definitions

The imports have been updated to use the centralized id package and the accountdomain package from reearthx, which aligns with the PR objective of unifying IDs across the codebase.


18-18: Asset struct field updated to use centralized ID type

Updated the id field to use id.AssetID instead of a local ID type, aligning with the unified ID approach.


20-21: Asset struct fields updated to use centralized types

Updated the workspace field to use accountdomain.WorkspaceID and the project field to use *id.ProjectID, ensuring consistent type usage across packages.


29-29: Method signature updated to return centralized ID type

Updated the ID method to return id.AssetID instead of a local ID type, aligning with the unified ID approach.


33-33: Method signature updated to return accountdomain type

Updated the Workspace method to return accountdomain.WorkspaceID instead of a local WorkspaceID type, improving cross-package type consistency.


37-37: Method signature updated to return centralized ID type

Updated the Project method to return *id.ProjectID instead of a local *ProjectID type, aligning with the unified ID approach.


41-41: Method signature updated to accept centralized ID type

Updated the SetProject method to accept *id.ProjectID instead of a local *ProjectID type, aligning with the unified ID approach.

server/pkg/scene/plugin.go (7)

3-3: Import adjusted to use centralized ID definitions

The import has been updated to use the centralized id package, which aligns with the PR objective of unifying IDs across the codebase.


6-7: Plugin struct fields updated to use centralized ID types

Updated the plugin field to use id.PluginID and the property field to use *id.PropertyID, aligning with the unified ID approach.


10-10: Constructor signature updated to use centralized ID types

Updated the NewPlugin function to accept id.PluginID and *id.PropertyID instead of local types, ensuring consistent type usage across packages.


17-17: Method signature updated to return centralized ID type

Updated the Plugin method to return id.PluginID instead of a local PluginID type, aligning with the unified ID approach.


19-19: Default return value updated to use centralized ID type

Updated the default return value to id.PluginID{} instead of PluginID{}, ensuring type consistency.


24-24: Method signature updated to return centralized ID type

Updated the PluginRef method to return *id.PluginID instead of a local *PluginID type, aligning with the unified ID approach.


31-31: Method signature updated to return centralized ID type

Updated the Property method to return *id.PropertyID instead of a local *PropertyID type, aligning with the unified ID approach.

server/pkg/asset/builder.go (6)

5-7: Imports adjusted to use centralized ID definitions

The imports have been updated to use the centralized id package and the accountdomain package from reearthx, which aligns with the PR objective of unifying IDs across the codebase.


20-20: Error handling consolidated using centralized error definitions

Changed from using a local ErrInvalidID to the centralized id.ErrInvalidID, ensuring consistent error handling across the codebase.


45-45: Method signature updated to use centralized ID type

Updated the ID method to accept id.AssetID instead of a local ID type, aligning with the unified ID approach.


51-51: ID creation consolidated through centralized ID package

Updated to use id.NewAssetID() instead of a local NewID() function, ensuring consistent ID creation across the codebase.


55-55: Method signature updated to use accountdomain package

Updated the Workspace method to use accountdomain.WorkspaceID instead of a local WorkspaceID type, improving cross-package type consistency.


60-60: Method signature updated to use centralized ID type

Updated the Project method to accept *id.ProjectID instead of a local *ProjectID type, aligning with the unified ID approach.

server/internal/usecase/repo/container_test.go (5)

6-6: Good import update for ID package.

The import change aligns with the PR objective of centralizing ID management in the id package.


33-34: Correct migration from scene.NewID() to id.NewSceneID().

The scene ID creation has been properly migrated to use the centralized id package function.


36-38: Successful type migration from scene.IDList to id.SceneIDList.

Type references for SceneFilter fields have been appropriately updated.


39-44: Consistent update of SceneIDList usage in test assertion.

All references to SceneIDList have been properly migrated to the centralized id package.


45-48: Complete migration of empty list assertions.

Empty list assertions have been correctly updated to use the new id.SceneIDList{} type.

server/pkg/project/builder.go (6)

7-9: Appropriate import updates for ID management.

The imports have been updated to refer to the centralized id package and accountdomain package, which is in line with the PR objective.


22-22: Good error reference update.

The error reference has been updated from a custom ErrInvalidID to id.ErrInvalidID, providing more consistency in error handling.


41-44: Proper type migration for ID method.

The parameter type has been updated from ID to id.ProjectID, ensuring type consistency across the codebase.


46-49: Correct function migration for NewID.

Now using id.NewProjectID() instead of a custom NewID() function, which centralizes ID creation.


132-135: Appropriate workspace ID type update.

The Workspace method parameter now uses accountdomain.WorkspaceID instead of a custom WorkspaceID type.


157-160: Good migration of scene ID type.

The Scene method parameter now uses id.SceneID instead of a custom SceneID type, aligning with the centralized ID management approach.

server/pkg/scene/plugins_test.go (8)

6-6: Correct import addition for the id package.

The import has been added to support the migration to centralized ID types.


11-12: Appropriate function migration for plugin and property IDs.

Test setup now uses id.MustPluginID and id.NewPropertyID from the centralized package.


75-78: Correct type migration for test parameters.

The test structure now uses id.PluginID and id.PropertyID types from the centralized package.


94-95: Successful migration of plugin ID creation in test assertions.

The test now uses id.MustPluginID for creating plugin IDs in assertions.


178-180: Comprehensive type migration for property IDs and lists.

The test has been updated to use id.NewPropertyID and []id.PropertyID consistently.

Also applies to: 184-184, 197-197


339-339: Proper migration of official plugin ID references.

References to OfficialPluginID have been updated to use id.OfficialPluginID.

Also applies to: 374-376


397-405: Thorough type migration for function parameters.

All parameter types in the test function have been properly migrated to use the centralized ID types.


448-453: Complete migration of official plugin ID usage in final test cases.

All remaining references to OfficialPluginID have been correctly updated.

Also applies to: 461-462

server/pkg/scene/widgets.go (7)

6-6: Appropriate import update for ID package.

The import has been added to support the migration to centralized ID types.


65-75: Proper type migration for Widget method.

The parameter type for the Widget method has been updated from WidgetID to id.WidgetID.


77-87: Good type migration for Has method.

The parameter type for the Has method has been updated from WidgetID to id.WidgetID.


96-106: Appropriate type migration for Remove method.

The parameter type for the Remove method has been updated from WidgetID to id.WidgetID.


108-122: Complete type migration for RemoveAllByPlugin method.

The parameter types and return type have been updated to use centralized ID types from the id package.


124-133: Successful type migration for UpgradePlugin method.

The parameter types for the UpgradePlugin method have been updated from PluginID to id.PluginID.


135-144: Thorough type migration for Properties method and variable declaration.

The return type for the Properties method and the local variable declaration have been updated to use id.PropertyID.

server/pkg/scene/widget_area.go (5)

4-4: Added required import for ID refactoring.

The import of the id package is necessary to implement the centralized ID type pattern being adopted across the codebase.


11-11: Updated field type to use centralized ID type.

Changed widgetIds field type from WidgetIDList to id.WidgetIDList as part of the ID standardization effort.


27-27: Updated function signature to use centralized ID types.

Changed parameter type from []WidgetID to []id.WidgetID to align with the consistent ID management approach.


40-40: Updated return type to use centralized ID type.

Changed return type from WidgetIDList to id.WidgetIDList for consistency.


89-89: Updated method parameter types consistently.

All method parameters previously using WidgetID type have been updated to use id.WidgetID for consistent ID management throughout the codebase.

Also applies to: 96-96, 110-110, 150-150

server/pkg/scene/scene.go (4)

8-8: Updated import for workspace ID type.

Changed from generic account import to more specific accountdomain for better type clarity.


14-17: Updated struct field types to use centralized ID types.

Changed field types:

  • id: from ID to id.SceneID
  • project: from ProjectID to id.ProjectID
  • workspace: from WorkspaceID to accountdomain.WorkspaceID
  • property: from PropertyID to id.PropertyID

This aligns with the PR objective to consolidate ID types across packages.

Also applies to: 20-20


24-27: Updated method return types and zero values.

All getter methods for ID fields have been consistently updated to return the appropriate types from the id package, and their zero value returns have been updated accordingly.

Also applies to: 38-41, 45-48, 52-55


105-109: Updated Property collection return type.

Changed the return type of Properties() method from []PropertyID to []id.PropertyID and updated the variable type in the implementation to maintain consistency with the ID type refactoring.

server/pkg/scene/widget.go (4)

3-3: Added import for centralized ID package.

Added the necessary import for the id package to support the ID type refactoring.


6-9: Updated Widget struct field types.

All ID-related fields in the Widget struct have been updated to use types from the centralized id package:

  • id: from WidgetID to id.WidgetID
  • plugin: from PluginID to id.PluginID
  • extension: from PluginExtensionID to id.PluginExtensionID
  • property: from PropertyID to id.PropertyID

14-17: Updated constructor function and error handling.

The NewWidget function parameters have been updated to use the centralized ID types, and the error reference has been changed from ErrInvalidID to id.ErrInvalidID.


29-29: Updated remaining method signatures consistently.

All ID-related method parameters and return types have been updated to use types from the centralized id package, maintaining a consistent approach across the entire file.

Also applies to: 37-37, 41-41, 45-45, 49-49, 95-95

server/pkg/scene/builder_test.go (5)

7-7: Added import for centralized ID package in test file.

Added the necessary import for the id package to support the ID type refactoring in tests.


17-17: Updated ID creation in test methods.

All ID creation calls have been updated to use functions from the centralized id package:

  • NewID()id.NewSceneID()
  • NewPropertyID()id.NewPropertyID()
  • OfficialPluginIDid.OfficialPluginID
  • NewProjectID()id.NewProjectID()
  • NewWidgetID()id.NewWidgetID()

Also applies to: 29-29, 36-36, 43-43, 50-50


58-60: Updated variable declarations and struct field types.

All variable declarations and struct field types have been updated to use types from the centralized id package, ensuring consistency throughout the test code.

Also applies to: 62-62, 65-65, 69-72, 75-75


87-87: Updated error handling to use centralized error type.

Error references have been changed from ErrInvalidID to id.ErrInvalidID to maintain consistency with the ID type refactoring.

Also applies to: 95-95, 102-102, 108-108


158-163: Updated remaining test code consistently.

All remaining ID-related code in the TestBuilder_MustBuild function has been updated to use types and functions from the centralized id package, maintaining a consistent approach throughout the test file.

Also applies to: 166-166, 169-173, 177-177, 189-190, 198-198, 205-205, 212-212

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca9cce2 and 71627bc.

📒 Files selected for processing (92)
  • server/e2e/gql_project_test.go (3 hunks)
  • server/e2e/seeder.go (2 hunks)
  • server/internal/adapter/gql/gqlmodel/convert_project_test.go (2 hunks)
  • server/internal/app/web_test.go (2 hunks)
  • server/internal/infrastructure/memory/asset.go (3 hunks)
  • server/internal/infrastructure/memory/project.go (1 hunks)
  • server/internal/infrastructure/mongo/container.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/nlslayer.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/property.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/property_schema.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/style.go (1 hunks)
  • server/internal/usecase/interactor/asset_test.go (4 hunks)
  • server/internal/usecase/interactor/project_test.go (5 hunks)
  • server/internal/usecase/interactor/scene.go (1 hunks)
  • server/internal/usecase/interactor/scene_plugin_test.go (4 hunks)
  • server/internal/usecase/interactor/storytelling.go (1 hunks)
  • server/internal/usecase/operator.go (2 hunks)
  • server/internal/usecase/repo/container.go (4 hunks)
  • server/internal/usecase/repo/container_test.go (2 hunks)
  • server/pkg/asset/asset.go (2 hunks)
  • server/pkg/asset/asset_test.go (2 hunks)
  • server/pkg/asset/builder.go (3 hunks)
  • server/pkg/asset/builder_test.go (10 hunks)
  • server/pkg/asset/id.go (0 hunks)
  • server/pkg/id/id.go (0 hunks)
  • server/pkg/nlslayer/builder.go (1 hunks)
  • server/pkg/nlslayer/group.go (1 hunks)
  • server/pkg/nlslayer/group_builder.go (1 hunks)
  • server/pkg/nlslayer/id.go (0 hunks)
  • server/pkg/nlslayer/loader.go (2 hunks)
  • server/pkg/nlslayer/nlslayer.go (3 hunks)
  • server/pkg/nlslayer/simple.go (1 hunks)
  • server/pkg/nlslayer/simple_builder.go (1 hunks)
  • server/pkg/plugin/id.go (0 hunks)
  • server/pkg/plugin/manifest/convert.go (2 hunks)
  • server/pkg/plugin/manifest/convert_test.go (2 hunks)
  • server/pkg/plugin/manifest/parser.go (4 hunks)
  • server/pkg/plugin/plugin.go (2 hunks)
  • server/pkg/plugin/pluginpack/package.go (2 hunks)
  • server/pkg/project/builder.go (5 hunks)
  • server/pkg/project/builder_test.go (6 hunks)
  • server/pkg/project/id.go (0 hunks)
  • server/pkg/project/project.go (6 hunks)
  • server/pkg/property/builder.go (2 hunks)
  • server/pkg/property/builder_test.go (4 hunks)
  • server/pkg/property/id.go (0 hunks)
  • server/pkg/property/initializer.go (4 hunks)
  • server/pkg/property/initializer_test.go (3 hunks)
  • server/pkg/property/item_test.go (3 hunks)
  • server/pkg/property/list_test.go (1 hunks)
  • server/pkg/property/loader_test.go (2 hunks)
  • server/pkg/property/merged_test.go (2 hunks)
  • server/pkg/property/property.go (2 hunks)
  • server/pkg/property/property_test.go (6 hunks)
  • server/pkg/property/schema.go (2 hunks)
  • server/pkg/property/sealed_test.go (2 hunks)
  • server/pkg/scene/builder.go (4 hunks)
  • server/pkg/scene/builder/decoder.go (1 hunks)
  • server/pkg/scene/builder/scene.go (2 hunks)
  • server/pkg/scene/builder/scene_test.go (3 hunks)
  • server/pkg/scene/builder_test.go (7 hunks)
  • server/pkg/scene/id.go (0 hunks)
  • server/pkg/scene/list.go (2 hunks)
  • server/pkg/scene/list_test.go (2 hunks)
  • server/pkg/scene/plugin.go (1 hunks)
  • server/pkg/scene/plugin_test.go (1 hunks)
  • server/pkg/scene/plugins.go (8 hunks)
  • server/pkg/scene/plugins_test.go (19 hunks)
  • server/pkg/scene/scene.go (3 hunks)
  • server/pkg/scene/scene_test.go (2 hunks)
  • server/pkg/scene/sceneops/plugin_installer.go (2 hunks)
  • server/pkg/scene/sceneops/plugin_migrator_test.go (1 hunks)
  • server/pkg/scene/style.go (2 hunks)
  • server/pkg/scene/style_builder.go (3 hunks)
  • server/pkg/scene/style_test.go (2 hunks)
  • server/pkg/scene/widget.go (3 hunks)
  • server/pkg/scene/widget_align_system.go (4 hunks)
  • server/pkg/scene/widget_align_system_test.go (11 hunks)
  • server/pkg/scene/widget_area.go (6 hunks)
  • server/pkg/scene/widget_area_test.go (12 hunks)
  • server/pkg/scene/widget_section.go (3 hunks)
  • server/pkg/scene/widget_section_test.go (5 hunks)
  • server/pkg/scene/widget_test.go (5 hunks)
  • server/pkg/scene/widget_zone.go (3 hunks)
  • server/pkg/scene/widget_zone_test.go (5 hunks)
  • server/pkg/scene/widgets.go (7 hunks)
  • server/pkg/scene/widgets_test.go (9 hunks)
  • server/pkg/storytelling/id.go (0 hunks)
  • server/pkg/storytelling/story.go (3 hunks)
  • server/pkg/storytelling/story_bulider.go (2 hunks)
  • server/pkg/storytelling/story_bulider_test.go (2 hunks)
  • server/pkg/storytelling/story_test.go (2 hunks)
💤 Files with no reviewable changes (8)
  • server/pkg/storytelling/id.go
  • server/pkg/nlslayer/id.go
  • server/pkg/property/id.go
  • server/pkg/project/id.go
  • server/pkg/id/id.go
  • server/pkg/plugin/id.go
  • server/pkg/asset/id.go
  • server/pkg/scene/id.go
🧰 Additional context used
🧬 Code Definitions (39)
server/internal/adapter/gql/gqlmodel/convert_project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/internal/infrastructure/memory/asset.go (1)
server/pkg/asset/asset.go (10) (10)
  • a (29-31)
  • a (33-35)
  • a (37-39)
  • a (41-43)
  • a (45-47)
  • a (49-51)
  • a (53-55)
  • a (57-59)
  • a (61-63)
  • a (65-70)
server/pkg/nlslayer/group_builder.go (4)
server/pkg/nlslayer/builder.go (8) (8)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
server/pkg/nlslayer/simple_builder.go (8) (8)
  • b (32-37)
  • b (39-45)
  • b (47-50)
  • b (52-55)
  • b (57-60)
  • b (62-65)
  • b (67-70)
  • b (72-75)
server/internal/adapter/gql/gqlmodel/models_gen.go (2) (2)
  • Scene (959-975)
  • Scene (977-977)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/plugin/manifest/convert.go (3)
server/internal/usecase/interactor/scene.go (15) (15)
  • i (63-70)
  • i (72-83)
  • i (85-92)
  • i (94-155)
  • i (157-181)
  • i (183-237)
  • i (239-323)
  • i (325-400)
  • i (402-457)
  • i (459-507)
  • i (509-552)
  • i (558-629)
  • i (637-659)
  • i (661-672)
  • i (674-689)
server/pkg/plugin/manifest/schema_gen.go (1) (1)
  • Root (87-98)
server/pkg/plugin/manifest/schema_translation_i18n.go (1) (1)
  • TranslatedRoot (33-38)
server/e2e/gql_project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/internal/usecase/interactor/storytelling.go (1)
server/internal/usecase/repo/container.go (1) (1)
  • SceneFilter (129-132)
server/pkg/nlslayer/simple_builder.go (2)
server/pkg/nlslayer/builder.go (8) (8)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
server/pkg/nlslayer/group_builder.go (8) (8)
  • b (32-37)
  • b (39-45)
  • b (47-50)
  • b (52-55)
  • b (57-60)
  • b (62-65)
  • b (67-70)
  • b (72-75)
server/pkg/nlslayer/loader.go (1)
server/pkg/nlslayer/nlslayer_list.go (1) (1)
  • NLSLayerList (9-9)
server/pkg/property/list_test.go (2)
server/pkg/property/id.go (3) (3)
  • ID (7-7)
  • NewID (13-13)
  • MustSchemaID (19-19)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/property/item_test.go (5)
server/pkg/property/builder.go (1) (1)
  • New (9-11)
server/pkg/nlslayer/id.go (1) (1)
  • NewID (16-16)
server/pkg/plugin/id.go (1) (1)
  • NewID (10-10)
server/pkg/property/id.go (1) (1)
  • NewID (13-13)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/property/schema.go (2)
server/pkg/plugin/plugin.go (12) (12)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/scene/style.go (1)
server/pkg/scene/scene.go (11) (11)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • Scene (13-22)
server/internal/usecase/interactor/asset_test.go (5)
server/pkg/id/id.go (8) (8)
  • NewProjectID (66-66)
  • Asset (5-5)
  • Asset (24-24)
  • Workspace (16-16)
  • Workspace (35-35)
  • ProjectID (47-47)
  • Project (10-10)
  • Project (29-29)
server/pkg/asset/asset.go (1) (1)
  • Asset (17-27)
server/internal/usecase/interactor/asset.go (1) (1)
  • Asset (25-28)
server/internal/usecase/interfaces/asset.go (2) (2)
  • Asset (36-43)
  • CreateAssetParam (25-30)
server/internal/infrastructure/memory/project.go (1) (1)
  • Project (18-22)
server/internal/infrastructure/memory/project.go (4)
server/internal/infrastructure/mongo/project.go (17) (17)
  • r (39-41)
  • r (43-48)
  • r (50-63)
  • r (65-72)
  • r (74-89)
  • r (91-118)
  • r (120-136)
  • r (138-150)
  • r (152-168)
  • r (170-179)
  • r (181-193)
  • r (195-201)
  • r (203-205)
  • r (207-213)
  • r (215-225)
  • r (227-251)
  • Project (27-31)
server/internal/usecase/interfaces/project.go (1) (1)
  • Project (63-76)
server/internal/usecase/repo/project.go (1) (1)
  • Project (19-32)
server/pkg/id/id.go (3) (3)
  • Project (10-10)
  • Project (29-29)
  • ProjectID (47-47)
server/pkg/scene/widget_section.go (2)
server/pkg/scene/plugin.go (4) (4)
  • s (17-22)
  • s (24-29)
  • s (31-36)
  • s (38-46)
server/pkg/scene/scene.go (10) (10)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
server/pkg/nlslayer/nlslayer.go (4)
server/internal/adapter/gql/gqlmodel/models_gen.go (2) (2)
  • Scene (959-975)
  • Scene (977-977)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/usecase/interactor/scene.go (1) (1)
  • Scene (28-43)
server/pkg/nlslayer/simple.go (16) (16)
  • l (9-11)
  • l (13-15)
  • l (17-22)
  • l (24-26)
  • l (28-30)
  • l (32-34)
  • l (36-41)
  • l (43-48)
  • l (50-55)
  • l (57-62)
  • l (64-69)
  • l (71-77)
  • l (79-84)
  • l (86-96)
  • l (98-103)
  • l (105-110)
server/pkg/storytelling/story.go (1)
server/pkg/scene/scene.go (11) (11)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • Scene (13-22)
server/pkg/property/initializer.go (4)
server/pkg/plugin/plugin.go (12) (12)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
server/pkg/plugin/manifest/convert.go (2) (2)
  • p (263-271)
  • p (273-281)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/property/id.go (1) (1)
  • SchemaID (10-10)
server/pkg/property/builder_test.go (2)
server/pkg/property/id.go (6) (6)
  • ID (7-7)
  • MustSchemaID (19-19)
  • NewID (13-13)
  • NewItemID (14-14)
  • FieldID (9-9)
  • SchemaGroupID (11-11)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/property/sealed_test.go (2)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/scene/scene_test.go (2)
server/pkg/scene/scene.go (12) (12)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/scene/widget.go (2) (2)
  • Widget (5-12)
  • MustWidget (29-35)
server/pkg/asset/builder.go (3)
server/pkg/id/id.go (7) (7)
  • AssetID (43-43)
  • NewAssetID (62-62)
  • Workspace (16-16)
  • Workspace (35-35)
  • Project (10-10)
  • Project (29-29)
  • ProjectID (47-47)
server/pkg/asset/asset.go (10) (10)
  • a (29-31)
  • a (33-35)
  • a (37-39)
  • a (41-43)
  • a (45-47)
  • a (49-51)
  • a (53-55)
  • a (57-59)
  • a (61-63)
  • a (65-70)
server/pkg/project/project.go (1) (1)
  • Project (32-57)
server/pkg/scene/widget_zone_test.go (2)
server/pkg/scene/widget_zone.go (4) (4)
  • WidgetSectionLeft (15-15)
  • WidgetSectionCenter (16-16)
  • WidgetSectionRight (17-17)
  • WidgetSectionType (12-12)
server/pkg/scene/widget_section.go (1) (1)
  • WidgetAreaTop (15-15)
server/pkg/scene/widget_area_test.go (3)
server/pkg/scene/widget_area.go (2) (2)
  • WidgetArea (10-17)
  • NewWidgetArea (27-37)
server/pkg/scene/widget_align_system_test.go (1) (1)
  • args (271-274)
server/pkg/scene/widget_section_test.go (1) (1)
  • args (170-173)
server/pkg/scene/widgets_test.go (4)
server/pkg/scene/widget.go (2) (2)
  • MustWidget (29-35)
  • Widget (5-12)
server/pkg/scene/widgets.go (2) (2)
  • Widgets (13-16)
  • NewWidgets (18-42)
server/pkg/plugin/id.go (1) (1)
  • ID (5-5)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/project/builder_test.go (1)
server/pkg/id/id.go (2) (2)
  • NewProjectID (66-66)
  • ProjectID (47-47)
server/pkg/scene/list.go (2)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/id/id.go (3) (3)
  • Scene (15-15)
  • Scene (34-34)
  • SceneID (50-50)
server/pkg/property/builder.go (2)
server/pkg/scene/builder.go (1) (1)
  • Builder (10-12)
server/pkg/scene/scene.go (11) (11)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
server/pkg/scene/style_builder.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • ErrInvalidID (21-21)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
server/pkg/storytelling/id.go (1) (1)
  • ErrInvalidID (19-19)
server/pkg/scene/plugins_test.go (5)
server/pkg/storytelling/id.go (3) (3)
  • NewPropertyID (15-15)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/scene/plugins.go (2) (2)
  • Plugins (5-7)
  • NewPlugins (9-30)
server/pkg/plugin/plugin.go (1) (1)
  • Plugin (9-18)
server/pkg/plugin/id.go (1) (1)
  • OfficialPluginID (22-22)
server/pkg/asset/asset.go (5)
server/pkg/id/id.go (8) (8)
  • AssetID (43-43)
  • ProjectID (47-47)
  • Asset (5-5)
  • Asset (24-24)
  • Workspace (16-16)
  • Workspace (35-35)
  • Project (10-10)
  • Project (29-29)
server/internal/infrastructure/memory/asset.go (1) (1)
  • Asset (18-21)
server/internal/usecase/interfaces/asset.go (1) (1)
  • Asset (36-43)
server/internal/usecase/repo/asset.go (1) (1)
  • Asset (18-27)
server/internal/infrastructure/memory/project.go (1) (1)
  • Project (18-22)
server/pkg/scene/widget_test.go (3)
server/pkg/plugin/id.go (2) (2)
  • ID (5-5)
  • ErrInvalidID (23-23)
server/pkg/property/id.go (2) (2)
  • ID (7-7)
  • ErrInvalidID (36-36)
server/pkg/scene/widget.go (1) (1)
  • MustWidget (29-35)
server/pkg/scene/builder.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • ErrInvalidID (21-21)
server/pkg/storytelling/id.go (1) (1)
  • ErrInvalidID (19-19)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
server/pkg/scene/widgets.go (1)
server/pkg/scene/widget.go (11) (11)
  • w (37-39)
  • w (41-43)
  • w (45-47)
  • w (49-51)
  • w (53-58)
  • w (60-65)
  • w (67-72)
  • w (74-79)
  • w (81-93)
  • w (95-100)
  • Widget (5-12)
server/pkg/scene/scene.go (7)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/id/id.go (9) (9)
  • SceneID (50-50)
  • ProjectID (47-47)
  • PropertyID (48-48)
  • Scene (15-15)
  • Scene (34-34)
  • Project (10-10)
  • Project (29-29)
  • Property (11-11)
  • Property (30-30)
server/pkg/scene/widgets.go (1) (1)
  • Widgets (13-16)
server/pkg/scene/plugins.go (1) (1)
  • Plugins (5-7)
server/internal/usecase/interfaces/scene.go (1) (1)
  • Scene (20-33)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/scene/builder_test.go (4)
server/pkg/scene/builder.go (12) (12)
  • b (18-35)
  • b (37-43)
  • b (45-48)
  • b (50-53)
  • b (55-58)
  • b (60-63)
  • b (65-68)
  • b (70-73)
  • b (75-78)
  • b (80-83)
  • b (85-88)
  • New (14-16)
server/pkg/property/id.go (2) (2)
  • ID (7-7)
  • ErrInvalidID (36-36)
server/pkg/scene/plugins.go (2) (2)
  • NewPlugins (9-30)
  • Plugins (5-7)
server/pkg/scene/widgets.go (2) (2)
  • NewWidgets (18-42)
  • Widgets (13-16)
server/pkg/scene/plugin.go (2)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/scene/plugins.go (6)
server/pkg/plugin/plugin.go (13) (13)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
  • Plugin (9-18)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/plugin/id.go (1) (1)
  • OfficialPluginID (22-22)
server/pkg/scene/plugin.go (1) (1)
  • Plugin (5-8)
server/pkg/scene/widget.go (6)
server/pkg/nlslayer/id.go (3) (3)
  • PluginID (12-12)
  • PropertyID (9-9)
  • ErrInvalidID (21-21)
server/pkg/storytelling/id.go (3) (3)
  • PluginID (9-9)
  • PropertyID (8-8)
  • ErrInvalidID (19-19)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/scene/widget_align_system.go (1) (1)
  • w (109-120)
server/pkg/scene/widgets.go (10) (10)
  • w (44-49)
  • w (51-56)
  • w (58-63)
  • w (65-75)
  • w (77-87)
  • w (89-94)
  • w (96-106)
  • w (108-122)
  • w (124-133)
  • w (135-144)
server/pkg/scene/plugin.go (1) (1)
  • Plugin (5-8)
🔇 Additional comments (276)
server/internal/infrastructure/mongo/mongodoc/nlslayer.go (1)

134-134: Parameter type updated for consistency

The parameter type for NewNLSLayers function has been changed from scene.IDList to id.SceneIDList as part of the effort to unify scene IDs across packages. This change aligns with the PR objective to standardize ID types and eliminates redundant SceneID type definitions.

server/internal/infrastructure/mongo/mongodoc/property_schema.go (1)

124-124: Parameter type updated for consistency

The parameter type for NewPropertySchemas function has been changed from scene.IDList to id.SceneIDList to align with the centralized ID definitions in the id package. This change is consistent with the PR's goal of removing redundant SceneID type definitions across different packages.

server/internal/infrastructure/mongo/mongodoc/property.go (1)

150-150: Parameter type updated for consistency

The parameter type for NewProperties function has been changed from scene.IDList to id.SceneIDList to consolidate scene ID types. This modification is part of the broader refactoring effort to unify ID types across the codebase and reduce redundancy.

server/pkg/scene/widget_zone.go (3)

3-4: Added import for the id package

Added import for the id package to support the updated WidgetID type references in the following method signatures.


45-45: Method signature updated to use unified ID type

The parameter type for the Remove method has been changed from WidgetID to id.WidgetID, aligning with the centralized ID definitions in the id package.


55-55: Method signature updated to use unified ID type

The parameter type for the Find method has been changed from WidgetID to id.WidgetID, consistent with the overall ID type unification effort across the codebase.

server/internal/infrastructure/mongo/container.go (2)

129-134: Good change: Unified scene ID type.

The parameter type for applySceneFilter has been properly updated from scene.IDList to id.SceneIDList, which aligns with the PR objective of unifying scene IDs across packages. The function's logic remains unchanged, maintaining behavior while improving type consistency.


136-145: Good change: Unified scene ID type.

Similarly, the parameter type for applyOptionalSceneFilter has been correctly updated from scene.IDList to id.SceneIDList, consistent with the other changes. The function implementation remains unchanged, preserving the original behavior.

server/pkg/scene/list_test.go (6)

6-6: Good addition: Import for ID package.

Properly added the import for the id package which is needed for the unified scene ID references.


12-13: Good change: Using unified scene ID constructor.

The test is now correctly using id.NewSceneID() instead of the local NewID() function, which aligns with the ID unification strategy.


20-20: Good change: Consistent use of ID constructor.

The assertion is now correctly using id.NewSceneID() instead of NewID(), maintaining consistency throughout the test file.


27-28: Good change: Consistent ID constructor usage in scene initialization.

Scene initialization now correctly uses id.NewSceneID() instead of the local ID constructor, ensuring type consistency throughout the test.


38-39: Good change: Consistent ID constructor usage.

Similar to other changes, using id.NewSceneID() instead of the local ID constructor ensures consistency in how scene IDs are generated.


43-45: Good change: Updated type references in assertions.

The assertions have been correctly updated to expect []id.SceneID instead of the local []ID type, completing the type unification in the test.

server/pkg/scene/plugin.go (6)

3-4: Good addition: Import for ID package.

Properly added an explicit import for the id package to support the type changes.


6-8: Good change: Updated struct field types.

The Plugin struct fields have been properly updated to use id.PluginID and *id.PropertyID from the unified ID package instead of local type definitions.


10-15: Good change: Updated constructor parameter types.

The NewPlugin function signature has been correctly updated to accept id.PluginID and *id.PropertyID parameters, consistent with the struct field changes.


17-22: Good change: Updated method return type.

The Plugin() method now correctly returns id.PluginID and the zero value has been updated to id.PluginID{}, maintaining type consistency.


24-29: Good change: Updated reference return type.

The PluginRef() method now correctly returns *id.PluginID, consistent with the struct field type changes.


31-36: Good change: Updated property return type.

The Property() method now correctly returns *id.PropertyID, completing the type unification for ID-related methods.

server/pkg/nlslayer/group.go (1)

26-28: Good change: Updated scene ID return type.

The Scene() method now correctly returns id.SceneID instead of the local SceneID type, aligning with the ID unification strategy.

server/internal/adapter/gql/gqlmodel/convert_project_test.go (2)

8-8: Added import for the id package

The addition of the id package import is necessary to support the ID generation changes in this file.


48-48: Project ID generation updated to use centralized id package

The code has been refactored to use id.NewProjectID() instead of the previous project.NewID(), which aligns with the PR objective to unify ID types across packages.

server/pkg/nlslayer/simple.go (1)

28-28: Updated return type to use centralized SceneID type

The return type for the Scene() method has been updated from a local SceneID type to id.SceneID, which is consistent with the PR objective to unify scene IDs across packages.

server/pkg/storytelling/story_test.go (2)

7-7: Added import for the id package

Adding the import for the id package is necessary to support the scene ID generation changes.


17-17: Scene ID generation updated to use centralized id package

The code has been refactored to use id.NewSceneID() instead of the previous NewSceneID() local function, aligning with the PR objective to unify scene IDs across packages.

server/pkg/nlslayer/builder.go (1)

36-36: Updated parameter type to use centralized SceneID type

The parameter type for the Scene() method has been updated from a local SceneID type to id.SceneID, which is consistent with the PR objective to unify scene IDs across packages.

server/pkg/scene/style_test.go (2)

6-6: Import added for id package

The import for the id package is correctly added for using the centralized ID generation.


16-16: ID generation standardized

Good change from local NewID() to centralized id.NewSceneID(), aligning with the PR objective to unify scene IDs across packages.

server/pkg/storytelling/story_bulider_test.go (2)

6-6: Import added for id package

The import for the id package is correctly added to support the centralized ID generation.


28-28: Scene ID creation standardized

Good update from local NewSceneID() to centralized id.NewSceneID(), aligning with the PR objective to unify scene IDs.

server/pkg/plugin/manifest/convert_test.go (2)

7-7: Import added for id package

The import for the id package is correctly added to support the type change in the test struct.


62-62: Type reference updated

Correctly updated the scene field type from *plugin.SceneID to *id.SceneID to use the centralized ID type.

server/pkg/nlslayer/group_builder.go (1)

72-75: Method signature updated

The method signature is correctly updated to use id.SceneID instead of a local SceneID type. This change is consistent with similar updates to other builder implementations in the codebase, ensuring a unified approach to scene ID management.

server/pkg/property/initializer_test.go (3)

6-6: Import addition aligns with the SceneID unification

Adding the id package import here is necessary to support the SceneID type centralization.


29-29: Updated to use centralized SceneID generation

Replacing local SceneID creation with the centralized function from the id package. This change aligns with the PR objective to unify scene ID definitions across packages.


55-55: Updated to use centralized SceneID generation

Same change as before - using the centralized id.NewSceneID() function for consistency with the unified ID approach.

server/pkg/property/schema.go (2)

3-4: Import addition for ID unification

Adding the id package import supports the return type change in the Scene() method.


28-28: Updated Scene method return type for ID unification

Changing the return type from a locally defined *SceneID to *id.SceneID from the centralized ID package. This matches the PR objective of eliminating duplicate SceneID type definitions across packages.

server/pkg/scene/sceneops/plugin_migrator_test.go (1)

19-19: Updated to use centralized SceneID generation

Changed from using scene.NewID() to id.NewSceneID() to align with the unified approach to scene ID generation.

server/pkg/plugin/manifest/convert.go (2)

8-8: Import addition for ID unification

Adding the import for the id package to support the parameter type change in the manifest method.


17-17: Updated function parameter type for ID unification

Changing the parameter type from *plugin.SceneID to *id.SceneID ensures the function signature uses the centralized SceneID type defined in the id package. This is consistent with the PR's goal of unifying scene identifiers across the codebase.

server/pkg/nlslayer/simple_builder.go (1)

72-75: Change looks good - method signature updated to use centralized ID type.

The update to use id.SceneID aligns with the PR objectives to unify scene IDs across packages, replacing the locally defined SceneID type with the centralized version from the id package.

server/pkg/plugin/plugin.go (2)

6-6: Appropriate import added for ID package.

Adding the import for the id package is necessary to support the updated return type in the Scene() method.


34-36: Return type correctly updated to use centralized ID type.

The change from *SceneID to *id.SceneID as the return type aligns with the PR's goal of unifying scene IDs across the codebase. This maintains the same functionality while using the standardized ID type.

server/pkg/property/property_test.go (6)

17-17: Test case updated to use centralized ID creation.

The change from NewSceneID() to id.NewSceneID() correctly aligns with the PR's goal of unifying scene ID usage across the codebase.


100-100: Test case updated to use centralized ID creation.

The change from NewSceneID() to id.NewSceneID() correctly aligns with the PR's goal of unifying scene ID usage across the codebase.


152-152: Test case updated to use centralized ID creation.

The change from NewSceneID() to id.NewSceneID() correctly aligns with the PR's goal of unifying scene ID usage across the codebase.


203-203: Test case updated to use centralized ID creation.

The change from NewSceneID() to id.NewSceneID() correctly aligns with the PR's goal of unifying scene ID usage across the codebase.


225-225: Test case updated to use centralized ID creation.

The change from NewSceneID() to id.NewSceneID() correctly aligns with the PR's goal of unifying scene ID usage across the codebase.


240-240: Test case updated to use centralized ID creation.

The change from NewSceneID() to id.NewSceneID() correctly aligns with the PR's goal of unifying scene ID usage across the codebase.

server/pkg/storytelling/story_bulider.go (2)

5-7: Appropriate import added for ID package.

Adding the import for the id package is necessary to support the updated parameter type in the Scene() method. The blank line before the import is maintained for consistent formatting.


54-57: Method signature correctly updated to use centralized ID type.

The change from SceneID to id.SceneID as the parameter type in the Scene() method aligns with the PR's goal of unifying scene IDs across the codebase. This maintains the same functionality while using the standardized ID type.

server/internal/usecase/interactor/project_test.go (3)

41-41: Commented-out code explanation is helpful

The commented-out line clearly shows the previous approach of pre-defining project IDs, which helps document the refactoring change. This makes the transition to using dynamically generated IDs from got.ID() more understandable.


59-59: Good refactoring: Using dynamically created IDs instead of mock IDs

Changing from pre-defined mock IDs to using the actual ID returned by the Create method (got.ID()) improves test reliability. This approach ensures the test validates with the actual generated ID rather than relying on mock values.

Also applies to: 89-89


70-70: Improved test assertions with actual generated IDs

The assertions now correctly use the dynamically generated project ID from the creation process, making the tests more accurate by verifying the actual system behavior rather than using pre-defined mock IDs.

Also applies to: 100-100

server/e2e/gql_project_test.go (2)

11-11: Added import for consolidated ID package

Adding the ID package import supports the project's goal of unifying ID generation across packages.


527-527: Standardized project ID generation with id.NewProjectID()

Replaced project-specific ID generation (project.NewID()) with the standardized approach (id.NewProjectID()). This change aligns with the PR objectives to unify ID generation and eliminate redundant ID type definitions across packages.

Also applies to: 545-545

server/pkg/property/builder.go (2)

3-4: Added import for consolidated ID package

Adding the ID package import enables the use of the consolidated scene ID type.


44-47: Updated Scene method to use consolidated ID type

Changed the Scene method parameter from a local SceneID type to id.SceneID from the centralized ID package. This implementation successfully aligns with the PR's goal of unifying scene ID types across packages.

server/pkg/property/merged_test.go (2)

6-6: Added import for consolidated ID package

Adding the ID package import enables the use of the consolidated scene ID generation function in tests.


78-78: Standardized scene ID generation in test

Updated the scene ID generation from local NewSceneID() to the consolidated id.NewSceneID() function. This change ensures consistent ID creation across the codebase and supports the PR's unification goals.

server/pkg/scene/sceneops/plugin_installer.go (2)

6-6: Approved: Updated import to use centralized ID package

The change properly imports the centralized ID package which aligns with the PR objective of unifying scene IDs across packages.


15-15: Approved: Updated parameter type to use centralized ID type

The function signature now uses id.PluginID instead of scene.PluginID, which correctly implements the PR's goal of unifying scene IDs and eliminating redundant type definitions.

server/pkg/scene/plugin_test.go (2)

6-6: Approved: Added import for centralized ID package

The import change properly integrates the centralized ID package for managing IDs.


11-12: Approved: Updated plugin ID and property ID creation

The test now correctly uses id.MustPluginID and id.NewPropertyID() from the centralized ID package instead of locally defined functions, which aligns with the PR objective to standardize ID handling.

server/internal/app/web_test.go (2)

20-20: Approved: Added import for accountdomain package

The import change properly integrates the accountdomain package which provides workspace ID functionality.


38-38: Approved: Updated workspace ID creation

The code now uses accountdomain.NewWorkspaceID() instead of project.NewWorkspaceID(), which aligns with the PR objective of centralizing ID generation and eliminating redundant implementations.

server/pkg/scene/builder/decoder.go (1)

128-128: Approved: Updated SceneFilter to use centralized ID list type

The Filter function now correctly uses id.SceneIDList instead of scene.IDList for both Readable and Writable fields, which aligns with the PR objective of unifying scene IDs and standardizing type usage across the codebase.

server/internal/infrastructure/mongo/mongodoc/style.go (1)

34-34: LGTM: Standardized SceneID type usage.

The parameter type change from scene.IDList to id.SceneIDList aligns with the PR objective to unify scene IDs across packages. This change maintains function behavior while ensuring consistent ID type usage.

server/pkg/property/loader_test.go (3)

7-7: LGTM: Appropriate import added.

Added import for the centralized ID package.


12-12: LGTM: Updated scene ID initialization.

Updated to use the centralized id.NewSceneID() function instead of a local implementation.


30-30: LGTM: Updated scene ID initialization.

Updated to use the centralized id.NewSceneID() function instead of a local implementation.

server/pkg/storytelling/story.go (3)

10-10: LGTM: Appropriate import added.

Added import for the centralized ID package.


24-24: LGTM: Standardized scene field type.

Changed the scene field type from a local SceneID to the centralized id.SceneID type, aligning with the PR objective to unify ID types.


54-54: LGTM: Updated return type for Scene() method.

The return type change from a local SceneID to id.SceneID maintains consistency with the field type change and aligns with the PR objective.

server/pkg/plugin/pluginpack/package.go (2)

13-13: LGTM: Appropriate import change.

Updated import to use the centralized ID package.


27-27: LGTM: Standardized parameter type.

Changed the scene parameter type from *plugin.SceneID to *id.SceneID, properly implementing the PR objective to unify scene ID types across packages.

server/internal/infrastructure/memory/project.go (1)

130-130: ID type unification aligned with PR objectives.

This change updates the return type from []project.ID to []id.ProjectID, which aligns with the PR's objective of unifying scene IDs across packages to use the definitions in ./server/pkg/id/id.go.

server/pkg/property/list_test.go (2)

6-6: Import added for ID package.

The import for the ID package has been added to support the refactoring of scene IDs.


13-14: Scene ID generation refactored.

The scene ID generation has been updated to use id.NewSceneID() from the centralized ID package instead of NewSceneID(), which aligns with the PR objective of unifying scene ID types across the codebase.

server/pkg/property/item_test.go (2)

6-6: Import added for ID package.

The import for the ID package has been added to support the refactoring of scene IDs.


64-64: Scene ID generation refactored.

The scene ID generation has been updated to use id.NewSceneID() from the centralized ID package, aligning with the PR objective of unifying scene ID types across packages.

Also applies to: 77-77

server/pkg/property/sealed_test.go (2)

7-7: Import updated for ID package consistency.

The import of the id package is added to support the refactored scene ID generation approach, aligning with the PR objective to unify ID usage across packages.


172-172: Scene ID generation now uses the unified id package.

The function call has been updated from using a local NewSceneID() to id.NewSceneID(), which centralizes the ID generation logic in the id package as per the PR objective.

server/pkg/asset/asset_test.go (4)

7-9: Updated imports for ID package consistency.

The import of the id package is added to support the refactored asset ID approach, while maintaining the import for accountdomain which handles workspace IDs.


13-14: Asset ID generation now uses the unified id package.

The code now uses id.NewAssetID() instead of a local NewID() function, consistent with the PR's goal to standardize ID generation across packages.


20-23: Updated type declarations for standardized ID types.

The struct field types have been updated to use the more specific types:

  • id.AssetID instead of a local ID type
  • accountdomain.WorkspaceID instead of a local WorkspaceID type

This change ensures type consistency across packages.


33-36: Updated struct field types for consistency in test expectations.

The expected struct field types are updated to match the implementation:

  • id.AssetID instead of a local ID type
  • accountdomain.WorkspaceID instead of a local WorkspaceID type

This ensures the test assertions are consistent with the refactored types.

server/pkg/property/property.go (3)

7-9: Import added for ID package while maintaining code organization.

The import of the id package is added with appropriate spacing, maintaining clean code organization.


13-13: Updated Property struct field type for scene ID.

The scene field type has been changed from a local SceneID type to the unified id.SceneID type, aligning with the PR's goal of standardizing ID types.


29-29: Updated Scene() method return type for consistency.

The return type of the Scene() method has been changed from a local SceneID type to the unified id.SceneID type, ensuring API consistency.

server/pkg/property/builder_test.go (4)

6-7: Import added for ID package consistency in tests.

The import of the id package is added to support the refactored scene ID generation in test code.


17-17: Updated scene ID creation in test cases for consistency.

All occurrences of NewSceneID() have been replaced with id.NewSceneID() to use the unified ID generation approach across test cases. This change maintains consistency with the implementation code.

Also applies to: 22-23, 27-28, 32-33, 81-82


92-93: Updated variable type for scene ID in test setup.

The scene ID variable sid is now created using id.NewSceneID(), ensuring test setup uses the same ID types as the implementation code.


99-101: Updated test struct field type for scene ID.

The Scene field in the args struct has been updated from SceneID to id.SceneID, ensuring test code uses the same ID types as the implementation code.

server/pkg/scene/builder/scene.go (2)

7-7: Adding the id package for unified ID handling.

This import modification is part of the broader refactoring to unify scene IDs across packages, which helps maintain consistency in the codebase.


90-90: Updated function parameter type for ID consistency.

Changed parameter type from []scene.WidgetID to []id.WidgetID to align with the ID unification initiative. This ensures consistent ID typing across the application.

server/internal/usecase/interactor/scene.go (1)

555-555: Updated IDList type for consistent ID handling.

Changed from using scene.IDList to id.SceneIDList for both Readable and Writable fields, making the code more consistent with the unified ID approach. This ensures that all scene identifiers come from a single source of truth.

server/internal/usecase/interactor/storytelling.go (1)

1092-1092: Updated SceneFilter to use ID package's SceneIDList.

Modified the readableFilter declaration to use id.SceneIDList instead of scene.IDList, which aligns with the codebase's ID unification effort and matches the changes in the repo.SceneFilter struct shown in the relevant code snippets.

server/e2e/seeder.go (2)

149-149: Switched to unified ID generator for assets.

Changed from using asset.NewID() to id.NewAssetID() to create asset identifiers, consistent with the standardization of ID generation across the codebase.


354-354: Updated function parameter type for consistent ID handling.

Modified the function signature to use id.SceneID instead of scene.ID as the parameter type, aligning with the unified ID approach across the codebase.

server/pkg/scene/scene_test.go (4)

7-7: Import added for ID package

The added import correctly supports the refactoring to use centralized ID types from the id package.


22-23: Property ID creation now uses centralized ID package

The change from local NewPropertyID() to id.NewPropertyID() aligns with the PR objective to unify ID types across packages.


30-30: Widget creation now uses centralized ID types

MustWidget function now properly uses the ID package for widget, plugin and property identifiers.


35-35: Updated assertion to use the ID package type

The assertion correctly uses the id.PropertyID type instead of a local PropertyID type, maintaining consistency across the codebase.

server/pkg/nlslayer/nlslayer.go (3)

10-10: Updated interface method return type to use centralized ID

The NLSLayer.Scene() method now correctly returns id.SceneID instead of a locally defined SceneID type.


69-69: Updated struct field type to use centralized ID

The scene field in the layerBase struct now uses id.SceneID from the centralized ID package.


103-103: Updated method implementation return type to match interface

The layerBase.Scene() method implementation now returns id.SceneID to match the updated interface.

server/pkg/scene/widget_section.go (3)

3-4: Added import for ID package

The added import correctly supports the refactoring to use centralized ID types from the id package.


49-49: Updated Find method parameter type

The WidgetSection.Find method now correctly accepts id.WidgetID instead of a locally defined WidgetID type.


66-66: Updated Remove method parameter type

The WidgetSection.Remove method now correctly accepts id.WidgetID instead of a locally defined WidgetID type.

server/internal/usecase/interactor/asset_test.go (7)

17-17: Import added for ID package

The added import correctly supports the refactoring to use centralized ID types.


30-30: Using centralized ID for project identifier

The test now correctly uses id.NewProjectID() to create a project ID, aligning with the PR's goal of ID unification.


32-34: Improved file system handling in test

Switching to an in-memory filesystem with error checking is a good practice for tests as it doesn't rely on the local filesystem.


35-43: Updated struct initialization and naming

Renamed variable from uc to uContainer for better clarity and updated the gateway container field name from 'FS' to 'File'.


48-52: Updated asset creation with project ID

The asset creation now includes a project ID parameter, which is consistent with the updated API signature.


65-76: Updated asset initialization with consistent IDs

The asset initialization now correctly uses res.ID() for ID and timestamp, and includes the project ID in the asset construction.


79-81: Updated repository query and assertions

The repository query now correctly uses the result ID and the assertions have been updated to verify the result.

server/pkg/scene/style.go (4)

3-4: LGTM: Import statement for the id package added.

The import statement for the id package has been properly added to support the type changes in this file.


6-9: Appropriate type update for Style struct fields.

The field types have been correctly updated to use id package types:

  • id field changed from StyleID to id.StyleID
  • scene field changed from ID to id.SceneID

These changes align with the PR objective to unify scene IDs across packages.


12-17: Return type properly updated in the ID() method.

The return type of the ID() method has been correctly updated from StyleID to id.StyleID, and the nil check handling is consistent with the type change.


47-49: Return type properly updated in the Scene() method.

The Scene() method's return type has been correctly changed from ID to id.SceneID, maintaining the same behavior while using the unified type from the id package.

server/pkg/nlslayer/loader.go (2)

12-12: LoaderByScene type signature correctly updated.

The LoaderByScene function type has been properly updated to use id.SceneID instead of SceneID, aligning with the ID standardization objective of this PR.


78-78: Parameter type updated in LoaderBySceneFrom implementation.

The anonymous function parameter has been correctly updated to use id.SceneID type, ensuring consistency with the type signature change. This maintains compatibility with code that calls this function.

server/pkg/property/initializer.go (4)

5-9: Import statement for id package properly added.

The import statement for the id package has been correctly added to support the parameter type changes in this file.


39-62: Property method parameter type correctly updated.

The scene parameter type in the Property method has been properly changed from SceneID to id.SceneID, while maintaining the same method logic and functionality.


65-83: PropertyIncludingEmpty method parameter type correctly updated.

The scene parameter type in the PropertyIncludingEmpty method has been properly changed from SceneID to id.SceneID, maintaining the same method behavior.


85-91: MustBeProperty method parameter type correctly updated.

The scene parameter type in the MustBeProperty method has been properly changed from SceneID to id.SceneID, while preserving the same error handling and return behavior.

server/pkg/scene/widget_zone_test.go (6)

3-8: Import statement for id package properly added.

The import statement for the id package has been correctly added to support the type changes in this test file.


25-32: Widget ID creation updated to use id package.

The widget ID creation statements have been properly updated to use id.NewWidgetID() instead of NewWidgetID(), aligning with the ID standardization approach.


35-36: Input field type updated in test struct.

The Input field type in the test struct has been correctly changed from WidgetID to id.WidgetID to maintain consistency with the widget ID type changes.


64-65: ID creation in test case correctly updated.

The widget ID creation in the "invalid id" test case has been properly updated to use id.NewWidgetID(), maintaining the same test behavior with the new ID type.


93-95: WidgetIDList type updated in test setup.

The WidgetIDList type used in the test setup has been correctly updated to id.WidgetIDList, ensuring compatibility with the widget ID type changes.


106-150: Widget ID types properly updated in Remove tests.

All widget ID related types and creation functions have been correctly updated to use the id package types and functions in the Remove tests:

  • Widget ID creation now uses id.NewWidgetID()
  • Expected results are now typed as id.WidgetIDList

This ensures consistency with the ID standardization approach across the codebase.

server/pkg/scene/widget_align_system.go (4)

3-4: Properly imported the required package.

Added import for the id package to support the type changes from WidgetID to id.WidgetID in method signatures.


58-58: Method signature updated for consistent ID type usage.

Updated the parameter type from WidgetID to id.WidgetID to align with the PR's objective of unifying ID types across the codebase.


71-71: Method signature updated for consistent ID type usage.

Updated the parameter type from WidgetID to id.WidgetID in the Find method to maintain consistency with the ID unification effort.


94-94: Method signature updated for consistent ID type usage.

Updated the parameter type from WidgetID to id.WidgetID in the Move method to complete the consistent usage of unified ID types throughout the widget alignment system.

server/pkg/scene/widget_section_test.go (8)

6-6: Properly imported the required package.

Added import for the id package to support the transition to centralized ID type definitions.


25-31: Updated widget ID creation to use centralized ID package.

Changed all widget ID creation calls from NewWidgetID() to id.NewWidgetID() to align with the unified ID management approach.


35-36: Updated struct field type for consistent ID usage.

Changed the Input field type from WidgetID to id.WidgetID to maintain type consistency throughout the test cases.


60-61: Updated test case to use centralized ID generator.

Changed the invalid ID test case to use id.NewWidgetID() instead of the local NewWidgetID() function.


86-88: Updated widget ID list type for consistent ID usage.

Changed WidgetIDList to id.WidgetIDList for all area additions to align with the centralized ID types.


98-98: Updated widget ID creation to use centralized ID package.

Changed widget ID creation from NewWidgetID() to id.NewWidgetID() in the TestWidgetSection_Remove function.


103-104: Updated struct field types for consistent ID usage.

Changed both Input and Expected field types to use the centralized ID types (id.WidgetID and id.WidgetIDList).


111-111: Updated expected widget ID lists for consistent type usage.

Changed all expected widget ID lists in the test cases to use id.WidgetIDList instead of the local WidgetIDList type.

Also applies to: 117-118, 123-123, 129-130, 135-135, 141-141

server/pkg/scene/list.go (4)

3-6: Added necessary imports for ID type unification.

Imported both the id package for scene IDs and accountdomain for workspace IDs to support the centralized ID type definitions.


10-10: Updated IDs method return type for consistent ID usage.

Changed the return type from []ID to []id.SceneID and updated the slice initialization to match, aligning with the unified ID type system.

Also applies to: 15-15


22-22: Updated FilterByID parameter type for consistent ID usage.

Changed parameter type from ids ...ID to ids ...id.SceneID to use the centralized scene ID type definition.


40-40: Updated FilterByWorkspace parameter type for consistent ID usage.

Changed parameter type from workspaces ...WorkspaceID to workspaces ...accountdomain.WorkspaceID to use the centralized workspace ID type definition.

server/pkg/project/builder_test.go (10)

9-9: Imported ID package for centralized type definitions.

Added import for the id package to support the transition to centralized project ID types.


22-22: Updated ID function call to use centralized ID generator.

Changed from using a local ID generator to id.NewProjectID() to align with the unified ID management approach.


166-167: Updated project ID creation to use centralized ID package.

Changed project ID creation from NewID() to id.NewProjectID() to ensure consistency across the codebase.


174-174: Updated struct field types for consistent ID usage.

Changed field types in the args struct:

  • id from ID to id.ProjectID
  • workspace from WorkspaceID to accountdomain.WorkspaceID

This ensures type consistency throughout the test cases.

Also applies to: 180-180


240-240: Updated error reference for consistent error handling.

Changed error reference from ErrInvalidID to id.ErrInvalidID to align with the centralized ID type system.


245-246: Updated project ID creation in test case to use centralized ID package.

Changed project ID creation from NewID() to id.NewProjectID() in the "failed invalid alias" test case.


287-288: Updated ID variable initialization for the MustBuild test.

Changed project ID creation from NewID() to id.NewProjectID() and maintained consistency with workspace ID.


295-295: Updated struct field types in MustBuild test for consistent ID usage.

Changed field types in the args struct for the MustBuild test:

  • id from ID to id.ProjectID
  • workspace from WorkspaceID to accountdomain.WorkspaceID

This maintains type consistency across all test cases.

Also applies to: 301-301


370-370: Updated error reference for consistent error handling in MustBuild test.

Changed error reference from ErrInvalidID to id.ErrInvalidID in the MustBuild test's "failed invalid id" case.


375-376: Updated project ID creation in MustBuild test case.

Changed project ID creation from NewID() to id.NewProjectID() in the "failed invalid alias" test case for MustBuild.

server/pkg/scene/widget_area_test.go (4)

6-6: Import update for the new ID package is correctly implemented.

The import of the id package is needed for the widget ID refactoring, aligning with the PR objective to unify scene IDs.


12-13: Widget ID creation is correctly migrated to id package.

The NewWidgetID() calls are properly updated to use id.NewWidgetID(), which centralizes ID generation in the id package.


15-15: Widget ID type references correctly updated to use the id package.

All references to WidgetIDList have been properly updated to id.WidgetIDList throughout the test file, ensuring type consistency.

Also applies to: 30-31, 33-33, 38-38, 46-47, 59-59, 75-76, 78-78, 162-163, 168-169, 174-175, 211-212, 217-218, 295-296, 300-301, 341-342, 347-348


105-108: Widget instantiation correctly uses the new ID types.

The NewWidgetArea instantiations now correctly use id.WidgetIDList as parameters, maintaining functionality while using the centralized ID types.

Also applies to: 139-139, 192-192, 316-317, 362-363

server/internal/usecase/repo/container.go (4)

8-8: Import added for the id package.

The import for the id package is correctly added, which is necessary for using the centralized ID types.


130-131: SceneFilter structure correctly updated to use centralized ID types.

The SceneFilter struct fields are properly updated to use id.SceneIDList instead of scene.IDList, aligning with the PR objective of unifying ID types.


142-142: Variable types in Merge method updated for consistency.

The local variables r and w in the Merge method are correctly updated to use id.SceneIDList, maintaining type consistency throughout the method.


173-173: Method signatures correctly updated to use centralized ID types.

The CanRead and CanWrite method signatures are properly updated to accept id.SceneID instead of scene.ID, ensuring consistent ID type usage across the codebase.

Also applies to: 177-177

server/pkg/asset/builder.go (6)

6-7: Imports updated to use id and accountdomain packages.

The imports are correctly updated to include the id package for asset IDs and the accountdomain package for workspace IDs, aligning with the ID unification objective.


20-20: Error reference updated to use centralized error definition.

The error reference is updated from a local ErrInvalidID to id.ErrInvalidID, ensuring error definitions are also centralized alongside ID types.


45-45: ID method signature updated to use centralized ID type.

The ID method now correctly accepts id.AssetID instead of a local ID type, maintaining consistent ID types across the codebase.


51-51: NewID method implementation updated to use centralized ID generator.

The NewID method now correctly uses id.NewAssetID() instead of a local ID generator, centralizing ID generation logic.


55-55: Workspace method updated to use accountdomain package.

The Workspace method now correctly accepts accountdomain.WorkspaceID instead of a local WorkspaceID type, aligning with the ID unification objective.


60-60: Project method updated to use centralized ProjectID type.

The Project method now correctly accepts *id.ProjectID instead of a local *ProjectID type, ensuring consistent ID type usage throughout the codebase.

server/pkg/plugin/manifest/parser.go (2)

13-13: Import added for the id package.

The import for the id package is correctly added, which is necessary for using the centralized ID types.


23-23: Function parameter types updated to use centralized SceneID type.

The parameter types for the Parse, ParseSystemFromBytes, and MustParseSystemFromBytes functions are correctly updated to use *id.SceneID instead of *plugin.SceneID, ensuring consistent ID type usage across the codebase.

Also applies to: 41-41, 56-56

server/pkg/asset/builder_test.go (6)

7-7: Appropriate import of the ID package.

The import of the id package is now correctly used throughout the file to reference specialized asset ID functions.


13-13: Consistent use of specialized ID constructor.

Changed from generic NewID() to the more specific id.NewAssetID(), which aligns with the PR's goal of unifying ID types across packages.


18-18: Proper type specificity for ID fields.

Updated struct field types from general ID to specific id.AssetID and from general WorkspaceID to more specific accountdomain.WorkspaceID, improving type clarity and consistency.

Also applies to: 21-21


57-57: Consistent ID initialization across test cases.

All asset ID initializations now use the specialized id.NewAssetID() function rather than a generic ID constructor, ensuring type safety and consistency.

Also applies to: 69-69, 81-81, 93-93


83-83: Proper workspace ID initialization.

Updated empty workspace initialization to use accountdomain.WorkspaceID{} rather than a generic workspace ID type, maintaining consistency with other changes.

Also applies to: 199-199


100-100: Standardized error references.

Updated error reference from local ErrInvalidID to id.ErrInvalidID, centralizing error definitions in the id package.

Also applies to: 216-216

server/pkg/scene/plugins_test.go (5)

6-6: Appropriate import of the ID package.

The id package import correctly supports the refactoring of plugin IDs and property IDs.


11-12: Consistent ID initialization patterns across test functions.

Updated all ID initializations to use specialized functions from the id package (id.MustPluginID and id.NewPropertyID), replacing local package functions and ensuring type consistency throughout tests.

Also applies to: 70-71, 110-111, 144-145, 178-179, 212-213, 246-247, 280-281, 314-315, 364-365, 397-400


75-75: Type consistency for ID parameters and return values.

All parameter and return types for plugin and property IDs have been updated to use the standardized types from the id package, ensuring type consistency across the codebase.

Also applies to: 77-77, 115-115, 151-151, 184-184, 197-197, 217-217, 251-251, 402-406


94-94: Consistent usage of plugin ID constructors in test scenarios.

Test scenarios now consistently use id.MustPluginID when creating plugin IDs for comparison cases, maintaining type safety and improving readability.

Also applies to: 128-128, 230-230, 264-264, 298-298


339-339: Proper reference to official plugin ID constants.

References to OfficialPluginID have been updated to use id.OfficialPluginID, centralizing constant definitions in the id package.

Also applies to: 374-377, 448-452, 460-461

server/pkg/scene/builder/scene_test.go (5)

6-6: Appropriate import of the ID package.

Added the id package import to support specialized scene and widget ID types.


14-14: Scene ID creation now uses centralized ID package.

Changed from scene.NewID() to id.NewSceneID(), aligning with the PR objective to unify scene IDs across packages.


52-58: Widget ID creation and collection now use centralized ID package.

Updated widget ID creation from scene.NewWidgetID() to id.NewWidgetID() and changed the collection type from []scene.WidgetID to []id.WidgetID, ensuring consistent ID type usage.


63-63: Input parameter type updated for consistency.

Changed the input parameter type from []scene.WidgetID to []id.WidgetID in the test cases, maintaining consistency with other ID type changes.


89-89: Widget ID creation for align system test updated.

Changed widget ID creation from scene.NewWidgetID() to id.NewWidgetID() in the widget align system test, completing the ID package migration.

server/pkg/scene/style_builder.go (5)

3-4: Added import for the ID package.

The import addition is necessary to support the refactored ID types and error references.


15-15: Standardized error reference.

Updated the error reference from local ErrInvalidID to id.ErrInvalidID, centralizing error definitions.


28-28: Updated method signature to use centralized ID type.

Changed the parameter type from local StyleID to id.StyleID, aligning with the ID unification goal.


34-34: Style ID creation now uses centralized ID package.

Updated from local NewStyleID() to id.NewStyleID(), ensuring consistent ID creation patterns.


38-38: Updated Scene parameter type in method signature.

Changed the parameter type from local ID to more specific id.SceneID, improving type clarity and consistency.

server/pkg/scene/widget_align_system_test.go (6)

6-6: LGTM: Import addition for ID package.

The new import of the id package is correctly added to support the refactored ID types.


32-36: LGTM: Widget ID creation refactored correctly.

Good refactoring of widget ID creation to use id.NewWidgetID() instead of a local implementation, aligning with the PR objective to unify scene IDs across packages.


40-40: LGTM: Updated Input variable type.

The type of Input has been correctly updated from WidgetID to id.WidgetID in the test case struct, consistent with the ID unification effort.


85-86: LGTM: Widget ID list type updated properly.

The WidgetIDList type has been appropriately changed to id.WidgetIDList in the method calls, maintaining type consistency.


95-128: LGTM: TestWidgetAlignSystem_Remove refactored properly.

All widget ID related types and creations in the TestWidgetAlignSystem_Remove function have been correctly updated to use the centralized types from the id package.


155-188: LGTM: TestWidgetAlignSystem_Move refactored correctly.

The widget ID types and creations in the TestWidgetAlignSystem_Move function have been properly updated to use the centralized id package types, consistent with the PR objectives.

server/pkg/scene/widgets_test.go (7)

6-6: LGTM: Import addition for ID package.

The id package import has been correctly added to support the refactored ID types.


11-13: LGTM: ID creation methods updated correctly.

The ID creation calls have been properly updated to use the corresponding methods from the id package, aligning with the PR objective to unify IDs.


111-116: LGTM: TestWidgets_Remove updated properly.

The widget ID creation and types have been correctly refactored to use the centralized ID types from the id package in the TestWidgets_Remove test.


151-157: LGTM: RemoveAllByPlugin test refactored properly.

All ID types and creations in the TestWidgets_RemoveAllByPlugin function have been correctly updated to use the centralized types from the id package.


158-164: LGTM: Updated struct field types for RemoveAllByPlugin test.

The parameter types in the test struct have been correctly updated to use the centralized ID types from the id package.


199-204: LGTM: UpgradePlugin test refactored properly.

The ID types and creations in the TestWidgets_UpgradePlugin function have been correctly updated to use the id package.


240-246: LGTM: Properties test refactored correctly.

All ID types and creations in the TestWidgets_Properties function have been properly updated to use the centralized types from the id package.

server/pkg/asset/asset.go (5)

6-9: LGTM: Import additions for ID and accountdomain packages.

The necessary imports for id and accountdomain packages have been correctly added to support the refactored ID types.


17-27: LGTM: Asset struct field types updated correctly.

The Asset struct field types have been properly refactored:

  • id field type changed from ID to id.AssetID
  • workspace field type changed from WorkspaceID to accountdomain.WorkspaceID
  • project field type changed from *ProjectID to *id.ProjectID

This aligns with the PR objective of unifying ID types across packages.


29-31: LGTM: ID() method return type updated.

The ID() method return type has been correctly updated to return id.AssetID instead of a custom ID type.


33-35: LGTM: Workspace() method return type updated.

The Workspace() method return type has been properly updated to return accountdomain.WorkspaceID.


37-43: LGTM: Project methods updated correctly.

Both Project() return type and SetProject() parameter type have been properly updated to use *id.ProjectID.

server/pkg/scene/builder.go (5)

5-8: LGTM: Import additions for ID and accountdomain packages.

The necessary imports for id and accountdomain packages have been correctly added to support the refactored ID types.


19-24: LGTM: Error handling updated to use centralized error constants.

Error handling has been properly updated to use id.ErrInvalidID from the central ID package instead of a locally defined error constant.


45-48: LGTM: ID() method parameter type updated.

The ID() method parameter type has been correctly updated to accept id.SceneID instead of a custom ID type.


50-53: LGTM: NewID() method implementation updated.

The NewID() method now properly uses id.NewSceneID() to create new scene IDs from the central ID package.


55-83: LGTM: Method parameter types updated correctly.

All method parameter types have been properly updated to use the centralized types:

  • Project() now accepts id.ProjectID
  • Workspace() now accepts accountdomain.WorkspaceID
  • Property() now accepts id.PropertyID

This aligns with the PR objective of unifying ID types across packages.

server/internal/usecase/repo/container_test.go (4)

6-6: Updated import to use centralized ID package.

Import of the id package has been added to use the new centralized ID types, which aligns with the PR objective of unifying scene IDs across packages.


33-34: Updated scene ID creation to use centralized id package.

Scene ID creation has been refactored from scene.NewID() to id.NewSceneID(), which ensures consistent ID generation across the codebase.


36-44: Updated SceneFilter usage to use centralized ID types.

The code now uses id.SceneIDList instead of scene.IDList in the SceneFilter test, maintaining consistent type usage across the codebase.


45-48: Updated empty SceneIDList references to use centralized ID types.

The assertions with empty SceneIDLists now use the centralized id.SceneIDList{} type, ensuring type consistency throughout the tests.

server/pkg/scene/widgets.go (7)

5-7: Updated imports to include centralized ID package.

Added import for the id package to access the centralized ID types, supporting the ID unification objective.


65-75: Updated Widget method to use centralized WidgetID type.

The Widget method signature now uses id.WidgetID instead of a local WidgetID type, ensuring type consistency across the codebase.


77-87: Updated Has method to use centralized WidgetID type.

The Has method signature now uses id.WidgetID instead of a local WidgetID type, aligning with the centralized ID approach.


96-106: Updated Remove method to use centralized WidgetID type.

The Remove method signature now uses id.WidgetID instead of a local WidgetID type, maintaining consistent type usage.


108-122: Updated RemoveAllByPlugin method to use centralized ID types.

The method now uses id.PluginID, *id.PluginExtensionID, and returns []id.PropertyID instead of local types, ensuring consistency across the codebase.


124-133: Updated UpgradePlugin method to use centralized PluginID type.

The UpgradePlugin method signature now uses id.PluginID instead of a local PluginID type, ensuring type consistency.


135-144: Updated Properties method to use centralized PropertyID type.

The Properties method return type and internal slice creation now use id.PropertyID instead of a local PropertyID type, aligning with the centralized ID approach.

server/pkg/project/builder.go (6)

7-10: Updated imports to use centralized ID and accountdomain packages.

Added imports for id and accountdomain packages to support the use of centralized ID types throughout the builder.


21-23: Updated error handling to use centralized error type.

The code now returns id.ErrInvalidID instead of a local ErrInvalidID, ensuring consistent error handling across the codebase.


41-44: Updated ID method to use centralized ProjectID type.

The ID method signature now uses id.ProjectID instead of a local ID type, maintaining type consistency across the codebase.


46-49: Updated NewID method to use centralized ID generation.

The NewID method now uses id.NewProjectID() instead of a local NewID() function, ensuring consistent ID generation.


132-135: Updated Workspace method to use centralized WorkspaceID type.

The Workspace method signature now uses accountdomain.WorkspaceID instead of a local WorkspaceID type, ensuring type consistency.


157-160: Updated Scene method to use centralized SceneID type.

The Scene method signature now uses id.SceneID instead of a local SceneID type, maintaining type consistency across the codebase.

server/internal/usecase/interactor/scene_plugin_test.go (5)

38-39: Updated scene ID creation to use centralized ID package.

Scene ID creation has been refactored from scene.NewID() to id.NewSceneID(), which ensures consistent ID generation across the codebase.


42-43: Updated scene ID reference in WithScene call.

The code now uses id.NewSceneID().Ref() instead of scene.NewID().Ref() for creating a scene-specific plugin ID, maintaining consistent ID generation.


162-163: Updated scene ID creation to use centralized ID package.

Scene ID creation has been refactored from scene.NewID() to id.NewSceneID() in the UninstallPlugin test, ensuring type consistency.


229-230: Updated widget ID creation to use centralized ID package.

Widget ID creation has been refactored from scene.NewWidgetID() to id.NewWidgetID(), aligning with the centralized ID approach.


300-301: Updated scene ID creation to use centralized ID package.

Scene ID creation has been refactored from scene.NewID() to id.NewSceneID() in the UpgradePlugin test, ensuring consistent ID generation.

server/pkg/scene/widget_test.go (5)

6-6: Import update is correctly implemented

The addition of the id package import is appropriate and aligns with the PR objective of unifying scene IDs across packages.


11-13: Type migration complete

The ID initialization functions are properly updated to use the centralized id package methods, which is consistent with the PR's goal of eliminating redundant SceneID types.


17-20: Type references correctly updated

The struct field types have been properly updated to use the id package's type definitions, maintaining type safety while consolidating ID management.


43-43: Error reference correctly updated

Error handling now properly references id.ErrInvalidID instead of a locally defined error, ensuring consistency in error handling across the codebase.


67-69: All test cases properly migrated

All test function implementations have been successfully migrated to use the new id package types, ensuring tests remain valid after the refactoring.

Also applies to: 73-76, 99-99, 126-126, 132-132, 138-138

server/pkg/scene/widget_area.go (3)

3-4: Import correctly added

The id package is properly imported and the import organization is clean.


11-11: Field type correctly updated

The widgetIds field type is successfully transitioned from WidgetIDList to id.WidgetIDList, which aligns with the ID unification goal.


27-27: Method signatures properly updated

All method signatures have been consistently updated to use the id package types, maintaining API compatibility while centralizing ID types.

Also applies to: 40-40, 89-89, 96-96, 110-110, 150-150

server/pkg/scene/plugins.go (4)

3-4: Import declaration is clean and focused

The import statement is correctly implemented, importing only the necessary id package without any unnecessary imports.


36-36: Method signatures properly updated

Function signatures have been correctly updated to use id.PluginID instead of PluginID, maintaining consistency with the centralized ID management approach.

Also applies to: 45-45, 54-54, 80-80


73-73: References to constants updated

References to OfficialPluginID have been properly updated to id.OfficialPluginID, ensuring consistent use of the centralized constants.

Also applies to: 81-81, 93-93


92-92: Parameter types and return types correctly refactored

All parameter and return types related to IDs have been successfully migrated to use the centralized id package types.

Also applies to: 101-101, 113-113, 117-117, 126-126

server/internal/usecase/operator.go (2)

15-18: Fields properly migrated to use centralized ID types

The Operator struct fields have been successfully updated from scene.IDList to id.SceneIDList, aligning with the ID unification goal.


73-73: Method return types properly updated

All methods that return scene ID lists have been correctly updated to return id.SceneIDList instead of scene.IDList, ensuring consistent type usage throughout the codebase.

Also applies to: 77-77, 81-81, 85-85

server/pkg/scene/widget.go (6)

3-4: LGTM: Import update correctly integrates with ID refactoring

The import of the ID package is added properly to accommodate the transition to unified ID types.


6-9: LGTM: Widget struct fields now use consistent ID types

The Widget struct fields have been appropriately updated to use the centralized ID types from the id package rather than package-specific types. This aligns with the PR goal of unifying scene IDs across packages.


14-17: LGTM: Function signature updated correctly for NewWidget

The NewWidget function signature now uses the centralized ID types from the id package. The error handling is also updated to use id.ErrInvalidID instead of a local error constant.


29-35: LGTM: MustWidget function updated consistently

The MustWidget function has been updated to use the same ID types as the NewWidget function, maintaining consistency across the codebase.


37-39: LGTM: Getter methods return consistent ID types

All getter methods (ID, Plugin, Extension, Property) have been updated to return the centralized ID types from the id package, ensuring consistency in how IDs are handled throughout the codebase.

Also applies to: 41-43, 45-47, 49-51


95-100: LGTM: SetPlugin method updated correctly

The SetPlugin method now accepts id.PluginID instead of a local PluginID type, maintaining consistency with the other changes in this file.

server/pkg/project/project.go (4)

11-14: LGTM: Imports updated properly for ID refactoring

The imports have been updated to include the id package and the accountdomain package, which are necessary for the transition to the centralized ID types.


33-34: LGTM: Project struct fields updated to use consistent ID types

The Project struct fields (id, workspace, sceneId) have been properly updated to use the centralized ID types from the id and accountdomain packages, aligning with the PR goal of unifying ID types.

Also applies to: 48-49, 54-55


59-61: LGTM: Getter methods return consistent ID types

The ID(), Scene(), and Workspace() methods have been updated to return the centralized ID types from the id and accountdomain packages, ensuring consistency in how IDs are handled throughout the codebase.

Also applies to: 136-138, 144-146


239-241: LGTM: Update methods accept consistent ID types

The UpdateWorkspace() and UpdateSceneID() methods now accept the centralized ID types from the accountdomain and id packages, maintaining consistency with the other changes in this file.

Also applies to: 259-261

server/pkg/scene/builder_test.go (5)

7-8: LGTM: Imports updated correctly

The imports have been properly updated to include the id package, which is necessary for using the centralized ID types in the test code.


17-18: LGTM: ID generation calls updated properly

All ID generation calls (NewID(), NewPropertyID(), etc.) have been replaced with their counterparts from the id package, ensuring that tests use the same ID generation mechanisms as the production code.

Also applies to: 29-30, 36-37, 43-44, 50-51, 58-60


69-75: LGTM: Struct argument types updated correctly

The argument struct types have been updated to use the centralized ID types from the id and accountdomain packages, maintaining consistency with the changes in the production code.


95-96: LGTM: Error assertions updated properly

The error assertions have been updated to use id.ErrInvalidID instead of a local error constant, aligning with the changes in the production code.

Also applies to: 108-109


169-177: LGTM: Consistent updates in the second test

The updates in the TestBuilder_MustBuild function are consistent with those in the TestBuilder_Build function, ensuring that all tests use the same ID types and error constants.

server/pkg/scene/scene.go (4)

7-9: LGTM: Imports updated correctly

The imports have been properly updated to include the accountdomain package, which is necessary for using the centralized ID types in the Scene struct and methods.


14-17: LGTM: Scene struct fields use consistent ID types

The Scene struct fields (id, project, workspace, property) have been properly updated to use the centralized ID types from the id and accountdomain packages, aligning with the PR goal of unifying ID types across the codebase.

Also applies to: 20-20


24-29: LGTM: Getter methods return consistent ID types

The ID(), Project(), Workspace(), and Property() methods have been updated to return the centralized ID types from the id and accountdomain packages, ensuring consistency in how IDs are handled throughout the codebase.

Also applies to: 38-43, 45-50, 52-57


105-113: LGTM: Properties method updated correctly

The Properties() method has been updated to return []id.PropertyID instead of a local property ID type, and the initialization of the ids slice has been updated to use the new type. This maintains consistency with the other changes in this file.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
server/internal/usecase/interactor/project_test.go (1)

41-41: Commented code should be removed.

Instead of commenting out code, it's better to remove it entirely as it's no longer needed. This commented line indicates a shift from using mock project IDs to using the actual IDs generated during test execution.

-	// pId1, pId2 := id.NewProjectID(), id.NewProjectID()
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ca9cce2 and 71627bc.

📒 Files selected for processing (92)
  • server/e2e/gql_project_test.go (3 hunks)
  • server/e2e/seeder.go (2 hunks)
  • server/internal/adapter/gql/gqlmodel/convert_project_test.go (2 hunks)
  • server/internal/app/web_test.go (2 hunks)
  • server/internal/infrastructure/memory/asset.go (3 hunks)
  • server/internal/infrastructure/memory/project.go (1 hunks)
  • server/internal/infrastructure/mongo/container.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/nlslayer.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/property.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/property_schema.go (1 hunks)
  • server/internal/infrastructure/mongo/mongodoc/style.go (1 hunks)
  • server/internal/usecase/interactor/asset_test.go (4 hunks)
  • server/internal/usecase/interactor/project_test.go (5 hunks)
  • server/internal/usecase/interactor/scene.go (1 hunks)
  • server/internal/usecase/interactor/scene_plugin_test.go (4 hunks)
  • server/internal/usecase/interactor/storytelling.go (1 hunks)
  • server/internal/usecase/operator.go (2 hunks)
  • server/internal/usecase/repo/container.go (4 hunks)
  • server/internal/usecase/repo/container_test.go (2 hunks)
  • server/pkg/asset/asset.go (2 hunks)
  • server/pkg/asset/asset_test.go (2 hunks)
  • server/pkg/asset/builder.go (3 hunks)
  • server/pkg/asset/builder_test.go (10 hunks)
  • server/pkg/asset/id.go (0 hunks)
  • server/pkg/id/id.go (0 hunks)
  • server/pkg/nlslayer/builder.go (1 hunks)
  • server/pkg/nlslayer/group.go (1 hunks)
  • server/pkg/nlslayer/group_builder.go (1 hunks)
  • server/pkg/nlslayer/id.go (0 hunks)
  • server/pkg/nlslayer/loader.go (2 hunks)
  • server/pkg/nlslayer/nlslayer.go (3 hunks)
  • server/pkg/nlslayer/simple.go (1 hunks)
  • server/pkg/nlslayer/simple_builder.go (1 hunks)
  • server/pkg/plugin/id.go (0 hunks)
  • server/pkg/plugin/manifest/convert.go (2 hunks)
  • server/pkg/plugin/manifest/convert_test.go (2 hunks)
  • server/pkg/plugin/manifest/parser.go (4 hunks)
  • server/pkg/plugin/plugin.go (2 hunks)
  • server/pkg/plugin/pluginpack/package.go (2 hunks)
  • server/pkg/project/builder.go (5 hunks)
  • server/pkg/project/builder_test.go (6 hunks)
  • server/pkg/project/id.go (0 hunks)
  • server/pkg/project/project.go (6 hunks)
  • server/pkg/property/builder.go (2 hunks)
  • server/pkg/property/builder_test.go (4 hunks)
  • server/pkg/property/id.go (0 hunks)
  • server/pkg/property/initializer.go (4 hunks)
  • server/pkg/property/initializer_test.go (3 hunks)
  • server/pkg/property/item_test.go (3 hunks)
  • server/pkg/property/list_test.go (1 hunks)
  • server/pkg/property/loader_test.go (2 hunks)
  • server/pkg/property/merged_test.go (2 hunks)
  • server/pkg/property/property.go (2 hunks)
  • server/pkg/property/property_test.go (6 hunks)
  • server/pkg/property/schema.go (2 hunks)
  • server/pkg/property/sealed_test.go (2 hunks)
  • server/pkg/scene/builder.go (4 hunks)
  • server/pkg/scene/builder/decoder.go (1 hunks)
  • server/pkg/scene/builder/scene.go (2 hunks)
  • server/pkg/scene/builder/scene_test.go (3 hunks)
  • server/pkg/scene/builder_test.go (7 hunks)
  • server/pkg/scene/id.go (0 hunks)
  • server/pkg/scene/list.go (2 hunks)
  • server/pkg/scene/list_test.go (2 hunks)
  • server/pkg/scene/plugin.go (1 hunks)
  • server/pkg/scene/plugin_test.go (1 hunks)
  • server/pkg/scene/plugins.go (8 hunks)
  • server/pkg/scene/plugins_test.go (19 hunks)
  • server/pkg/scene/scene.go (3 hunks)
  • server/pkg/scene/scene_test.go (2 hunks)
  • server/pkg/scene/sceneops/plugin_installer.go (2 hunks)
  • server/pkg/scene/sceneops/plugin_migrator_test.go (1 hunks)
  • server/pkg/scene/style.go (2 hunks)
  • server/pkg/scene/style_builder.go (3 hunks)
  • server/pkg/scene/style_test.go (2 hunks)
  • server/pkg/scene/widget.go (3 hunks)
  • server/pkg/scene/widget_align_system.go (4 hunks)
  • server/pkg/scene/widget_align_system_test.go (11 hunks)
  • server/pkg/scene/widget_area.go (6 hunks)
  • server/pkg/scene/widget_area_test.go (12 hunks)
  • server/pkg/scene/widget_section.go (3 hunks)
  • server/pkg/scene/widget_section_test.go (5 hunks)
  • server/pkg/scene/widget_test.go (5 hunks)
  • server/pkg/scene/widget_zone.go (3 hunks)
  • server/pkg/scene/widget_zone_test.go (5 hunks)
  • server/pkg/scene/widgets.go (7 hunks)
  • server/pkg/scene/widgets_test.go (9 hunks)
  • server/pkg/storytelling/id.go (0 hunks)
  • server/pkg/storytelling/story.go (3 hunks)
  • server/pkg/storytelling/story_bulider.go (2 hunks)
  • server/pkg/storytelling/story_bulider_test.go (2 hunks)
  • server/pkg/storytelling/story_test.go (2 hunks)
💤 Files with no reviewable changes (8)
  • server/pkg/nlslayer/id.go
  • server/pkg/storytelling/id.go
  • server/pkg/plugin/id.go
  • server/pkg/property/id.go
  • server/pkg/id/id.go
  • server/pkg/project/id.go
  • server/pkg/asset/id.go
  • server/pkg/scene/id.go
🧰 Additional context used
🧬 Code Definitions (39)
server/pkg/property/schema.go (2)
server/pkg/plugin/plugin.go (12) (12)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/nlslayer/builder.go (1)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/property/item_test.go (2)
server/pkg/property/id.go (1) (1)
  • NewID (13-13)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/storytelling/story.go (1)
server/pkg/scene/scene.go (11) (11)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • Scene (13-22)
server/pkg/scene/sceneops/plugin_installer.go (4)
server/pkg/scene/plugin.go (4) (4)
  • s (17-22)
  • s (24-29)
  • s (31-36)
  • s (38-46)
server/pkg/scene/scene.go (10) (10)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
server/pkg/nlslayer/id.go (1) (1)
  • PluginID (12-12)
server/pkg/storytelling/id.go (1) (1)
  • PluginID (9-9)
server/internal/infrastructure/mongo/mongodoc/property_schema.go (2)
server/pkg/property/schema.go (1) (1)
  • Schema (5-10)
server/internal/usecase/repo/container.go (8) (8)
  • f (90-95)
  • f (97-119)
  • f (121-123)
  • f (125-127)
  • f (141-164)
  • f (166-171)
  • f (173-175)
  • f (177-179)
server/e2e/gql_project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/pkg/plugin/pluginpack/package.go (1)
server/internal/usecase/repo/container.go (2) (2)
  • r (98-98)
  • r (142-142)
server/internal/usecase/interactor/storytelling.go (1)
server/internal/usecase/repo/container.go (1) (1)
  • SceneFilter (129-132)
server/pkg/property/list_test.go (2)
server/pkg/property/id.go (3) (3)
  • ID (7-7)
  • NewID (13-13)
  • MustSchemaID (19-19)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/infrastructure/memory/asset.go (2)
server/internal/infrastructure/mongo/mongodoc/asset.go (1) (1)
  • d (55-85)
server/pkg/asset/asset.go (10) (10)
  • a (29-31)
  • a (33-35)
  • a (37-39)
  • a (41-43)
  • a (45-47)
  • a (49-51)
  • a (53-55)
  • a (57-59)
  • a (61-63)
  • a (65-70)
server/pkg/property/sealed_test.go (6)
server/pkg/property/builder.go (1) (1)
  • New (9-11)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/usecase/interfaces/scene.go (1) (1)
  • Scene (20-33)
server/pkg/property/schema.go (1) (1)
  • Schema (5-10)
server/pkg/nlslayer/simple_builder.go (2)
server/pkg/nlslayer/builder.go (8) (8)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
server/pkg/nlslayer/group_builder.go (8) (8)
  • b (32-37)
  • b (39-45)
  • b (47-50)
  • b (52-55)
  • b (57-60)
  • b (62-65)
  • b (67-70)
  • b (72-75)
server/pkg/scene/scene_test.go (3)
server/pkg/scene/scene.go (12) (12)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/scene/widget.go (2) (2)
  • Widget (5-12)
  • MustWidget (29-35)
server/e2e/seeder.go (1)
server/pkg/id/id.go (2) (2)
  • NewAssetID (62-62)
  • SceneID (50-50)
server/pkg/property/builder.go (3)
server/pkg/nlslayer/builder.go (9) (9)
  • b (13-15)
  • b (17-19)
  • b (21-24)
  • b (26-29)
  • b (31-34)
  • b (36-39)
  • b (41-44)
  • b (46-49)
  • Builder (5-7)
server/pkg/scene/builder.go (1) (1)
  • Builder (10-12)
server/pkg/scene/scene.go (11) (11)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
server/pkg/nlslayer/nlslayer.go (4)
server/internal/adapter/gql/gqlmodel/models_gen.go (2) (2)
  • Scene (959-975)
  • Scene (977-977)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/internal/usecase/interactor/scene.go (1) (1)
  • Scene (28-43)
server/pkg/nlslayer/simple.go (16) (16)
  • l (9-11)
  • l (13-15)
  • l (17-22)
  • l (24-26)
  • l (28-30)
  • l (32-34)
  • l (36-41)
  • l (43-48)
  • l (50-55)
  • l (57-62)
  • l (64-69)
  • l (71-77)
  • l (79-84)
  • l (86-96)
  • l (98-103)
  • l (105-110)
server/internal/usecase/interactor/asset_test.go (6)
server/pkg/id/id.go (8) (8)
  • NewProjectID (66-66)
  • Asset (5-5)
  • Asset (24-24)
  • Workspace (16-16)
  • Workspace (35-35)
  • ProjectID (47-47)
  • Project (10-10)
  • Project (29-29)
server/internal/infrastructure/memory/asset.go (1) (1)
  • Asset (18-21)
server/pkg/asset/asset.go (1) (1)
  • Asset (17-27)
server/internal/usecase/interactor/asset.go (1) (1)
  • Asset (25-28)
server/internal/usecase/interfaces/asset.go (2) (2)
  • Asset (36-43)
  • CreateAssetParam (25-30)
server/internal/infrastructure/memory/project.go (1) (1)
  • Project (18-22)
server/internal/adapter/gql/gqlmodel/convert_project_test.go (1)
server/pkg/id/id.go (1) (1)
  • NewProjectID (66-66)
server/pkg/property/builder_test.go (2)
server/pkg/property/id.go (6) (6)
  • ID (7-7)
  • MustSchemaID (19-19)
  • NewID (13-13)
  • NewItemID (14-14)
  • FieldID (9-9)
  • SchemaGroupID (11-11)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/scene/widget_zone_test.go (2)
server/pkg/scene/widget_zone.go (4) (4)
  • WidgetSectionLeft (15-15)
  • WidgetSectionCenter (16-16)
  • WidgetSectionRight (17-17)
  • WidgetSectionType (12-12)
server/pkg/scene/widget_section.go (1) (1)
  • WidgetAreaTop (15-15)
server/pkg/nlslayer/loader.go (1)
server/pkg/nlslayer/nlslayer_list.go (1) (1)
  • NLSLayerList (9-9)
server/pkg/property/property.go (3)
server/pkg/plugin/id.go (1) (1)
  • ID (5-5)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/scene/scene.go (1) (1)
  • Scene (13-22)
server/pkg/property/initializer.go (3)
server/pkg/plugin/plugin.go (12) (12)
  • p (20-25)
  • p (27-32)
  • p (34-36)
  • p (38-43)
  • p (45-50)
  • p (52-57)
  • p (59-64)
  • p (66-79)
  • p (81-91)
  • p (93-98)
  • p (100-113)
  • p (115-143)
server/pkg/property/property.go (1) (1)
  • Property (11-16)
server/pkg/property/id.go (1) (1)
  • SchemaID (10-10)
server/pkg/scene/plugins_test.go (5)
server/pkg/storytelling/id.go (3) (3)
  • NewPropertyID (15-15)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/scene/plugins.go (2) (2)
  • Plugins (5-7)
  • NewPlugins (9-30)
server/pkg/scene/plugin.go (2) (2)
  • Plugin (5-8)
  • NewPlugin (10-15)
server/pkg/plugin/id.go (1) (1)
  • OfficialPluginID (22-22)
server/pkg/scene/list.go (2)
server/pkg/scene/scene.go (13) (13)
  • Scene (13-22)
  • s (24-29)
  • s (31-36)
  • s (38-43)
  • s (45-50)
  • s (52-57)
  • s (59-64)
  • s (66-71)
  • s (73-78)
  • s (80-89)
  • s (91-96)
  • s (98-103)
  • s (105-113)
server/pkg/id/id.go (3) (3)
  • Scene (15-15)
  • Scene (34-34)
  • SceneID (50-50)
server/internal/infrastructure/memory/project.go (4)
server/internal/infrastructure/mongo/project.go (17) (17)
  • r (39-41)
  • r (43-48)
  • r (50-63)
  • r (65-72)
  • r (74-89)
  • r (91-118)
  • r (120-136)
  • r (138-150)
  • r (152-168)
  • r (170-179)
  • r (181-193)
  • r (195-201)
  • r (203-205)
  • r (207-213)
  • r (215-225)
  • r (227-251)
  • Project (27-31)
server/internal/usecase/interfaces/project.go (1) (1)
  • Project (63-76)
server/internal/usecase/repo/project.go (1) (1)
  • Project (19-32)
server/pkg/id/id.go (3) (3)
  • Project (10-10)
  • Project (29-29)
  • ProjectID (47-47)
server/pkg/scene/style_builder.go (4)
server/pkg/nlslayer/id.go (1) (1)
  • ErrInvalidID (21-21)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
server/pkg/storytelling/id.go (1) (1)
  • ErrInvalidID (19-19)
server/pkg/scene/widgets_test.go (4)
server/pkg/scene/widget.go (2) (2)
  • MustWidget (29-35)
  • Widget (5-12)
server/pkg/scene/widgets.go (2) (2)
  • Widgets (13-16)
  • NewWidgets (18-42)
server/pkg/plugin/id.go (1) (1)
  • ID (5-5)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
server/pkg/asset/asset.go (1)
server/pkg/id/id.go (6) (6)
  • AssetID (43-43)
  • ProjectID (47-47)
  • Asset (5-5)
  • Asset (24-24)
  • Project (10-10)
  • Project (29-29)
server/pkg/asset/builder.go (3)
server/pkg/id/id.go (7) (7)
  • AssetID (43-43)
  • NewAssetID (62-62)
  • Workspace (16-16)
  • Workspace (35-35)
  • Project (10-10)
  • Project (29-29)
  • ProjectID (47-47)
server/pkg/asset/asset.go (10) (10)
  • a (29-31)
  • a (33-35)
  • a (37-39)
  • a (41-43)
  • a (45-47)
  • a (49-51)
  • a (53-55)
  • a (57-59)
  • a (61-63)
  • a (65-70)
server/pkg/project/project.go (1) (1)
  • Project (32-57)
server/pkg/scene/widgets.go (3)
server/pkg/scene/widget.go (11) (11)
  • w (37-39)
  • w (41-43)
  • w (45-47)
  • w (49-51)
  • w (53-58)
  • w (60-65)
  • w (67-72)
  • w (74-79)
  • w (81-93)
  • w (95-100)
  • Widget (5-12)
server/pkg/nlslayer/id.go (3) (3)
  • PluginID (12-12)
  • PluginExtensionID (13-13)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (3) (3)
  • PluginID (9-9)
  • PluginExtensionID (10-10)
  • PropertyID (8-8)
server/pkg/scene/plugin.go (2)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/scene/plugins.go (4)
server/pkg/nlslayer/id.go (2) (2)
  • PluginID (12-12)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • PluginID (9-9)
  • PropertyID (8-8)
server/pkg/plugin/id.go (1) (1)
  • OfficialPluginID (22-22)
server/pkg/scene/plugin.go (1) (1)
  • Plugin (5-8)
server/pkg/scene/builder.go (5)
server/pkg/nlslayer/id.go (2) (2)
  • ErrInvalidID (21-21)
  • PropertyID (9-9)
server/pkg/storytelling/id.go (2) (2)
  • ErrInvalidID (19-19)
  • PropertyID (8-8)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/property/id.go (2) (2)
  • ErrInvalidID (36-36)
  • ID (7-7)
server/pkg/id/id.go (3) (3)
  • Property (11-11)
  • Property (30-30)
  • PropertyID (48-48)
server/pkg/scene/widget.go (7)
server/pkg/nlslayer/id.go (3) (3)
  • PluginID (12-12)
  • PropertyID (9-9)
  • ErrInvalidID (21-21)
server/pkg/storytelling/id.go (3) (3)
  • PluginID (9-9)
  • PropertyID (8-8)
  • ErrInvalidID (19-19)
server/pkg/plugin/id.go (2) (2)
  • ErrInvalidID (23-23)
  • ID (5-5)
server/pkg/scene/widget_align_system.go (1) (1)
  • w (109-120)
server/pkg/scene/widget_align_system_test.go (1) (1)
  • w (317-317)
server/pkg/scene/widgets.go (10) (10)
  • w (44-49)
  • w (51-56)
  • w (58-63)
  • w (65-75)
  • w (77-87)
  • w (89-94)
  • w (96-106)
  • w (108-122)
  • w (124-133)
  • w (135-144)
server/pkg/scene/plugin.go (1) (1)
  • Plugin (5-8)
server/pkg/scene/widget_test.go (4)
server/pkg/plugin/id.go (2) (2)
  • ID (5-5)
  • ErrInvalidID (23-23)
server/pkg/property/id.go (2) (2)
  • ID (7-7)
  • ErrInvalidID (36-36)
server/pkg/nlslayer/id.go (4) (4)
  • PluginID (12-12)
  • PluginExtensionID (13-13)
  • PropertyID (9-9)
  • ErrInvalidID (21-21)
server/pkg/scene/widget.go (1) (1)
  • MustWidget (29-35)
server/pkg/scene/builder_test.go (4)
server/pkg/scene/builder.go (12) (12)
  • b (18-35)
  • b (37-43)
  • b (45-48)
  • b (50-53)
  • b (55-58)
  • b (60-63)
  • b (65-68)
  • b (70-73)
  • b (75-78)
  • b (80-83)
  • b (85-88)
  • New (14-16)
server/pkg/property/id.go (2) (2)
  • ID (7-7)
  • ErrInvalidID (36-36)
server/pkg/scene/plugins.go (2) (2)
  • NewPlugins (9-30)
  • Plugins (5-7)
server/pkg/scene/widgets.go (2) (2)
  • NewWidgets (18-42)
  • Widgets (13-16)
server/pkg/scene/scene.go (7)
server/pkg/scene/builder.go (1) (1)
  • New (14-16)
server/pkg/id/id.go (9) (9)
  • SceneID (50-50)
  • ProjectID (47-47)
  • PropertyID (48-48)
  • Scene (15-15)
  • Scene (34-34)
  • Project (10-10)
  • Project (29-29)
  • Property (11-11)
  • Property (30-30)
server/pkg/scene/widgets.go (1) (1)
  • Widgets (13-16)
server/pkg/scene/plugins.go (1) (1)
  • Plugins (5-7)
server/internal/usecase/interactor/scene.go (1) (1)
  • Scene (28-43)
server/internal/usecase/interfaces/scene.go (1) (1)
  • Scene (20-33)
server/pkg/property/id.go (1) (1)
  • ID (7-7)
🔇 Additional comments (328)
server/pkg/scene/widget_zone.go (3)

3-3: Appropriate ID package import for type standardization.

Adding the import for the id package aligns with the PR objective of standardizing ID types across different packages.


45-45: Correct update to use id.WidgetID type.

The signature update from using a local WidgetID to id.WidgetID is consistent with the overall refactoring to standardize ID management.


55-55: Appropriate update to use id.WidgetID in Find method.

This signature change properly updates the parameter type to use the ID type from the central id package.

server/pkg/scene/widget_zone_test.go (8)

6-6: Correct import addition for the id package.

This import is necessary to support the refactored ID usage throughout the test file.


25-31: Correct updating of widget ID creation.

All widget IDs are now properly created using id.NewWidgetID() instead of a local function, aligning with the centralized ID management approach.


35-35: Appropriate type update for test input.

The test structure's Input field type has been correctly updated to use id.WidgetID.


64-64: Consistent update for widget ID creation in invalid ID test case.

The invalid ID test case now properly uses the centralized ID creation function.


93-95: Proper use of id.WidgetIDList in test setup.

The test now correctly uses the id.WidgetIDList type for adding widgets to each section.


106-106: Consistent update for widget ID creation in removal tests.

Widget ID creation for removal tests now uses the centralized ID function.


111-112: Correct type updates for test structure fields.

The Input and Expected fields in the removal test structure now properly use the centralized ID types.


119-149: Consistent updates throughout test cases for widget ID lists and creation.

All remaining test cases have been properly updated to use centralized ID types and creation functions, maintaining consistency throughout the test file.

server/pkg/nlslayer/group.go (1)

26-26: Appropriate update to use id.SceneID for return type.

This change correctly updates the return type of the Scene method to use the centralized ID type, consistent with the PR objective of standardizing scene IDs.

server/pkg/nlslayer/builder.go (1)

36-36: Correct parameter type update for Scene method.

The Scene method parameter has been properly updated to use id.SceneID, aligning with the standardized ID management approach throughout the codebase.

server/pkg/scene/style_test.go (1)

6-6: Appropriate update to use centralized ID generator.

This change properly implements the PR objective of standardizing scene ID management by:

  1. Adding the necessary import for the ID package
  2. Replacing the local NewID() with the centralized id.NewSceneID()

This helps maintain consistency across the codebase and reduces redundant ID type definitions.

Also applies to: 16-16

server/pkg/nlslayer/simple.go (1)

28-28: Correctly standardized return type for Scene() method.

The return type has been properly updated from a local SceneID type to the standardized id.SceneID type, aligning with the PR objective of unifying scene IDs across packages. The method functionality remains unchanged while improving type consistency.

server/internal/infrastructure/mongo/mongodoc/style.go (1)

34-34: Successfully updated parameter type to use centralized ID type.

The parameter type has been correctly changed from scene.IDList to id.SceneIDList, which aligns with the PR objective of standardizing scene ID types. The function implementation still works with this type change since both types appear to have compatible interfaces (both support the Has() method).

server/pkg/property/item_test.go (1)

6-6: Properly updated to use standardized scene ID generation.

The changes correctly implement the PR objective of unifying scene ID management:

  1. Added the necessary import for the ID package
  2. Updated both test functions to use id.NewSceneID() instead of a local implementation

This maintains consistent ID type handling across the codebase while preserving the same test functionality.

Also applies to: 64-64, 77-77

server/pkg/scene/sceneops/plugin_migrator_test.go (1)

19-19: Good change for ID consistency.

This change properly replaces scene.NewID() with id.NewSceneID(), aligning with the PR objective to unify scene IDs with the definitions in the id package.

server/pkg/storytelling/story_bulider_test.go (2)

6-6: Appropriate import added.

Adding the id package import is necessary for the subsequent id.NewSceneID() usage.


28-28: Properly refactored scene ID creation.

You've correctly changed NewSceneID() to id.NewSceneID(), following the consistent pattern of centralizing ID creation in the id package.

server/pkg/plugin/manifest/convert_test.go (2)

7-7: Appropriate import added.

Adding the id package import is necessary for using the id.SceneID type.


62-62: Good type correction for scene ID.

Correctly updated from *plugin.SceneID to *id.SceneID, which ensures type consistency with the centralized ID types in the id package.

server/pkg/scene/builder/decoder.go (1)

128-128: Properly updated to use the centralized ID list type.

This change correctly updates the SceneFilter initialization to use id.SceneIDList instead of scene.IDList, maintaining consistency with the ID refactoring objective.

server/pkg/property/schema.go (2)

3-3: Appropriate ID package import added.

The addition of the ID package import is consistent with the PR's goal of standardizing the handling of scene IDs across the codebase.


28-28: Return type properly updated to use the centralized ID package.

Changing the return type from *SceneID to *id.SceneID aligns with the PR objective to unify scene IDs across packages. This change ensures type consistency while maintaining the same functionality.

server/pkg/property/property_test.go (6)

17-17: Correctly updated to use the centralized ID package.

The test correctly uses id.NewSceneID() instead of the previous implementation, ensuring consistent ID creation in test code.


100-100: Properly updated scene ID initialization.

The scene ID is now correctly initialized using the centralized ID package's function.


152-152: Consistent use of ID package for scene ID creation.

The test is correctly updated to use the ID package's function for creating scene IDs.


203-203: Properly standardized scene ID creation.

Using id.NewSceneID() ensures consistency with the rest of the codebase.


225-225: Correctly updated ID creation method.

The scene ID creation is now properly using the centralized ID package.


240-240: Appropriate use of the ID package for scene ID creation.

The test is consistently using the ID package for creating scene IDs.

server/pkg/plugin/plugin.go (2)

6-6: Appropriate ID package import added.

The addition of the ID package import is necessary for the return type change in the Scene() method.


34-34: Return type properly updated to use the centralized ID package.

Changing the return type from *SceneID to *id.SceneID aligns with the PR objective to unify scene IDs across packages. This maintains the same functionality while ensuring type consistency.

server/pkg/storytelling/story.go (3)

10-10: Appropriate ID package import added.

The addition of the ID package import is necessary for the type changes in the Story struct and Scene() method.


24-24: Field type correctly updated to use the centralized ID package.

Changing the field type from SceneID to id.SceneID aligns with the PR objective to unify scene IDs. This ensures type consistency across the codebase.


54-54: Return type properly updated to use the centralized ID package.

Changing the return type from SceneID to id.SceneID maintains the same functionality while ensuring type consistency throughout the application.

server/pkg/nlslayer/simple_builder.go (1)

72-72: Type refactoring looks good.

The parameter type change from SceneID to id.SceneID aligns with the PR objective to unify scene IDs across packages. This standardization will improve type safety and maintainability.

server/pkg/storytelling/story_test.go (2)

7-7: Import added correctly.

Good addition of the id package import to support the ID type refactoring.


17-17: Consistent ID generation refactoring.

Successfully migrated from local NewSceneID() to the centralized id.NewSceneID() function, which aligns with the PR's goal to standardize ID handling across the codebase.

server/pkg/scene/plugin_test.go (2)

6-6: Import added correctly.

Appropriate addition of the id package import to support the refactored ID generation methods.


11-12: ID generation standardized.

Successfully refactored both plugin ID and property ID generation to use the centralized methods from the id package. This change enhances consistency and type safety across the codebase.

server/pkg/nlslayer/group_builder.go (1)

72-72: Type refactoring looks good.

The parameter type change from SceneID to id.SceneID aligns with the PR objective to unify scene IDs across packages. This standardization will improve type safety and maintainability.

server/pkg/scene/sceneops/plugin_installer.go (2)

6-6: Import updated to use centralized ID package

The import has been updated to use the centralized id package instead of the scene package, which aligns with the ID standardization goal in this refactoring.


15-15: Method signature updated to use centralized ID type

The parameter type has been updated from scene.PluginID to id.PluginID, ensuring consistent ID usage across the codebase.

server/internal/usecase/interactor/scene.go (1)

554-555: Updated to use standardized ID types

The Filter function now returns a repo.SceneFilter with id.SceneIDList instead of scene.IDList for both readable and writable fields, maintaining the same functionality while aligning with the centralized ID system.

server/pkg/property/loader_test.go (3)

7-7: Added import for centralized ID package

Import added for the id package to access standardized ID creation functions.


12-12: Updated to use standardized scene ID creation

Changed scene ID creation to use the centralized id.NewSceneID() function instead of a local implementation.


30-30: Updated to use standardized scene ID creation

Changed scene ID creation to use the centralized id.NewSceneID() function instead of a local implementation, maintaining consistency with the first test function.

server/internal/infrastructure/memory/project.go (1)

130-130: Updated return type to use standardized project ID type

The return type has been changed from []project.ID to []id.ProjectID to align with the centralized ID system. This maintains the same functionality while ensuring type consistency across the codebase.

server/pkg/property/sealed_test.go (2)

7-7: Updated import for consistent ID management.

Adding the import for the centralized id package aligns with the PR's goal of standardizing scene ID handling across the codebase.


172-172: Properly refactored to use centralized ID creation.

Changed from using a local NewSceneID() function to the standardized id.NewSceneID() from the centralized ID package. This change improves consistency in ID handling across the codebase.

server/internal/usecase/interactor/storytelling.go (1)

1092-1092: Updated to use centralized ID type definition.

Modified the filter from using scene.IDList{sId} to id.SceneIDList{sId} to align with the centralized ID type system. This change improves type consistency across the application and eliminates redundant type definitions.

server/pkg/property/merged_test.go (2)

6-6: Added import for centralized ID package.

Adding the import for the id package supports the refactoring goal of using standardized ID types across the codebase.


78-78: Transitioned to centralized ID creation.

Correctly updated from using a local NewSceneID() function to the standardized id.NewSceneID(). This change ensures consistent ID type handling throughout the application.

server/internal/adapter/gql/gqlmodel/convert_project_test.go (2)

8-8: Added import for the central ID package.

Added the import for the id package to access the standardized ID creation functions, which aligns with the broader refactoring goals.


48-48: Updated project ID creation to use the centralized method.

Changed from using project.NewID() to id.NewProjectID() for consistency with the unified ID type system. This change is part of the broader effort to standardize ID management across the codebase.

server/pkg/plugin/manifest/convert.go (2)

7-8: Import added for id package to support type changes.

The addition of the id package import supports the refactoring of scene IDs as part of the effort to centralize ID types across packages.


17-17: Parameter type changed to use centralized ID type.

Updated function signature to use *id.SceneID instead of *plugin.SceneID, aligning with the project-wide effort to standardize scene IDs across packages.

server/pkg/property/property.go (3)

7-9: Import added for id package to support type changes.

This import accommodates the transition from package-specific ID types to centralized ID types in the id package.


13-13: Field type updated to use centralized ID type.

Changed scene field type from SceneID to id.SceneID as part of standardizing ID types across the codebase.


29-29: Method return type updated to match field type change.

Updated the return type of Scene() method to id.SceneID to maintain consistency with the field type change.

server/pkg/property/builder_test.go (3)

6-7: Import added for id package to support type changes in tests.

The import enables the use of centralized ID types in test code.


17-17: Updated scene ID creation calls in tests.

Test code now uses id.NewSceneID() instead of the previous package-specific ID creation function, maintaining consistency with the refactored type system.

Also applies to: 22-22, 27-27, 32-32, 81-81, 92-92


100-100: Updated struct field type in test case.

Changed Scene field type from SceneID to id.SceneID in the test's args struct to match the refactored type system.

server/internal/infrastructure/mongo/mongodoc/nlslayer.go (1)

134-134: Updated function parameter type to use centralized ID list type.

Changed the second parameter type from scene.IDList to id.SceneIDList to align with the project-wide refactoring of scene IDs.

server/pkg/asset/builder_test.go (5)

7-7: Importing the centralized ID package

This change is part of the larger effort to unify ID types across the codebase. By importing the centralized ID package, the test can now use standardized ID types.


13-14: Using centralized AssetID creation

Replacing the local NewID() with id.NewAssetID() aligns with the PR objective to unify ID implementations. This ensures consistent ID creation across packages.


18-21: Updating struct field types

The type changes from local ID types to centralized ones (IDid.AssetID and WorkspaceIDaccountdomain.WorkspaceID) improve type consistency across the codebase.


57-57: Consistent usage of centralized ID types

These changes consistently apply the ID refactoring pattern throughout the test cases. Using specialized ID types from the centralized package improves type safety and reduces redundancy.

Also applies to: 69-69, 81-83, 93-94, 100-100


129-130: Continuing ID refactoring pattern in MustBuild tests

The same ID refactoring pattern is correctly applied throughout the MustBuild test suite, maintaining consistency with the earlier changes.

Also applies to: 134-137, 174-175, 186-187, 199-200, 210-211, 216-216

server/pkg/plugin/pluginpack/package.go (2)

13-13: Importing centralized ID package

Correctly imports the centralized ID package while maintaining all other necessary imports.


27-27: Updated function signature to use centralized SceneID

Changed the parameter type from *plugin.SceneID to *id.SceneID to align with the unified ID approach. This change is consistent with the PR objective to standardize scene ID handling across the codebase.

server/pkg/storytelling/story_bulider.go (2)

5-7: Added import for centralized ID package

Good addition of the ID package import with proper spacing to maintain code style.


54-54: Updated StoryBuilder.Scene method signature

Changed the parameter type from SceneID to id.SceneID to use the centralized ID type. This ensures type consistency across the codebase and aligns with the PR objective.

server/pkg/scene/list_test.go (6)

6-6: Importing centralized ID package

Correctly imports the ID package while maintaining other necessary imports.


12-14: Using centralized SceneID creation

Replacing NewID() with id.NewSceneID() aligns with the PR objective to unify ID implementations across packages.


20-20: Consistent usage of centralized ID creation

Good consistency in using id.NewSceneID() throughout the test assertions.


27-29: Updated Scene instantiation

Scene instances now correctly use the centralized ID types, maintaining consistency with other changes.


38-40: Centralized ID creation in IDs test

Consistent application of the ID refactoring pattern in the IDs test.


43-45: Updated return type assertions

The assertions correctly reflect the change from local []ID to centralized []id.SceneID, ensuring type consistency in test expectations.

server/e2e/gql_project_test.go (3)

11-11: Added import for the id package

This is part of the ID scene refactoring to use a centralized ID system from the id package.


527-528: Project ID creation now uses id package

Updated to use id.NewProjectID() instead of project.NewID() which aligns with the PR objective to unify ID handling across the codebase.


545-546: Project ID creation now uses id package

Updated to use id.NewProjectID() instead of project.NewID() for consistency with the ID standardization effort.

server/internal/infrastructure/mongo/mongodoc/property_schema.go (1)

124-124: Updated parameter type to use id package

The function signature now uses id.SceneIDList instead of scene.IDList, which aligns with the objective of centralizing ID types in the id package. The function body remains compatible since both types implement the same interface.

server/internal/infrastructure/mongo/mongodoc/property.go (1)

150-150: Updated parameter type to use id package

Changed parameter type from scene.IDList to id.SceneIDList to align with the ID standardization effort. The function body continues to work as expected since both types support the same operations.

server/internal/app/web_test.go (2)

20-20: Added import for accountdomain package

Imported the accountdomain package to use its ID generation functionality.


38-38: Updated workspace ID creation to use accountdomain

Changed from project.NewWorkspaceID() to accountdomain.NewWorkspaceID() as part of the ID standardization effort. This ensures that workspace IDs are created consistently throughout the codebase.

server/pkg/scene/builder/scene.go (2)

7-7: LGTM: Good addition of id package import

This import supports the broader effort to unify scene IDs across the codebase.


90-90: LGTM: Properly updated parameter type for toString function

Good change to use id.WidgetID from the centralized package rather than a package-specific type. This aligns with the PR goal of unifying ID types.

server/pkg/property/builder.go (2)

3-4: LGTM: Properly added import for id package

Adding this import supports the refactoring effort to unify ID types.


44-44: LGTM: Method signature properly updated to use centralized ID type

Good change to update the Scene method to use id.SceneID from the centralized package, aligning with the PR objective of unifying scene ID definitions.

server/pkg/property/list_test.go (2)

6-6: LGTM: Added appropriate import for id package

This import supports using the centralized ID types in the test file.


13-14: LGTM: Updated test code to use centralized ID generation

Good update to use id.NewSceneID() instead of package-specific ID generation, which aligns with the broader refactoring effort.

server/pkg/property/initializer_test.go (3)

6-6: Added import for ID package

The addition of this import is aligned with the PR's goal of centralizing ID types and generation in the id package.


29-29: Updated scene ID generation to use centralized id package

Changed from using a local NewSceneID() to the unified id.NewSceneID() for consistency with ID handling across the codebase.


55-55: Updated scene ID generation to use centralized id package

Changed from using a local NewSceneID() to the unified id.NewSceneID() for consistency with ID handling across the codebase.

server/pkg/scene/scene_test.go (4)

7-7: Added import for ID package

The addition of this import is aligned with the PR's goal of centralizing ID types and generation in the id package.


22-24: Updated property ID generation to use centralized id package

Changed from using a local NewPropertyID() to the unified id.NewPropertyID() for consistency with ID handling across the codebase.


30-30: Updated widget and plugin ID generation to use centralized id package

Changed from using local ID generation methods to the unified id.NewWidgetID() and id.MustPluginID() for consistency with ID handling across the codebase.


35-35: Updated property ID type to use centralized id package

Changed the assertion type from local []PropertyID to []id.PropertyID, ensuring type consistency across the codebase.

server/pkg/asset/asset_test.go (4)

7-7: Added import for ID package

The addition of this import is aligned with the PR's goal of centralizing ID types and generation in the id package.


13-13: Updated asset ID generation to use centralized id package

Changed from using a local NewID() to the unified id.NewAssetID() for consistency with ID handling across the codebase.


20-20: Updated asset ID type references to use centralized id package

Changed the ID field type from a local type to id.AssetID, ensuring type consistency across the codebase.

Also applies to: 33-33


22-22: Updated workspace ID type references to use accountdomain package

Changed the Workspace field type from a local WorkspaceID to accountdomain.WorkspaceID, ensuring type consistency across the codebase.

Also applies to: 35-35

server/e2e/seeder.go (2)

149-149: Updated asset ID generation to use centralized id package

Changed from using asset.NewID() to the unified id.NewAssetID() for consistency with ID handling across the codebase.


354-354: Updated scene ID parameter type to use centralized id package

Changed the parameter type from scene.ID to id.SceneID, ensuring type consistency across the codebase and aligning with the PR's goal of unifying ID types.

server/internal/usecase/repo/container_test.go (4)

6-6: Added the id package import to support the SceneID type migration.

The addition of this import statement is necessary as part of the refactoring to use unified scene IDs from the central id package.


33-34: Correctly updated scene ID creation to use id.NewSceneID().

This change migrates from using the package-specific ID constructor to the centralized ID creation function, aligning with the PR's objective to unify scene ID management.


36-37: Scene ID type transformation is correctly implemented.

The update from scene.IDList to id.SceneIDList for filter fields correctly implements the centralized ID approach. This ensures consistent type handling across the codebase.

Also applies to: 39-40, 42-43


45-48: Empty SceneIDList initialization correctly updated.

The empty list initialization is properly updated to use the new ID type, ensuring consistency in empty list handling throughout the tests.

server/pkg/project/builder_test.go (6)

9-9: Added the id package import to support ProjectID type migration.

The addition of this import statement is necessary as part of the refactoring to use unified project IDs from the central id package.


22-22: Correctly updated builder ID method to use centralized ID type.

This change properly migrates the Builder.ID method call to use the standardized id.NewProjectID() function.


166-167: Updated test case data types to use centralized ID types.

The test data has been correctly updated to use the centralized ID types:

  • pid is now of type id.ProjectID
  • The id field in the args struct now uses id.ProjectID
  • The workspace field now uses accountdomain.WorkspaceID

This ensures type consistency with the modified project builder implementation.

Also applies to: 174-174, 180-180


240-240: Error reference updated to use centralized error definition.

The error reference has been updated from a package-local error to the centralized error definition in the id package, ensuring consistent error handling.


245-245: Updated ID creation in test cases.

The ID creation in test cases has been properly updated to use the centralized id.NewProjectID() function, maintaining consistency with the refactoring approach.

Also applies to: 375-375


287-288: Similar type updates in MustBuild test cases.

The same pattern of type replacement is correctly applied to the MustBuild test cases:

  • pid is now of type id.ProjectID
  • Field types in the args struct are updated
  • Error reference uses the centralized definition

This ensures consistency throughout all test cases.

Also applies to: 295-295, 301-301, 370-370

server/internal/infrastructure/mongo/container.go (2)

129-134: Updated applySceneFilter parameter type to use centralized ID list.

The function signature has been correctly updated to use id.SceneIDList instead of scene.IDList, while preserving the existing function behavior. This aligns with the centralized ID management approach.


136-145: Updated applyOptionalSceneFilter parameter type to use centralized ID list.

Similarly, this function's signature has been updated to use id.SceneIDList, maintaining consistent ID type usage throughout the codebase while preserving the function logic.

server/pkg/nlslayer/nlslayer.go (3)

10-10: Updated NLSLayer interface to use the centralized SceneID type.

The interface method signature has been correctly updated to return id.SceneID instead of a package-specific SceneID type, ensuring consistent ID type usage across the codebase.


69-69: Updated layerBase struct field to use centralized SceneID type.

The scene field in the layerBase struct has been properly updated to use id.SceneID, ensuring data structure consistency with the interface changes.


103-105: Updated Scene method implementation to use centralized SceneID type.

The method implementation for Scene() has been properly updated to return id.SceneID, matching the interface signature change and completing the type migration for this struct.

server/internal/usecase/interactor/project_test.go (1)

59-59: Good refactoring to use actual IDs instead of mocks.

This change improves the test by using the actual ID from the created project rather than a predefined mock ID. This makes the test more realistic and robust, aligning with the goal of unifying ID management across the codebase.

Also applies to: 70-70, 89-89, 100-100

server/pkg/scene/widget_section_test.go (3)

6-6: Good addition of the id package import.

This import is necessary for the migration to the centralized ID management system, allowing the use of id.WidgetID and id.NewWidgetID().


25-31: Appropriate migration to the id package for widget IDs.

The change from NewWidgetID() to id.NewWidgetID() correctly implements the standardization of ID types using the centralized id package.


35-35: Good type migration to use id package types.

The change from custom WidgetID and WidgetIDList types to id.WidgetID and id.WidgetIDList correctly implements the ID standardization across the codebase.

Also applies to: 87-88, 103-104, 111-141

server/internal/usecase/interactor/asset_test.go (6)

17-17: Good addition of the id package import.

This import is necessary for the migration to the centralized ID management system, allowing the use of id.NewProjectID().


30-30: Appropriate migration to id.NewProjectID().

This change correctly implements the standardization of project ID creation using the centralized id package.


32-35: Variable naming improved for clarity.

Changing f to gFile and uc to uContainer improves readability by making the variable names more descriptive and consistent with their purpose.

Also applies to: 41-41, 48-48


51-51: Good addition of ProjectID parameter.

Adding the ProjectID parameter to the Create method correctly associates the asset with a project, aligning with the updated interface.


66-71: Good migration to use actual IDs and timestamps.

The change to use res.ID() and res.ID().Timestamp() instead of hardcoded values makes the test more realistic and maintainable. Additionally, properly setting the Project field to the created project ID ensures the asset is correctly associated.


79-81: Test assertion improved.

The change to check for a nil error and directly compare the result against the expected value improves the test's clarity and correctness.

server/pkg/scene/widget_section.go (2)

3-3: Good addition of the id package import.

This import is necessary to use the centralized widget ID types from the id package.


49-49: Appropriate method signature updates.

Changing the parameter types from custom WidgetID to id.WidgetID correctly implements the standardization of ID types using the centralized id package. This change ensures consistency in ID handling across the codebase.

Also applies to: 66-66

server/pkg/scene/style.go (4)

3-4: Appropriate import for the ID package.

Clean addition of the import for ID types, which aligns with the PR objective of unifying scene IDs.


6-9: Type refactoring aligns with ID standardization goal.

Good job changing the struct fields from local ID types to the centralized id package types. This enhances type consistency across the codebase.


12-16: Method return type properly updated.

Correctly updated the return type signature and nil check return value to use id.StyleID instead of the local type definition.


47-49: Return type properly updated for Scene method.

Consistent change to use id.SceneID as the return type for the Scene method.

server/pkg/nlslayer/loader.go (2)

12-12: Function type signature updated correctly.

The type signature for LoaderByScene has been properly updated to use id.SceneID instead of the local SceneID type, which is consistent with the PR's ID unification goal.


78-78: Implementation signature updated correctly.

The function implementation correctly uses id.SceneID in the parameter, maintaining consistency with the type definition.

server/pkg/scene/widget_align_system.go (4)

3-4: Appropriate import for the ID package.

Clean addition of the import for ID types, which aligns with the PR objective of unifying widget IDs.


58-65: Remove method signature updated correctly.

The parameter type for the Remove method has been properly updated to use id.WidgetID instead of the local WidgetID type, maintaining consistency with the PR's ID unification objective.


71-92: Find method signature updated correctly.

The parameter and internal logic of the Find method has been properly updated to use id.WidgetID instead of the local WidgetID type, while preserving the existing functionality.


94-107: Move method signature updated correctly.

The parameter type for the Move method has been properly updated to use id.WidgetID instead of the local WidgetID type, maintaining consistency without altering the method's behavior.

server/pkg/scene/builder/scene_test.go (5)

6-6: Appropriate import for the ID package in test.

Clean addition of the import for the id package to support the ID type changes in tests.


14-14: Scene ID creation updated in tests.

Correctly updated to use id.NewSceneID() instead of scene.NewID() for scene ID creation in the test.


52-58: Widget ID creation and collection updated in tests.

All widget ID creation calls have been properly updated to use id.NewWidgetID() instead of scene.NewWidgetID(), and the slice type has been updated to []id.WidgetID for consistency.


63-63: Input parameter type updated in test structure.

The test struct's Input field type has been correctly updated to []id.WidgetID to reflect the type changes.


89-89: Widget ID creation updated in alignment system test.

Correctly updated to use id.NewWidgetID() instead of scene.NewWidgetID() for widget ID creation in the widget align system test.

server/internal/usecase/repo/container.go (5)

8-8: Added id package import to support the refactored ID types.

This addition is necessary to support the transition from scene-specific IDs to centralized ID types.


130-131: Good refactoring of SceneFilter fields to use id.SceneIDList.

The change from scene.IDList to id.SceneIDList aligns with the PR objective of unifying scene IDs under the central id package.


142-142: Updated variable types to match the refactored SceneFilter fields.

Correctly updated the variable types from scene.IDList to id.SceneIDList to maintain consistency with the struct field changes.


173-173: Refactored method signature to use id.SceneID parameter.

This change from scene.ID to id.SceneID properly updates the method signature to use the centralized ID type.


177-177: Refactored method signature to use id.SceneID parameter.

Similar to the CanRead method, this method signature has been correctly updated to use the centralized ID type.

server/pkg/scene/list.go (4)

3-6: Added necessary imports for the refactored ID types.

Added imports for the id and accountdomain packages to support the transition to centralized ID types.


10-10: Updated IDs method return type to use id.SceneID.

The method now returns []id.SceneID instead of a scene package-specific ID type, aligning with the centralized ID approach.

Also applies to: 15-15


22-22: Refactored FilterByID method to use id.SceneID parameters.

The method now accepts id.SceneID parameters, consistent with the updated return type of the IDs() method.


40-40: Updated FilterByWorkspace to use accountdomain.WorkspaceID.

This change follows the same pattern of moving to centralized ID types, using accountdomain.WorkspaceID instead of a scene-specific workspace ID type.

server/pkg/scene/widget_area_test.go (20)

6-6: Added id package import to support the refactored widget ID types.

This addition is necessary to support the transition to centralized widget ID types.


12-13: Updated widget ID creation to use id.NewWidgetID().

The test now uses the centralized ID creation function instead of the scene-specific one.


15-15: Updated WidgetIds type to id.WidgetIDList.

Changed the type from a scene-specific WidgetIDList to the centralized id.WidgetIDList.


30-31: Updated test expectations to use id.WidgetIDList.

Test case input and expected values have been properly updated to use the new ID list type.

Also applies to: 33-33


38-38: Updated widget area expected values to use id.WidgetIDList.

Test case expected widget areas now correctly use the centralized ID list type.

Also applies to: 41-41


46-47: Consistently updated all test case inputs to use id.WidgetIDList.

All the test inputs have been updated to maintain consistency with the new ID types.

Also applies to: 59-59


93-94: Updated widget ID creation in TestWidgetArea_WidgetIDs.

Using id.NewWidgetID() and id.WidgetIDList in the widget area test.


106-107: Updated widget ID creation in TestWidgetArea_Find.

Consistently using id.NewWidgetID() for widget ID creation in the Find test.


111-111: Updated Input type to id.WidgetID.

Changed the test case input type to match the new ID type.


139-139: Updated widget area creation to use id.WidgetIDList.

The test now creates widget areas with the new ID list type.


147-149: Updated widget ID creation in TestWidgetArea_Add.

Using id.NewWidgetID() for all widget IDs in the Add test.


154-154: Updated test case input and expected types to id.WidgetID and id.WidgetIDList.

Changed the test case types to match the new ID types.

Also applies to: 156-156


162-162: Updated expected widget ID lists in TestWidgetArea_Add.

All test expectations now correctly use id.WidgetIDList.

Also applies to: 168-168, 174-174


192-192: Updated widget area creation to use id.WidgetIDList in test setup.

Setup code for the test now uses the new ID list type.


200-201: Updated widget ID creation and list types in TestWidgetArea_AddAll.

Test now uses id.NewWidgetID() and id.WidgetIDList for widget ID creation and management.

Also applies to: 206-207, 211-212, 216-217


284-284: Updated widget ID creation and expected types in TestWidgetArea_Remove.

Remove test now uses id.NewWidgetID() and id.WidgetIDList.

Also applies to: 288-288


295-295: Updated expected widget ID list in TestWidgetArea_Remove.

Test now expects the correct ID list type after the removal operation.

Also applies to: 300-300


316-316: Updated widget area creation to use id.WidgetIDList in test setup.

Setup code for the Remove test now uses the new ID list type.


327-329: Updated widget ID creation and expected values in TestWidgetArea_Move.

Move test now uses id.NewWidgetID() and id.WidgetIDList for all operations.

Also applies to: 334-334, 341-341, 347-347


362-362: Updated widget area creation to use id.WidgetIDList in Move test setup.

Final test's setup code also uses the new ID list type consistently.

server/internal/usecase/interactor/scene_plugin_test.go (5)

38-38: Updated scene ID creation to use id.NewSceneID().

Changed from scene-specific ID creation to the centralized ID creation function.


42-42: Updated scene ID reference creation to use id.NewSceneID().

Properly updating references to scene IDs using the centralized ID creation function.


162-162: Updated scene ID creation in UninstallPlugin test.

Using id.NewSceneID() for scene ID creation in this test, maintaining consistency with the refactoring.


229-229: Updated widget ID creation to use id.NewWidgetID().

Changed widget creation to use centralized ID method, maintaining consistency with other ID type changes.


300-300: Updated scene ID creation in UpgradePlugin test.

Using id.NewSceneID() for scene ID creation in this test, consistent with the overall refactoring approach.

server/pkg/property/initializer.go (4)

7-8: Import statement added for id package.

The addition of the id package import is necessary to support the type changes in the method signatures below.


39-39: Type standardization from SceneID to id.SceneID.

This change aligns with the PR objective of unifying scene IDs across the codebase to use the definition from the id package.


65-65: Type standardization from SceneID to id.SceneID.

This change is consistent with the standardization of ID types across the codebase, ensuring type safety and uniformity.


85-85: Type standardization from SceneID to id.SceneID.

This change completes the consistent update of all scene ID parameter types in the Initializer struct methods.

server/pkg/scene/widget_align_system_test.go (10)

6-6: Import statement added for id package.

The addition of the id package import supports the standardized ID generation and type references throughout this test file.


32-37: Widget ID generation using standardized id package.

Updated widget ID creation to use the standardized id.NewWidgetID() function instead of a local implementation, ensuring consistent ID generation across the codebase.


40-41: Type references updated from WidgetID to id.WidgetID.

Changed type reference in the test struct from WidgetID to id.WidgetID for consistency with the wider ID standardization effort.


59-59: Widget ID generation using standardized id package.

Using id.NewWidgetID() for consistent ID generation in test cases.


85-86: Type reference updated from WidgetIDList to id.WidgetIDList.

Updated the AddAll method call to use id.WidgetIDList type for consistency.


102-102: Type references updated to use id package.

Changed Input and Expected type references to use id.WidgetID and id.WidgetIDList for consistency with the standardization effort.

Also applies to: 109-109


114-115: Widget ID generation and list references using id package.

Updated to use id.NewWidgetID() for ID generation and id.WidgetIDList for type references in test expectations.

Also applies to: 126-127


156-161: Widget ID generation using standardized id package.

Consistently using id.NewWidgetID() to generate widget IDs for test cases, maintaining standardization.


164-164: Type references updated to use id package.

Updated Input1, ExpectedSource, and ExpectedDest type references to use id.WidgetID and id.WidgetIDList types.

Also applies to: 168-169


186-187: Widget ID list references updated to use id.WidgetIDList.

All references to widget ID lists in test expectations and method calls have been updated to use id.WidgetIDList.

Also applies to: 203-204, 220-222, 237-239, 257-258, 259-260

server/pkg/plugin/manifest/parser.go (4)

13-13: Import statement added for id package.

The addition of the id package import supports the type changes in the function signatures below.


23-23: **Type standardization from plugin.SceneID to id.SceneID.

Updated the scene parameter type in the Parse function to use the standardized id package type.


41-41: **Type standardization from plugin.SceneID to id.SceneID.

Updated the scene parameter type in the ParseSystemFromBytes function to use the standardized id package type.


56-56: **Type standardization from plugin.SceneID to id.SceneID.

Updated the scene parameter type in the MustParseSystemFromBytes function to use the standardized id package type.

server/pkg/scene/style_builder.go (5)

3-4: Import statement added for id package.

Added import for the id package to support the standardized ID types and error handling.


15-15: Error reference updated to use id.ErrInvalidID.

Updated the error reference to use the standardized error from the id package, ensuring consistent error handling across the codebase.


28-28: Parameter type updated from StyleID to id.StyleID.

Updated the ID method parameter type to use the standardized id.StyleID type.


34-34: ID generation updated to use id.NewStyleID().

Changed the implementation of NewID to use the standardized ID generator from the id package.


38-38: Parameter type updated from ID to id.SceneID.

Updated the Scene method parameter type from ID to id.SceneID for consistency with the standardization effort.

server/pkg/asset/asset.go (7)

6-8: Type imports updated for consistent ID handling.

The imports now include the id and accountdomain packages, aligning with the PR objective to unify ID types across packages.


18-18: Field type updated from generic ID to specific id.AssetID.

The id field has been properly updated to use the more specific id.AssetID type as defined in the id package.


20-21: Workspace and Project fields updated to use standardized ID types.

The field types have been appropriately updated:

  • workspace now uses accountdomain.WorkspaceID
  • project now uses *id.ProjectID

This change maintains consistency with ID types across the codebase.


29-31: Method signature updated for ID().

The return type has been properly changed from generic ID to specific id.AssetID.


33-35: Method signature updated for Workspace().

The return type has been properly changed from WorkspaceID to accountdomain.WorkspaceID.


37-39: Method signature updated for Project().

The return type has been properly changed from *ProjectID to *id.ProjectID.


41-43: Method signature updated for SetProject().

The parameter type has been properly changed from *ProjectID to *id.ProjectID.

server/pkg/scene/widgets_test.go (11)

6-6: Added import for centralized ID management.

Import for the id package has been added to utilize shared ID types and functions.


11-13: Updated plugin and property ID creation to use centralized types.

Function calls have been properly updated to use the id package:

  • MustPluginIDid.MustPluginID
  • NewPropertyIDid.NewPropertyID
  • NewWidgetIDid.NewWidgetID

This ensures ID creation is consistent across the codebase.


61-63: Updated widget ID creation for test cases.

Variable declarations properly use ID types from the id package.


111-115: Updated widget and plugin ID declarations in test constants.

All ID types are now consistently using the id package types.


119-120: Updated type declarations in struct field.

The Input field is properly updated to use id.WidgetID type.


154-156: Updated variable declarations for widget and plugin IDs.

Test variables are now consistently using the id package types.


160-162: Updated parameter and return type declarations in test structs.

The ArgsPID, ArgsEID, and ExpectedResult fields have been properly updated to use id package types.


278-283: Test widget declarations updated to use centralized ID types.

All widget ID declarations in the test constants now use id package types.


323-324: Updated struct field type declaration.

The ID field in the test struct now correctly uses id.WidgetID type.


359-361: Updated ID declarations for plugin IDs in test case.

Variable declarations properly use ID types from the id package.


365-366: Updated struct field type declaration.

The ID field in the test struct now correctly uses id.WidgetID type.

server/pkg/scene/plugins_test.go (31)

6-6: Added import for centralized ID management.

Import for the id package has been added to utilize shared ID types and functions.


11-12: Updated plugin and property ID creation to use centralized types.

Function calls have been properly updated to use the id package:

  • MustPluginIDid.MustPluginID
  • NewPropertyIDid.NewPropertyID

This ensures ID creation is consistent across the codebase.


70-71: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


75-77: Updated type declarations in test struct fields.

The Input and Expected fields now correctly use id.PluginID and *id.PropertyID types.


94-94: Updated plugin ID creation in test case.

The test now uses id.MustPluginID for creating the plugin ID.


110-111: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


115-116: Updated type declaration in test struct field.

The Input field now correctly uses id.PluginID type.


128-128: Updated plugin ID creation in test case.

The test now uses id.MustPluginID for creating the plugin ID.


144-145: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


178-180: Updated property ID declarations in test cases.

Variable declarations properly use ID types from the id package.


184-184: Updated type declaration in struct field.

The Expected field now correctly uses []id.PropertyID type.


194-195: Updated plugin ID creation in test cases.

Test now uses id.MustPluginID for creating plugin IDs.


197-197: Updated expected property IDs in test case.

The expected result is now properly typed as []id.PropertyID.


212-213: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


217-217: Updated type declaration in struct field.

The Input field now correctly uses id.PluginID type.


230-230: Updated plugin ID creation in test case.

The test now uses id.MustPluginID for creating the plugin ID.


246-247: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


251-251: Updated type declaration in struct field.

The Input field now correctly uses id.PluginID type.


264-264: Updated plugin ID creation in test case.

The test now uses id.MustPluginID for creating the plugin ID.


280-281: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


298-298: Updated plugin ID creation in test case.

The test now uses id.MustPluginID for creating the plugin ID.


314-315: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


339-339: Updated official plugin ID reference.

The test now uses id.OfficialPluginID instead of a local declaration.


364-365: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


369-369: Updated type declaration in struct field.

The Input field now correctly uses id.PluginID type.


374-376: Updated official plugin ID reference in test case.

The test now uses id.OfficialPluginID for the official plugin references.


397-400: Updated plugin and property ID creation in test cases.

Variable declarations properly use ID types from the id package.


403-405: Updated type declarations in struct fields.

All ID-related fields in the struct now correctly use ID types from the id package.


448-448: Updated official plugin ID reference.

The test now uses id.OfficialPluginID instead of a local declaration.


451-452: Updated official plugin ID reference in test case.

The test now uses id.OfficialPluginID for the official plugin references.


460-461: Updated official plugin ID reference in test case.

The test now uses id.OfficialPluginID for the official plugin references.

server/pkg/project/builder.go (6)

7-9: Added imports for centralized ID management.

Imports have been updated to include:

  • github.com/reearth/reearth/server/pkg/id for unified ID types
  • Updated import path for accountdomain package

This aligns with the PR objective to unify ID types across packages.


22-22: Updated error reference to use standardized error from id package.

Error reference has been updated from a locally defined ErrInvalidID to the centralized id.ErrInvalidID. This ensures consistent error handling for ID-related issues across the codebase.


41-44: Updated method signature to use standardized ID type.

The ID() method's parameter type has been updated from a local ID type to the standardized id.ProjectID type from the id package.


47-47: Updated ID creation to use centralized function.

The NewID() method now uses id.NewProjectID() instead of a local implementation, ensuring consistent ID generation across the codebase.


132-135: Updated method signature to use standardized workspace ID type.

The Workspace() method's parameter type has been updated from a local WorkspaceID type to the standardized accountdomain.WorkspaceID type.


157-160: Updated method signature to use standardized scene ID type.

The Scene() method's parameter type has been updated from a local SceneID type to the standardized id.SceneID type from the id package.

server/pkg/scene/plugin.go (6)

3-4: LGTM: Added necessary import for the id package

The import statement correctly adds the necessary id package for the type changes.


6-7: Updated struct field types to use centralized ID types

The change to use centralized ID types from the id package improves consistency across the codebase.


10-14: Updated constructor signature to use id package types

The constructor function now properly accepts parameters of type id.PluginID and *id.PropertyID.


17-22: Return type updated to use id.PluginID

The method now correctly returns id.PluginID and uses the zero value id.PluginID{} for nil receivers.


24-29: Updated PluginRef method to use id package type

The method now correctly returns a pointer to id.PluginID.


31-36: Updated Property method to use id package type

The method now correctly returns a pointer to id.PropertyID.

server/pkg/asset/builder.go (6)

3-8: LGTM: Added necessary imports for the refactoring

The import statements correctly add the necessary id and accountdomain packages for the type changes.


19-21: Updated error handling to use centralized error

Now using id.ErrInvalidID from the centralized package instead of a local error constant.


45-48: Updated ID method signature to use id.AssetID

The method now properly accepts a parameter of type id.AssetID.


50-53: Updated NewID method to use centralized ID generation

The method now correctly uses id.NewAssetID() for ID generation, ensuring consistency with the rest of the codebase.


55-58: Updated Workspace method signature to use accountdomain.WorkspaceID

The method now properly accepts a parameter of type accountdomain.WorkspaceID.


60-63: Updated Project method signature to use id.ProjectID

The method now properly accepts a parameter of type *id.ProjectID.

server/pkg/scene/builder.go (8)

3-8: LGTM: Added necessary imports for the refactoring

The import statements correctly add the necessary id and accountdomain packages for the type changes.


19-21: Updated error handling to use centralized error

Now using id.ErrInvalidID from the centralized package instead of a local error constant.


22-24: Consistent error handling for workspace ID validation

Now using the same id.ErrInvalidID for workspace ID validation, maintaining consistency across the codebase.


45-48: Updated ID method signature to use id.SceneID

The method now properly accepts a parameter of type id.SceneID.


50-53: Updated NewID method to use centralized ID generation

The method now correctly uses id.NewSceneID() for ID generation, ensuring consistency with the rest of the codebase.


55-58: Updated Project method signature to use id.ProjectID

The method now properly accepts a parameter of type id.ProjectID.


60-63: Updated Workspace method signature to use accountdomain.WorkspaceID

The method now properly accepts a parameter of type accountdomain.WorkspaceID.


80-83: Updated Property method signature to use id.PropertyID

The method now properly accepts a parameter of type id.PropertyID.

server/pkg/scene/widgets.go (7)

3-7: LGTM: Added necessary import for the id package

The import statement correctly adds the necessary id package for the type changes.


65-75: Updated Widget method signature to use id.WidgetID

The method now properly accepts a parameter of type id.WidgetID.


77-87: Updated Has method signature to use id.WidgetID

The method now properly accepts a parameter of type id.WidgetID.


96-106: Updated Remove method signature to use id.WidgetID

The method now properly accepts a parameter of type id.WidgetID.


108-122: Updated RemoveAllByPlugin method signature and return type

The method now properly accepts parameters of types id.PluginID and *id.PluginExtensionID, and returns a slice of id.PropertyID.


124-133: Updated UpgradePlugin method signature to use id.PluginID

The method now properly accepts parameters of type id.PluginID.


135-144: Updated Properties method return type and slice initialization

The method now correctly returns a slice of id.PropertyID and initializes the slice with the proper type.

server/pkg/scene/widget_test.go (8)

6-6: Good addition of the id package import.

The addition of the id package import is necessary to support the refactoring of ID types in this file.


11-13: Successfully migrated ID creation to the id package.

The code now uses the centralized ID generators from the id package, which aligns with the goal of unifying ID management across the codebase.


17-20: Appropriate type updates for test struct fields.

The struct field types have been properly updated to use the centralized types from the id package, ensuring consistency with the rest of the codebase.


43-43: Correctly updated error reference.

The error reference has been updated to use id.ErrInvalidID, maintaining consistency with the id package.


67-69: Successfully migrated ID creation in second test function.

Similar to the first test function, this code now uses the centralized ID generators from the id package.


73-76: Appropriate type updates for second test struct.

The struct field types have been properly updated to use types from the id package, ensuring consistency.


99-99: Correctly updated error reference in second test case.

The error reference has been updated to use id.ErrInvalidID, maintaining consistency with the id package.


126-126: Successfully updated MustWidget calls.

The calls to MustWidget have been updated to use the id package functions for creating widget IDs and property IDs, completing the migration to centralized ID management.

Also applies to: 132-132, 138-138

server/internal/usecase/operator.go (2)

15-18: Successfully migrated scene ID list types.

The Operator struct fields have been updated to use id.SceneIDList instead of scene.IDList, aligning with the goal of centralizing ID types in the id package.


73-75: Correctly updated method return types.

All methods related to scene IDs now return id.SceneIDList instead of scene.IDList, maintaining consistency with the updated field types in the Operator struct.

Also applies to: 77-79, 81-83, 85-87

server/pkg/scene/widget_area.go (5)

4-4: Good addition of the id package import.

The addition of the id package import is necessary to support the refactoring of ID types in this file.


11-11: Successfully migrated widget ID list type.

The widgetIds field has been updated to use id.WidgetIDList, aligning with the goal of centralizing ID types in the id package.


27-27: Correctly updated parameter type in NewWidgetArea.

The parameter type has been updated to use id.WidgetID, maintaining consistency with the updated field type.


40-40: Successfully updated return type in WidgetIDs method.

The return type has been properly updated to id.WidgetIDList, ensuring consistency with the updated field type.


89-89: Correctly updated parameter types in widget manipulation methods.

The parameter types in Find, Add, AddAll, and Remove methods have been updated to use id.WidgetID, maintaining consistency with the updated field type.

Also applies to: 96-96, 110-110, 150-150

server/pkg/scene/plugins.go (7)

3-4: Good addition of the id package import.

The addition of the id package import is necessary to support the refactoring of ID types in this file.


36-36: Correctly updated parameter and return types.

The parameter and return types have been properly updated to use id.PluginID and id.PropertyID, ensuring consistency with the centralized ID types.

Also applies to: 45-45, 54-54


73-73: Successfully updated official plugin ID reference.

The reference to OfficialPluginID has been updated to use id.OfficialPluginID, maintaining consistency with the id package.


80-81: Correctly updated parameter type and plugin ID reference.

The parameter type for Remove has been updated to id.PluginID, and the reference to OfficialPluginID has been updated to use id.OfficialPluginID, ensuring consistency.


92-93: Successfully updated parameter types and plugin ID reference.

The parameter types for Upgrade have been properly updated to use id.PluginID and id.PropertyID, and the reference to OfficialPluginID has been updated to use id.OfficialPluginID.


113-113: Correctly updated return type and variable type.

The Properties method now returns []id.PropertyID instead of []PropertyID, and the variable res is also typed correctly, ensuring consistency with the id package.

Also applies to: 117-117


126-126: Successfully updated parameter type in Plugin method.

The parameter type for the Plugin method has been updated to id.PluginID, maintaining consistency with the id package.

server/pkg/project/project.go (5)

11-12: LGTM: Added import for centralized ID types

The addition of the id package import facilitates the consistent use of standardized ID types throughout the codebase.


14-14: LGTM: Updated import path for account domain

The import path has been updated to use the accountdomain package, aligning with the overall refactoring.


33-33: LGTM: Standardized ID field types in Project struct

Field types have been changed to use centralized ID types:

  • idid.ProjectID
  • workspaceaccountdomain.WorkspaceID
  • sceneIdid.SceneID

This change ensures consistency with ID definitions in ./server/pkg/id/id.go.

Also applies to: 48-48, 54-54


59-61: LGTM: Updated getter method signatures

Method signatures have been updated to return the centralized ID types, improving type safety and consistency across the codebase.

Also applies to: 136-138, 144-146


239-241: LGTM: Updated setter method signatures

Method signatures for UpdateWorkspace and UpdateSceneID have been updated to accept the centralized ID types, maintaining consistency with the field type changes.

Also applies to: 259-261

server/pkg/scene/builder_test.go (4)

7-9: LGTM: Updated imports for consistent ID handling

The imports now include the centralized id package and accountdomain package, aligning with the overall ID standardization.


17-17: LGTM: Updated ID creation calls

ID creation calls have been updated to use the centralized functions from the id package, ensuring consistency in how IDs are generated across the codebase.

Also applies to: 29-29, 36-36, 43-43, 50-50, 58-58, 59-59, 60-60, 161-162


69-76: LGTM: Updated struct field types

The args struct fields have been updated to use the centralized ID types, ensuring test cases properly reflect the refactored type system.

Also applies to: 169-178


87-95: LGTM: Updated error references

Error references have been changed from local ErrInvalidID to id.ErrInvalidID, maintaining consistency with the error handling approach in the centralized id package.

Also applies to: 95-96, 108-109, 189-199, 199-200, 212-213

server/pkg/scene/scene.go (4)

7-9: LGTM: Updated imports for ID standardization

The imports now include the centralized id package and the refactored path for accountdomain, supporting the ID type standardization.


14-17: LGTM: Standardized Scene struct field types

Field types in the Scene struct have been updated to use centralized ID types:

  • idid.SceneID
  • projectid.ProjectID
  • workspaceaccountdomain.WorkspaceID
  • propertyid.PropertyID

This change ensures consistency in ID handling across the codebase.

Also applies to: 20-20


24-29: LGTM: Updated getter method signatures and nil checks

The getter method signatures have been updated to return the centralized ID types, and the nil check return values have been updated to return empty values of the appropriate type.

Also applies to: 38-43, 45-50, 52-57


105-113: LGTM: Updated Properties method return type

The Properties method now returns []id.PropertyID instead of a custom type, maintaining consistency with the centralized ID types.

server/pkg/scene/widget.go (6)

3-3: LGTM: Added import for centralized ID types

The import of the id package supports the consistent use of standardized ID types throughout this file.


6-9: LGTM: Standardized Widget struct field types

Field types in the Widget struct have been updated to use centralized ID types:

  • idid.WidgetID
  • pluginid.PluginID
  • extensionid.PluginExtensionID
  • propertyid.PropertyID

This change ensures consistency with ID definitions across the codebase.


14-17: LGTM: Updated NewWidget function signature and error handling

The NewWidget function signature now uses centralized ID types for all ID parameters, and error handling has been updated to use id.ErrInvalidID.


29-35: LGTM: Updated MustWidget function signature

The MustWidget function signature now uses centralized ID types for all ID parameters, maintaining consistency with the NewWidget function.


37-51: LGTM: Updated getter method signatures

All getter methods now return the centralized ID types, ensuring type safety and consistency throughout the codebase.


95-100: LGTM: Updated SetPlugin method signature

The SetPlugin method now accepts id.PluginID instead of a custom type, maintaining consistency with the field type changes.

@@ -126,7 +129,7 @@ func (r *Asset) Save(_ context.Context, a *asset.Asset) error {
if !r.f.CanWrite(a.Workspace()) {
return repo.ErrOperationDenied
}

fmt.Println("Save------------------", a.ID().String())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hexaforce
If it’s for debugging purposes, I think it’s better to associate it with the context.
In that case, I’d like to use log.Infofc like we do elsewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had deleted it, but it was still there.

@@ -51,6 +52,8 @@ func (r *Asset) FindByURL(_ context.Context, path string) (*asset.Asset, error)

func (r *Asset) FindByID(_ context.Context, id id.AssetID) (*asset.Asset, error) {
d, ok := r.data.Load(id)
d2 := *d
fmt.Println(d2.URL())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I had deleted it, but it was still there.

Copy link
Contributor

@soneda-yuya soneda-yuya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM!

@hexaforce hexaforce force-pushed the chore/refactoring-id-scene-widget2 branch from ad1a69e to ac6a1a3 Compare March 21, 2025 00:50
@hexaforce hexaforce enabled auto-merge (squash) March 21, 2025 00:50
@hexaforce hexaforce merged commit e8a438c into main Mar 21, 2025
19 checks passed
@hexaforce hexaforce deleted the chore/refactoring-id-scene-widget2 branch March 21, 2025 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants