Skip to content

Commit

Permalink
AcceptedTOS
Browse files Browse the repository at this point in the history
  • Loading branch information
elffjs committed Sep 17, 2024
1 parent fa2c734 commit bea92f6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 33 deletions.
9 changes: 2 additions & 7 deletions docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,8 @@ const docTemplate = `{
"internal_controller.UserResponse": {
"type": "object",
"properties": {
"agreedTosAt": {
"description": "AgreedTosAt is the time at which the user last agreed to the terms of service.",
"acceptedTosAt": {
"description": "AcceptedTOSAt is the time at which the user last agreed to the terms of service.",
"type": "string",
"example": "2021-12-01T09:00:41Z"
},
Expand Down Expand Up @@ -423,11 +423,6 @@ const docTemplate = `{
"description": "Address is the Ethereum address associated with the user.",
"type": "string",
"example": "0x142e0C7A098622Ea98E5D67034251C4dFA746B5d"
},
"inApp": {
"description": "InApp indicates whether this is an in-app wallet, managed by the DIMO app.",
"type": "string",
"example": "false"
}
}
},
Expand Down
9 changes: 2 additions & 7 deletions docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -344,8 +344,8 @@
"internal_controller.UserResponse": {
"type": "object",
"properties": {
"agreedTosAt": {
"description": "AgreedTosAt is the time at which the user last agreed to the terms of service.",
"acceptedTosAt": {
"description": "AcceptedTOSAt is the time at which the user last agreed to the terms of service.",
"type": "string",
"example": "2021-12-01T09:00:41Z"
},
Expand Down Expand Up @@ -414,11 +414,6 @@
"description": "Address is the Ethereum address associated with the user.",
"type": "string",
"example": "0x142e0C7A098622Ea98E5D67034251C4dFA746B5d"
},
"inApp": {
"description": "InApp indicates whether this is an in-app wallet, managed by the DIMO app.",
"type": "string",
"example": "false"
}
}
},
Expand Down
9 changes: 2 additions & 7 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ definitions:
type: object
internal_controller.UserResponse:
properties:
agreedTosAt:
description: AgreedTosAt is the time at which the user last agreed to the
acceptedTosAt:
description: AcceptedTOSAt is the time at which the user last agreed to the
terms of service.
example: "2021-12-01T09:00:41Z"
type: string
Expand Down Expand Up @@ -87,11 +87,6 @@ definitions:
description: Address is the Ethereum address associated with the user.
example: 0x142e0C7A098622Ea98E5D67034251C4dFA746B5d
type: string
inApp:
description: InApp indicates whether this is an in-app wallet, managed by
the DIMO app.
example: "false"
type: string
type: object
internal_controller.UserUpdateRequest:
properties:
Expand Down
16 changes: 8 additions & 8 deletions internal/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,14 +187,14 @@ func (d *Controller) createUser(ctx context.Context, userAccount *AccountClaims,

func (d *Controller) formatUserAcctResponse(acct *models.Account, wallet *models.Wallet, email *models.Email) (*UserResponse, error) {
userResp := &UserResponse{
ID: acct.ID,
CreatedAt: acct.CreatedAt,
ReferralCode: acct.ReferralCode.String,
ReferredBy: acct.ReferredBy.String,
ReferredAt: acct.ReferredAt.Ptr(),
AgreedTOSAt: acct.AcceptedTosAt.Ptr(),
CountryCode: acct.CountryCode.String,
UpdatedAt: acct.UpdatedAt,
ID: acct.ID,
CreatedAt: acct.CreatedAt,
ReferralCode: acct.ReferralCode.String,
ReferredBy: acct.ReferredBy.String,
ReferredAt: acct.ReferredAt.Ptr(),
AcceptedTOSAt: acct.AcceptedTosAt.Ptr(),
CountryCode: acct.CountryCode.String,
UpdatedAt: acct.UpdatedAt,
}

if acct.ReferredBy.Valid {
Expand Down
6 changes: 2 additions & 4 deletions internal/controller/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ type UserResponseEmail struct {
type UserResponseWeb3 struct {
// Address is the Ethereum address associated with the user.
Address common.Address `json:"address,omitempty" swaggertype:"string" example:"0x142e0C7A098622Ea98E5D67034251C4dFA746B5d"`
// InApp indicates whether this is an in-app wallet, managed by the DIMO app.
Provider string `json:"inApp" example:"false"`
}

type UserResponse struct {
Expand All @@ -43,8 +41,8 @@ type UserResponse struct {
Wallet *UserResponseWeb3 `json:"wallet"`
// CountryCode, if present, is a valid ISO 3166-1 alpha-3 country code.
CountryCode string `json:"countryCode,omitempty" swaggertype:"string" example:"USA"`
// AgreedTosAt is the time at which the user last agreed to the terms of service.
AgreedTOSAt *time.Time `json:"agreedTosAt,omitempty" swaggertype:"string" example:"2021-12-01T09:00:41Z"`
// AcceptedTOSAt is the time at which the user last agreed to the terms of service.
AcceptedTOSAt *time.Time `json:"acceptedTosAt,omitempty" swaggertype:"string" example:"2021-12-01T09:00:41Z"`
// ReferralCode is the user's referral code to be given to others. It is an 8 alphanumeric code,
// only present if the account has a confirmed Ethereum address.
ReferralCode string `json:"-" swaggertype:"string" example:"ANB95N"`
Expand Down

0 comments on commit bea92f6

Please sign in to comment.