Skip to main content

User Model

This document describes the User model, as defined in the Go codebase. The User model represents user data, including personal information, contact details, and relevant timestamps. It is primarily used for sending user information via webhooks.

Structure

type User struct {
ID uuid.UUID `json:"id"`
FirstName *string `json:"first_name"`
MiddleName *string `json:"middle_name"`
LastName *string `json:"last_name"`
Email string `json:"email"`
BirthDate *string `json:"birth_date"`
Telephone *string `json:"telephone"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
CustomerNumber string `json:"customer_number"`
}

Field Descriptions

FieldTypeDescription
IDuuid.UUIDUnique identifier of the user.
FirstName*stringThe first name of the user (optional).
MiddleName*stringThe middle name of the user (optional).
LastName*stringThe last name of the user (optional).
EmailstringThe email address of the user.
BirthDate*stringThe birthdate of the user (optional, ISO 8601).
Telephone*stringThe telephone number of the user (optional).
CreatedAttime.TimeThe creation timestamp of the user.
UpdatedAttime.TimeThe update timestamp of the user.
CustomerNumberstringThe customer number of the user.

Example JSON

{
"id": "b6e5c8f3-7d4b-4b5a-9e6a-2b8e7c0f3e4c",
"first_name": "Anna",
"middle_name": "van",
"last_name": "Dijk",
"email": "anna.vandijk@example.com",
"birth_date": "1990-04-23",
"telephone": "+31-6-12345678",
"created_at": "2025-05-20T12:00:00Z",
"updated_at": "2025-05-20T12:30:00Z",
"customer_number": "CUST-2025-0001"
}

Notes

  • Optional Fields: FirstName, MiddleName, LastName, BirthDate, and Telephone can be null in JSON.
  • Timestamps: CreatedAt and UpdatedAt are in ISO 8601 format.
  • UUID: The ID field uses Go uuid package.
  • Customer Number: This is a string identifier for the user in the business context.

See Also