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

feat: add user edge to audit mixin, move to schema directory #363

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

golanglemonade
Copy link
Member

@golanglemonade golanglemonade commented Jan 4, 2025

  • Moves the AuditMixin, currently located in entx, to be in schema due to the dependency on the User schema
  • Changes the updatedBy and createdBy fields to updatedByID and createdByID
  • This allows us to use updatedBy as the edge field to pull the user details (e.g. email, first and last name)
  • Also changed the deletedBy field to deletedByID to align with the other fields. This does not include an edge because it will not be retrievable by the API.
  • The seed data needed to be adjusted because system (and unknown in the mixin) are not valid FK to the user table
go run cmd/cli/main.go procedure get  -z json         
{
  "procedures": {
    "edges": [
      {
        "node": {
          "background": "",
          "createdAt": "2025-01-04T12:49:55.986182-07:00",
          "createdBy": {
            "email": "[email protected]",
            "firstName": "matt",
            "id": "01JGSDTR8GFQGH3JQ2ECN22J45",
            "lastName": "anderson"
          },
          "createdByID": "01JGSDTR8GFQGH3JQ2ECN22J45",
          "description": "",
          "id": "01JGSDVYMCG3SHPZ7EHCGVJDQD",
          "name": "Onboarding SOP",
          "procedureType": "",
          "purposeAndScope": "",
          "satisfies": "",
          "status": "",
          "updatedAt": "2025-01-04T12:49:55.980409-07:00",
          "updatedBy": {
            "email": "[email protected]",
            "firstName": "matt",
            "id": "01JGSDTR8GFQGH3JQ2ECN22J45",
            "lastName": "anderson"
          },
          "updatedByID": "01JGSDTR8GFQGH3JQ2ECN22J45",
          "version": "v0.1"
        }
      }
    ]
  }
}

Signed-off-by: Sarah Funkhouser <[email protected]>
@github-actions github-actions bot added the cli label Jan 4, 2025
Signed-off-by: Sarah Funkhouser <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant