feat(invitations): accept invitations with C4 consent and contact grants; share the E0 quota across holdings
This commit is contained in:
1 parent
a5990d3fc6
commit
676b3c6e24
59 files changed
+4926
-194
No files matched your search
@@ -0,0 +1,29 @@
|
||||
package outbound
|
||||
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
|
||||
"github.com/google/uuid"
|
||||
|
||||
"lincodex/backend/internal/domain"
|
||||
)
|
||||
|
||||
// ErrContactGrantNotFound reports that the invitation has no contact grant of
|
||||
// the organization. An accepted invitation always has one, so a missing grant
|
||||
// of an accepted invitation is a storage defect.
|
||||
var ErrContactGrantNotFound = errors.New("contact grant not found")
|
||||
|
||||
// ContactGrantRepository stores the contact grants of accepted invitations. A
|
||||
// grant is created in the acceptance transaction next to its consent C4
|
||||
// record; it is never updated here, and a read is always scoped by the
|
||||
// organization.
|
||||
type ContactGrantRepository interface {
|
||||
// Create inserts the grant in the surrounding transaction. The database
|
||||
// checks that the grant agrees with its consent record and invitation.
|
||||
Create(ctx context.Context, grant domain.ContactGrant) error
|
||||
|
||||
// GetByInvitation returns the grant of one invitation of one organization,
|
||||
// or ErrContactGrantNotFound.
|
||||
GetByInvitation(ctx context.Context, organizationID, invitationID uuid.UUID) (domain.ContactGrant, error)
|
||||
}
|
||||
Reference in new issue
Block a user