mirror of
https://github.com/absmach/magistrala.git
synced 2026-06-23 04:10:28 +00:00
1f087bf42c
* feat(invitations): add repository layer Add PostgreSQL migration, setup test, and repository for invitations Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(invitations): Implement error handling and repository functions This commit introduces modifications to the error handling and repository functions in the internal/postgres and invitations/postgres packages. The changes primarily focus on retrieving invitations from a database and handling errors appropriately. Additionally, the code diff includes updates to imports and test cases for the InvitationCreate function. The Retrieve function is thoroughly tested with different scenarios, including tests for updating invitation tokens and confirmations. Moreover, tests are added for the update and delete functions for invitations in a repository. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat: test with token Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(Page): Add new field `InvitedByOrUserID` This code change adds a new field to the Page struct and modifies the pageQuery function to handle it. The change also includes modifications to the test file. The code snippet tests the functionality of retrieving invitations, specifically using the invited_by_or_user_id field. The test ensures that the retrieved invitations match the expected response. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> * feat(invitations): add updated_at field to UpdateConfirmation query This commit adds the updated_at field to the UpdateConfirmation query in the invitations package. This ensures that the updated_at field is updated when confirming an invitation. Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com> --------- Signed-off-by: Rodney Osodo <28790446+rodneyosodo@users.noreply.github.com>
6 lines
178 B
Go
6 lines
178 B
Go
// Copyright (c) Abstract Machines
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
// Package postgres provides a postgres implementation of the invitations repository.
|
|
package postgres
|