mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-12 19:14:23 +00:00
7a6ca24625
* check uniqueness on create and register user * change user email, reserve release unique email * usergrant unique aggregate * usergrant uniqueness * validate UserGrant * fix tests * domain is set on username in all orgs * domain in admin * org domain sql * zitadel domain org name * org domains * org iam policy * default org iam policy * SETUP * load login names * login by login name * login name * fix: merge master * fix: merge master * Update internal/user/repository/eventsourcing/user.go Co-authored-by: Livio Amstutz <livio.a@gmail.com> * fix: fix unique domains * fix: rename env variable Co-authored-by: adlerhurst <silvan.reusser@gmail.com> Co-authored-by: Livio Amstutz <livio.a@gmail.com>
45 lines
1.2 KiB
Go
45 lines
1.2 KiB
Go
package view
|
|
|
|
import (
|
|
org_model "github.com/caos/zitadel/internal/org/model"
|
|
org_view "github.com/caos/zitadel/internal/org/repository/view"
|
|
"github.com/caos/zitadel/internal/org/repository/view/model"
|
|
"github.com/caos/zitadel/internal/view"
|
|
)
|
|
|
|
const (
|
|
orgTable = "admin_api.orgs"
|
|
)
|
|
|
|
func (v *View) OrgByID(orgID string) (*model.OrgView, error) {
|
|
return org_view.OrgByID(v.Db, orgTable, orgID)
|
|
}
|
|
|
|
func (v *View) SearchOrgs(query *org_model.OrgSearchRequest) ([]*model.OrgView, int, error) {
|
|
return org_view.SearchOrgs(v.Db, orgTable, query)
|
|
}
|
|
|
|
func (v *View) PutOrg(org *model.OrgView) error {
|
|
err := org_view.PutOrg(v.Db, orgTable, org)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
return v.ProcessedOrgSequence(org.Sequence)
|
|
}
|
|
|
|
func (v *View) GetLatestOrgFailedEvent(sequence uint64) (*view.FailedEvent, error) {
|
|
return v.latestFailedEvent(orgTable, sequence)
|
|
}
|
|
|
|
func (v *View) ProcessedOrgFailedEvent(failedEvent *view.FailedEvent) error {
|
|
return v.saveFailedEvent(failedEvent)
|
|
}
|
|
|
|
func (v *View) GetLatestOrgSequence() (uint64, error) {
|
|
return v.latestSequence(orgTable)
|
|
}
|
|
|
|
func (v *View) ProcessedOrgSequence(eventSequence uint64) error {
|
|
return v.saveCurrentSequence(orgTable, eventSequence)
|
|
}
|