mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-24 08:41:33 +00:00
3025ac577b
* search orgs * org by domain * member spooler * member * get roles * tests * types duration * use default func for renew * correct database * reorder migrations * delete unused consts * move get roles to internal * use prepared org by domain * implement org in other objects * add eventstores
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package view
|
|
|
|
import (
|
|
org_view "github.com/caos/zitadel/internal/org/repository/view"
|
|
"github.com/caos/zitadel/internal/view"
|
|
)
|
|
|
|
const (
|
|
orgTable = "management.orgs"
|
|
)
|
|
|
|
func (v *View) OrgByID(orgID string) (*org_view.OrgView, error) {
|
|
return org_view.OrgByID(v.Db, orgTable, orgID)
|
|
}
|
|
|
|
func (v *View) OrgByDomain(domain string) (*org_view.OrgView, error) {
|
|
return org_view.GetGlobalOrgByDomain(v.Db, orgTable, domain)
|
|
}
|
|
|
|
func (v *View) PutOrg(org *org_view.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)
|
|
}
|