Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Line1 string `json:"line1"` Line2 *string `json:"line2"` ZipCode string `json:"zipCode"` City string `json:"city"` State string `json:"state"` Country string `json:"country"` // According to ISO 3166-1 alpha-2 }
Address structure for marshaling/unmarshalling JSON.
type CreateOrganizationInput ¶
type CreateOrganizationInput struct { LegalName string `json:"legalName" validate:"required,max=256"` ParentOrganizationID *string `json:"parentOrganizationId" validate:"omitempty,uuid"` DoingBusinessAs *string `json:"doingBusinessAs" validate:"max=256"` LegalDocument string `json:"legalDocument" validate:"required,max=256"` Address Address `json:"address"` Status Status `json:"status"` Metadata map[string]any `json:"metadata"` }
CreateOrganizationInput is a struct design to encapsulate request create payload data.
type Organization ¶
type Organization struct { ID string `json:"id"` ParentOrganizationID *string `json:"parentOrganizationId"` LegalName string `json:"legalName"` DoingBusinessAs *string `json:"doingBusinessAs"` LegalDocument string `json:"legalDocument"` Address Address `json:"address"` Status Status `json:"status"` CreatedAt time.Time `json:"createdAt"` UpdatedAt time.Time `json:"updatedAt"` DeletedAt *time.Time `json:"deletedAt"` Metadata map[string]any `json:"metadata"` }
Organization is a struct designed to encapsulate response payload data.
type OrganizationPostgreSQLModel ¶
type OrganizationPostgreSQLModel struct { ID string ParentOrganizationID *string LegalName string DoingBusinessAs *string LegalDocument string Address Address Status string StatusDescription *string CreatedAt time.Time UpdatedAt time.Time DeletedAt sql.NullTime Metadata map[string]any }
OrganizationPostgreSQLModel represents the entity Organization into SQL context in Database
func (*OrganizationPostgreSQLModel) FromEntity ¶
func (t *OrganizationPostgreSQLModel) FromEntity(organization *Organization)
FromEntity converts an entity.Organization to OrganizationPostgresModel
func (*OrganizationPostgreSQLModel) ToEntity ¶
func (t *OrganizationPostgreSQLModel) ToEntity() *Organization
ToEntity converts an OrganizationPostgreSQLModel to entity.Organization
type Repository ¶
type Repository interface { Create(ctx context.Context, organization *Organization) (*Organization, error) Update(ctx context.Context, id uuid.UUID, organization *Organization) (*Organization, error) Find(ctx context.Context, id uuid.UUID) (*Organization, error) FindAll(ctx context.Context, limit, page int) ([]*Organization, error) ListByIDs(ctx context.Context, ids []uuid.UUID) ([]*Organization, error) Delete(ctx context.Context, id uuid.UUID) error }
Repository provides an interface for operations related to organization entities.
type Status ¶
type Status struct { Code string `json:"code" validate:"max=100"` Description *string `json:"description" validate:"max=256"` }
Status structure for marshaling/unmarshalling JSON.
type UpdateOrganizationInput ¶
type UpdateOrganizationInput struct { LegalName string `json:"legalName" validate:"required,max=256"` ParentOrganizationID *string `json:"parentOrganizationId" validate:"omitempty,uuid"` DoingBusinessAs *string `json:"doingBusinessAs" validate:"max=256"` Address Address `json:"address"` Status Status `json:"status"` Metadata map[string]any `json:"metadata"` }
UpdateOrganizationInput is a struct design to encapsulate request update payload data.