Documentation
¶
Index ¶
- Constants
- type ActivationMail
- type ActivationResponse
- type CheckEmailRequest
- type CheckEmailResponse
- type CheckUsernameRequest
- type CheckUsernameResponse
- type ConfirmationMail
- type Contributor
- type CostCategoryPatchRequest
- type CostCategoryPostRequest
- type CostCategoryResponse
- type CostCategorySchema
- type CostContributionSchema
- type CostDTO
- type CostDistributionDTO
- type CostOverviewDTO
- type CostQueryParams
- type CostSchema
- type DebtDTO
- type DebtOverviewDTO
- type DebtSchema
- type ExpenseContextKey
- type ExpenseServiceError
- type ForgotPasswordRequest
- type LifeCheckResponse
- type LoginRequest
- type LoginResponse
- type PasswordResetMail
- type RefreshTokenRequest
- type RefreshTokenResponse
- type RegistrationRequest
- type ResendTokenRequest
- type ResetPasswordConfirmationMail
- type ResetPasswordRequest
- type SendContactMailRequest
- type SlimTripDTO
- type TokenSchema
- type TransactionDTO
- type TransactionQueryParams
- type TransactionSchema
- type TripDTO
- type TripDistributionDTO
- type TripNameToIdDTO
- type TripParticipationDTO
- type TripSchema
- type UpdateUserRequest
- type UserDetailsResponse
- type UserDto
- type UserSchema
- type UserSuggestResponse
- type UserSuggestion
- type UserTripSchema
- type VerifyPasswordResetTokenRequest
Constants ¶
View Source
const ( // ParamKeyUserId is the key for the id in the params ExpenseParamKeyUserId = "userId" // ParamKeyTripId is the key for the id in the params ExpenseParamKeyTripId = "tripId" // ParamKeyCostCategoryId is the key for the id in the params ExpenseParamKeyCostCategoryId = "costCategoryId" // ParamKeyCostId is the key for the id in the params ExpenseParamKeyCostId = "costId" // ParamKeyTransactionId is the key for the id in the params ExpenseParamKeyTransactionId = "transactionId" // ParamKeyDebtId is the key for the id in the params ExpenseParamKeyDebtId = "debtId" )
View Source
const ( // ExpenseQueryKeyQueryString is the key for the queryString in the query ExpenseQueryKeyQueryString = "q" // ExpenseQueryKeyToken is the key for the token in the query ExpenseQueryKeyToken = "token" // ExpenseQueryParamKeyCostCategoryId is the key for the costCategoryId in the query ExpenseQueryParamKeyCostCategoryId = "costCategoryId" // ExpenseQueryKeyFile is the key for the file in the multiform ExpenseQueryKeyFile = "image" )
View Source
const ( // ExpenseContextKeyUserID is the key for the user id in the context ExpenseContextKeyUserID = ExpenseContextKey("userId") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActivationMail ¶
type ActivationResponse ¶
type CheckEmailRequest ¶
type CheckEmailRequest struct {
Email string `json:"email"`
}
type CheckEmailResponse ¶
type CheckEmailResponse struct {
EmailExists bool `json:"emailExists"`
}
type CheckUsernameRequest ¶
type CheckUsernameRequest struct {
Username string `json:"username"`
}
type CheckUsernameResponse ¶
type CheckUsernameResponse struct {
UsernameExists bool `json:"usernameExists"`
}
type ConfirmationMail ¶
type Contributor ¶
type CostCategoryPostRequest ¶
type CostCategoryResponse ¶
type CostCategorySchema ¶
type CostCategorySchema struct { CostCategoryID *uuid.UUID `json:"costCategoryId" db:"id"` Name string `json:"name" db:"name"` Description string `json:"description" db:"description"` Icon string `json:"icon" db:"icon"` Color string `json:"color" db:"color"` TripID *uuid.UUID `json:"tripId" db:"id_trip"` }
type CostContributionSchema ¶
type CostContributionSchema struct { UserID *uuid.UUID `json:"userId" db:"id_user"` CostID *uuid.UUID `json:"costId" db:"id_cost"` IsCreditor bool `json:"isCreditor" db:"is_creditor"` Amount decimal.Decimal `json:"amount" db:"amount"` }
CostContributionSchema Users are called contributors in the context of a cost. A user can be a creditor or a debtor: creditor means that the user has paid for the cost, debtor means that the user has to pay for the cost
type CostDTO ¶
type CostDTO struct { CostID *uuid.UUID `json:"costId"` CostCategoryID *uuid.UUID `json:"costCategoryId"` Amount string `json:"amount"` CurrencyCode string `json:"currency"` Description string `json:"description"` CreationDate string `json:"createdAt"` DeductionDate string `json:"deductedAt"` EndDate string `json:"endDate"` Creditor string `json:"creditor"` Debtors []*Contributor `json:"contributors"` }
CostDTO Data transfer object for cost entries
type CostDistributionDTO ¶
type CostOverviewDTO ¶
type CostOverviewDTO struct { TotalCosts string `json:"totalCosts"` AverageTripCosts string `json:"averageTripCosts"` MostExpensiveTrip *TripNameToIdDTO `json:"mostExpensiveTrip"` LeastExpensiveTrip *TripNameToIdDTO `json:"leastExpensiveTrip"` AverageContributionPercentage string `json:"averageContributionPercentage"` TripDistribution []*TripDistributionDTO `json:"tripDistribution"` CostDistribution []*CostDistributionDTO `json:"costDistribution"` }
CostOverviewDTO Data transfer object for cost overview
type CostQueryParams ¶
type CostQueryParams struct { TripId *uuid.UUID CostCategoryId *uuid.UUID CostCategoryName *string UserId *uuid.UUID Username *string MinAmount *string // MinAmount steht für die minimale Kostenhöhe MaxAmount *string // MinAmount steht für die maximale Kostenhöhe MinDeductionDate *string // MinDeductionDate steht für das früheste Datum, an dem die Kosten abgezogen wurden MaxDeductionDate *string // MaxDeductionDate steht für das späteste Datum, an dem die Kosten abgezogen wurden MinEndDate *string // MinEndDate steht für das früheste Datum, an dem die Kosten enden MaxEndDate *string // MaxEndDate steht für das späteste Datum, an dem die Kosten enden MinCreationDate *string // MinCreationDate steht für das früheste Datum, an dem die Kosten erstellt wurden MaxCreationDate *string // MaxCreationDate steht für das späteste Datum, an dem die Kosten erstellt wurden Page int // Page wird für die Paginierung verwendet PageSize int // PageSize steht für die Anzahl der Kosten, die pro Seite angezeigt werden SortBy string // SortBy steht für die Spalte, nach der die Kosten sortiert werden sollen SortOrder string // SortOrder steht für die Reihenfolge, in der die Kosten sortiert werden sollen }
CostQueryParams Query parameters for cost entries
type CostSchema ¶
type CostSchema struct { CostID *uuid.UUID `json:"costId" db:"id"` Amount decimal.Decimal `json:"amount" db:"amount"` Description string `json:"description" db:"description"` CreationDate *time.Time `json:"createdAt" db:"created_at"` DeductionDate *time.Time `json:"deductedAt" db:"deducted_at"` EndDate *time.Time `json:"endDate,omitempty" db:"end_date"` CostCategoryID *uuid.UUID `json:"costCategoryId" db:"id_cost_category"` }
type DebtDTO ¶
type DebtDTO struct { DebtID *uuid.UUID `json:"debtId"` Creditor *UserDto `json:"creditor"` Debtor *UserDto `json:"debtor"` Trip *SlimTripDTO `json:"trip"` Amount string `json:"amount"` CurrencyCode string `json:"currency"` CreationDate string `json:"createdAt"` UpdateDate string `json:"updatedAt"` }
DebtDTO Data transfer object for debt entries
type DebtOverviewDTO ¶
type DebtOverviewDTO struct { Debts []*DebtDTO `json:"debts"` OpenDebtAmount string `json:"openDebtAmount"` OpenCreditAmount string `json:"openCreditAmount"` TotalSpent string `json:"totalSpent"` TotalReceived string `json:"totalReceived"` }
DebtOverviewDTO Data transfer object for the debt overview in the UI
type DebtSchema ¶
type DebtSchema struct { DebtID *uuid.UUID `json:"debtId" db:"id"` CreditorId *uuid.UUID `json:"creditorId" db:"id_creditor"` DebtorId *uuid.UUID `json:"debtorId" db:"id_debtor"` TripId *uuid.UUID `json:"tripId" db:"id_trip"` Amount decimal.Decimal `json:"amount" db:"amount"` CurrencyCode string `json:"currency" db:"currency_code"` CreationDate *time.Time `json:"createdAt" db:"created_at"` UpdateDate *time.Time `json:"updatedAt" db:"updated_at"` }
type ExpenseContextKey ¶
type ExpenseContextKey string
ExpenseContextKey is the type for the context keys
type ExpenseServiceError ¶
type ForgotPasswordRequest ¶
type ForgotPasswordRequest struct {
Email string `json:"email"`
}
type LifeCheckResponse ¶
LifeCheckResponse is the response for the lifecheck endpoint
type LoginRequest ¶
type LoginResponse ¶
type PasswordResetMail ¶
type RefreshTokenRequest ¶
type RefreshTokenRequest struct {
RefreshToken string `json:"refreshToken"`
}
type RefreshTokenResponse ¶
type RegistrationRequest ¶
type RegistrationRequest struct { Username string `json:"username" form:"username" binding:"required"` FirstName string `json:"firstName" form:"firstName" binding:"required"` LastName string `json:"lastName" form:"lastName" binding:"required"` Location string `json:"location" form:"location" binding:"required"` Email string `json:"email" form:"email" binding:"required"` Password string `json:"password" form:"password" binding:"required"` Birthday string `json:"birthday" form:"birthday" binding:"required"` ProfilePicture *multipart.FileHeader `json:"profilePicture" form:"profilePicture"` }
type ResendTokenRequest ¶
type ResendTokenRequest struct {
Email string `json:"email"`
}
type ResetPasswordRequest ¶
type SendContactMailRequest ¶
type SlimTripDTO ¶
type TokenSchema ¶
type TokenSchema struct { UserID *uuid.UUID `json:"userId" db:"id_user"` Token string `json:"token" db:"token"` Type string `json:"type" db:"type"` CreatedAt *time.Time `json:"createdAt" db:"created_at"` ConfirmedAt *time.Time `json:"confirmedAt" db:"confirmed_at"` ExpiresAt *time.Time `json:"expiresAt" db:"expires_at"` }
type TransactionDTO ¶
type TransactionDTO struct { TransactionId *uuid.UUID `json:"transactionId"` Creditor *UserDto `json:"creditor"` Debtor *UserDto `json:"debtor"` Trip *SlimTripDTO `json:"trip"` // CreditorId *uuid.UUID `json:"creditorId,omitempty"` // Creditor is always context user DebtorId *uuid.UUID `json:"debtorId,omitempty"` Amount string `json:"amount"` CreationDate string `json:"createdAt"` IsConfirmed bool `json:"isConfirmed"` }
type TransactionQueryParams ¶
type TransactionQueryParams struct { DebtorId *uuid.UUID `json:"debtorId,omitempty"` DebtorUsername string `json:"debtorUsername,omitempty"` CreditorId *uuid.UUID `json:"creditorId,omitempty"` CreditorUsername string `json:"creditorUsername,omitempty"` SortBy string `json:"sortBy,omitempty"` SortOrder string `json:"order,omitempty"` IsConfirmed *bool `json:"isConfirmed,omitempty"` }
type TransactionSchema ¶
type TransactionSchema struct { TransactionId *uuid.UUID `json:"transactionId" db:"id"` CreditorId *uuid.UUID `json:"creditorId" db:"id_creditor"` DebtorId *uuid.UUID `json:"debtorId" db:"id_debtor"` TripId *uuid.UUID `json:"tripId" db:"id_trip"` Amount decimal.Decimal `json:"amount" db:"amount"` CreationDate *time.Time `json:"createdAt" db:"created_at"` CurrencyCode string `json:"currency" db:"currency_code"` IsConfirmed bool `json:"isConfirmed" db:"is_confirmed"` }
type TripDTO ¶
type TripDTO struct { TripID *uuid.UUID `json:"tripId"` Name string `json:"name"` Description string `json:"description"` Location string `json:"location"` StartDate string `json:"startDate"` EndDate string `json:"endDate"` TotalCost string `json:"totalCost"` UserDebt string `json:"userDebt"` // How much the user owes UserCredit string `json:"userCredit"` // How much the user is owed CostCategories []CostCategoryResponse `json:"costCategories"` Participants []TripParticipationDTO `json:"participants"` }
type TripDistributionDTO ¶
type TripNameToIdDTO ¶
type TripParticipationDTO ¶
type TripSchema ¶
type TripSchema struct { TripID *uuid.UUID `json:"tripId" db:"id"` Name string `json:"name" db:"name"` Description string `json:"description" db:"description"` Location string `json:"location" db:"location"` StartDate *time.Time `json:"startDate" db:"start_date"` EndDate *time.Time `json:"endDate" db:"end_date"` }
type UpdateUserRequest ¶
type UserDetailsResponse ¶
type UserDetailsResponse struct { ID *uuid.UUID `json:"id"` FirstName string `json:"firstName"` LastName string `json:"lastName"` Location string `json:"location"` UserName string `json:"username"` Email string `json:"email"` Birthday string `json:"birthday"` ProfilePicture string `json:"profilePicture"` CreatedAt string `json:"createdAt"` OpenDebts int `json:"openDebts"` TripsJoined int `json:"tripsJoined"` }
type UserSchema ¶
type UserSchema struct { UserID *uuid.UUID `json:"userId" db:"id"` Username string `json:"userName" db:"username"` FirstName string `json:"firstName" db:"firstname"` LastName string `json:"lastName" db:"lastname"` Location string `json:"location" db:"location"` Email string `json:"email" db:"email"` Password string `json:"password" db:"password"` Activated bool `json:"activated" db:"activated"` ProfilePicture string `json:"profilePicture" db:"profile_pic"` Birthday *time.Time `json:"birthday" db:"birthday"` CreatedAt *time.Time `json:"createdAt" db:"created_at"` }
type UserSuggestResponse ¶
type UserSuggestResponse struct {
UserSuggestions []UserSuggestion `json:"userSuggestions"`
}
type UserSuggestion ¶
type UserTripSchema ¶
type UserTripSchema struct { UserID *uuid.UUID `json:"id_user" db:"id_user"` TripID *uuid.UUID `json:"id_trip" db:"id_trip"` HasAccepted bool `json:"accepted" db:"is_accepted"` PresenceStartDate *time.Time `json:"startDate" db:"presence_start_date"` PresenceEndDate *time.Time `json:"endDate" db:"presence_end_date"` }
Click to show internal directories.
Click to hide internal directories.