Skip to content

Commit

Permalink
remove prestaking fields from read endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-cronus committed Feb 1, 2024
1 parent a2a58fe commit 53a772f
Show file tree
Hide file tree
Showing 10 changed files with 9 additions and 141 deletions.
24 changes: 0 additions & 24 deletions cmd/eskimo-hut/api/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1644,18 +1644,10 @@ const docTemplate = `{
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"checksum": {
"type": "string",
"example": "1232412415326543647657"
Expand Down Expand Up @@ -1800,10 +1792,6 @@ const docTemplate = `{
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
},
Expand Down Expand Up @@ -1983,18 +1971,10 @@ const docTemplate = `{
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"checksum": {
"type": "string",
"example": "1232412415326543647657"
Expand Down Expand Up @@ -2135,10 +2115,6 @@ const docTemplate = `{
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
},
Expand Down
24 changes: 0 additions & 24 deletions cmd/eskimo-hut/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1638,18 +1638,10 @@
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"checksum": {
"type": "string",
"example": "1232412415326543647657"
Expand Down Expand Up @@ -1794,10 +1786,6 @@
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
},
Expand Down Expand Up @@ -1977,18 +1965,10 @@
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"checksum": {
"type": "string",
"example": "1232412415326543647657"
Expand Down Expand Up @@ -2129,10 +2109,6 @@
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
},
Expand Down
18 changes: 0 additions & 18 deletions cmd/eskimo-hut/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,15 +65,9 @@ definitions:
agendaPhoneNumberHashes:
example: Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2
type: string
allocation:
example: 100
type: number
blockchainAccountAddress:
example: 0x4B73C58370AEfcEf86A6021afCDe5673511376B2
type: string
bonus:
example: 100
type: number
checksum:
example: "1232412415326543647657"
type: string
Expand Down Expand Up @@ -175,9 +169,6 @@ definitions:
verified:
example: true
type: boolean
years:
example: 1
type: integer
type: object
main.ProcessFaceRecognitionResultArg:
properties:
Expand Down Expand Up @@ -298,15 +289,9 @@ definitions:
agendaPhoneNumberHashes:
example: Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2
type: string
allocation:
example: 100
type: number
blockchainAccountAddress:
example: 0x4B73C58370AEfcEf86A6021afCDe5673511376B2
type: string
bonus:
example: 100
type: number
checksum:
example: "1232412415326543647657"
type: string
Expand Down Expand Up @@ -405,9 +390,6 @@ definitions:
verified:
example: true
type: boolean
years:
example: 1
type: integer
type: object
quiz.Progress:
properties:
Expand Down
24 changes: 0 additions & 24 deletions cmd/eskimo/api/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -647,18 +647,10 @@ const docTemplate = `{
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"checksum": {
"type": "string",
"example": "1232412415326543647657"
Expand Down Expand Up @@ -789,10 +781,6 @@ const docTemplate = `{
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
},
Expand Down Expand Up @@ -1013,18 +1001,10 @@ const docTemplate = `{
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"city": {
"type": "string",
"example": "New York"
Expand Down Expand Up @@ -1151,10 +1131,6 @@ const docTemplate = `{
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
}
Expand Down
24 changes: 0 additions & 24 deletions cmd/eskimo/api/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -641,18 +641,10 @@
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"checksum": {
"type": "string",
"example": "1232412415326543647657"
Expand Down Expand Up @@ -783,10 +775,6 @@
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
},
Expand Down Expand Up @@ -1007,18 +995,10 @@
"type": "string",
"example": "Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2"
},
"allocation": {
"type": "number",
"example": 100
},
"blockchainAccountAddress": {
"type": "string",
"example": "0x4B73C58370AEfcEf86A6021afCDe5673511376B2"
},
"bonus": {
"type": "number",
"example": 100
},
"city": {
"type": "string",
"example": "New York"
Expand Down Expand Up @@ -1145,10 +1125,6 @@
"verified": {
"type": "boolean",
"example": true
},
"years": {
"type": "integer",
"example": 1
}
}
}
Expand Down
18 changes: 0 additions & 18 deletions cmd/eskimo/api/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,9 @@ definitions:
agendaPhoneNumberHashes:
example: Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2
type: string
allocation:
example: 100
type: number
blockchainAccountAddress:
example: 0x4B73C58370AEfcEf86A6021afCDe5673511376B2
type: string
bonus:
example: 100
type: number
checksum:
example: "1232412415326543647657"
type: string
Expand Down Expand Up @@ -108,9 +102,6 @@ definitions:
verified:
example: true
type: boolean
years:
example: 1
type: integer
type: object
server.ErrorResponse:
properties:
Expand Down Expand Up @@ -272,15 +263,9 @@ definitions:
agendaPhoneNumberHashes:
example: Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2
type: string
allocation:
example: 100
type: number
blockchainAccountAddress:
example: 0x4B73C58370AEfcEf86A6021afCDe5673511376B2
type: string
bonus:
example: 100
type: number
city:
example: New York
type: string
Expand Down Expand Up @@ -370,9 +355,6 @@ definitions:
verified:
example: true
type: boolean
years:
example: 1
type: integer
type: object
info:
contact:
Expand Down
2 changes: 0 additions & 2 deletions users/DDL.sql
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ END $$;
ALTER TABLE users ADD COLUMN IF NOT EXISTS kyc_step_blocked smallint NOT NULL DEFAULT 0;
ALTER TABLE users ADD COLUMN IF NOT EXISTS kyc_steps_last_updated_at timestamp[];
ALTER TABLE users ADD COLUMN IF NOT EXISTS kyc_steps_created_at timestamp[];
ALTER TABLE users ADD COLUMN IF NOT EXISTS kyc_steps_created_at timestamp[];
ALTER TABLE users ADD COLUMN IF NOT EXISTS kyc_steps_created_at timestamp[];
ALTER TABLE users ADD COLUMN IF NOT EXISTS pre_staking_allocation DECIMAL NOT NULL DEFAULT 0;
ALTER TABLE users ADD COLUMN IF NOT EXISTS pre_staking_years bigint NOT NULL DEFAULT 0;
ALTER TABLE users ADD COLUMN IF NOT EXISTS pre_staking_bonus DECIMAL NOT NULL DEFAULT 0;
Expand Down
10 changes: 5 additions & 5 deletions users/contract.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,23 @@ type (
FirstName *string `json:"firstName,omitempty" example:"John" db:"first_name"`
LastName *string `json:"lastName,omitempty" example:"Doe" db:"last_name"`
devicemetadata.DeviceLocation
PreStaking
}
PublicUserInformation struct {
ID UserID `json:"id,omitempty" example:"did:ethr:0x4B73C58370AEfcEf86A6021afCDe5673511376B2" db:"id"`
Username string `json:"username,omitempty" example:"jdoe" db:"username"`
ProfilePictureURL string `json:"profilePictureUrl,omitempty" example:"https://somecdn.com/p1.jpg" db:"profile_picture_name"`
}
PreStaking struct {
Years *uint64 `json:"years,omitempty" example:"1" db:"pre_staking_years"`
Allocation *float64 `json:"allocation,omitempty" example:"100.00" db:"pre_staking_allocation"`
Bonus *float64 `json:"bonus,omitempty" example:"100.00" db:"pre_staking_bonus"`
Years *uint64 `json:"years,omitempty" swaggerignore:"true" example:"1" db:"pre_staking_years"`
Allocation *float64 `json:"allocation,omitempty" swaggerignore:"true" example:"100.00" db:"pre_staking_allocation"`
Bonus *float64 `json:"bonus,omitempty" swaggerignore:"true" example:"100.00" db:"pre_staking_bonus"`
}
PreStakingSummary struct {
*PreStaking
UserID string `json:"userId,omitempty" example:"edfd8c02-75e0-4687-9ac2-1ce4723865c4"`
}
PreStakingSnapshot struct {
preStakingSnapshot struct {
*PreStakingSummary
Before *PreStakingSummary `json:"before,omitempty"`
}
Expand All @@ -134,7 +135,6 @@ type (
RepeatableKYCSteps *map[KYCStep]*time.Time `json:"repeatableKYCSteps,omitempty" db:"-"` //nolint:tagliatelle // Nope.
PrivateUserInformation
PublicUserInformation
PreStaking
ReferredBy UserID `json:"referredBy,omitempty" example:"did:ethr:0x4B73C58370AEfcEf86A6021afCDe5673511376B2" db:"referred_by"`
PhoneNumberHash string `json:"phoneNumberHash,omitempty" example:"Ef86A6021afCDe5673511376B2" swaggerignore:"true" db:"phone_number_hash"`
AgendaPhoneNumberHashes *string `json:"agendaPhoneNumberHashes,omitempty" example:"Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2,Ef86A6021afCDe5673511376B2" db:"-"` //nolint:lll // .
Expand Down
2 changes: 1 addition & 1 deletion users/pre_staking_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ func (s *preStakingSource) Process(ctx context.Context, msg *messagebroker.Messa
if len(msg.Value) == 0 {
return nil
}
message := new(PreStakingSnapshot)
message := new(preStakingSnapshot)
if err := json.UnmarshalContext(ctx, msg.Value, message); err != nil {
return errors.Wrapf(err, "cannot unmarshal %v into %#v", string(msg.Value), message)
}
Expand Down
Loading

0 comments on commit 53a772f

Please sign in to comment.