Zoonk.Orgs.Org (Zoonk v0.1.0-dev)

View Source

Defines the Org schema.

Every data on Zoonk is related to an organization. An organization can be a business, a creator, or a school.

All organizations have a subdomain that can be used for their white-label page, e.g. https://<subdomain>.zoonk.io.

Some orgs can also have a custom domain, e.g. https://<custom_domain>. This is useful for schools and businesses that want to use their own domain for their white-label page.

This schema manages public information about the organization. For private settings, see Zoonk.Orgs.OrgSettings.

Organization Types

TypeDescription
:appThe main organization that owns this entire app (e.g. Zoonk)
:teamOrganizations using Zoonk for internal training.
:creatorOrganizations selling content on Zoonk.
:schoolEducational institutions using Zoonk with their existing students.

Why the main app is an organization?

The main app is also an organization because it allows us to query everything using an org_id, ensuring users have access to the correct scope.

Without this, we would need to add a lot of org_id checks everywhere in the codebase, which would be a nightmare to maintain.

Plus, we'd need to check for is_nil(org_id) everywhere when we need to query data that is not related to main app only - and not to a specific organization.

Having an org_id associated with every data makes it easier to manage permissions and access control.

Fields

Field NameTypeDescription
kindEcto.EnumThe type of organization.
display_nameStringPublic name of the organization
bioStringA brief description of the organization.
public_emailStringThe public email address for the organization.
icon_urlStringURL for the organization's icon.
logo_urlStringURL for the organization's logo.
subdomainStringSubdomain used for the white-label page.
custom_domainStringCustom domain used for the white-label page.
inserted_atDateTimeTimestamp when the profile was created.
updated_atDateTimeTimestamp when the profile was last updated.